/* ===========================================================================
   Notfallpraxis — Grundlagen (Fassung 7.4, Bauvertrag §0.1/§0.2, VORGABE-global §1)

   Lädt vor allen anderen NPZ-Stilen (inc/assets.php: Abhängigkeit
   `hbl-npz-grundlagen`). Das Plugin lädt nur auf der NPZ — Regeln auf `:root` gelten
   deshalb nur dort; das Theme bleibt unverändert (HBL ist live).

   Bruchstufen (eine Liste für alle NPZ-Dateien):
     D Rechner   min-width 1025  Desktop-Schrift, Abschnitt 96
     T Tablet    max-width 1024  Schrift = Telefon-Werte, Abschnitt 56, zweispaltig
     P1 schmal   max-width 767   gestapelt (Bühne, Zweispalter, Zeilen)
     P Telefon   max-width 599   Knöpfe 52 hoch, volle Breite, untereinander; Aktion 40
     P schmalst  max-width 374   Seitenrand 20
   Kopf: Desktop-Kopf ab 1280 (kopf.css). Pille ab 1440. Anrufleiste bis 1024.
   =========================================================================== */

/* --- Seitenrand über das Theme (Entscheid 7) -------------------------------
   `--npz-rand` allein verschöbe keine Theme-Spur: Das Theme rechnet Rumpf, Bänder
   und Bühnen mit `--hbl-aussenbund` (38) → `--hbl-inhaltsbund`. Darum hier der
   Aussenbund selbst, ≤ 1024 auf den NPZ-Rand. `html:root` (0,1,1) schlägt das
   `:root` des Themes und die Inline-Variablen von design.json. Ab 1025 bleibt 38
   (die Fusszeile Desktop steht darauf), der Inhalt läuft auf --hbl-inhaltsbund. */
@media (max-width: 1024px) { html:root { --hbl-aussenbund: clamp(40px, 4.7vw, 48px); } }
@media (max-width: 767px)  { html:root { --hbl-aussenbund: 40px; } }
@media (max-width: 599px)  { html:root { --hbl-aussenbund: 24px; } }
@media (max-width: 374px)  { html:root { --hbl-aussenbund: 20px; } }

