/* ========================================
   SWELL風スタイルシート for frozen-gamer
   ======================================== */

/* ---------- リセット・基本 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, "Yu Gothic", sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  color: #333;
  background: #f5f6f7;
}

a { color: #1a56db; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- ヘッダー ---------- */
#site-header {
  background: #1a56db;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

#site-header .site-title a {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

#site-header nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  margin-left: 24px;
  text-decoration: none;
}
#site-header nav a:hover { color: #fff; }

/* ---------- メインレイアウト ---------- */
#wrapper {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  #wrapper { grid-template-columns: 1fr; }
  #sidebar { display: none; }
}

/* ---------- パンくず ---------- */
.breadcrumb {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 16px;
}
.breadcrumb a { color: #888; }
.breadcrumb span { margin: 0 6px; }

/* ---------- 記事カード ---------- */
#main article {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* ---------- 記事ヘッダー ---------- */
.entry-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid #f0f0f0;
}

@media (max-width: 600px) {
  .entry-header { padding: 24px 20px 16px; }
}

.post-category {
  display: inline-block;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
  text-decoration: none;
}

.entry-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.5;
  color: #111;
  margin-bottom: 12px;
}

@media (max-width: 600px) { .entry-title { font-size: 1.3rem; } }

.post-meta {
  font-size: 0.8rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 16px;
}
.post-meta time::before { content: "📅 "; }

/* ---------- 目次 ---------- */
.toc-box {
  background: #f8f9ff;
  border: 1px solid #d0daf7;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 32px 40px;
}

@media (max-width: 600px) { .toc-box { margin: 24px 20px; } }

.toc-box .toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a56db;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc-box .toc-title::before { content: "📋"; }

.toc-box ol {
  padding-left: 20px;
  margin: 0;
}
.toc-box li { font-size: 0.875rem; line-height: 1.8; }
.toc-box a { color: #1a56db; }

/* ---------- 記事本文 ---------- */
.entry-content {
  padding: 32px 40px 40px;
}

@media (max-width: 600px) { .entry-content { padding: 24px 20px; } }

/* H2 - SWELL風：背景つき */
.entry-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  background: #1a56db;
  color: #fff;
  padding: 0.65em 1.1em;
  border-radius: 5px;
  margin: 2.5em 0 1em;
  line-height: 1.5;
}

/* H3 - SWELL風：左ボーダー */
.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  border-left: 4px solid #1a56db;
  padding-left: 0.75em;
  margin: 2em 0 0.75em;
  color: #111;
  line-height: 1.5;
}

/* H4 */
.entry-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5em 0 0.5em;
  padding-bottom: 4px;
  border-bottom: 1px dashed #ccc;
  color: #222;
}

/* 段落 */
.entry-content p {
  margin-bottom: 1.4em;
  line-height: 1.9;
}

/* リスト */
.entry-content ul, .entry-content ol {
  padding-left: 1.6em;
  margin-bottom: 1.4em;
}
.entry-content li { margin-bottom: 0.4em; }

/* 引用 */
.entry-content blockquote {
  border-left: 4px solid #1a56db;
  background: #f8f9ff;
  padding: 1em 1.2em;
  margin: 1.5em 0;
  border-radius: 0 4px 4px 0;
  color: #555;
}

/* コード */
.entry-content code {
  background: #f0f2f5;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #e83e8c;
}

.entry-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.2em 1.4em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
.entry-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* テーブル */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}
.entry-content th {
  background: #1a56db;
  color: #fff;
  padding: 0.6em 0.9em;
  text-align: left;
}
.entry-content td {
  padding: 0.6em 0.9em;
  border-bottom: 1px solid #e8e8e8;
}
.entry-content tr:nth-child(even) td { background: #f8f9ff; }

/* 区切り線 */
.entry-content hr {
  border: none;
  border-top: 2px solid #e8e8e8;
  margin: 2em 0;
}

/* ---------- 記事フッター ---------- */
.entry-footer {
  padding: 24px 40px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

@media (max-width: 600px) { .entry-footer { padding: 20px; } }

.entry-footer .back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: #1a56db;
  padding: 8px 16px;
  border: 1px solid #1a56db;
  border-radius: 4px;
}
.entry-footer .back-to-top:hover { background: #e8f0fe; text-decoration: none; }

/* ---------- サイドバー ---------- */
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.widget-title {
  background: #1a56db;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 16px;
  letter-spacing: 0.05em;
}

.widget-body {
  padding: 16px;
}

.widget-body ul { list-style: none; padding: 0; margin: 0; }
.widget-body li {
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 0;
  font-size: 0.875rem;
}
.widget-body li:last-child { border-bottom: none; }
.widget-body a { color: #333; }
.widget-body a:hover { color: #1a56db; text-decoration: none; }

/* ---------- フッター ---------- */
#site-footer {
  background: #1a2236;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px 20px;
  font-size: 0.8rem;
  margin-top: 40px;
}
#site-footer a { color: rgba(255,255,255,0.7); }

/* ---------- ページトップボタン ---------- */
#page-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a56db;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  opacity: 0.85;
}
#page-top:hover { opacity: 1; text-decoration: none; }
