:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2733;
  --ink-soft: #4a5563;
  --muted: #7a8390;
  --line: #e3e0d9;
  --navy: #1e3a5f;
  --navy-deep: #152a45;
  --accent: #9a7b4f;
  --accent-soft: #f3ede3;
  --cta: #c0573b;
  --cta-deep: #a24630;
  --radius: 8px;
  --max: 1160px;
  --read: 760px;
  --shadow: 0 1px 2px rgba(21, 42, 69, .06), 0 4px 14px rgba(21, 42, 69, .06);
  --serif: "Noto Serif JP", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.9; letter-spacing: .02em;
}
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--read); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-icon { width: 36px; height: 36px; border-radius: 50%; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: .08em; }
.brand-en { font-size: 11px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; }
.header-links { display: flex; gap: 18px; }
.header-link { font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.cat-nav { border-top: 1px solid var(--line); background: var(--surface); }
.cat-nav-inner { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 6px; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; font-size: 13px; color: var(--ink-soft); text-decoration: none;
  padding: 4px 14px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.cat-nav a:hover { border-color: var(--line); color: var(--navy); }
.cat-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

/* ---------- hero ---------- */
.hero { background: var(--navy-deep); color: #f2efe8; padding: 56px 0 52px; }
.hero .eyebrow { font-size: 12px; letter-spacing: .24em; color: #c9b38c; margin: 0 0 12px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 4.2vw, 38px); line-height: 1.5; margin: 0 0 14px; }
.hero p { max-width: 640px; color: #d5dbe3; margin: 0; font-size: 15px; }

/* ---------- 2カラム ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-top: 36px; padding-bottom: 64px; align-items: start; }
.main-col { min-width: 0; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

.home-section { margin-bottom: 44px; }
.section-title {
  font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 18px;
  padding-bottom: 10px; border-bottom: 2px solid var(--navy);
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.section-title small { font-family: var(--sans); font-size: 13px; font-weight: 400; }
.page-h1 { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 30px); margin: 4px 0 12px; }
.page-lead { color: var(--ink-soft); margin: 0 0 24px; font-size: 15px; }

/* ---------- カード ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(21,42,69,.08), 0 10px 24px rgba(21,42,69,.10); color: var(--ink); }
.card-thumb { aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; background: var(--navy-deep); }
.card-body { padding: 12px 14px 16px; }
.card-title { font-weight: 600; font-size: 15px; line-height: 1.6; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card:hover .card-title { color: var(--navy); }
.empty-note { color: var(--muted); font-size: 14px; }

.meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag {
  display: inline-block; font-size: 11px; color: var(--accent); background: var(--accent-soft);
  border-radius: 3px; padding: 0 8px; line-height: 1.9; text-decoration: none;
}

/* ---------- サイドバー ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 120px; }
@media (max-width: 960px) { .sidebar { position: static; } }
.widget { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); font-size: 14px; }
.widget-title { font-family: var(--serif); font-size: 16px; margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--navy); }
.profile-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.profile-head img { width: 56px; height: 56px; border-radius: 50%; }
.profile-head strong { display: block; font-family: var(--serif); }
.profile-head span { font-size: 12px; color: var(--muted); line-height: 1.5; display: block; }
.profile p { color: var(--ink-soft); margin: 0 0 10px; line-height: 1.8; }
.widget-link { font-size: 13px; }
.cat-list, .mini-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.cat-list li:last-child a { border-bottom: 0; }
.cat-list span { color: var(--muted); font-size: 12px; }
.mini-list li + li { margin-top: 12px; }
.mini-list a { display: grid; grid-template-columns: 96px 1fr; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.55; font-size: 13px; }
.mini-list img { border-radius: 4px; aspect-ratio: 1200/630; object-fit: cover; }

/* ---------- 記事 ---------- */
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.article-h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(23px, 3.4vw, 30px); line-height: 1.55; margin: 10px 0 16px; }
.eyecatch { width: 100%; border-radius: var(--radius); margin: 0 0 24px; box-shadow: var(--shadow); }
.ad-label { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 4px 12px; border-radius: 4px; display: inline-block; margin: 0 0 16px; background: var(--surface); }

.prose { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 5vw, 44px); box-shadow: var(--shadow); }
.prose h2 {
  font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.6;
  margin: 48px -8px 18px; padding: 12px 16px; background: var(--navy); color: #fff; border-radius: 4px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17px; margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); color: var(--navy); }
.prose p { margin: 0 0 1.3em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.prose li { margin-bottom: 4px; }
.prose li::marker { color: var(--accent); }
.prose b, .prose strong { background: linear-gradient(transparent 62%, #f6e3b8 62%); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--accent-soft); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.summary-box { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 28px; font-size: 15px; border-top: 4px solid var(--accent); }
.summary-box strong { display: block; font-family: var(--serif); color: var(--navy); margin-bottom: 6px; background: none; }
.summary-box ul { margin: 0; }
.note { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 12px 16px; font-size: 14px; color: var(--ink-soft); margin: 0 0 1.4em; background: #fdfcfa; border-radius: 0 4px 4px 0; }
.sources { font-size: 14px; }

/* 目次 */
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; margin: 0 0 32px; background: #fbfaf7; }
.toc-title { font-family: var(--serif); font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.4em; font-size: 14px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--navy); text-decoration: underline; }

/* 広告リンク：単独の段落にある広告リンクはボタン表示 */
.prose p > a[rel~="sponsored"]:only-child {
  display: block; max-width: 420px; margin: 8px auto 8px; text-align: center;
  background: var(--cta); color: #fff; text-decoration: none; font-weight: 600;
  padding: 14px 20px; border-radius: 999px; box-shadow: 0 3px 0 var(--cta-deep);
  transition: transform .1s ease, box-shadow .1s ease;
}
.prose p > a[rel~="sponsored"]:only-child::after { content: " →"; }
.prose p > a[rel~="sponsored"]:only-child:hover { transform: translateY(2px); box-shadow: 0 1px 0 var(--cta-deep); color: #fff; }

/* シェア・著者・関連 */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 28px 0; }
.share-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.share a { font-size: 13px; color: #fff; text-decoration: none; padding: 6px 16px; border-radius: 4px; font-weight: 600; }
.share-x { background: #111; }
.share-line { background: #06c755; }
.share-hatena { background: #00a4de; }
.share a:hover { opacity: .85; color: #fff; }
.author-box { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 40px; }
.author-box img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.author-name { font-weight: 600; font-size: 14px; }
.author-box p { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.8; }
.related .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ページ送り */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0 0; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 6px 12px; border-radius: 4px; font-size: 14px; text-decoration: none; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.pager .pager-current { background: var(--navy); color: #fff; }

/* 検索 */
.search-form input { width: 100%; font: inherit; font-size: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); margin: 4px 0 14px; }
.search-form input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

/* 固定ページ（運営者情報など） */
.main-col > h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.55; margin: 4px 0 16px; }
.page { padding: 40px 0 72px; }
.page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.6vw, 30px); line-height: 1.55; margin: 8px 0 16px; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: #b9c2cd; font-size: 13px; padding: 40px 0 28px; }
.site-footer a { color: #dfe4ea; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { font-family: var(--serif); font-size: 18px; color: #f2efe8; letter-spacing: .08em; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.copyright { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); color: #8d98a6; }
.to-top {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; text-decoration: none;
  box-shadow: var(--shadow); font-size: 18px; opacity: .85;
}
.to-top:hover { color: #fff; opacity: 1; }

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .brand-en { display: none; }
  .hero { padding: 40px 0 36px; }
  .layout { padding-top: 24px; }
  .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-title { font-size: 15px; -webkit-line-clamp: 2; }
  .prose h2 { font-size: 18px; margin-left: -4px; margin-right: -4px; }
  .related .card-grid { grid-template-columns: 1fr; }
}