:root {
  /* Seitenrand des Inhalts: 108 bei 1440 (Spur 1224), sonst der Aussenbund oben. */
  --npz-rand: var(--hbl-inhaltsbund);
  /* Polster oben/unten eines Abschnitts, Lücke zwischen seinen Teilen. */
  --npz-sektion: 96px;
  --npz-luecke: 48px;
  --npz-knopf-h: 48px;
  /* Haarlinie 22 % (Figma), 30 % (Fuss, Mobil-Menü), 16 % (Unterliste). */
  --npz-linie: color-mix(in srgb, var(--hbl-haarlinie) 22%, transparent);
  --npz-linie-30: color-mix(in srgb, var(--hbl-haarlinie) 30%, transparent);
  --npz-linie-16: color-mix(in srgb, var(--hbl-haarlinie) 16%, transparent);
  /* Ein Bronzeton für Knöpfe (Entscheid 8, Figma l1/l13). */
  --npz-bronze: var(--akzent-text-tief, #7A5E48);
  --npz-bronze-hover: #69513E;
  --npz-bronze-gedrueckt: #5A4635;
  --npz-schatten: 0 12px 32px rgb(41 51 61 / .16);
  /* Rolle `aktion` (Text → Knopf 48 · 48 · 40). Das Theme liefert die Rolle seit 0.9.6
     selbst (tokens.css, css/abstaende.css) und mit denselben Werten; sie steht hier
     trotzdem fest, damit die NPZ nicht mitwandert, wenn HBL seine Rolle ändert
     (Bauvertrag §0.2, BERICHT-angleich). */
  --hbl-raum-aktion: 48px;

  /* Lucide-Icons als Masken (24er Raster, Kontur 1,75). Farbe = currentColor. */
  --npz-i-telefon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
  --npz-i-route: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='3 11 22 2 13 21 11 13 3 11'/%3E%3C/svg%3E");
  --npz-i-aussen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E");
  --npz-i-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
  --npz-i-chevron-unten: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --npz-i-chevron-rechts: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  --npz-i-chevron-links: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  --npz-i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
  --npz-i-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
  --npz-i-menue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 6h16'/%3E%3Cpath d='M4 18h16'/%3E%3C/svg%3E");
  --npz-i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}
@media (max-width: 1024px) {
  :root { --npz-sektion: 56px; --npz-luecke: 32px; }
}
@media (max-width: 599px) {
  :root { --npz-knopf-h: 52px; --hbl-raum-aktion: 40px; }
}

/* HBL-Rollen auf die NPZ-Werte (Abschnitt 96 / 56; `aktion` bleibt 48 · 48 · 40). */
body.hbl-npz { --hbl-raum-sektion: var(--npz-sektion); }

/* --- Fugen zum HBL-Abstandssystem (Bauvertrag §0.2) ------------------------
   Jeder Abschnitt trägt sein Polster selbst (`npz-abschnitt`); zwischen Bühne,
   Inhalt und Standort-Band steht kein Aussenabstand. Das Seitenende kommt aus dem
   letzten Abschnitt bzw. dem Band (V14). */
body.hbl-npz .hbl-rumpf > .wp-block-group__inner-container > * + * { margin-top: 0; }
body.hbl-npz .site-content .hbl-rumpf > .wp-block-group__inner-container > :is(.npz-buehne, .npz-titelband, .npz-start-buehne):first-child { margin-top: 0; }
body.hbl-npz.one-container .site-content,
body.hbl-npz.separate-containers .site-content { padding-bottom: 0; }
body.hbl-npz .entry-content > .npz-abschnitt { margin-block: 0; }

/* Theme 0.9.6 (css/abstaende.css, Ebene A): Auf Seiten ohne `.hbl-hero` setzt es dem
   ersten Kind des Hauptbereichs die Rolle `kopf` (64 · 56 · 48) als Abstand zur
   Kopfkante. Die NPZ hat keine HBL-Bühne; ihre Bühnen und Titelbänder stossen bündig
   an den Kopf (Fassung 7.4), die 404 trägt ihren Abstand unten selbst. */
body.hbl-npz .site-content .site-main > :first-child { margin-top: 0; }

/* Bühne oben bündig unter dem Kopf: kein Polster von GP über dem Inhalt. */
body.hbl-npz .site-content:has(.hbl-rumpf :is(.npz-buehne, .npz-titelband, .npz-start-buehne)),
body.hbl-npz .content-area:has(.hbl-rumpf :is(.npz-buehne, .npz-titelband, .npz-start-buehne)) { padding-top: 0; }

/* Randlos: Bühne und Abschnitte brechen aus der 1224er-Spur des Rumpfs aus (wie
   .hbl-band; alignfull allein reicht in der constrained-Gruppe von GP nicht). */
body.hbl-npz .hbl-rumpf :is(.npz-buehne, .entry-content > .npz-abschnitt) {
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-100vw / 2 + 100% / 2) !important;
  margin-right: calc(-100vw / 2 + 100% / 2) !important;
}

/* --- Abschnitt ------------------------------------------------------------- */
body.hbl-npz .npz-abschnitt {
  box-sizing: border-box;
  margin-block: 0;
  padding: var(--npz-sektion) var(--npz-rand);
  background: var(--white);
}
body.hbl-npz .npz-abschnitt.npz-flaeche-blau { background: var(--blau-hell); }
/* GP begrenzt den Innenkasten randloser Gruppen (1240) — der Abschnitt nimmt die
   ganze Breite, sein Polster setzt die Spur. */
body.hbl-npz .npz-abschnitt > .wp-block-group__inner-container { max-width: none; margin: 0; padding: 0; }
body.hbl-npz .npz-abschnitt > :first-child,
body.hbl-npz .npz-abschnitt > .wp-block-group__inner-container > :first-child { margin-top: 0; }
body.hbl-npz .npz-abschnitt > :last-child,
body.hbl-npz .npz-abschnitt > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }

/* Ein Kreis bleibt ein Kreis: die globale Eckenglättung des Themes (corner-shape
   superellipse) machte aus border-radius 50 % ein weiches Quadrat. */
body.hbl-npz :is(.npz-status-punkt, .npz-logoband-halt, .npz-rund) { corner-shape: round; }

/* --- Fokusring (Teil a §1.6, Entscheid e11) --------------------------------
   Aussen 2 Slate, innen Weiss (Schatten füllt den Abstand) — sichtbar auf Hell
   und auf Slate. `:where()` hält die Spezifität bei 0; Radius nur für Textlinks
   (sonst schlüge er den Radius 12 der Knöpfe). */
