/* ---------------------------------------------------------------------
 * Brand typeface: Lexend Deca — carried over from the existing WordPress
 * site, where it is the face for both body and headings (verified via
 * computed styles on the live site, not guessed from theme presets).
 *
 * Self-hosted per the tracking-free constraint: no Google Fonts CDN.
 * Variable font, full 100–900 range in one file per subset, so quark2's
 * weight scale (h1 400, h2 700, body 400) renders real weights rather than
 * synthetic bold. latin-ext is only downloaded if a glyph outside latin is
 * actually used — German needs latin alone.
 * ------------------------------------------------------------------- */
@font-face {
  font-family: "Lexend Deca";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/lexend-deca/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lexend Deca";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/lexend-deca/lexend-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* quark2 drives all typography through these two custom properties, so
 * overriding them here re-faces the whole site — no per-element rules.
 *
 * The theme-attribute selectors are load-bearing, not decoration: quark2
 * declares these vars inside `:root[data-theme="light"]` (specificity 0,2,0),
 * which outranks a plain `:root` (0,1,0) no matter which stylesheet loads
 * last. Matching its specificity is what makes the override actually win. */
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  --pico-font-family-sans-serif: "Lexend Deca", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --pico-font-family-display: "Lexend Deca", system-ui, -apple-system,
    "Segoe UI", sans-serif;
}

/* Lexend Deca is a wide, open face; at quark2's stock display weights it
 * reads heavier than the live site's airy setting. Pull the display
 * weights back toward the brand's own light treatment (live site: 300
 * headings / 200 body) without going so thin that contrast suffers. */
h1 {
  font-weight: 300;
  letter-spacing: -0.02em;
  /* quark2's display scale (up to 3.75rem) runs large in Lexend Deca; pull all
   * page titles — home hero and every other page — down ~20%. */
  font-size: clamp(1.9rem, 4vw + 0.75rem, 3rem);
}
h2 {
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw + 0.4rem, 1.7rem);
}
h3,
h4 {
  font-weight: 500;
}

/* Style variant: accent B (calm/clinical) + "getönt" background.
 * Chosen by the owner 2026-07-20, see docs/superpowers/plans/style-variant-decision.md
 *
 * The accent itself is set via the theme's `accent-color` config field, which
 * quark2 turns into --q2-accent/--q2-link inline (see quark2 partials/base.html.twig).
 * Only the canvas needs overriding here — quark2 has no config field for it.
 *
 * Light mode only: quark2 keeps its stock near-black canvas in dark mode, and
 * the tint would muddy it. Radius is left alone — variant B's values are
 * quark2's shipped defaults already.
 *
 * --q2-bg-elev deliberately NOT overridden: it stays #ffffff so the content
 * card keeps separating from the tinted canvas.
 *
 * Contrast verified: text 14.12:1, links 7.00:1 on this canvas.
 */
:root[data-theme="light"] {
  --q2-bg: #F1F5F4;
  --q2-bg-muted: #E6EEEC;
  --q2-nav-bg: rgba(241, 245, 244, 0.82);

  /* quark2 derives --q2-link from accent-color, i.e. #3E6E63 — only 5.29:1
   * on this canvas. Variant B specifies a darker link (7.00:1), which is what
   * the approved mockup showed. Restore it rather than inherit the weaker
   * derivation. Dark mode is left to quark2's own lightening formula. */
  --q2-link: #2E5B51;
}

/* Portrait images in content (home page). Served at 2x via Grav's derivative
 * pipeline and constrained here, so it stays sharp on retina without
 * becoming a full-bleed banner. */
/* Footer brand mark — the watercolour logo carried over from the live site,
 * where it sits in the footer rather than the navbar. alt="" because the
 * practice name is already adjacent as real text: announcing it again would
 * just be noise for screen readers. */
