/*
Theme Name: grand_line
Description: description
Version: 1.0.1
*/

.multilevel-menu {
  max-width: 100%!important;
}

/* ============================================================
   1. CSS VARIABLES & RESET
   ============================================================ */
:root {
  /* Palette — Swiss editorial light theme */
  --accent: #DA291C;
  --accent-hover: #B22217;
  --bg: #FAFAF7;
  --bg-header: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-muted: #F0EEE8;
  --text: #1A1A1A;
  --text-body: #2A2A2A;
  --text-muted: #6B6B68;
  --border: #E5E2DB;
  --border-strong: #1A1A1A;
  --success: #2C6E49;
  --danger: #B22217;

  /* Typography */
  --font-heading: "Poppins", system-ui, sans-serif;
  --font-body: "Lora", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* Layout */
  --content-width: 720px;
  --wide-width: 1100px;
  --section-gap: clamp(3rem, 6vw, 5.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================================
   2. GLOBAL TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  margin-bottom: 1rem;
  scroll-margin-top: 2rem;
}

h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 2rem;
}

h4 {
  font-size: 20px;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  text-align: center;
  margin-bottom: 1.2em;
  max-width: var(--content-width);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

ul, ol {
  text-align: center;
  margin-bottom: 1.2em;
  padding-left: 1.5em;
  max-width: var(--content-width);
}
li { margin-bottom: 0.5em; }

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

blockquote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 22px;
  border-left: 4px solid var(--accent);
  padding-left: 24px;
  margin: 1.5em 0;
  color: var(--text-body);
  max-width: var(--content-width);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Tables — editorial mono-style */
table {
  width: 100%;
  max-width: var(--content-width);
  border-collapse: collapse;
  margin: 1.5em auto;
  font-family: var(--font-mono);
  font-size: 14px;
}
thead th {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-strong);
  color: var(--text);
  background: transparent;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: center;
}
tbody tr:nth-child(even) { background: var(--bg-muted); }

figure {
  margin: 1.5em auto;
  max-width: 100%;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
}
figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

img { max-width: 100%; height: auto; }

::selection { background: var(--accent); color: #fff; }

/* ============================================================
   3. LAYOUT — sections
   ============================================================ */
main {
  width: 100%;
  display: block;
}

article { display: block; }

[data-content] {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  margin-top: var(--section-gap);
  margin-bottom: 0;
}

[data-content] > h2:first-child {
  position: relative;
  padding-top: 1.25rem;
}
[data-content] > h2:first-child::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--border-strong);
  position: absolute;
  top: 0;
  left: 0;
}

/* Wider section for tables that need it */
[data-content="gruppen-uebersicht"] table,
[data-content="stadien-strip"] table,
[data-content="timeline"] table,
[data-content="wm-fakten"] table,
[data-content="nati-hub"] table {
  max-width: 100%;
}

/* ============================================================
   4. COMPONENTS
   ============================================================ */

/* info-box */
.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 22px 24px;
  margin: 1.75em 0;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.04);
  max-width: var(--content-width);
}
.info-box p {
  margin-bottom: 0.8em;
  max-width: none;
}
.info-box p:last-child { margin-bottom: 0; }
.info-box strong:first-child {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: inline-block;
  margin-right: 0.4em;
}

/* callout */
.callout {
  background: var(--bg-muted);
  padding: 24px 28px;
  margin: 1.75em 0;
  position: relative;
  max-width: var(--content-width);
  font-size: 17px;
}
.callout::before {
  content: "§";
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  position: absolute;
  left: 14px;
  top: 18px;
}
.callout p {
  padding-left: 28px;
  max-width: none;
  margin-bottom: 0;
}

/* key-takeaway — large display strip */
.key-takeaway {
  border-top: 4px solid var(--accent);
  padding-top: 1.25rem;
  margin: 2em 0;
  max-width: var(--content-width);
}
.key-takeaway::before {
  content: "DAS WICHTIGSTE IN KÜRZE";
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.key-takeaway p {
  font-family: var(--font-heading);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  max-width: none;
  margin-bottom: 0;
  text-align: center;
}

/* fun-fact — marginal note */
.fun-fact {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.75rem;
  margin: 1.75em 0;
  max-width: var(--content-width);
}
.fun-fact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 1.25rem;
  height: 2px;
  background: var(--accent);
}
.fun-fact p {
  font-style: italic;
  color: var(--text-body);
  margin-bottom: 0;
  max-width: none;
  text-align: center;
}
.fun-fact strong:first-child {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  display: inline-block;
  margin-right: 0.5em;
  font-weight: 700;
}

/* glossary-term — inline definition row */
.glossary-term {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 1rem 0;
  margin: 1.5em 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: var(--content-width);
}
.glossary-term p {
  margin: 0;
  max-width: none;
  text-align: center;
}
.glossary-term strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: none;
  white-space: nowrap;
  margin-right: 0.5em;
}

/* tldr block */
.tldr {
  background: var(--bg-muted);
  border-left: 4px solid var(--border-strong);
  padding: 1.75rem 2rem;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--section-gap);
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.04);
}
.tldr h2 {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 1rem;
  padding-top: 0;
  scroll-margin-top: 2rem;
}
.tldr h2::before { display: none; }
.tldr ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
  max-width: none;
}
.tldr li {
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 0.6em;
}
.tldr li:last-child { margin-bottom: 0; }

