:root {
  --pine: #21331f;
  --pine-2: #2c4327;
  --pine-soft: #3c5535;
  --ember: #b8481f;
  --ember-dark: #93381a;
  --ember-light: #e08a4f;
  --moss: #5c7a49;
  --parchment: #f2ecdd;
  --paper: #fbf8ef;
  --ink: #241f16;
  --brown: #43392a;
  --line: #ddd0ac;
  --muted: #766c56;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --serif: "Zen Old Mincho", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

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

a {
  color: var(--ember-dark);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ember);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  background: var(--paper);
  padding: 0.6rem 1.1rem;
  z-index: 999;
  border: 1px solid var(--line);
}

.skip-link:focus {
  top: 1rem;
}

/* ===== header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(33, 51, 31, 0.94);
  backdrop-filter: blur(7px);
  border-bottom: 3px solid var(--ember);
}

.brand-row {
  max-width: 1200px;
  min-height: 74px;
  margin: auto;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: #f4ecd8;
  line-height: 1.25;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px dashed var(--ember-light);
  color: var(--ember-light);
  font-size: 1.3rem;
  flex: none;
  transform: rotate(-4deg);
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.14rem;
  letter-spacing: 0.1em;
}

.brand small {
  display: block;
  color: #c9d6bd;
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  margin-top: 4px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--ember-light);
  background: transparent;
  flex: none;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: #f4ecd8;
  margin: 6px 0;
}

.global-nav {
  border-top: 1px solid rgba(244, 236, 216, 0.16);
}

.global-nav ul {
  max-width: 1200px;
  margin: auto;
  padding: 0 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
}

.global-nav a {
  display: block;
  padding: 11px 13px;
  color: #e7e0cb;
  font-size: 0.76rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.global-nav a:hover,
.global-nav a[aria-current="page"] {
  border-color: var(--ember-light);
  color: #fff;
}

/* ===== hero ===== */
.hero-block {
  position: relative;
  max-width: 1600px;
  margin: auto;
  background: var(--pine);
  min-height: 480px;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
}

.hero-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 22, 12, 0.92) 4%, rgba(15, 22, 12, 0.5) 46%, rgba(15, 22, 12, 0.14) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  color: #fff;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 78px 0 58px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 5px 14px 5px 12px;
  border: 1px dashed var(--ember-light);
  color: #ffe2c4;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  transform: rotate(-1.5deg);
}

.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin: 0 0 18px;
  max-width: 920px;
  color: #fbf3e2;
  text-shadow: 0 3px 4px rgba(0, 0, 0, 0.75), 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 2px rgba(0, 0, 0, 0.9);
}

.hero-copy > p:last-child {
  max-width: 700px;
  font-size: 1.05rem;
  margin: 0;
  color: #f2ede0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

/* ===== layout ===== */
.container {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 60px;
  align-items: start;
  padding-top: 70px;
  padding-bottom: 92px;
}

.article {
  min-width: 0;
}

.article > section {
  margin: 0 0 62px;
}

.article h2 {
  font-family: var(--serif);
  font-size: clamp(1.42rem, 2.4vw, 1.95rem);
  line-height: 1.55;
  letter-spacing: 0.04em;
  margin: 0 0 24px;
  padding: 10px 0 10px 22px;
  border-left: 5px solid var(--ember);
  color: var(--brown);
}

.article h3 {
  font-family: var(--serif);
  line-height: 1.6;
  color: var(--pine-2);
  margin: 1.7em 0 0.6em;
  padding-left: 12px;
  border-left: 2px dotted var(--moss);
}

.article p {
  margin: 0 0 1.35em;
}

.overview-block {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 38px;
}

/* ===== sidebar ===== */
.sidebar {
  position: sticky;
  top: 148px;
  display: grid;
  gap: 22px;
}

.sidebar nav,
.ad-slot {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
}

.sidebar h2 {
  font-family: var(--serif);
  font-size: 1rem;
  margin: 0 0 12px;
  color: var(--brown);
}

.sidebar ol,
.sidebar ul {
  margin: 0;
  padding-left: 1.2rem;
}

.sidebar li + li {
  margin-top: 8px;
}

.sidebar a {
  font-size: 0.84rem;
}

.ad-slot span {
  display: inline-block;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  width: 100%;
}

.ad-slot strong {
  display: block;
  font-family: var(--serif);
  line-height: 1.55;
  color: var(--brown);
}

.ad-slot p {
  font-size: 0.78rem;
  line-height: 1.65;
}

.ad-slot > a {
  display: inline-block;
  background: var(--ember);
  color: #fff;
  padding: 9px 16px;
  text-decoration: none;
  font-size: 0.82rem;
}

.ad-slot > a:hover {
  background: var(--ember-dark);
  color: #fff;
}

.related-pages ul {
  list-style: none;
  padding: 0;
}

.related-pages li {
  padding-left: 1.1rem;
  position: relative;
}

.related-pages li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--moss);
}

/* ===== related / cards ===== */
.related {
  border-top: 1px dashed var(--line);
  padding-top: 50px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--moss);
  padding: 22px;
}

.related-grid h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  font-family: var(--serif);
}

.related-grid p {
  font-size: 0.8rem;
  line-height: 1.65;
  margin: 0;
  color: var(--muted);
}

.related-sites {
  background: #e9e2c8;
  border: 1px dashed var(--brown);
  padding: 30px;
  margin-top: 48px;
}

.related-sites h2 {
  margin-top: 0;
}