body.hbl-npz :where(a, button, summary, input, select, textarea, [tabindex], .wp-block-button__link):focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--white);
}
body.hbl-npz :where(a:not(.wp-block-button__link), summary):focus-visible { border-radius: 4px; }

/* --- Link im Fliesstext (Teil a §14) ---------------------------------------
   Unterstrichen in der Textfarbe; Maus darüber Bronze. Auf Slate: Weiss. Gilt im
   Seiteninhalt — die Theme-Regel §24.4 hängt an .hbl-behandlung. */
body.hbl-npz .entry-content :is(p:not(.npz-textlink), li) a:not(.wp-block-button__link) {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
body.hbl-npz .entry-content :is(p:not(.npz-textlink), li) a:not(.wp-block-button__link):hover { color: var(--npz-bronze); }
body.hbl-npz :is(.npz-buehne, .npz-anrufband, .npz-titelband, .npz-standort, .has-slate-background-color) :is(p, li) a:not(.wp-block-button__link) { color: var(--white); }
body.hbl-npz :is(.npz-buehne, .npz-anrufband, .npz-titelband, .npz-standort, .has-slate-background-color) :is(p, li) a:not(.wp-block-button__link):hover { color: var(--taupe); }

/* --- Schriftklassen, die GP nicht abdeckt (Teil a §1.2) --------------------- */
body.hbl-npz .npz-text { font-size: 20px; line-height: 32px; font-weight: 400; }
body.hbl-npz .npz-lead { font-size: 22px; line-height: 33px; font-weight: 400; }
body.hbl-npz .npz-klein { font-size: 16px; line-height: 24px; }
body.hbl-npz .npz-mini { font-size: 14px; line-height: 20px; }
body.hbl-npz .npz-titel-h3 { font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: 0; }
body.hbl-npz .npz-ziffer { font-size: 44px; line-height: 48px; font-weight: 300; font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) {
  body.hbl-npz .npz-text { font-size: 17px; line-height: 27px; }
  body.hbl-npz .npz-lead { font-size: 19px; line-height: 28px; }
  body.hbl-npz .npz-titel-h3 { font-size: 22px; line-height: 28px; }
  body.hbl-npz .npz-ziffer { font-size: 32px; line-height: 36px; }
}

/* Überschriften: Silbentrennung statt Bruch mitten im Wort (GP setzt global
   word-break: break-word; Muster Theme). */
body.hbl-npz :is(h1, h2, h3) { word-break: normal; overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 10 4 4; }


/* --- 404 (Theme-Seite ohne NPZ-Entwurf) ------------------------------------
   Theme 0.9.6 hat die Abstände der 404 auf die HBL-Rollen umgestellt (style.css
   „404“, css/abstaende.css). Für die NPZ gilt der Stand, den Fassung 7.4 abgenommen
   hat (Theme 0.9.2): Kopfkante → Inhalt 40 + 96 (≤ 768: 30 + 64), Code → H1 24,
   H1 → Vorspann 48, Suche 32 darunter, Fuss 96 (≤ 768: 64). Werte gemessen am
   Stand vor dem Angleichen (BERICHT-angleich). */
body.hbl-npz.error404 .site-content { padding-top: 40px; }
body.hbl-npz.error404 .site-content .content-area { padding-top: 96px; padding-bottom: 96px; }   /* unten: Abnahme 17.11. Teil 4 Nr. 9 — die Suche stiess bündig an die Fusszeile */
body.hbl-npz.error404 .hbl-404 .hbl-404-kopf > .hbl-404-code { margin-top: 0; margin-bottom: 24px; }
body.hbl-npz.error404 .hbl-404 .hbl-404-kopf > h1 { margin-top: 0; margin-bottom: 48px; }
body.hbl-npz.error404 .hbl-404 .hbl-404-kopf > .hbl-vorspann { margin-top: 16px; margin-bottom: 0; }
body.hbl-npz.error404 .hbl-404 > .search-form { margin-top: 32px; gap: 12px; }
body.hbl-npz.error404 .hbl-404 > .hbl-404-fuss { margin-top: 96px; margin-bottom: 1.5em; gap: 10px; }
@media (max-width: 768px) {
  body.hbl-npz.error404 .site-content { padding-top: 30px; }
  body.hbl-npz.error404 .site-content .content-area { padding-top: 64px; padding-bottom: 64px; }
  body.hbl-npz.error404 .hbl-404 > .hbl-404-fuss { margin-top: 64px; }
}