/* author-bio */
.author-bio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 2rem;
}

/* FAQ — details accordion */
[data-content="faq"] > div {
  max-width: var(--content-width);
}
details {
  border-bottom: 1px solid var(--border);
  background: transparent;
}
details:first-of-type { border-top: 1px solid var(--border); }
summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  position: relative;
  user-select: none;
  transition: color 0.2s ease;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.3s ease;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
summary:hover { color: var(--accent); }

details > div {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 0 0 0;
}
details[open] > div {
  max-height: 800px;
  opacity: 1;
  padding: 0 0 1.25rem 0;
}
details > div p {
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 0;
  color: var(--text-body);
}

/* ============================================================
   5. HEADER
   ============================================================ */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  position: relative;
}
.header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.custom-logo {
  display: block;
  width: 200px;
  height: auto;
  max-width: 100%;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.header-trust {
  color: var(--accent);
  font-weight: 700;
}
.header-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.7em;
  border: 1px solid var(--border);
  background: var(--bg);
}
.header-date-badge time { color: var(--text); }

/* ============================================================
   6. HERO
   ============================================================ */
[data-content="hero"] {
  max-width: 100%;
  width: 100%;
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  padding: clamp(3rem, 7vw, 6rem) 1.5rem clamp(2.5rem, 5vw, 4.5rem);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
}
[data-content="hero"] > * {
  position: relative;
  z-index: 1;
  max-width: var(--wide-width);
  margin-left: auto;
  margin-right: auto;
}
[data-content="hero"]::before { display: none; }

[data-content="hero"] .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: none;
  text-align: center;
}

[data-content="hero"] h1 {
  max-width: 16ch;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text);
}

[data-content="hero"] h1::after {
  content: "";
  display: block;
  width: 120px;
  height: 4px;
  background: var(--border-strong);
  margin-top: 1.75rem;
}

[data-content="hero"] .lead {
  font-family: var(--font-body);
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.55;
  color: var(--text-body);
  max-width: 70ch;
  margin-bottom: 1.25em;
  text-align: center;
}

[data-content="hero"] p {
  text-align: center;
  max-width: 70ch;
}

[data-content="hero"] .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 2rem;
  margin-bottom: 0;
  max-width: none;
  text-align: center;
}

.start-reading {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  border: 2px solid var(--accent);
  transition: background 0.2s ease, color 0.2s ease;
}
.start-reading:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* ============================================================
   7. TOC — horizontal variant (selected by randomizer)
   ============================================================ */
.toc {
  max-width: var(--content-width);
  margin: var(--section-gap) auto;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.04);
}
.toc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.9rem;
  display: block;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  max-width: none;
}
.toc-list > li {
  margin: 0;
  padding: 0;
}
.toc-list > li > a {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg);
  display: inline-block;
  transition: all 0.2s ease;
}
.toc-list > li > a:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.toc-list ul { display: none; }

/* ============================================================
   8. BACK TO TOP
   ============================================================ */
.back-to-top-wrap {
  max-width: var(--content-width);
  margin: var(--section-gap) auto 0;
  padding: 0 1.5rem;
  text-align: center;
}
.back-to-top {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: transparent;
  transition: all 0.2s ease;
}
.back-to-top:hover {
  background: var(--text);
  color: var(--bg);
}

/* ============================================================
   9. FOOTER
   ============================================================ */
.site-footer {
  background: #1A1A1A;
  color: #B8B8B5;
  padding: 3.5rem 1.5rem 1.5rem;
  margin-top: var(--section-gap);
  font-size: 13px;
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}
.footer-col h3 {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  margin: 0 0 1rem 0;
  padding: 0;
  border-bottom: 1px solid #333;
  padding-bottom: 0.6rem;
  scroll-margin-top: 0;
}
.footer-col p {
  font-size: 12px;
  line-height: 1.55;
  color: #B8B8B5;
  margin-bottom: 0.7em;
  max-width: none;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
}
.footer-col li {
  margin-bottom: 0.5em;
  font-size: 12px;
}
.footer-col a {
  color: #B8B8B5;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-col strong { color: #FFFFFF; }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   10. WEITERLESEN — last section styling
   ============================================================ */
[data-content="weiterlesen"] {
  border-top: 1px solid var(--border);
  padding-top: var(--section-gap);
  margin-top: var(--section-gap);
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 17px; }

  [data-content] {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  [data-content="hero"] {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  [data-content="hero"] h1 { max-width: 100%; }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .custom-logo { width: 170px; }
  .header-meta { font-size: 10px; gap: 0.75rem; }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .glossary-term {
    flex-direction: column;
    gap: 6px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .toc-list { gap: 0.4rem; }
  .toc-list > li > a { font-size: 12px; padding: 0.4rem 0.7rem; }
}

@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  blockquote { font-size: 19px; padding-left: 18px; }
}

/* Print + reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}


/* ============================================================
   QUOTENKREIS 26 — Image styles
   ============================================================ */

.hero-img {
  display: block;
  width: 100%;
  max-width: calc(var(--content-width) + 15em);
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  margin: 0 auto 2rem;
  border-top: 4px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}

.section-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  margin: 1.25rem 0 2rem 0;
  border: 1px solid var(--border);
  background: var(--bg-muted);
}

@media (max-width: 720px) {
  .hero-img,
  .section-img {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
    max-width: none;
  }
}
