/* MacherPost Design System — Swiss Editorial
 * Colors: Swiss Red accent on warm paper
 * Typography: DM Serif Display / Spectral / Space Grotesk / JetBrains Mono
 */

:root {
  /* Colors */
  --ink: #0a0a0a;
  --ink-2: #1a1a1a;
  --ink-soft: #2a2a2a;
  --muted: #6b6b66;
  --muted-2: #9a9a93;
  --paper: #faf8f2;
  --paper-2: #f3efe4;
  --paper-3: #ede8d9;
  --rule: #1a1a1a;
  --rule-soft: rgba(10, 10, 10, 0.14);
  --accent: #c8102e;
  --accent-ink: #8a0a20;

  /* Typography */
  --f-display: "DM Serif Display", "Playfair Display", Georgia, serif;
  --f-serif: "Spectral", Georgia, "Times New Roman", serif;
  --f-sans: "Space Grotesk", -apple-system, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing */
  --pad-x: 40px;
  --row-gap: 48px;

  /* Spacing Scale (DESIGN.md, eingef. 2026-04-25) */
  --s-1: 4px;   /* Hairline */
  --s-2: 8px;   /* Inline-Gap */
  --s-3: 12px;  /* UI-Gap */
  --s-4: 16px;  /* Card-Pad */
  --s-5: 24px;  /* Block-Pad */
  --s-6: 32px;  /* Sek-Gap */
  --s-7: 48px;  /* Sek-Pad */
  --s-8: 64px;  /* Hero-Pad */
  --s-9: 80px;  /* Marketing-Block */

  /* Type Scale (DESIGN.md, eingef. 2026-04-25) */
  --t-xxs:  9px;   /* Hairline-Caption */
  --t-xs:  11px;   /* Eyebrow, Meta */
  --t-sm:  13px;   /* Footer-Body, Caption */
  --t-base: 17px;  /* Body-Text */
  --t-lg:  22px;   /* Lead, Dek */
  --t-xl:  32px;   /* H3 / Sek-Header */
  --t-2xl: 48px;   /* H2 / Hero-Sub */
  --t-3xl: 72px;   /* H1 / Hero */

  /* Footer-Alphas (DESIGN.md, eingef. 2026-04-25)
   * NIE rgba(255,255,255,X) im Footer verwenden -- immer diese Tokens.
   * Pures Weiss kollidiert mit dem Cream-Brand. */
  --paper-90: rgba(250, 248, 242, 0.90);
  --paper-65: rgba(250, 248, 242, 0.65);
  --paper-45: rgba(250, 248, 242, 0.45);
  --paper-30: rgba(250, 248, 242, 0.30);
  --paper-15: rgba(250, 248, 242, 0.15);

  /* Legacy aliases (backward compat mit altem Code) */
  --c-ink: var(--ink);
  --c-muted: var(--muted);
  --c-accent: var(--accent);
  --c-dark: var(--ink);
  --c-bg: var(--paper);
  --c-border: var(--rule-soft);
  --c-green: #16A34A;
  --max-w: 1440px;
}

[data-density="compact"] { --row-gap: 28px; }
[data-density="spacious"] { --row-gap: 72px; }

/* === Reset === */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; }

