/* ============================================================
   EV Battery Journal — メインスタイルシート
   ============================================================ */

/* ===== CSS 変数 ===== */
:root {
  --bg:        #11161A;
  --panel:     #151D2A;
  --accent:    #4A9EFF;
  --sub:       #FFD938;
  --text:      #EAF2EC;
  --muted:     #9DB5C8;
  --border:    rgba(74,158,255,0.15);
  --radius:    8px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

/* ===== スクリーンリーダー用 ===== */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17,22,26,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.logo-icon { width: 36px; height: 36px; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

/* WP の wp_nav_menu が出力する <ul class="site-nav menu"> に対応 */
.site-nav,
ul.site-nav {
  display: flex;
  gap: 32px;
  list-style: none;
}
.site-nav li a,
ul.site-nav li a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  white-space: nowrap;
}
.site-nav li a:hover,
ul.site-nav li a:hover { color: var(--accent); }
/* 子項目（ドロップダウン）。テーマに .sub-menu の指定が無く、
   ブラウザ既定の箇条書きがそのままPCのヘッダーに出ていた */
.site-nav li,
ul.site-nav li { position: relative; }
.site-nav li.menu-item-has-children > a::after {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}
.site-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 210px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  /* 記事の上に重なるので不透明にする。backdrop-filter は環境によって
     背後の明るさを拾って白っぽくなることがあるため使わない */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  z-index: 120;
}
/* focus-within でキーボード操作でも開く */
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { display: block; }
.site-nav .sub-menu li a { display: block; padding: 9px 16px; }
.site-nav .sub-menu li a:hover { color: var(--accent); }

/* ナビの他は規約・ポリシー類。EVカタログは読み物なので色で立てる。
   テーマが差し込んだ場合（クラスで一致）と、管理画面で追加した場合（URLで一致）の
   どちらでも効くようにしてある */
.site-nav li.evbj-menu-catalog a,
ul.site-nav li.evbj-menu-catalog a,
.site-nav li a[href$="/ev-catalog/"],
ul.site-nav li a[href$="/ev-catalog/"] { color: var(--sub); }
.site-nav li.evbj-menu-catalog a:hover,
ul.site-nav li.evbj-menu-catalog a:hover,
.site-nav li a[href$="/ev-catalog/"]:hover,
ul.site-nav li a[href$="/ev-catalog/"]:hover { color: var(--sub); text-decoration: underline; }

/* ハンバーガーメニュー */
.nav-toggle { display: none; }
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 4px;
  z-index: 200;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle:checked + .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .nav-hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked + .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ロゴとナビの間をこの1つの要素にまとめ、.site-header は
   常に「ロゴ／この要素」の2つだけを space-between で両端に置く */
.site-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* サイト内検索（ヘッダー常時表示） */
.site-search {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 4px 0 14px;
  height: 34px;
  transition: border-color 0.2s;
}
.site-search:focus-within { border-color: var(--accent); }
.site-search-input {
  width: 160px;
  max-width: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}
.site-search-input::placeholder { color: var(--muted); }
/* Safari/WebKit のデフォルトの「×」ボタンとの重なりを消す */
.site-search-input::-webkit-search-decoration,
.site-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.site-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s;
}
.site-search-btn:hover,
.site-search-btn:focus-visible { color: var(--accent); }
.site-search-btn svg { width: 16px; height: 16px; }

