/* Die Weiberei — Design Tokens */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..700,0..100,0..1&display=swap');

/* Bacalisties — flourish display face for signature keywords
   (Weiber*, Dina, Franzi*). Loaded locally, used only via .bacalisties span. */
@font-face {
  font-family: 'Bacalisties';
  src: url('assets/fonts/Bacalisties.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Inline span auto-applied to signature keywords. Preserves surrounding
   color + tracking, swaps font + adjusts size so the script reads at the
   same optical weight as the host text. */
.bacalisties {
  font-family: 'Bacalisties', 'Fraunces', Georgia, serif;
  /* Bacalisties ships as a single weight — let the browser synthesize bold
     so the strokes match Fraunces' visual density next to it. */
  font-weight: 700;
  font-synthesis: weight;
  -webkit-font-synthesis: weight;
  font-style: normal;
  letter-spacing: 0;
  /* Slightly larger than surrounding face — the script reads a touch
     smaller at the same em. Kept moderate so tall descenders (long
     terminal swashes) don't crash into the next line in big headlines. */
  font-size: 1.18em;
  line-height: 0.9;
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(-0.06em);
  /* Script terminal swashes run long to the right — give following
     glyphs (typically the closing period) breathing room. */
  margin-right: 0.12em;
}

/* In big display headings the script's descenders are tall enough to
   overlap the next line — pad the host heading's line-height when a
   .bacalisties is present so the layout stays clean. */
h1:has(.bacalisties),
h2:has(.bacalisties),
.has-bacalisties {
  line-height: 1.25 !important;
}

:root {
  /* Brand */
  --heather-plum: #8B6E7E;
  --heather-hover: #6F5663;
  --heather-subtle: #EFE3E7;
  --rose-dust: #C9A6A6;
  --rose-tint: #F2E1E1;
  --sandstone: #E8D5C0;
  --sandstone-border: #C4A98F;
  --sage: #9CA88E;
  --sage-tint: #D8DFD1;
  --sage-ink: #4A5544;
  --honey: #D4A574;
  --honey-tint: #F0DCB9;
  --honey-ink: #8B6B3E;
  --canvas: #F2E4CE;       /* warm, sandy page background */
  --offwhite: #FAF6F1;     /* used inside cards / pills / surfaces */
  --ink: #2A221D;
  --ink-70: #5C4A3E;
  --ink-50: #8A7A6C;
  --terracotta: #B5684A;
  --terracotta-subtle: #F2DDD1;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(42,34,29,0.04);
  --shadow-sm: 0 2px 4px rgba(42,34,29,0.06);
  --shadow-md: 0 4px 12px rgba(42,34,29,0.08);
  --shadow-lg: 0 12px 32px rgba(42,34,29,0.12);
  --shadow-cta: 0 4px 12px rgba(139,110,126,0.25);

  /* Easing */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.eyebrow {
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heather-plum);
  display: inline-block;
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-70);
  font-weight: 400;
}

a { color: var(--heather-plum); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
  position: relative;
  z-index: 2;
}

/* Hero 60/40 split — mobile stacks copy above portrait */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
.hero-portrait-stack {
  position: relative;
  width: 100%;
  max-width: 420px;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hero-portrait-deck {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  /* Padding lets fanned cards peek out without clipping */
  padding: 0;
  perspective: 1200px;
}
.hero-portrait-card {
  position: absolute;
  inset: 0;
  border: 6px solid var(--offwhite);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #f5e6d3 0%, #e8c9b5 38%, #c89889 72%, #8d5f6d 100%);
  box-shadow: 0 24px 60px rgba(42,34,29,0.22), 0 6px 18px rgba(141,95,109,0.18);
  padding: 0;
  transition: transform 700ms cubic-bezier(.22,.61,.36,1), opacity 700ms ease;
  transform-origin: 50% 80%;
  outline: none;
}
.hero-portrait-card:focus-visible {
  box-shadow: 0 24px 60px rgba(42,34,29,0.22), 0 0 0 3px var(--heather-plum);
}
.hero-portrait-caption {
  position: absolute;
  left: 14px; bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(250,246,241,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(196,169,143,0.4);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-70);
  z-index: 4;
  pointer-events: none;
}
.hero-portrait-caption .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--heather-plum);
}
.hero-portrait-dots {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.hero-portrait-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(141,95,109,0.28);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 240ms ease, background 240ms ease;
}
.hero-portrait-dot.is-active {
  width: 24px;
  background: var(--heather-plum);
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(48px, 7vw, 96px);
  }
  .hero-portrait-stack {
    justify-self: end;
    max-width: 100%;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 180ms var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--heather-plum);
  color: var(--offwhite);
}
.btn-primary:hover {
  background: var(--heather-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--sandstone-border);
}
.btn-secondary:hover {
  background: var(--heather-subtle);
  border-color: var(--heather-plum);
}

