/* =============================================
   Roulette Regeln — Global CSS
   Palette: slate (#1C2B3A primary, #AD6F3B copper, #F7F3EE cream)
   Fonts: Playfair Display (heading) + Karla (body) — self-hosted via @fontsource
   Archetype: Reference-Handbook (sticky sidebar TOC + numbered chapters)
   ============================================= */

/* ---- Tokens ---- */
:root {
  --wine:     #1C2B3A;
  --wine-dk:  #111C27;
  --wine-lt:  #2E4860;
  --gold:     #AD6F3B;
  --gold-lt:  #C98A55;
  --cream:    #F7F3EE;
  --cream-dk: #EDE7DD;
  --ink:      #0D1B26;
  --muted:    #556575;
  --border:   #C9BDB0;

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Karla', system-ui, sans-serif;

  --radius:   2px;
  --max-w:    1200px;
  --sidebar-w: 240px;
  --gap:      2rem;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image: radial-gradient(circle, rgba(173, 111, 59, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--wine); text-decoration: underline; text-decoration-color: var(--gold); }
a:hover { color: var(--wine-lt); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: var(--wine-dk);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 {
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  font-weight: 600;
  margin-top: 2.5rem;
  padding-top: 0;
  padding-left: 1rem;
  position: relative;
  border-top: none;
}
h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.1em;
  width: 3px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-lt) 100%);
  border-radius: 2px;
}
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.5rem; }
p  { margin-top: 1rem; max-width: 72ch; }
ul, ol { margin-top: 1rem; padding-left: 1.5rem; }
li { margin-top: 0.4rem; }
strong { font-weight: 600; color: var(--wine-dk); }
.site-logo strong { color: var(--gold-lt); }
.site-logo:hover { color: var(--cream); text-decoration: none; }

/* ---- Layout ---- */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.site-header {
  background: linear-gradient(135deg, #090f18 0%, var(--wine) 60%, #1e324a 100%);
  color: var(--cream);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 24px rgba(9, 15, 24, 0.45);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream);
}
.site-logo .logo-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201, 138, 85, 0.7)) drop-shadow(0 0 2px rgba(201, 138, 85, 0.5));
}
.site-logo .logo-text { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; text-shadow: 0 1px 12px rgba(0,0,0,0.4); }
.site-logo .logo-sub { font-size: 0.72rem; color: var(--gold-lt); display: block; margin-top: -3px; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  background: rgba(201, 138, 85, 0.22);
  color: var(--gold-lt);
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* ---- Main two-column (handbook) ---- */
.page-main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

/* Sidebar TOC */
.toc-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
}
.toc-sidebar nav {
  background: var(--cream-dk);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.toc-label {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.toc-sidebar ol { padding-left: 1.1rem; margin-top: 0; }
.toc-sidebar li { margin-top: 0.3rem; }
.toc-sidebar a {
  font-size: 0.85rem;
  color: var(--wine);
  text-decoration: none;
  display: block;
  padding: 0.1rem 0;
}
.toc-sidebar a:hover { color: var(--wine-lt); text-decoration: underline; text-decoration-color: var(--gold); }
.toc-sidebar .toc-active { color: var(--gold); font-weight: 600; }

/* Article content */
.article-content { flex: 1; min-width: 0; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--wine); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* Page hero */
.page-hero {
  margin-bottom: 2rem;
}
.page-hero .chapter-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #fff;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-lt) 100%);
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 12px rgba(173, 111, 59, 0.4);
}
.page-hero h1 { margin-bottom: 0.6rem; }
.page-hero .lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 65ch;
}

/* Thumbnail image — natural proportions, no cropping */
.thumb-wrap {
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  border-radius: 8px;
  box-shadow:
    0 2px 6px  rgba(13, 27, 38, 0.07),
    0 8px 20px rgba(13, 27, 38, 0.11);
}
.thumb-wrap picture, .thumb-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Info boxes */
.info-box {
  background: var(--cream-dk);
  border-left: 4px solid var(--gold);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.info-box p { margin-top: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  background: var(--wine);
  color: var(--cream);
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-family: var(--font-head);
  font-weight: 600;
}
td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--cream-dk); }
tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-section { margin-top: 3rem; }
.faq-section h2 { border-top: none; padding-top: 0; }
.faq-list { margin-top: 1rem; }
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.6rem;
  background: var(--cream);
}
summary {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.8rem 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--wine-dk);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--gold);
  font-family: var(--font-body);
}
details[open] summary::after { content: '−'; }
.faq-answer { padding: 0.8rem 1rem 1rem; border-top: 1px solid var(--border); }
.faq-answer p { margin-top: 0; }

/* Hub card grid */
.hub-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}
.hub-card {
  flex: 1 1 220px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.hub-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(173, 111, 59, 0.15), 0 2px 6px rgba(13,27,38,0.08);
  color: var(--ink);
  transform: translateY(-2px);
}
.hub-card .card-icon { font-size: 1.6rem; }
.hub-card .card-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; color: var(--wine-dk); }
.hub-card .card-desc { font-size: 0.85rem; color: var(--muted); }

/* SVG infographic wrapper */
.infographic {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  padding: 1rem;
}
.infographic figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ---- Footer ---- */
.site-footer {
  background: linear-gradient(135deg, #090f18 0%, var(--wine-dk) 100%);
  color: var(--cream);
  padding: 1.5rem;
  margin-top: auto;
  border-top: 2px solid var(--gold);
  box-shadow: 0 -4px 24px rgba(9, 15, 24, 0.3);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal a { color: var(--gold-lt); text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }
.footer-note { color: rgba(250,246,239,0.55); }

/* 18+ badge */
.badge-18 {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold-lt);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius);
  vertical-align: middle;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .page-main { flex-direction: column; }
  .toc-sidebar { width: 100%; position: static; }
  .hub-grid { flex-direction: column; }
}
