/**
 * CENIK MEDICAL DESIGN SYSTEM 2.0
 * Premium European Medical Care — cascade layer on top of main.css
 * Fonts: Source Sans 3 + Cormorant Garamond (already licensed / self-hosted)
 * Do not load Inter/Manrope — avoids new font licensing & FOUT risk.
 */

:root {
  /* —— Brand palette —— */
  --cmds-navy: #102A38;
  --cmds-navy-mid: #1A3D4F;
  --cmds-navy-soft: #2A5566;
  --cmds-gold: #D4B078;
  --cmds-gold-soft: #E6D0A8;
  --cmds-gold-deep: #B89255;
  /* Text on ivory — WCAG AA normal (≥4.5:1 vs #F6F4F0); keep --cmds-gold for accents */
  --cmds-gold-ink: #8A6534;
  --cmds-ivory: #F6F4F0;
  --cmds-white: #FFFFFF;
  /* #5F747C on ivory was 4.47:1 (axe fail); #556970 clears AA normal */
  --cmds-slate: #556970;
  --cmds-slate-deep: #3E5056;
  --cmds-line: #E4DFD7;

  /* Map into legacy tokens used across main.css */
  --brand-blue-dark: var(--cmds-navy);
  --brand-blue: var(--cmds-navy-mid);
  --brand-blue-mid: var(--cmds-navy-soft);
  --brand-blue-soft: #3A6B82;
  --brand-blue-pale: #E8F1F5;
  --brand-gold: var(--cmds-gold);
  --brand-gold-light: var(--cmds-gold-soft);
  --brand-gold-lighter: #F0E4CC;
  --brand-gold-dark: var(--cmds-gold-deep);

  --navy-900: var(--cmds-navy);
  --navy-800: var(--cmds-navy-mid);
  --navy-700: var(--cmds-navy-soft);
  --navy-600: #3A6B82;
  --navy-100: #E8F1F5;
  --bronze-800: var(--cmds-gold-deep);
  --bronze-700: #C4A06A;
  --bronze-600: var(--cmds-gold);
  --bronze-100: #F5EFE6;
  --cream-50: #FAFAF8;
  --cream-100: var(--cmds-ivory);
  --cream-200: var(--cmds-line);
  --gray-700: var(--cmds-slate-deep);
  --gray-500: var(--cmds-slate);
  --gray-300: #D1D5DB;
  --white: var(--cmds-white);
  --text-main: var(--cmds-navy);
  --text-muted: var(--cmds-slate);
  --accent: var(--cmds-navy-mid);
  --bg-main: var(--cmds-ivory);

  /* —— Typography —— Source Sans 3 first (licensed) —— */
  --font-sans: "Source Sans 3", "Source Sans 3 Fallback", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cormorant Garamond", "Cormorant Garamond Fallback", Georgia, "Times New Roman", serif;
  --text-body: 17px;
  --text-body-lg: 18px;
  --text-caption: 14px;
  --text-overline: 12px;
  --line-body: 1.65;
  --line-body-lg: 1.55;

  /* —— Layout —— */
  --content-max: 1240px;
  --content-wide: 1280px;
  --content-narrow: 44rem; /* ~704px */
  --content-editorial: 46rem;
  --prose-max: min(70ch, 100%);
  /* Deliberate section rhythm (~24–52px). Prevents empty ivory stripes from
     double-stacked padding between major sections. */
  --section-y: clamp(24px, 3.2vw, 52px);
  --section-y-compact: clamp(20px, 2.6vw, 36px);
  --section-y-hero: clamp(32px, 4.5vw, 64px);
  --section-y-page: clamp(28px, 3.8vw, 48px);
  --footer-pad-block: clamp(28px, 3.5vw, 44px);
  --header-gap: clamp(10px, 1.5vw, 16px);
  --section-head-mb: var(--header-gap);
  --gap-card: clamp(12px, 1.5vw, 20px);
  --gap-related: clamp(8px, 1.2vw, 14px);
  --text-to-component: clamp(18px, 2vw, 26px);
  --radius-md: 12px;
  --radius-control: 12px;
  --cmds-shadow: 0 4px 20px rgba(16, 42, 56, 0.08);
}

