/* user-guide/style.css — shared stylesheet for all user-guide pages.
   Unified with welcome_page.php: dark GitHub-graphite palette, brass-gold
   accent, system-font stack (NO Google Fonts). Tokens are the source of
   truth from the welcome-page audit. Print rules at the bottom keep the
   chromium --print-to-pdf export legible on white paper. */

:root {
  --bg:          #0d1117;
  --bg2:         #161b22;
  --bg3:         #1c2230;
  --surface:     #21262d;
  --border:      #30363d;
  --gold:        #c9a84c;
  --gold-light:  #e0c068;
  --gold-dim:    #7a6020;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --green:       #3fb950;
  --radius:      12px;
  --radius-sm:   8px;
  --content-w:   1140px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle radial wash echoing welcome's hero ambience */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201,168,76,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 20% 110%, rgba(201,168,76,0.04) 0%, transparent 60%);
}

/* ── Layout ─────────────────────────────────────────────────── */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar a { color: var(--muted); text-decoration: none; transition: color 0.18s; }
.topbar a:hover { color: var(--gold-light); }
.topbar .crumb-sep { color: var(--gold-dim); }
.topbar .spacer { flex: 1; }
.topbar a:last-of-type {
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-weight: 600;
}
.topbar a:last-of-type:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── Headings ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.subtitle code { font-size: 0.92em; }

/* Section eyebrow style — appears via h2 by default */
h2 {
  font-size: 1.5rem;
  margin: 56px 0 18px;
  color: var(--text);
  letter-spacing: -0.005em;
  padding-bottom: 14px;
  position: relative;
}
h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}

h3 {
  font-size: 1.15rem;
  margin: 32px 0 12px;
  color: var(--gold-light);
  letter-spacing: 0.005em;
}
h4 {
  font-size: 0.78rem;
  margin: 18px 0 8px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ── Body text ──────────────────────────────────────────────── */
p { margin: 0 0 16px; color: var(--text); }
ol, ul { margin: 0 0 18px 26px; }
li { margin-bottom: 8px; color: var(--text); }
li::marker { color: var(--gold); }
strong { color: var(--gold-light); font-weight: 700; }
em { font-style: italic; color: var(--text); }

code, kbd {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.88em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--gold-light);
  white-space: nowrap;
}

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  transition: color 0.18s, border-color 0.18s;
}
a:hover {
  color: var(--gold-light);
  border-color: var(--gold);
}