.footer-mark {
  width: 120px;
  height: auto;
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------
 * Dark-mode accent, derived from the inverted brand mark.
 *
 * Two reasons this exists:
 *
 * 1. Accessibility. quark2 lightens the accent for dark mode but keeps the
 *    button label white — white on that lightened green measured 3.87:1,
 *    below AA for a 15px label. Fixed by giving the fill a dark ink label.
 *
 * 2. Coherence. Dark mode shows the colour-inverted logo, whose artwork sits
 *    at a median hue of 261deg (violet). The green accent belongs to the
 *    light mark; carrying it into dark mode left the page fighting its own
 *    logo. This hue is taken from that inverted artwork and lifted in
 *    lightness until it clears contrast — the logo's own pixels are far too
 *    dark to use raw against the #1d1f25 card.
 *
 * Light mode is deliberately untouched: that is variant B, the version the
 * owner reviewed and chose.
 *
 * Verified against the #1d1f25 card and #08090b page:
 *   fill vs card 5.93 | ink label 6.80 | link vs card 5.93 | link vs page 7.18
 * ------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --q2-accent: #A88FD6;
  --q2-link: #A88FD6;
  --q2-accent-contrast: #111111;
  --q2-focus-ring: color-mix(in oklab, #A88FD6 55%, transparent);
}

/* Light/dark variants of the brand mark. Only one is ever shown. */
.footer-mark-dark {
  display: none;
}
:root[data-theme="dark"] .footer-mark-light {
  display: none;
}
:root[data-theme="dark"] .footer-mark-dark {
  display: inline-block;
}

/* ---------------------------------------------------------------------
 * FAQ accordion. The partial renders after </article>, i.e. outside the
 * content card, so it needs the card treatment itself to avoid floating
 * unstyled on the canvas.
 * ------------------------------------------------------------------- */
.faq {
  max-width: 960px;
  margin: 1.5rem auto 0;
  background: var(--q2-bg-elev);
  border-radius: var(--q2-radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 4vw, 3.25rem);
  box-shadow:
    rgba(19, 19, 22, 0.04) 0 1px 2px,
    rgba(19, 19, 22, 0.04) 0 8px 24px -8px;
}
:root[data-theme="dark"] .faq {
  box-shadow:
    rgba(0, 0, 0, 0.35) 0 1px 2px,
    rgba(0, 0, 0, 0.45) 0 10px 30px -10px,
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.faq > h2 {
  margin-top: 0;
}

.faq details {
  border-top: 1px solid var(--q2-divider);
}
.faq details:last-of-type {
  border-bottom: 1px solid var(--q2-divider);
}
.faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 500;
  line-height: 1.45;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
/* Own marker. Blades paints an SVG chevron via background-image on
   summary::after, which collides with a text marker — so that has to be
   cleared explicitly, not just list-style:none. */
.faq summary::after {
  content: "+";
  float: right;
  margin-left: 1rem;
  font-weight: 400;
  font-size: 1.25em;
  line-height: 1;
  color: var(--q2-accent);
  background-image: none;
  width: auto;
  height: auto;
  transform: none;
}
.faq details[open] summary::after {
  content: "–";
}

/* Blades mutes an open summary to #898989 (~3.5:1 on the card) — below AA,
   and it dims the very question the reader just chose to open.
   Set Blades' own variables rather than out-specifying its selector
   (`details[open] > summary:not([role]):not(:focus)` is 0,3,2, which beats
   any reasonable class rule); the variables inherit, so one declaration on
   the container covers every summary. */
.faq {
  --pico-accordion-open-summary-color: var(--q2-text);
  --pico-accordion-close-summary-color: var(--q2-text);
  --pico-accordion-active-summary-color: var(--q2-accent);
}
.faq summary:hover,
.faq summary:focus-visible {
  color: var(--q2-accent);
}
.faq details > div {
  padding-bottom: 1rem;
}
.faq details > div > :first-child {
  margin-top: 0;
}
.faq details > div > :last-child {
  margin-bottom: 0;
}

/* Content images sit centred in the text column. */
.content-item img {
  display: block;
  margin-inline: auto;
}

/* Grav emits <img> without width/height, so the browser cannot reserve space
   and the text below jumps once the image loads. aspect-ratio reserves it.
   The ratios must match the cropZoom in the page markdown:
     portrait  -> cropZoom=…,  2:3   (680x1020, 800x1200)
     landscape -> cropZoom=…,  3:2   (1200x800) */
img.portrait {
  max-width: 340px;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: var(--q2-radius-lg);
}
img.landscape {
  max-width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: var(--q2-radius-lg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--q2-bg-elev);
  color: var(--q2-text-strong);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: var(--q2-radius);
  box-shadow: var(--q2-shadow-raised);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Keine Silbentrennung — lange Wörter rücken komplett in die nächste Zeile.
 * Überschreibt body{hyphens:auto} aus blades.min.css. break-word statt
 * anywhere: bricht nur, wenn ein Wort sonst über den Rand liefe. */
body {
  hyphens: none;
  overflow-wrap: break-word;
}

/* Kein dekorativer Akzent-Strich vor h2 (aus quark2 theme.css). */
h2::before { display: none; }

/* Header (Desktop): Seitentitel zentriert über der ebenfalls zentrierten
 * Navigation stapeln. Nur >860px, darunter greift das Mobile-Menü.
 * Theme-Umschalter (.actions) rechts absolut positioniert, damit er die
 * Zentrierung nicht verschiebt. */
@media (min-width: 861px) {
  #header .navbar {
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    padding-block: 0.75rem;
  }
  #header .navbar .navbar-section.logo { flex: 0 0 auto; }
  #header .navbar .desktop-menu { flex: 0 0 auto; justify-content: center; }
  #header .navbar .navbar-section.actions {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    margin-left: 0;
  }
}

/* Body-Schrift feiner an das Live-Setting angleichen: Lexend Deca 300 statt
 * quark2-Default 400, plus Groesse 18px. Line-height (1.6) unveraendert. */
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  --pico-font-weight: 300;
  --pico-font-size: 18px;
}

/* Tighten the gap above and below the content block. quark2's #body-wrapper
 * adds clamp(2.5rem,5vw,4rem) top+bottom; halve both. */
#body-wrapper {
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
}