@media (max-width: 767px) {
  :root {
    --text-body: 16px;
    --text-body-lg: 17px;
    --section-y: clamp(24px, 4.5vw, 40px);
    --section-y-compact: clamp(20px, 3.5vw, 32px);
    --section-y-page: clamp(24px, 4.5vw, 40px);
    --footer-pad-block: clamp(24px, 4vw, 36px);
  }
}

/* —— Base —— */
body.theme-ref,
body.page {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--line-body);
  color: var(--cmds-slate-deep);
  background: var(--cmds-ivory);
}

.theme-ref .container,
.container {
  max-width: var(--content-max);
  margin-inline: auto;
}

.theme-ref h1,
.theme-ref .heading-1,
.theme-ref .hero-ref h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 3.35rem); /* ~32–54px */
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--cmds-navy);
}

.theme-ref h2,
.theme-ref .heading-2 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.6vw, 2.25rem); /* ~25–36px */
  line-height: 1.2;
  color: var(--cmds-navy);
}

.theme-ref h3,
.theme-ref .heading-3 {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.3;
  color: var(--cmds-navy);
}

.theme-ref p,
.theme-ref .body-text {
  font-size: clamp(16px, 1.2vw, 17px);
  line-height: var(--line-body);
  color: var(--cmds-slate-deep);
  max-width: var(--prose-max);
}

/*
  ROOT CAUSE (footer copyright left bias):
  The prose measure above also matched `.footer-bottom p` / `.footer-since`.
  Those blocks stayed ~70ch wide, left-edged inside a full-width `.footer-bottom`
  that already had text-align:center — so text looked centered inside a left box.
  Copyright is a sibling of `.footer-grid`, not a grid child; restore full row width.
*/
.theme-ref .footer-bottom,
.theme-ref .footer-ref .footer-bottom,
.theme-ref footer.footer .footer-bottom {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  text-align: center;
  border-top: 1px solid var(--cmds-line);
  padding-top: 24px;
}
.theme-ref .footer-bottom p,
.theme-ref .footer-bottom .footer-since,
.theme-ref .footer-ref .footer-bottom p,
.theme-ref footer.footer .footer-bottom p {
  max-width: none;
  width: 100%;
  margin-inline: 0;
  text-align: center;
}

.theme-ref .body-text-lg {
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: var(--line-body-lg);
  color: var(--cmds-slate-deep);
}

.theme-ref .overline,
.theme-ref .section-header .overline {
  font-size: var(--text-overline);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cmds-gold-ink);
  font-weight: 600;
}

/* —— Section rhythm —— */
.theme-ref .section-standard,
.theme-ref .section-page,
.section-standard,
.section-page {
  padding-block: var(--section-y);
}

.theme-ref .section-compact,
.section-compact {
  padding-block: var(--section-y-compact);
}

.theme-ref .section-therapy-page,
.section-therapy-page {
  padding-block: var(--section-y-page);
}

.theme-ref .section-standard .section-header,
.theme-ref .section-page .section-header,
.section-standard .section-header,
.section-page .section-header {
  margin-bottom: var(--header-gap);
}

.theme-ref .section-header h2 {
  margin: 0 0 0.45rem;
}

.theme-ref .section-header p,
.theme-ref .section-header .body-text,
.theme-ref .section-header .body-text-lg {
  margin: 0;
}

/* —— Buttons —— */
.theme-ref .btn,
.theme-ref a.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-ref .btn-primary,
.theme-ref a.btn-primary {
  background: var(--cmds-navy);
  border-color: var(--cmds-navy);
  color: var(--cmds-white);
}

.theme-ref .btn-primary:hover,
.theme-ref a.btn-primary:hover {
  background: var(--cmds-navy-mid);
  border-color: var(--cmds-navy-mid);
  color: var(--cmds-white);
  box-shadow: var(--cmds-shadow);
}