/* === Typography === */
.eyebrow {
  font-family: var(--f-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}
.eyebrow-ink { color: var(--ink); }
.eyebrow-muted { color: var(--muted); }

.label {
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
}
h1 { font-size: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: clamp(22px, 2.5vw, 28px); }
h4 { font-size: 20px; line-height: 1.2; }

p { margin: 0 0 1em 0; }

/* === Rules === */
.rule { height: 1px; background: var(--ink); }
.rule-soft { height: 1px; background: var(--rule-soft); }
.rule-thick { height: 3px; background: var(--ink); }
.rule-double {
  height: 5px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: transparent;
}

/* === Layout === */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
@media (max-width: 768px) {
  :root { --pad-x: 20px; }
  h1 { font-size: clamp(32px, 10vw, 56px); }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: all 0.15s ease;
  cursor: pointer;
  border-radius: 0;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-lg { padding: 16px 24px; font-size: 14px; }

/* === Image placeholders === */
.img-ph {
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.img-ph img { width: 100%; height: 100%; object-fit: cover; }

/* === Article hover === */
.article-link { cursor: pointer; transition: opacity 0.15s ease; display: block; }
.article-link:hover h2,
.article-link:hover h3,
.article-link:hover h4 { color: var(--accent); }
.article-link h2,
.article-link h3,
.article-link h4 { transition: color 0.15s ease; }

/* === Utilities === */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.gap-56 { gap: 56px; }

.grid { display: grid; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.tabular { font-variant-numeric: tabular-nums; }

.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-paper { color: var(--paper); }
.bg-paper { background: var(--paper); }
.bg-paper-2 { background: var(--paper-2); }
.bg-paper-3 { background: var(--paper-3); }
.bg-ink { background: var(--ink); color: var(--paper); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.max-w-600 { max-width: 600px; }
.max-w-800 { max-width: 800px; }
.max-w-900 { max-width: 900px; }

/* === Paywall fade === */
.paywall-fade {
  position: relative;
}
.paywall-fade::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 240px;
  background: linear-gradient(to bottom, rgba(250, 248, 242, 0), var(--paper) 85%);
  pointer-events: none;
}

/* === Drop cap === */
.dropcap::first-letter {
  font-family: var(--f-display);
  font-size: 5.2em;
  line-height: 0.85;
  float: left;
  margin: 0.05em 0.08em -0.05em 0;
  color: var(--ink);
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink-2); }

/* === Kicker chip (Ressort + Kicker + Premium) === */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 10px;
}
.kicker .k-ressort { color: var(--accent); }
.kicker .k-sep { color: var(--muted-2); }
.kicker .k-type { color: var(--ink); }
.kicker .k-premium {
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 1px 4px;
  font-size: 9px;
}

/* === Article meta (Autor · Min · Audio) === */
.art-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 12px;
}

/* === Responsive Grid Helpers === */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   MOBILE OPTIMIERUNGEN (eingef. 2026-04-25)
   Many users on phones — reduce font-sizes, fix overflow,
   make tap-targets thumb-friendly.
   ============================================================ */

/* H2-Skala responsiv: 56px Desktop -> 32px Phone */
@media (max-width: 768px) {
  h2, .section-header h2 { font-size: clamp(28px, 7vw, 40px) !important; line-height: 1.05 !important; }
  /* Hardcoded 56px in inline-styles ueberschreiben */
  [style*="font-size: 56px"] { font-size: clamp(28px, 7vw, 40px) !important; }
  [style*="font-size: 48px"] { font-size: clamp(26px, 6.5vw, 36px) !important; }
}

/* Top-Bar: lange Probeabo-CTA verkuerzen auf Handy */
@media (max-width: 720px) {
  .mp-top-bar a[href*="/abo?interval=trial"] {
    font-size: 10px !important;
    padding: 5px 8px !important;
    letter-spacing: 0.04em !important;
  }
  /* Top-Bar: Gratis-Tag-Hinweis verstecken auf Handy (Platz fuer CTA) */
  .mp-top-bar .flex.items-center.gap-24 > span:nth-child(2) { display: none; }
}

/* Footer: 4-col -> 1-col */
@media (max-width: 720px) {
  footer .container > div[style*="grid-template-columns"],
  footer .container > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* Mehr-Dropdown Touch-Targets */
@media (max-width: 768px) {
  .mp-home-more-menu a, #mp-ressort-more-menu a {
    padding: 14px 22px !important;
    font-size: 15px !important;
  }
  .mp-home-more-trigger {
    padding: 10px 4px !important;
  }
}

/* Container-Padding auf Handy enger */
@media (max-width: 600px) {
  :root { --pad-x: 16px; }
}

/* Karten-Bilder + Hero schaerfer auf kleinen Screens */
@media (max-width: 600px) {
  .hero-manifesto { padding: 24px 0 32px !important; }
  .hero-manifesto .dek { font-size: 16px !important; line-height: 1.45 !important; }
}

/* Wochen-Tabelle: scrollbar-hint */
.wochen-uebersicht::-webkit-scrollbar { height: 6px; }
.wochen-uebersicht::-webkit-scrollbar-track { background: var(--paper-2); }
.wochen-uebersicht::-webkit-scrollbar-thumb { background: var(--muted-2); border-radius: 3px; }


/* ============================================================
   MOBILE-POLISH 360-414PX (eingef. 2026-04-26)
   Fein-Tuning fuer Phone-Bildschirme.
   ============================================================ */

/* Hero-Manifest: stacking, Bild kleiner, H1 cap */
@media (max-width: 600px) {
  .hero-manifesto h1 { font-size: clamp(36px, 9vw, 48px) !important; line-height: 1.0 !important; }
  .hero-manifesto .dek { font-size: 15px !important; line-height: 1.4 !important; }
  .hero-manifesto .hero-meta { gap: 6px !important; font-size: 10px !important; }
  .hero-manifesto img,
  .hero-manifesto figure { aspect-ratio: 16/10 !important; max-height: 240px !important; object-fit: cover; }
}

/* Wochenplan: leichter zu scrollen + bessere Mobile-Breite */
@media (max-width: 600px) {
  .wochen-uebersicht { -webkit-overflow-scrolling: touch; }
  .wochen-uebersicht table { min-width: 640px !important; font-size: 11px !important; }
  .wochen-uebersicht td, .wochen-uebersicht th { padding: 12px 8px !important; }
  .wochen-uebersicht td div { font-size: 13px !important; }
}

/* Aktuell-Karten: weiterer Stack auf 360px */
@media (max-width: 480px) {
  .mp-home-grid { gap: 16px !important; }
  .mp-home-card h3 { font-size: 19px !important; line-height: 1.2 !important; }
  .mp-home-card .imgwrap { aspect-ratio: 16/10 !important; }
  .mp-home-card .meta { font-size: 11px !important; }
}

/* Newsletter-Form im Footer: vollbreit + groessere Buttons */
@media (max-width: 600px) {
  #mp-newsletter-form { flex-direction: column !important; gap: 10px !important; max-width: 100% !important; }
  #mp-newsletter-form input { width: 100% !important; padding: 12px 14px !important; font-size: 14px !important; }
  #mp-newsletter-form button { width: 100% !important; padding: 14px !important; font-size: 13px !important; }
}

/* Top-Bar: weniger packen */
@media (max-width: 480px) {
  .mp-top-bar { padding: 8px 0 !important; font-size: 10px !important; }
  .mp-top-bar .gap-24 { gap: 8px !important; }
  .mp-top-bar a { padding: 4px 6px !important; font-size: 9px !important; }
}

/* Top-Nav-Ressorts: tap-padding + scroll */
@media (max-width: 600px) {
  .mp-home-ressort-nav,
  #mp-ressort-nav { gap: 18px !important; font-size: 14px !important; }
  .mp-home-ressort-nav a, #mp-ressort-nav a { padding: 8px 0 !important; }
}

/* Team-Cards Mobile: 2 statt 4 cols */
@media (max-width: 600px) {
  .team-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
}
@media (max-width: 380px) {
  .team-grid { grid-template-columns: 1fr !important; }
}

/* Search-Input Archiv: voll breit + groessere Touch */
@media (max-width: 600px) {
  #searchInput { padding: 14px 16px !important; font-size: 14px !important; }
}
