/* ==========================================================================
   558H — shared stylesheet (pure CSS, no JS)
   ========================================================================== */

:root {
  --bg: #0e0a0c;
  --bg-alt: #170f13;
  --paper: #fbf4e7;
  --paper-text: #2a1c15;
  --paper-muted: #6b5748;
  --paper-border: #e5d3b3;
  --text-invert: #f5ebda;
  --muted-invert: #cbb69c;
  --gold: #e8b23d;
  --gold-light: #ffe9a8;
  --gold-dark: #a86a12;
  --red: #c81e34;
  --red-dark: #7a0f1f;
  --red-light: #ff5a6b;
  --max: 1180px;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-invert);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65em 1.4em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-solid {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 45%, var(--gold-dark));
  color: #2a1400;
  box-shadow: 0 8px 20px rgba(232, 178, 61, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--gold-light);
  border-color: rgba(232, 178, 61, 0.55);
}

.btn-ghost:hover { background: rgba(232, 178, 61, 0.12); }

.btn-red {
  background: linear-gradient(135deg, var(--red-light), var(--red) 55%, var(--red-dark));
  color: #fff2ea;
  box-shadow: 0 8px 20px rgba(200, 30, 52, 0.35);
}

.btn-sm { font-size: 0.85rem; padding: 0.5em 1.1em; }

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 10, 12, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(232, 178, 61, 0.18);
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.site-header__row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo img { height: 34px; width: auto; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  flex-shrink: 0;
}

.burger span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-nav { flex: 1; min-width: 0; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted-invert);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.mobile-nav {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  border-top: 1px solid rgba(232, 178, 61, 0);
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 6px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: var(--max);
  margin: 0 auto;
}

.mobile-nav a {
  display: block;
  padding: 10px 4px;
  font-weight: 600;
  color: var(--muted-invert);
  border-bottom: 1px solid rgba(232, 178, 61, 0.12);
}

.mobile-nav a[aria-current="page"] { color: var(--gold-light); }

.nav-toggle:checked ~ .mobile-nav {
  max-height: 400px;
  opacity: 1;
  border-top-color: rgba(232, 178, 61, 0.18);
}

.nav-toggle:checked ~ .site-header__row .burger span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle:checked ~ .site-header__row .burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .site-header__row .burger span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .burger { display: flex; }
  .header-actions .btn { padding: 0.55em 1.05em; font-size: 0.88rem; }
}

@media (max-width: 400px) {
  .logo img { height: 28px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 0.5em 0.8em; font-size: 0.8rem; }
}

/* -------------------------------------------------------------------------
   Breadcrumbs
   ------------------------------------------------------------------------- */

.breadcrumbs {
  background: var(--bg-alt);
  border-bottom: 1px solid rgba(232, 178, 61, 0.1);
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 10px 20px;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted-invert);
}

.breadcrumbs li { display: flex; align-items: center; gap: 6px; }

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: rgba(232, 178, 61, 0.4);
}

.breadcrumbs a { color: var(--muted-invert); }
.breadcrumbs a:hover { color: var(--gold-light); }
.breadcrumbs li[aria-current="page"] { color: var(--gold-light); }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  position: relative;
  background: url("/assets/img/hero-banner.svg") center right / cover no-repeat, var(--bg);
  min-height: clamp(320px, 46vw, 560px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 3, 5, 0.85) 0%, rgba(8, 3, 5, 0.55) 45%, rgba(8, 3, 5, 0) 75%);
}

.hero__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 20px;
  min-height: inherit;
  max-height: inherit;
  display: flex;
  align-items: center;
}

.hero__content {
  max-width: 560px;
  width: 100%;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(232, 178, 61, 0.12);
  border: 1px solid rgba(232, 178, 61, 0.4);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

.hero__title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.hero__content p {
  color: var(--muted-invert);
  font-size: clamp(0.92rem, 1.6vw, 1.05rem);
  margin: 0 0 26px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 640px) {
  .hero { min-height: clamp(340px, 92vw, 520px); }
  .hero__inner { padding: 40px 20px; }
  .hero__content { max-width: 100%; }
}

/* -------------------------------------------------------------------------
   Page content card
   ------------------------------------------------------------------------- */

main { display: block; }

.page-content {
  background: var(--paper);
  color: var(--paper-text);
  max-width: var(--max);
  margin: -34px auto 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 40px clamp(20px, 5vw, 56px) 10px;
  position: relative;
}

@media (max-width: 640px) {
  .page-content { margin-top: -20px; padding: 26px 18px 6px; }
}

.article-header h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  color: var(--red-dark);
  margin: 0 0 6px;
}

.updated-date {
  font-size: 0.82rem;
  color: var(--paper-muted);
  margin: 0 0 18px;
}

.article-header p {
  margin: 0 0 16px;
  max-width: 78ch;
}

.article-header .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 8px;
}

/* -------------------------------------------------------------------------
   TOC accordion
   ------------------------------------------------------------------------- */

.toc {
  background: #fff;
  border: 1px solid var(--paper-border);
  border-radius: 12px;
  margin: 28px 0 34px;
  overflow: hidden;
}

.toc summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 800;
  color: var(--red-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #fffaf0, #fbf1dc);
}

.toc summary::-webkit-details-marker { display: none; }

.toc summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-dark);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.toc[open] summary::after { transform: rotate(45deg); }

.toc summary h2 { margin: 0; font-size: 1rem; }

.toc nav { padding: 6px 20px 20px; }

.toc ul {
  columns: 2;
  column-gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dashed var(--paper-border); }

.toc a {
  font-size: 0.9rem;
  color: var(--paper-text);
}

.toc a:hover { color: var(--red); }

@media (max-width: 640px) {
  .toc ul { columns: 1; }
}

/* -------------------------------------------------------------------------
   Article content
   ------------------------------------------------------------------------- */

.article-body section {
  padding: 26px 0;
  border-top: 1px solid var(--paper-border);
}

.article-body section:first-child { border-top: none; }

.article-body h2 {
  font-size: 1.4rem;
  color: var(--red-dark);
  margin: 0 0 14px;
  scroll-margin-top: 90px;
}

.article-body h3 {
  font-size: 1.08rem;
  color: #4a2e13;
  margin: 22px 0 8px;
  scroll-margin-top: 90px;
}

.article-body p { margin: 0 0 14px; max-width: 78ch; }

.article-body ul,
.article-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  max-width: 74ch;
}

.article-body li { margin-bottom: 6px; }

.article-body a:not(.btn) {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: rgba(200, 30, 52, 0.35);
  text-underline-offset: 3px;
}

.article-body a:not(.btn):hover { color: var(--red-dark); }

.article-body > a.btn {
  margin: 6px 8px 6px 0;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid rgba(232, 178, 61, 0.14);
  margin-top: 40px;
  padding: 36px 0 28px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img { height: 30px; }

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  color: var(--muted-invert);
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-nav a:hover { color: var(--gold-light); }

.footer-disclaimer {
  font-size: 0.8rem;
  color: rgba(203, 182, 156, 0.75);
  border-top: 1px solid rgba(232, 178, 61, 0.12);
  padding-top: 18px;
  max-width: 90ch;
}

.footer-disclaimer strong { color: var(--gold-light); }