.theme-ref .btn-ghost,
.theme-ref a.btn-ghost {
  background: transparent;
  border: 1px solid rgba(16, 42, 56, 0.28);
  color: var(--cmds-navy);
}

.theme-ref .btn-ghost:hover {
  border-color: var(--cmds-gold);
  color: var(--cmds-navy);
  background: rgba(212, 176, 120, 0.12);
}

/* Gold accent CTA (appointment emphasis) */
.theme-ref .btn-accent,
.theme-ref .hero-actions .btn-primary,
.theme-ref .navbar-actions .btn-primary {
  background: var(--cmds-navy);
  border-color: var(--cmds-navy);
}

.theme-ref .rf-hero-actions .btn-primary,
.theme-ref .rf-cta-final .btn-primary {
  background: var(--cmds-gold);
  border-color: var(--cmds-gold);
  color: var(--cmds-navy);
}

/*
  Dark surface text (CMDS 2.0): theme-ref heading rules paint navy on all .heading-*.
  On navy CTAs / navy sections that becomes unreadable — keep light type on dark planes.
*/
.theme-ref .rf-cta-final,
.theme-ref .rf-section--navy,
.theme-ref .rf-hero {
  color: #fff;
}
.theme-ref .rf-cta-final h1,
.theme-ref .rf-cta-final h2,
.theme-ref .rf-cta-final h3,
.theme-ref .rf-cta-final .heading-1,
.theme-ref .rf-cta-final .heading-2,
.theme-ref .rf-cta-final .heading-3,
.theme-ref .rf-section--navy h1,
.theme-ref .rf-section--navy h2,
.theme-ref .rf-section--navy h3,
.theme-ref .rf-section--navy .heading-1,
.theme-ref .rf-section--navy .heading-2,
.theme-ref .rf-section--navy .heading-3,
.theme-ref .rf-hero h1,
.theme-ref .rf-hero .heading-1 {
  color: #fff;
}
.theme-ref .rf-cta-final p,
.theme-ref .rf-section--navy p,
.theme-ref .rf-section--navy .body-text {
  color: rgba(255, 255, 255, 0.92);
}