.related-sites ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.related-sites a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  text-decoration: none;
}

.related-sites strong {
  min-width: 130px;
  color: var(--brown);
}

.related-sites span {
  font-size: 0.78rem;
  color: var(--muted);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.report-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  position: relative;
}

.report-grid span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ember);
  color: var(--ember-dark);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--serif);
}

.report-grid h3 {
  margin: 12px 0 8px;
  font-family: var(--serif);
}

.report-grid p {
  font-size: 0.82rem;
  line-height: 1.7;
  margin: 0;
  color: var(--muted);
}

/* ブログ一覧・記事固有のスタイルは blog/blog.css に集約（二重定義回避） */

/* ===== ad banner (inject_site_ads.py) ===== */
.amazon-banner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ember);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.amazon-banner a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.6;
}

/* ===== footer ===== */
.site-footer {
  background: var(--pine);
  color: #e3ddc5;
  padding: 58px 24px 20px;
}

.footer-grid {
  max-width: 1120px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 58px;
}

.footer-grid h2 {
  font-family: var(--serif);
  font-size: 1rem;
  color: #fbf3e2;
  margin: 0 0 14px;
}

.footer-grid p {
  font-size: 0.78rem;
  max-width: 380px;
  color: #cfc7a9;
}

.footer-grid nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-grid a {
  color: #e3ddc5;
  font-size: 0.8rem;
  margin-bottom: 8px;
  text-decoration: none;
}

.footer-grid a:hover {
  text-decoration: underline;
}

.footer-links {
  max-width: 1120px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid #46593e;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: #e3ddc5;
  font-size: 0.78rem;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copyright {
  max-width: 1120px;
  margin: 18px auto 0;
  font-size: 0.65rem;
  color: #9fae8f;
}

.no-scroll {
  overflow: hidden;
}

/* ===== responsive ===== */
@media (max-width: 800px) {
  html {
    scroll-padding-top: 4.5rem;
  }
  .brand-row {
    min-height: 64px;
    padding: 10px 18px;
  }
  .brand strong {
    font-size: 0.94rem;
  }
  .brand small {
    font-size: 0.48rem;
  }
  .menu-toggle {
    display: block;
  }
  .global-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    /* backdrop-filter を持つ .site-header が fixed 要素の containing block に
       なるため、bottom:0 は使わずビューポート基準の高さを明示する。 */
    height: calc(100vh - 64px);
    background: var(--pine);
    overflow: auto;
  }
  .global-nav.is-open {
    display: block;
  }
  .global-nav ul {
    display: block;
    padding: 14px 22px;
  }
  .global-nav a {
    font-size: 0.92rem;
    padding: 13px 7px;
    border-bottom: 1px solid rgba(244, 236, 216, 0.16);
  }
  .hero-block {
    min-height: 430px;
  }
  .hero-copy {
    width: calc(100% - 36px);
    padding: 66px 0 44px;
  }
  .hero-copy h1 {
    font-size: clamp(1.8rem, 8.6vw, 2.5rem);
    overflow-wrap: anywhere;
  }
  .hero-copy > p:last-child {
    font-size: 0.92rem;
  }
  .container {
    width: calc(100% - 36px);
  }
  .content-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 48px;
    padding-bottom: 64px;
  }
  .article > section {
    margin-bottom: 52px;
  }
  .article h2 {
    font-size: 1.4rem;
  }
  .sidebar {
    position: static;
  }
  .related-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
  .related-sites {
    padding: 22px;
  }
  .related-sites a {
    display: block;
  }
  .related-sites strong,
  .related-sites span {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .overview-block {
    padding: 24px;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 15px;
  }
  .brand-mark {
    display: none;
  }
  .hero-block {
    min-height: 400px;
  }
  .sidebar nav,
  .ad-slot {
    padding: 20px;
  }
  .article h2 {
    padding-left: 16px;
  }
}

/* LATEST-COMMENTARY:START */
.latest-commentary {
  padding: 3rem 0;
}
/* .container を持たないサイトでも端に張り付かないための保険。
   :where() は詳細度0なので、サイト側の .container 定義が常に優先される。 */
:where(.latest-commentary .container) {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}
.latest-commentary h2 {
  margin-bottom: 1.25rem;
}
.latest-commentary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.latest-commentary-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line, #e5e5e5);
}
.latest-commentary-list time {
  flex: 0 0 auto;
  color: var(--muted, #666);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.latest-commentary-list a {
  flex: 1 1 16rem;
  min-width: 0;
  color: var(--ink, #222);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.latest-commentary-list a:hover {
  color: #0b5;
  text-decoration: underline;
}
.latest-commentary-more {
  margin-top: 1.25rem;
}
.latest-commentary-more a {
  color: #0b5;
  text-decoration: none;
  font-weight: 600;
}
.latest-commentary-more a:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .latest-commentary-list li {
    flex-direction: column;
    gap: 0.2rem;
  }
  /* 縦積み時に flex-basis(16rem) が高さに効かないよう auto に戻す */
  .latest-commentary-list a,
  .latest-commentary-list time {
    flex: 0 0 auto;
  }
}
/* LATEST-COMMENTARY:END */

/* HEADING-WRAP:START 見出し最終行孤立文字対策 (AGENTS.md NoGo) */
h1,h2,h3,h4,.hero-title,.page-title,.card-title{text-wrap:balance;word-break:auto-phrase;line-break:strict;overflow-wrap:break-word}
/* HEADING-WRAP:END */
