/* ──────────────────────────────────────────────────────────────────────────
   guide.css — shared stylesheet for the /guides/ SEO content pages.

   Extracted from public/about.html (the canonical content-page design) so the
   hub-and-spoke guide pages share one cacheable stylesheet instead of inlining
   ~400 lines each. Theme tokens, layout, hero, sections, tables, callout, CTA
   and footer are byte-faithful to about.html; the breadcrumb, related-guides
   grid and FAQ blocks at the bottom are the guide-only additions.

   NOTE: kept Prettier-clean — *.css is NOT in .prettierignore, so CI's
   format:check enforces it. Run `npm run format` after editing.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Theme variables ─────────────────────────────────── */
:root {
  --torii: #c0392b;
  --torii-bright: #e74c3c;
  --gold: #d4a017;
  --night: #09090f;
  --surface: #111119;
  --surface-2: #191928;
  --border: #222235;
  --text: #eeeef5;
  --muted: #8282ab; /* ≥4.5:1 on all surfaces (WCAG AA — keep in sync with src/index.css) */
  --knew: #27ae60;
}

/* ── Reset / base ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--night);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: inherit;
}

/* ── Shoji texture + torii bar ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.013) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--torii) 25%,
    var(--torii) 75%,
    transparent 100%
  );
  z-index: 100;
}

/* ── Header ──────────────────────────────────────────── */
.header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-en {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-link {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface-2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
}

.auth-header-btn {
  display: block;
  margin-top: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.auth-header-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-premium-sm {
  display: block;
  margin-top: 0.35rem;
  background: var(--torii);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-premium-sm:hover {
  opacity: 0.85;
}

.btn-terms-sm {
  display: block;
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: 0.1rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-terms-sm:hover {
  opacity: 1;
  color: var(--text);
}

/* ── Page wrapper ────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2.5rem;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--text);
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 3.5rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  line-height: 1;
  display: block;
  margin-bottom: 1.2rem;
  text-shadow:
    0 0 40px rgba(212, 160, 23, 0.2),
    0 0 80px rgba(212, 160, 23, 0.08);
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Section ─────────────────────────────────────────── */
.section {
  margin-bottom: 3.5rem;
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--torii);
  margin-bottom: 1.25rem;
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin: 1.75rem 0 0.75rem;
}

.section p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.section p:last-child {
  margin-bottom: 0;
}

.section ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.section li {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.6rem;
}

.section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--torii);
}

.section li strong {
  color: var(--text);
  font-weight: 500;
}

.section a.inline {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section a.inline:hover {
  color: var(--torii-bright);
}

.jp {
  font-family: 'Noto Serif JP', serif;
}

/* ── Tables ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-2);
}

.td-kanji {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.05em;
}

.td-kana {
  font-family: 'Noto Serif JP', serif;
  color: var(--text);
  font-size: 1rem;
}

.td-irregular {
  font-family: 'Noto Serif JP', serif;
  color: var(--torii-bright);
  font-size: 1rem;
}

.td-muted {
  font-family: 'Noto Serif JP', serif;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: line-through; /* the "wrong reading" cue */
}

/* ── Callout ─────────────────────────────────────────── */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 1.5rem 0;
}

.callout strong {
  color: var(--text);
  font-weight: 500;
}

.callout code {
  font-family: 'Noto Serif JP', serif;
  color: var(--gold);
  font-size: 0.95em;
  background: var(--surface-2);
  padding: 0.05em 0.3em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* ── FAQ ─────────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}

.faq-q {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.faq-a {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

.faq-a code {
  font-family: 'Noto Serif JP', serif;
  color: var(--gold);
}

/* ── Related guides (hub-and-spoke mesh) ─────────────── */
.related {
  margin: 3.5rem 0 0;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.related-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: var(--surface);
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}

.related-card:hover {
  border-color: var(--muted);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.related-card .rc-kanji {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.3rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.4rem;
}

.related-card .rc-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  display: block;
  margin-bottom: 0.3rem;
}

.related-card .rc-blurb {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── CTA ─────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.cta p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--torii);
  color: #fff;
  border: none;
  padding: 0.9rem 2.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.btn-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), transparent);
  pointer-events: none;
}

.btn-start:hover {
  background: var(--torii-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(192, 57, 43, 0.45);
}

.btn-start:active {
  transform: translateY(0);
}

.btn-start-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.05rem;
  opacity: 0.9;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

footer a:hover {
  color: var(--text);
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .header {
    padding: 0.85rem 1rem;
  }
  .brand-en {
    display: none;
  }
  .nav-link {
    display: none;
  }
  .header-auth {
    border-left: none;
    padding-left: 0;
  }
  .page {
    padding: 2.5rem 1.25rem 4rem;
  }
  .breadcrumb {
    margin-bottom: 2rem;
  }
  .hero-jp {
    font-size: 2.5rem;
  }
  .hero h1 {
    font-size: 1.35rem;
  }
  thead th,
  tbody td {
    padding: 0.6rem 0.75rem;
  }
  .td-kanji {
    font-size: 1.1rem;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
}
