/* =============================================================
   So funktioniert's – Permutis (web_site/so-funktionierts.html)
   Dediziertes Layout: 3-Spalten (Sidebar / Content / Explainer).
   CSS-Variablen (Farben, Radien) werden aus styles.css :root geerbt.
   Mobile-Breakpoint: <= 960px → Single-Column mit ausklappbarem TOC.
   ============================================================= */

.sowf-body {
  /* Eigene Body-Klasse, damit der Page-spezifische Look sauber von der
     Landingpage getrennt bleibt. */
  background: var(--bg);
}

/* Skip-Link (Accessibility) */
.sowf-skip-link {
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  transform: translateY(-150%);
  background: var(--green);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 200;
}
.sowf-skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--green);
}

/* =============================================================
   Hero
   ============================================================= */
.sowf-hero {
  background:
    radial-gradient(circle at 14% 18%, rgba(34, 197, 94, 0.18), transparent 38%),
    radial-gradient(circle at 90% 6%, rgba(108, 92, 231, 0.14), transparent 42%),
    linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
  padding: clamp(72px, 9vw, 130px) 0 clamp(48px, 6vw, 84px);
  text-align: center;
}
.sowf-hero-eyebrow {
  display: inline-block;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.sowf-hero h1 {
  max-width: 880px;
  margin: 0 auto 1rem;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.sowf-hero-subtitle {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.5;
}

/* =============================================================
   Mobile-Inhaltsverzeichnis (sichtbar ≤960px, versteckt >960px)
   ============================================================= */
.sowf-mobile-toc {
  display: none;
  margin: 1rem auto 0;
  max-width: var(--maxw);
  padding: 0 1.5rem;
}
.sowf-mobile-toc > summary {
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text);
}
.sowf-mobile-toc > summary::-webkit-details-marker { display: none; }
.sowf-mobile-toc-caret {
  transition: transform 0.2s ease;
  color: var(--muted);
}
.sowf-mobile-toc[open] .sowf-mobile-toc-caret { transform: rotate(180deg); }
.sowf-mobile-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem;
  margin-top: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sowf-mobile-toc-link {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
}
.sowf-mobile-toc-link:hover,
.sowf-mobile-toc-link:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}
.sowf-mobile-toc-link.is-active {
  background: rgba(34, 197, 94, 0.16);
  color: var(--text);
}

/* =============================================================
   3-Spalten-Layout (Desktop)
   ============================================================= */
.sowf-page { padding-bottom: clamp(64px, 7vw, 110px); }

.sowf-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 720px) 300px;
  gap: clamp(1.5rem, 2.4vw, 2.25rem);
  align-items: start;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

/* ----- LINKS: Sticky Sidebar ----- */
.sowf-sidebar {
  position: sticky;
  top: clamp(96px, 11vh, 128px);
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.sowf-sidebar-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem 0.4rem;
}
.sowf-toc-list { display: flex; flex-direction: column; gap: 0.15rem; }
.sowf-toc-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.sowf-toc-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sowf-toc-link.is-active {
  color: var(--text);
  background: rgba(34, 197, 94, 0.10);
  border-left-color: var(--green);
  font-weight: 700;
}
.sowf-toc-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ----- MITTE: Content-Spalte ----- */
.sowf-content {
  min-width: 0; /* verhindert Grid-Overflow bei langen Wörtern */
}
.sowf-section {
  padding: clamp(2rem, 4vw, 3.25rem) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: clamp(96px, 11vh, 128px);
}
.sowf-section:first-of-type { padding-top: 0.5rem; }
.sowf-section:last-of-type { border-bottom: 0; }

.sowf-section-intro {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
  max-width: 56ch;
}
.sowf-section-heading {
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0 0 1.25rem;
}

/* Submenü (Tabs innerhalb einer Sektion) */
.sowf-submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.sowf-submenu-link {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.sowf-submenu-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sowf-submenu-link.is-active {
  background: rgba(34, 197, 94, 0.16);
  color: var(--text);
  font-weight: 600;
}
.sowf-submenu-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Einzelne Unterthemen-Boxen */
.sowf-sub {
  scroll-margin-top: clamp(96px, 11vh, 128px);
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.sowf-sub-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--text);
}
.sowf-sub p {
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}
.sowf-sub--with-video {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 170px);
  gap: 1rem;
  align-items: center;
}
.sowf-match-video-frame {
  position: relative;
  width: 100%;
  max-width: 170px;
  justify-self: end;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0A0E1A;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}