/* ============================================================
   ヒーローセクション
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  padding: 80px 40px;
}

.hero-hex-bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cpolygon points='60,2 112,30 112,74 60,102 8,74 8,30' fill='none' stroke='%234A9EFF' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 120px 104px;
}
.hero-hex-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 65% 50%, transparent 30%, var(--bg) 80%);
}

.hero-content { position: relative; z-index: 2; max-width: 580px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-title .accent { color: var(--accent); }
.hero-title .sub    { color: var(--sub); }

.hero-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 440px;
  margin-bottom: 32px;
  line-height: 1.75;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.hero-cta:hover { opacity: 0.85; color: var(--bg); }

/* 右側六角セルビジュアル */
.hero-visual {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.battery-cell-grid {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 6px;
}
.hex-cell {
  width: 60px;
  height: 52px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}
.hex-cell.active { background: rgba(74,158,255,0.18); color: var(--accent); }
.hex-cell.warm   { background: rgba(255,217,56,0.18);  color: var(--sub); }
.hex-cell.bright { background: rgba(74,158,255,0.35);  color: var(--accent); font-weight: 700; }

/* ============================================================
   ニュース速報バー
   ============================================================ */
.news-ticker {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  font-size: 13px;
}
.ticker-label {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-inner {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-inner a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.ticker-inner a:hover { color: var(--accent); }
.ticker-sep { color: var(--muted); margin: 0 4px; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   メインレイアウト
   ============================================================ */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
}

/* ===== サイドバー付きレイアウト（「電池の勉強」カテゴリー関連ページのみ） ===== */
.site-main-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: start;
  gap: 48px;
}
.site-main-with-sidebar .layout-content { min-width: 0; }
.site-main-with-sidebar .posts-grid { grid-template-columns: repeat(2, 1fr); }

.sidebar-study {
  position: sticky;
  top: 24px;
}

.study-toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.study-toc-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.study-toc-pillar + .study-toc-pillar { margin-top: 18px; }

/* トグル用チェックボックスは非表示（ラベルクリックで開閉。ヘッダーのハンバーガーと同じ手法） */
.study-toc-toggle-input { display: none; }

.study-toc-pillar-head,
.study-toc-level-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.study-toc-pillar-head { margin-bottom: 8px; }

/* 見出しのリンク部分（クリックでその章／学年のアーカイブへ） */
.study-toc-pillar-link,
.study-toc-level-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  min-width: 0;
}
.study-toc-pillar-link:hover .study-toc-pillar-name,
.study-toc-level-link:hover { color: var(--accent); }

.study-toc-pillar-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.study-toc-pillar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.study-toc-level-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* 見出し右側：進捗カウンター＋開閉トグル（ラベル＝クリック領域） */
.study-toc-pillar-meta {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
}
.study-toc-progress {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.study-toc-toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 押せる場所だと分かるように、左の A/B バッジと同じ枠を付けて箱にする */
  width: 34px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.study-toc-toggle-label:hover {
  background-color: var(--border);
  border-color: var(--accent);
  color: var(--accent);
}
.study-toc-toggle-label::before {
  content: '▶';
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s ease;
}
/* 学年サブメニュー側は一段小さく */
.study-toc-level-head .study-toc-toggle-label { width: 28px; height: 24px; }
.study-toc-level-head .study-toc-toggle-label::before { font-size: 13px; }
.study-toc-toggle-input:checked ~ .study-toc-pillar-head .study-toc-toggle-label::before,
.study-toc-level > .study-toc-toggle-input:checked ~ .study-toc-level-head .study-toc-toggle-label::before {
  transform: rotate(90deg);
}

/* 柱の折りたたみ本体（学年サブメニュー、またはフラットな目次） */
.study-toc-body { display: none; }
.study-toc-pillar > .study-toc-toggle-input:checked ~ .study-toc-body { display: block; }

/* 学年サブメニュー（電気化学の勉強など、学年が分かれている柱のみ出現） */
.study-toc-level { margin-top: 10px; padding-left: 4px; border-left: 2px solid var(--border); }
.study-toc-level:first-child { margin-top: 0; }
.study-toc-level-head { padding-left: 8px; }
.study-toc-level > .study-toc-list { display: none; margin-top: 4px; }
.study-toc-level > .study-toc-toggle-input:checked ~ .study-toc-list { display: block; }

.study-toc-list { list-style: none; }
.study-toc-list-flat { margin-top: 2px; }
.study-toc-level .study-toc-item,
.study-toc-list-flat .study-toc-item { padding-left: 8px; }
.study-toc-item {
  font-size: 13px;
  line-height: 1.5;
  padding: 5px 0;
}
.study-toc-item.is-published a {
  color: var(--text);
  text-decoration: none;
}
.study-toc-item.is-published a:hover { color: var(--accent); }
.study-toc-item.is-pending span { color: var(--muted); opacity: 0.6; }

/* アーカイブの章絞り込み中バナー */
.archive-filter-note {
  margin-top: -8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--muted);
}
.archive-filter-note a {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ===== セクションヘッダー ===== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-title .dot { color: var(--accent); }
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.section-more {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
}
.section-more:hover { color: var(--accent); }

/* ===== カテゴリータブ ===== */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.cat-tab {
  padding: 7px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-head);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-tab.active, .cat-tab:hover {
  background: rgba(74,158,255,0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.cat-count {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
}
/* 記事の絞り込みではなく固定ページへ飛ぶタブ。同じ見た目だと絞り込みと誤解されるので色を変える */
.cat-tab--page {
  border-color: rgba(255,217,56,0.35);
  color: var(--sub);
}
.cat-tab--page:hover {
  background: rgba(255,217,56,0.1);
  border-color: var(--sub);
  color: var(--sub);
}


/* ===== 記事カード共通 ===== */
.post-card,
.post-card-featured {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.post-card:hover,
.post-card-featured:hover {
  border-color: rgba(74,158,255,0.5);
  transform: translateY(-2px);
}

.post-card-thumb {
  aspect-ratio: 3 / 2;   /* アイキャッチ 3:2 と枠をそろえる（切り取らない） */
  background: linear-gradient(135deg, #151D2A 0%, #0a1020 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-hex {
  opacity: 0.35;
  font-size: 80px;
  user-select: none;
  line-height: 1;
}

/* カテゴリーバッジ */
.post-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
}
.cat-ev    { background: rgba(74,158,255,0.18); color: var(--accent); }
.cat-bat   { background: rgba(255,217,56,0.18);  color: var(--sub); }
.cat-study { background: rgba(130,180,255,0.18); color: #90c0ff; }
.cat-cat   { background: rgba(74,158,255,0.12);  color: var(--accent); }

.post-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.post-card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--text);
  flex: 1;
}
.post-card-excerpt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

/* ===== フィーチャード + サイドカード ===== */
.posts-featured {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.post-card-featured .post-card-title { font-size: 20px; }

.posts-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== 3カラムグリッド ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

/* ===== アーカイブページ ===== */
.breadcrumbs { margin-bottom: 16px; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--muted); }
.breadcrumbs-sep { color: var(--border); }

.archive-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.archive-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.archive-title::before {
  content: '#';
  color: var(--accent);
  font-family: var(--font-mono);
  margin-right: 6px;
  font-size: 20px;
}
.archive-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ===== 研究者の半生：ほかの棚にいる偉人たち（2026-10-02） ===== */
.lives-elsewhere {
  margin: -16px 0 40px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--sub);
  border-radius: var(--radius);
}
.lives-elsewhere-title {
  font-family: var(--font-head);
  font-size: 17px;
  margin: 0 0 6px;
}
.lives-elsewhere-lead {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 14px;
}
.lives-elsewhere-lead strong { color: var(--text); }
.lives-elsewhere-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.lives-elsewhere-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.lives-elsewhere-card:hover { border-color: var(--accent); }
.lives-elsewhere-thumb { flex: 0 0 96px; }
.lives-elsewhere-thumb img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.lives-elsewhere-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lives-elsewhere-name { font-size: 14px; font-weight: 700; line-height: 1.5; }
.lives-elsewhere-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.lives-elsewhere-more { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 768px) {
  .lives-elsewhere { margin-top: -24px; padding: 16px; }
  .lives-elsewhere-grid { grid-template-columns: 1fr; }
}

/* ===== シングル記事 ===== */
.single-article-inner {
  max-width: 780px;
  margin: 0 auto;
}
.single-cat-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.single-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.single-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.single-thumbnail {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}
.single-thumbnail img { width: 100%; height: auto; }

/* .entry-content — WordPress 本文 */
.entry-content { font-size: 15px; line-height: 1.85; color: var(--muted); }
.entry-content > * + * { margin-top: 1.4em; }

.entry-content h2 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.35;
  margin-top: 40px;
}
.entry-content h3 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
}
.entry-content h4 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
}
.entry-content p { color: var(--muted); }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { opacity: 0.8; }
.entry-content strong { color: var(--text); font-weight: 600; }
.entry-content em { font-style: italic; }