/* ── Boxed callouts (cards) ─────────────────────────────────── */
.callout {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}
.callout.tip  { border-left-color: var(--green); }
.callout.warn { border-left-color: #d04a3b; }
.callout.note { border-left-color: var(--gold); }

.callout-title {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.callout.tip  .callout-title { color: var(--green); }
.callout.warn .callout-title { color: #ff7a6a; }
.callout p:last-child { margin-bottom: 0; }

/* ── Step lists (numbered with circles) ─────────────────────── */
ol.steps {
  counter-reset: step;
  list-style: none;
  margin-left: 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 14px 0 18px 60px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
ol.steps > li:last-child { border-bottom: none; }
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.12);
  border: 1.5px solid var(--gold-dim);
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps > li h4 {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--gold-light);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.02rem;
  font-weight: 600;
}
ol.steps > li > :last-child { margin-bottom: 0; }

/* ── Tables ─────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
th {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--bg3);
  border-bottom: 1px solid var(--gold-dim);
}
tbody tr:hover td { background: rgba(201,168,76,0.03); }

/* ── Q&A blocks (FAQ) ───────────────────────────────────────── */
details.qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 10px;
  transition: border-color 0.18s;
}
details.qa[open] { border-color: var(--gold-dim); }
details.qa summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before {
  content: '+';
  color: var(--gold);
  margin-right: 12px;
  display: inline-block;
  width: 16px;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}
details.qa[open] summary::before { content: '−'; }
details.qa[open] summary { color: var(--gold-light); }
details.qa .qa-body {
  margin-top: 14px;
  padding-left: 28px;
  color: var(--muted);
}
details.qa .qa-body p { color: var(--muted); }
details.qa .qa-body strong { color: var(--gold-light); }

/* ── TOC sidebar / index grid ───────────────────────────────── */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 36px 0 12px;
}
.toc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.toc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.15);
  border-color: var(--gold-dim);
}
.toc-card .num {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
}
.toc-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}
.toc-card h3 a {
  color: var(--text);
  border-bottom: none;
}
.toc-card h3 a:hover { color: var(--gold-light); }
.toc-card:hover h3,
.toc-card:hover h3 a { color: var(--gold-light); }
.toc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}
.toc-card .meta {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Page footer ────────────────────────────────────────────── */
.page-footer {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.page-footer .nav-arrows {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.page-footer a {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  border-bottom: none;
}
.page-footer a:hover { color: var(--gold-light); }

/* Optional primary button — matches welcome's hero CTA */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold) 0%, #b8862a 100%);
  color: #1a1000;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 24px rgba(201,168,76,0.25);
  border: none;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #1a1000;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(201,168,76,0.35);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .wrap { padding: 32px 18px 64px; }
  .topbar { padding: 12px 18px; font-size: 0.7rem; gap: 8px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; margin-top: 44px; }
  ol.steps > li { padding-left: 52px; }
  ol.steps > li::before { width: 36px; height: 36px; font-size: 0.9rem; }
  table { font-size: 0.88rem; }
  th, td { padding: 10px 12px; }
}

/* ── Print rules (PDF export via chromium --print-to-pdf) ───── */
@media print {
  :root { --content-w: 100%; }
  body  {
    background: #fff;
    color: #1a1a1a;
    font-size: 11.5pt;
  }
  body::before { display: none; }
  .topbar, .page-footer .nav-arrows { display: none; }
  .wrap { padding: 0; max-width: 100%; }
  a { color: inherit; text-decoration: none; border-bottom: none; }
  h1, h2, h3, h4 { color: #1a1a1a; }
  h2 { font-size: 14pt; page-break-before: auto; page-break-after: avoid; }
  h2::after { background: #a8843b; }
  h3 { color: #a8843b; page-break-after: avoid; }
  h4 { color: #a8843b; }
  strong { color: #1a1a1a; }
  code, kbd {
    background: #f3eedf;
    border: 1px solid #d8cba0;
    color: #5a4615;
  }
  .callout {
    background: #faf6e8;
    border: 1px solid #d8cba0;
    border-left: 3px solid #a8843b;
    color: #1a1a1a;
  }
  .callout-title { color: #a8843b; }
  ol.steps > li::before {
    background: #faf6e8;
    border-color: #a8843b;
    color: #a8843b;
  }
  ol.steps > li h4 { color: #a8843b; }
  table {
    background: #fff;
    border: 1px solid #d8cba0;
  }
  th {
    background: #faf6e8;
    color: #a8843b;
    border-bottom: 1px solid #a8843b;
  }
  th, td { border-bottom: 1px solid #d8cba0; }
  details.qa {
    background: #fff;
    border: 1px solid #d8cba0;
    color: #1a1a1a;
  }
  details.qa summary { color: #1a1a1a; }
  details.qa .qa-body, details.qa .qa-body p { color: #444; }
  .toc-card {
    background: #fff;
    border: 1px solid #d8cba0;
    box-shadow: none;
    color: #1a1a1a;
    break-inside: avoid;
  }
  .toc-card h3, .toc-card h3 a { color: #1a1a1a; }
  ol, ul { page-break-inside: avoid; }
  .callout, ol.steps > li, table { page-break-inside: avoid; }
}

/* Page-break helpers for multi-section guides */
.page-break { page-break-before: always; }

/* ── Screenshots (added 2026-09-03; same rules the display guide carries inline) ── */
figure.shot { margin: 28px 0; text-align: center; }
figure.shot img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.45);
}
figure.shot.portrait img { max-height: 620px; width: auto; }
figure.shot.tall img { max-height: 540px; width: auto; }
figure.shot.narrow img { max-width: 520px; }
figure.shot figcaption {
  margin-top: 11px;
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.shot-row {
  display: flex; gap: 24px; flex-wrap: wrap;
  justify-content: center; align-items: flex-start; margin: 28px 0;
}
.shot-row figure.shot { margin: 0; flex: 1 1 260px; }
@media print {
  figure.shot img { box-shadow: none; border: 1px solid #d8cba0; }
  figure.shot { break-inside: avoid; }
  figure.shot.portrait img { max-height: 340px; }
  figure.shot.tall img { max-height: 300px; }
  figure.shot img { max-height: 620px; }
  .shot-row { gap: 14px; }
  figure.shot figcaption { color: #555; }
}