.sowf-match-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sowf-sub p + p,
.sowf-sub p + ul,
.sowf-sub ul + p {
  margin-top: 0.75rem;
}
.sowf-sub ul {
  color: var(--muted);
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.65;
}
.sowf-sub li + li {
  margin-top: 0.35rem;
}

.sowf-note {
  background: rgba(108, 92, 231, 0.10);
  border: 1px solid rgba(108, 92, 231, 0.28);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}

/* FAQ-Items */
.sowf-faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.sowf-faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sowf-faq-item > summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.sowf-faq-item > summary::-webkit-details-marker { display: none; }
.sowf-faq-item > summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--green);
  transition: transform 0.2s ease;
  line-height: 1;
}
.sowf-faq-item[open] > summary::after { transform: rotate(45deg); }
.sowf-faq-item > summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.sowf-faq-answer {
  padding: 0 1.2rem 1.1rem;
  color: var(--muted);
  line-height: 1.65;
}

/* CTA am Ende der Content-Spalte */
.sowf-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(108, 92, 231, 0.10));
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: var(--radius-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.sowf-cta .btn { margin-right: 0.25rem; }
.sowf-cta .btn-secondary:hover,
.sowf-cta .btn-secondary:focus-visible { color: var(--text); }
.sowf-footer-note {
  width: 100%;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ----- RECHTS: Sticky Explainer-Karte ----- */
.sowf-explainer {
  position: sticky;
  top: clamp(96px, 11vh, 128px);
  align-self: start;
}
.sowf-explainer-card {
  background: linear-gradient(180deg, rgba(20, 26, 42, 0.95), rgba(28, 36, 56, 0.95));
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.25rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: var(--text-on-dark);
}
.sowf-explainer-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  margin-bottom: 0.5rem;
}
.sowf-explainer-summary {
  margin: 0 0 1rem;
  color: var(--text-on-dark);
  font-size: 0.95rem;
  line-height: 1.55;
}
.sowf-explainer-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.sowf-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sowf-badge--plan {
  background: rgba(34, 197, 94, 0.18);
  color: var(--text-on-dark);
  border: 1px solid rgba(34, 197, 94, 0.45);
}
.sowf-explainer-trade-note {
  color: var(--muted-on-dark);
  font-size: 0.8rem;
  font-style: italic;
}
.sowf-explainer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--border-on-dark);
  padding-top: 0.85rem;
}
.sowf-explainer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-on-dark);
  font-weight: 500;
  padding: 0.35rem 0;
}
.sowf-explainer-links a::before {
  content: '→';
  color: var(--accent-on-dark);
  font-weight: 700;
}
.sowf-explainer-links a:hover { color: var(--text-on-dark); }
.sowf-explainer-links a:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =============================================================
   Mobile-Breakpoint (<= 960px)
   Single-Column. Sidebar & Explainer rutschen in den Content-Bereich
   (Off-Canvas-Drawer oben für die TOC, Explainer unter der Sektion).
   ============================================================= */
@media (max-width: 960px) {
  .sowf-mobile-toc { display: block; }

  .sowf-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sowf-sidebar { display: none; }
  .sowf-explainer {
    position: static;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
  }
  .sowf-section { scroll-margin-top: 80px; }
}

@media (max-width: 640px) {
  .sowf-submenu { border-radius: var(--radius); }
  .sowf-submenu-link { font-size: 0.8125rem; padding: 0.4rem 0.75rem; }
  .sowf-explainer-card { padding: 1.1rem 1rem; }
  .sowf-section-heading { font-size: 1.5rem; }
  .sowf-sub--with-video { grid-template-columns: 1fr; }
  .sowf-match-video-frame {
    justify-self: center;
    max-width: min(220px, 72vw);
  }
}

/* Print: Mobile-TOC und Sidebar/Explainer ausblenden */
@media print {
  .sowf-mobile-toc,
  .sowf-sidebar,
  .sowf-explainer { display: none !important; }
  .sowf-layout { grid-template-columns: 1fr; }
  .sowf-section { border-bottom: 1px solid #ccc; }
}