/* —— Cards —— */
.theme-ref .card-service,
.theme-ref .article-card,
.theme-ref .contact-card,
.theme-ref .therapy-dropdown,
.theme-ref .rf-card {
  background: var(--cmds-white);
  border: 1px solid var(--cmds-line);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.theme-ref .card-service,
.theme-ref .article-card .article-card-body,
.theme-ref .contact-card {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.theme-ref .grid-services,
.theme-ref .article-grid {
  gap: var(--gap-card);
}

.theme-ref .therapy-dropdowns {
  max-width: min(1040px, 100%);
  gap: var(--gap-related);
}

.theme-ref .therapy-dropdown-trigger {
  min-height: 52px;
  font-size: 1.02rem;
  color: var(--cmds-navy);
}

.theme-ref .faq-list {
  gap: var(--gap-related);
}

/* —— Hero variants ——
   Root cause: .hero sets min-height:100vh + large padding; .theme-ref .hero-ref
   used clamp(80px,12vw,140px) padding and up to 96px gap → oversized home hero. */
.theme-ref .hero.hero-ref,
.theme-ref .hero.hero-ref.section-hero,
.page-home.theme-ref .hero.hero-ref {
  min-height: 0 !important;
  max-height: none !important;
  height: auto;
  display: grid;
  align-items: center;
  padding: clamp(2rem, 4.5vw, 4rem) 3% !important;
  gap: clamp(1.25rem, 3vw, 2.5rem) !important;
  background: linear-gradient(165deg, var(--cmds-ivory) 0%, #EEF2F4 55%, var(--cmds-ivory) 100%);
}

.theme-ref .hero-ref-quote {
  margin: var(--space-3) 0 !important;
}

.theme-ref .page-home .hero-ref h1,
.theme-ref .page-home .hero-ref-title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
}

/* Hero logo was effectively 400×400 — dominates composition */
.theme-ref .hero-ref-logo,
.page-home .hero-ref-logo {
  width: auto;
  max-width: min(240px, 100%);
  max-height: 220px;
  height: auto;
  object-fit: contain;
}

.theme-ref .hero-ref-right {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.theme-ref .hero-ref-sub {
  margin-bottom: 0.75rem !important;
}

.theme-ref .hero-ref-value-line,
.theme-ref .hero-ref-trust-line {
  margin: 0.5rem 0 !important;
}

.theme-ref .hero-ref-contact-boxes {
  margin: 0.75rem 0 !important;
}

.theme-ref .hero-ref-actions {
  margin-top: 0.85rem !important;
}

@media (max-width: 900px) {
  .theme-ref .hero.hero-ref,
  .page-home.theme-ref .hero.hero-ref {
    grid-template-columns: 1fr;
    /* Symmetric inline padding — do not steal end space for FAB rail */
    padding: clamp(1.5rem, 5vw, 2.5rem) 4% !important;
    gap: 1rem !important;
  }

  /* Logo already in navbar — keep open-status, shrink logo plane */
  .theme-ref .hero-ref-logo {
    max-width: 120px;
    max-height: 120px;
  }

  /* Insurer chips duplicated in doctor-card + kassen section */
  .theme-ref .hero-ref-value-line {
    display: none;
  }

  .theme-ref .hero-ref-quote {
    margin: 0.5rem 0 !important;
    font-size: 0.95rem;
    line-height: 1.45;
  }
}

/* Kassen: readable supporting copy (label may stay compact uppercase) */
.theme-ref .section-kassen-ref .kassen-subline,
.theme-ref .section-kassen-ref .kassen-facts .body-text,
.theme-ref .section-kassen-ref .kassen-facts p {
  font-size: clamp(15px, 1.2vw, 17px) !important;
  line-height: 1.55;
  color: var(--cmds-slate-deep);
}
.theme-ref .section-kassen-ref .kassen-label {
  font-size: 0.75rem; /* uppercase eyebrow OK */
}

/* Erster Termin: avoid double-inflated section padding */
.theme-ref .section-erster-termin.section-standard,
.page-home.theme-ref .section-erster-termin.section-standard {
  padding-block: var(--section-y) !important;
}

/* Erster Termin steps: left-aligned copy, equal columns, no centered narrow measure */
.theme-ref .erster-termin-steps {
  width: 100%;
  max-width: none;
}
.theme-ref .erster-termin-step {
  text-align: left;
  justify-items: start;
}
.theme-ref .erster-termin-step .heading-4,
.theme-ref .erster-termin-step .erster-termin-kicker,
.theme-ref .erster-termin-step .body-text {
  text-align: left;
  max-width: 100%;
}

/* Service / article cards: keep body copy left; avoid uneven centered wraps */
.theme-ref .card-service,
.theme-ref .article-card .article-card-body,
.theme-ref .contact-card {
  text-align: left;
}
.theme-ref .card-service .heading-4,
.theme-ref .card-service h3,
.theme-ref .card-service p,
.theme-ref .article-card-title,
.theme-ref .article-card .body-text {
  text-align: left;
  overflow-wrap: break-word;
  hyphens: manual;
}

/* Therapieangebot: readable measure, less floaty center block */
.page-therapieangebot .section-header,
.page-therapieangebot .section-therapy-page .section-header {
  text-align: left;
  margin-inline: 0 auto;
  max-width: min(42rem, 100%);
}
.page-therapieangebot .section-header p,
.page-therapieangebot .section-header .body-text,
.page-therapieangebot .section-header .body-text-lg {
  max-width: min(68ch, 100%);
  margin-inline: 0;
  text-align: left;
}
.page-therapieangebot .therapy-dropdowns {
  margin-inline: 0;
}

/* —— Template families —— */
.page-home .section-standard .section-header,
.page-therapieangebot .section-header {
  max-width: min(var(--content-editorial), 100%);
}

.page-therapieangebot .therapy-dropdowns,
.page-faq .faq-list,
.page-faq .section-faq .container {
  max-width: min(1040px, 100%);
}

.local-seo-content,
.section-page .container.local-seo-content {
  max-width: min(1040px, 100%);
}

.legal-content {
  max-width: min(720px, 100%);
}

/* —— Medical disclaimer ——
   Base rule used margin space-8 / space-10 → large empty ivory bands above footer.
   Keep the disclaimer text; remove spacer margins; continuous plane into footer. */
.theme-ref .medical-compliance {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--section-y-compact) 3%;
  background: var(--cmds-white);
  border-top: 1px solid var(--cmds-line);
  color: var(--cmds-slate);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.theme-ref .medical-compliance .medical-compliance-disclaimer,
.theme-ref .medical-compliance .medical-compliance-review {
  max-width: var(--content-narrow);
  margin-inline: auto;
}

/* —— CTA blocks —— */
.theme-ref .faq-cta-block,
.theme-ref .cta-block,
.theme-ref .local-seo-end-cta,
.theme-ref .local-seo-mid-cta {
  background: var(--cmds-white);
  border: 1px solid var(--cmds-line);
  border-radius: var(--radius-md);
  padding: clamp(1.15rem, 2.5vw, 1.75rem);
}

/* —— Image/text —— */
.theme-ref img {
  max-width: 100%;
  height: auto;
}

/* —— Header / Footer cohesion (no redesign of structure) —— */
.theme-ref .navbar {
  background: rgba(246, 244, 240, 0.92);
  border-bottom: 1px solid var(--cmds-line);
}

.theme-ref .navbar-links .nav-link {
  color: var(--cmds-navy);
  font-weight: 500;
}

.theme-ref .navbar-links .nav-link.is-active,
.theme-ref .navbar-links .nav-link[aria-current="page"] {
  color: var(--cmds-navy);
  font-weight: 700;
}

.theme-ref .footer-ref,
.theme-ref footer.footer {
  background: var(--cmds-white);
  color: var(--cmds-slate-deep);
  margin-top: 0;
  border-top: 1px solid var(--cmds-line);
  /* Base .footer uses space-10 top pad — reset; spacing lives on .footer-container */
  padding: 0;
}

/* —— Section transitions: continuous planes, no decorative empty ivory bands —— */
.theme-ref main {
  margin-bottom: 0;
  padding-bottom: 0;
}

/*
  Sticky CTA clearance:
  - Desktop: hide bottom sticky bar (nav already carries phone CTA) → no empty
    white slab under footer content from +72px pad.
  - Mobile: keep clearance inside footer bottom padding (same white plane).
*/
.theme-ref.page.has-mobile-cta > main,
body.theme-ref.page.has-mobile-cta > main {
  padding-bottom: 0;
}

.theme-ref.page.has-mobile-cta .footer-ref .footer-container,
.theme-ref.page.has-mobile-cta footer.footer .footer-container {
  padding-bottom: clamp(18px, 2.2vw, 28px);
}

@media (min-width: 769px) {
  body.theme-ref .sticky-cta-bar.mobile-cta,
  body.theme-ref.page.has-mobile-cta .sticky-cta-bar.mobile-cta {
    display: none;
  }
}

@media (max-width: 768px) {
  .theme-ref.page.has-mobile-cta .footer-ref .footer-container,
  .theme-ref.page.has-mobile-cta footer.footer .footer-container {
    padding-bottom: calc(clamp(18px, 2.2vw, 28px) + 72px);
  }
  /* Cancel legacy body pad that created empty slab below the footer */
  body.theme-ref.page.has-mobile-cta {
    padding-bottom: 0;
  }
}

.theme-ref main > section {
  margin-block: 0;
}

.theme-ref main > section:last-child {
  padding-bottom: var(--section-y-compact);
}

/* Opening hours: full-bleed white plane that meets the footer (not a floating card island) */
.theme-ref .section-zeiten-ref {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: var(--section-y-compact) 3%;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--cmds-line);
  box-shadow: none;
  background: var(--cmds-white);
}

.theme-ref .section-zeiten-ref .zeiten-grid,
.theme-ref .section-zeiten-ref .zeiten-note {
  max-width: var(--content-max);
  margin-inline: auto;
}

.theme-ref .section-gutscheine-ref,
.page-home.theme-ref .section-gutscheine-ref {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  justify-content: center;
  column-gap: clamp(1.5rem, 4vw, 2.75rem);
  row-gap: clamp(1rem, 2.5vw, 1.75rem);
  gap: clamp(1rem, 2.5vw, 1.75rem) clamp(1.5rem, 4vw, 2.75rem);
  padding-block: var(--section-y-compact);
  padding-inline: 3%;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  background: var(--cmds-ivory);
  border-top: 1px solid var(--cmds-line);
  box-sizing: border-box;
}

.theme-ref .section-gutscheine-ref .gutscheine-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: min(20rem, 100%);
  width: 100%;
  margin-inline: auto;
}

.theme-ref .section-gutscheine-ref .gutscheine-voucher-wrap {
  padding: 10px;
  margin: 0;
  background: var(--cmds-surface, #fff);
  border: 1px solid var(--cmds-line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(26, 56, 68, 0.08);
}

.theme-ref .section-gutscheine-ref .gutscheine-voucher-img {
  max-width: 260px;
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 420;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.theme-ref .section-gutscheine-ref .gutscheine-content {
  max-width: min(28rem, 100%);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.theme-ref .section-gutscheine-ref .gutscheine-title {
  margin: 0 0 0.65rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.theme-ref .section-gutscheine-ref .gutscheine-text {
  margin: 0 0 1.25rem;
  max-width: 40ch;
  line-height: 1.55;
}

.theme-ref .section-gutscheine-ref .gutscheine-content .btn {
  margin: 0;
}

.theme-ref .section-gutscheine-ref .gutscheine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: center;
}

@media (max-width: 768px) {
  .theme-ref .section-gutscheine-ref,
  .page-home.theme-ref .section-gutscheine-ref {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .theme-ref .section-gutscheine-ref .gutscheine-visual,
  .theme-ref .section-gutscheine-ref .gutscheine-content {
    max-width: 22rem;
    width: 100%;
    margin-inline: auto;
  }
  .theme-ref .section-gutscheine-ref .gutscheine-content {
    align-items: center;
  }
  .theme-ref .section-gutscheine-ref .gutscheine-text {
    margin-inline: auto;
  }
  .theme-ref .section-gutscheine-ref .gutscheine-voucher-img {
    max-width: 220px;
  }
  .theme-ref .section-gutscheine-ref .gutscheine-actions {
    justify-content: center;
  }
}

/* Minimum readable UI type on cards/tags */
.theme-ref .article-card-tag,
.theme-ref .therapy-badge-verify,
.theme-ref .card-link,
.theme-ref .kassen-label {
  font-size: max(0.8125rem, 13px);
}

.theme-ref .footer .footer-container,
.theme-ref .footer-ref .footer-container,
.theme-ref footer.footer .footer-container {
  padding: var(--footer-pad-block) 3% clamp(18px, 2.2vw, 28px);
}

/* Inner templates: last content block should not leave a tall ivory strip above footer */
.theme-ref .section-page:last-of-type,
.theme-ref .section-therapy-page:last-of-type,
.theme-ref .section-standard:last-of-type {
  padding-bottom: var(--section-y-compact);
}

.theme-ref .footer-ref .footer-col h5 {
  color: var(--cmds-navy);
  font-size: max(0.8125rem, 13px);
  letter-spacing: 0.06em;
}

.theme-ref .footer-ref .footer-col a {
  color: var(--cmds-slate-deep);
}

.theme-ref .footer-ref .footer-col a:hover {
  color: var(--cmds-navy);
}

/* —— R-FORCE bridge: keep elite layout, align palette —— */
.page-r-force {
  --rf-navy: var(--cmds-navy);
  --rf-navy-mid: var(--cmds-navy-mid);
  --rf-navy-deep: #0B1E28;
  --rf-gold: var(--cmds-gold);
  --rf-gold-soft: var(--cmds-gold-soft);
  --rf-cream: var(--cmds-ivory);
  --rf-line: var(--cmds-line);
  --rf-ink: var(--cmds-navy);
  --rf-muted: var(--cmds-slate); /* inherits AA-safe slate */
  --rf-max: 1240px;
  --rf-body: clamp(1rem, 1.1vw, 1.0625rem);
  --rf-h2: clamp(1.5rem, 2.4vw, 2.15rem);
  --rf-section-y: var(--section-y);
}

/* —— Contact template —— */
.page-kontakt .container-contact,
.theme-ref .container-contact {
  max-width: var(--content-max);
}

.theme-ref .contact-form-map-grid,
.theme-ref .contact-visit-grid,
.theme-ref .contact-cards-row {
  max-width: 100%;
}

.theme-ref .contact-form-column,
.theme-ref .contact-map-column,
.theme-ref .contact-map-panel,
.theme-ref .contact-map-wrap {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .theme-ref .contact-form-map-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .theme-ref .contact-form-column,
  .theme-ref .contact-map-column,
  .theme-ref .contact-map-panel,
  .theme-ref .contact-map-wrap,
  .theme-ref .contact-map-placeholder {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .theme-ref .contact-call-hours {
    grid-template-columns: 1fr;
  }
}

/* —— Homepage tech strip + therapy verification badges —— */
.theme-ref .section-tech-ref .rf-equip-card-home {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--cmds-gold) 45%, transparent);
  background: linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--cmds-ivory) 80%, #fff) 100%);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.theme-ref .section-tech-ref .rf-equip-card-home img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
}
.theme-ref .section-tech-ref .rf-equip-card-home strong,
.theme-ref .section-tech-ref .rf-equip-card-home .body-text,
.theme-ref .section-tech-ref .rf-equip-card-home span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.theme-ref .section-tech-ref .rf-equip-card-home strong {
  font-family: "Cormorant Garamond", "Cormorant Garamond Fallback", Georgia, serif;
  font-size: 1.15rem;
  color: var(--cmds-navy);
  margin-bottom: 0.35rem;
}
/* Narrow phones: FAB-rail inset shrinks content; stack card so copy cannot spill past viewport */
@media (max-width: 560px) {
  .theme-ref .section-tech-ref .rf-equip-card-home {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }
}
.theme-ref .therapy-badge-verify {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cmds-slate);
  font-family: "Source Sans 3", "Source Sans 3 Fallback", system-ui, sans-serif;
}
.theme-ref .therapy-detail-card--info {
  border-style: dashed;
  opacity: 0.98;
}
.theme-ref .contact-reviews-disclaimer {
  max-width: 42rem;
  margin: 0 auto 1rem;
  font-size: 0.95rem;
  color: var(--cmds-slate);
}

/* CMDS 2.0 Google Reviews live component */
.theme-ref .cmds-google-reviews[data-state='loading'] .contact-reviews-fallback {
  opacity: 0.85;
}
.theme-ref .cmds-google-reviews .contact-reviews-fallback {
  max-width: 36rem;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--cmds-slate);
}
.theme-ref .cmds-google-reviews .contact-reviews-synced {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cmds-slate);
  opacity: 0.9;
}
.theme-ref .cmds-google-reviews[data-state='live'] .contact-reviews-fallback {
  display: none;
}
.theme-ref .cmds-google-reviews[data-state='fallback'] [data-reviews-live],
.theme-ref .cmds-google-reviews[data-state='loading'] [data-reviews-live],
.theme-ref .cmds-google-reviews:not([data-state='live']) [data-reviews-live] {
  display: none !important;
}

/* —— Accessibility —— */
.theme-ref a.btn:focus-visible,
.theme-ref button.btn:focus-visible,
.theme-ref .navbar-toggle:focus-visible {
  outline: 3px solid var(--cmds-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-ref .btn,
  .theme-ref a.btn {
    transition: none;
  }
}

/* ==========================================================================
   Sitewide Visual QA / Alignment — 2026-11-09
   Execution polish only (CMDS 2.0 preserved). No redesign.
   Root causes from Wissen & News owner report, applied to shared components.
   ========================================================================== */

/* 1) Editorial page headers: stop center/left stagger (Wissen & News)
   .section-header is centered sitewide; .news-intro is left-aligned → ragged intro. */
.page-wissen .section-page .section-header,
.page-wissen.theme-ref .section-page .section-header {
  text-align: left;
  margin-inline: 0;
  max-width: min(var(--content-editorial), 100%);
}
.page-wissen .section-page .section-header .overline,
.page-wissen .section-page .section-header .heading-1,
.page-wissen .section-page .section-header h1 {
  text-align: left;
}
.page-wissen .section-page .section-header .body-text-lg,
.page-wissen .section-page .section-header p {
  margin-inline: 0;
  text-align: left;
  max-width: min(68ch, 100%);
}
.page-wissen .news-intro {
  max-width: min(68ch, 100%);
  margin: 0 0 var(--text-to-component);
  text-align: left;
}
.page-wissen .section-erkenntnisse-ref {
  margin-top: var(--text-to-component);
}

/* 2) Equal-height article cards + pinned meta (shared grid)
   Different copy lengths are OK; row bottoms must still align via stretch. */
.theme-ref .article-grid,
.theme-ref .section-erkenntnisse-ref .article-grid,
.theme-ref .grid-services {
  align-items: stretch;
}
.theme-ref .article-card,
.theme-ref .section-erkenntnisse-ref .article-card,
.theme-ref .card-service {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.theme-ref .article-card .article-card-body,
.theme-ref .section-erkenntnisse-ref .article-card .article-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.theme-ref .article-card .article-card-meta,
.theme-ref .section-erkenntnisse-ref .article-card .article-card-meta,
.theme-ref .article-card .article-card-link,
.theme-ref .section-erkenntnisse-ref .article-card .article-card-link {
  margin-top: auto;
  padding-top: var(--gap-related);
}
.theme-ref .article-card .article-card-title,
.theme-ref .section-erkenntnisse-ref .article-card .article-card-title {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
.theme-ref .card-service > .card-link:last-child,
.theme-ref .card-service > a.card-link:last-child {
  margin-top: auto;
}

/* 3) Mid-page CTA block rhythm (page-extra-block) */
.theme-ref .page-extra-block {
  margin-top: var(--section-y);
  padding: clamp(1.25rem, 2.5vw, 1.85rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  box-sizing: border-box;
}
.theme-ref .page-extra-block .body-text {
  margin-bottom: 0;
  max-width: 42ch;
}
.theme-ref .page-extra-block .btn {
  margin-top: 0.35rem;
}

/* 4) Medical compliance shares content-max inset with page chrome
   Narrow centered --content-narrow looked left-drifted vs CTA/footer. */
.theme-ref .medical-compliance {
  padding-inline: 3%;
  box-sizing: border-box;
}
.theme-ref .medical-compliance .medical-compliance-disclaimer,
.theme-ref .medical-compliance .medical-compliance-review {
  max-width: var(--content-max);
  width: 100%;
  margin-inline: auto;
  text-align: left;
}

/* 5) Footer + copyright: same content-max rail as main/containers */
.theme-ref .footer .footer-container,
.theme-ref .footer-ref .footer-container,
.theme-ref footer.footer .footer-container {
  max-width: var(--content-max);
  width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
}
.theme-ref .footer-ref .footer-grid {
  align-items: start;
}
.theme-ref .footer-ref .footer-brand {
  text-align: left;
}
.theme-ref .footer-ref .footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  text-align: center;
}
.theme-ref .footer-ref .footer-bottom p,
.theme-ref .footer-ref .footer-bottom .footer-since {
  text-align: center;
  max-width: none;
  width: 100%;
}

@media (max-width: 600px) {
  .theme-ref .footer-ref .footer-brand {
    text-align: center;
  }
  .theme-ref .footer-ref .footer-logo-link {
    margin-inline: auto;
  }
}