/* Animation helpers */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Background canvas (legacy) */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Quiet animated background — slow drifting warm washes */
.bg-quiet {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --mx: 0;
  --my: 0;
  overflow: hidden;
}
.bg-quiet::before,
.bg-quiet::after {
  content: '';
  position: absolute;
  inset: -15%;
  background-repeat: no-repeat;
  will-change: transform, background-position;
  filter: blur(60px);
}
/* Layer A — saturated warm tones, large, slow */
.bg-quiet::before {
  background-image:
    radial-gradient(36% 30% at 22% 28%, rgba(181, 104, 74, 0.55), transparent 65%),
    radial-gradient(32% 28% at 78% 18%, rgba(139, 110, 126, 0.45), transparent 65%),
    radial-gradient(38% 34% at 30% 82%, rgba(212, 165, 116, 0.55), transparent 65%);
  transform: translate3d(calc(var(--mx) * -14px), calc(var(--my) * -10px), 0);
  animation: quietDriftA 38s ease-in-out infinite alternate;
}
/* Layer B — rose + sage accents, offset, slower */
.bg-quiet::after {
  background-image:
    radial-gradient(34% 28% at 70% 70%, rgba(201, 166, 166, 0.55), transparent 65%),
    radial-gradient(30% 26% at 12% 60%, rgba(156, 168, 142, 0.40), transparent 65%),
    radial-gradient(28% 26% at 88% 42%, rgba(232, 180, 140, 0.50), transparent 65%);
  transform: translate3d(calc(var(--mx) * 18px), calc(var(--my) * 12px), 0);
  animation: quietDriftB 54s ease-in-out infinite alternate;
}

@keyframes quietDriftA {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%; }
  50%  { background-position: 6% -4%, -5% 5%, 4% 6%; }
  100% { background-position: -3% 5%, 4% -3%, -5% -4%; }
}
@keyframes quietDriftB {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%; }
  50%  { background-position: -5% 4%, 6% -5%, -4% 6%; }
  100% { background-position: 4% -5%, -6% 4%, 5% -3%; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-quiet::before,
  .bg-quiet::after { animation: none; }
}

main, header, footer { position: relative; z-index: 1; }

/* ============================================================
   Nav: desktop default vs mobile drawer
   ============================================================ */
.primary-nav { display: flex; }
.nav-burger { display: none !important; }

@media (max-width: 880px) {
  .primary-nav { display: none !important; }
  .nav-cta-desktop { display: none !important; }
  .nav-burger { display: inline-flex !important; }
}

/* ============================================================
   Mobile responsive overrides
   ============================================================
   Centralized media queries instead of per-component breakpoints.
   Targets the elements that need adjustment at tablet (≤880px)
   and phone (≤640px / ≤480px) widths.
*/

/* Tablet & below: 880px */
@media (max-width: 880px) {
  /* Headlines should not crash into 56px on a 6" phone */
  h1, .hero h1 { font-size: clamp(32px, 8vw, 44px) !important; line-height: 1.08 !important; }
  h2 { font-size: clamp(28px, 6vw, 40px) !important; line-height: 1.12 !important; }
  h3 { font-size: clamp(22px, 5vw, 30px) !important; }

  .lead { font-size: 17px !important; }

  /* Hero portrait stack — give it breathing room when stacked */
  .hero-portrait-stack { max-width: 480px !important; margin-left: auto !important; margin-right: auto !important; }

  /* Bauchschmiede card — single column on mobile, with image first then copy */
  .bauchschmiede-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .bauchschmiede-grid > .bauchschmiede-illu { order: -1; }

  /* Team detail card — 1 column when the grid was 1fr 1.1fr on desktop */
  .team-detail-grid { grid-template-columns: 1fr !important; }
  .team-detail-grid .team-detail-portrait { aspect-ratio: 4/5 !important; max-height: 380px; }

  /* Stats grid — let stat tiles wrap to single column comfortably */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 36px 24px !important;
  }

  /* Footer — relax columns */
  .footer-grid { gap: 32px !important; }

  /* Carousels & tracks — full bleed already; ensure no crushed gutters */
  .crs-track, .aktuelles-track {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Course-detail / behandlung-detail dl rows — stack labels/values */
  .detail-dl { grid-template-columns: 1fr !important; gap: 4px 0 !important; }
  .detail-dl dt { color: var(--ink-50); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
  .detail-dl dd { margin-bottom: 10px; }

  /* Kursplan calendar — switch to a stacked agenda on phones */
  .kp-calendar-week, .kp-calendar-grid { font-size: 13px; }
  .kp-day-cell { min-height: 72px !important; }
}

/* Phone: 640px */
@media (max-width: 640px) {
  /* Tighter section padding so we don't waste 96px on a small screen */
  section { padding-top: clamp(40px, 9vw, 64px) !important; padding-bottom: clamp(40px, 9vw, 64px) !important; }

  .container { padding-left: 20px !important; padding-right: 20px !important; }

  /* Buttons should be full width when only one wraps to a row by itself */
  .btn { padding: 12px 22px; font-size: 14.5px; }

  /* Pillow cards — drop max width so they fill */
  .angebot-grid { gap: 16px !important; }

  /* Detail modals — full-width on phones, less padding */
  .detail-modal-body { padding: 24px !important; }

  /* Aktuelles tile dimensions — reduce min so 2 cards aren't squashed */
  .aktuelles-card { min-width: 78vw !important; }

  /* Erfahrungen — already 1col at 640 */

  /* Footer — labels & links stack */
  .footer-bottom { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }
}

/* Very small: 380px */
@media (max-width: 380px) {
  h1, .hero h1 { font-size: 28px !important; }
  h2 { font-size: 24px !important; }
  .container { padding-left: 16px !important; padding-right: 16px !important; }
}