.entry-content ul, .entry-content ol {
  padding-left: 1.6em;
  color: var(--muted);
}
.entry-content ul li { list-style: disc; margin-bottom: 0.4em; }
.entry-content ol li { list-style: decimal; margin-bottom: 0.4em; }

.entry-content blockquote {
  border-left: 3px solid var(--border);
  padding: 12px 20px;
  background: rgba(74,158,255,0.05);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--muted);
}

/* 2026-09-20: 13px → 15px（本文と同じ大きさ）。式の中の l（ln・log）が
   13px だと潰れて I や 1 と見分けにくかったため。<pre> は本文で未使用。 */
.entry-content pre, .entry-content code {
  font-family: var(--font-mono);
  font-size: 15px;
  background: rgba(74,158,255,0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.entry-content pre { padding: 16px 20px; overflow-x: auto; }
.entry-content code { padding: 2px 6px; }
.entry-content pre code { background: none; border: none; padding: 0; }

.entry-content img { border-radius: 6px; max-width: 100%; height: auto; display: block; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.entry-content th, .entry-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.entry-content th { background: rgba(74,158,255,0.08); color: var(--text); font-weight: 600; }

/* WordPress 画像配置 */
.alignleft  { float: left;  margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 0 auto 16px; }
.alignwide  { margin-left: calc(-1 * var(--content-margin, 0px)); margin-right: calc(-1 * var(--content-margin, 0px)); }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }

/* 記事フッター */
.single-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
.single-cats a, .single-tags a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: border-color 0.2s, color 0.2s;
}
.single-cats a:hover, .single-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 本文下の広告枠（1枠のみ・読了後に表示） */
.single-adslot {
  margin-top: 32px;
  text-align: center;
  overflow: hidden;
}

/* 前後の記事ナビ */
.post-navigation {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nav-previous, .nav-next {
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.nav-previous:hover, .nav-next:hover { border-color: rgba(74,158,255,0.4); }
.nav-next { text-align: right; }
.nav-previous a, .nav-next a {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.nav-previous .nav-subtitle, .nav-next .nav-subtitle {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* ===== ページネーション ===== */
.pagination { margin-top: 48px; text-align: center; }
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  margin: 0 3px;
  transition: all 0.2s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: rgba(74,158,255,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .page-numbers.dots {
  background: none;
  border: none;
  color: var(--muted);
  cursor: default;
}
.pagination .page-numbers.prev,
.pagination .page-numbers.next {
  width: auto;
  padding: 0 16px;
  white-space: nowrap;
}

/* ===== 固定ページ ===== */
.static-page .single-title { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

/* ===== 404 ===== */
.error-404 {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-404-inner { text-align: center; }
.error-code {
  font-family: var(--font-mono);
  font-size: 120px;
  font-weight: 500;
  color: rgba(74,158,255,0.15);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}
.error-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.error-desc { color: var(--muted); margin-bottom: 32px; }

/* ===== 記事なし ===== */
.no-posts {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-family: var(--font-mono);
}

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .footer-logo {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.footer-col-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.footer-mono { font-family: var(--font-mono); }

/* ============================================================
   レスポンシブ — タブレット (〜1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .site-header { padding: 0 24px; }
  .site-header-right { gap: 14px; }
  .site-search-input { width: 120px; }
  .site-main   { padding: 48px 24px; }
  .hero        { padding: 72px 24px; }
  .footer-inner { padding: 40px 24px 20px; }

  .hero-title  { font-size: 40px; }
  .hero-visual { right: 24px; }
  .battery-cell-grid { grid-template-columns: repeat(3, 52px); }
  .hex-cell { width: 52px; height: 45px; }

  .posts-featured { grid-template-columns: 1fr; }
  .posts-side     { display: grid; grid-template-columns: 1fr 1fr; }
  .posts-grid     { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .news-ticker { padding: 10px 24px; }

  /* サイドバー付きレイアウト：1カラムに畳んでサイドバーを下段へ */
  .site-main-with-sidebar { grid-template-columns: 1fr; gap: 32px; }
  .sidebar-study { position: static; }
}

/* ============================================================
   レスポンシブ — モバイル (〜768px)
   ============================================================ */
@media (max-width: 768px) {
  /* ヘッダー */
  .site-header { padding: 0 16px; }
  .site-header-right { gap: 8px; }
  .site-search { padding: 0 2px 0 10px; height: 32px; }
  .site-search-input { width: 84px; font-size: 12px; }
  .nav-hamburger { display: flex; }
  .site-nav,
  ul.site-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(17,22,26,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    gap: 0;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .site-nav li a,
  ul.site-nav li a {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle:checked ~ nav .site-nav,
  .nav-toggle:checked ~ nav ul.site-nav { display: flex; }
  /* スマホでは浮かせず、字下げした入れ子の一覧として常に開いておく */
  .site-nav .sub-menu {
    display: block;
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-nav .sub-menu li a { padding: 14px 24px 14px 44px; }
  .site-nav li.menu-item-has-children > a::after { content: ""; margin: 0; }

  /* ヒーロー */
  .hero { padding: 52px 16px 44px; min-height: auto; }
  .hero-visual { display: none; }
  .hero-title  { font-size: 30px; letter-spacing: -0.01em; }
  .hero-desc   { font-size: 14px; max-width: 100%; margin-bottom: 24px; }
  .hero-hex-bg::after {
    background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 10%, var(--bg) 65%);
  }

  /* ティッカー */
  .news-ticker { padding: 10px 16px; }

  /* メイン */
  .site-main { padding: 28px 16px; }

  /* セクションヘッダー */
  .section-title  { font-size: 18px; }
  .section-label  { display: none; }

  /* カード */
  .posts-featured { grid-template-columns: 1fr; margin-bottom: 14px; }
  .posts-side     { display: flex; gap: 14px; }
  .posts-grid     { grid-template-columns: 1fr; gap: 14px; }
  .post-card-featured .post-card-title { font-size: 17px; }
  .thumb-hex { font-size: 60px; }

  /* シングル記事 */
  .single-article-inner { max-width: 100%; }
  .single-title { font-size: 22px; }
  .single-meta  { gap: 10px; }
  .entry-content h2 { font-size: 17px; }
  .post-navigation { grid-template-columns: 1fr; }
  .nav-next { text-align: left; }

  /* フッター */
  .footer-inner { padding: 32px 16px 16px; }
  .footer-grid  { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .site-footer  { margin-top: 40px; }
}

/* 幅の狭いスマホ（〜380px）：ロゴ＋検索＋ハンバーガーが1行に収まりきらないため検索欄をさらに縮める */
@media (max-width: 380px) {
  .site-header-right { gap: 6px; }
  .site-search { padding: 0 2px 0 8px; }
  .site-search-input { width: 60px; }
}

/* ===== サイトマップ（page-sitemap.php） ===== */
.sitemap h2 a { color: var(--text); text-decoration: none; }
.sitemap h2 a:hover { color: var(--accent); }
.sitemap-count { font-size: 13px; color: var(--muted); font-weight: 400; }
.sitemap-list { list-style: disc; padding-left: 1.4em; }
.sitemap-list li { margin: 0.3em 0; }
.sitemap-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 10px 16px; margin-top: 0.8em; }
.sitemap-group summary { cursor: pointer; color: var(--text); font-weight: 600; }
.sitemap-group[open] summary { margin-bottom: 0.6em; }
.sitemap-group h3 { font-size: 15px; margin-top: 1em; }
