/*
 * HBS-Theme für Contao 6 – Heinrich-Böll-Schule Hattersheim
 *
 * Aufbau:
 *   1. Schriften und Variablen
 *   2. Grundlagen
 *   3. Servicebar, Kopfbereich, Navigation
 *   4. Hero
 *   5. Inhaltsbereich und Unternavigation
 *   6. Bausteine: Hinweis, News-Karten, Kacheln, Buttons
 *   7. Fußzeile
 *   8. Hilfsklassen
 */

/* 1. Schriften und Variablen ---------------------------------------------- */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
    /* HBS-Farben */
    --hbs-gruen: #c8d530;          /* Logo-Grün (seit 1.58.0): Flächen, Balken, Labels (nie als Textfarbe auf Weiß) */
    --hbs-gruen-text: #566a06;     /* Grün für Text und Links auf Weiß (Kontrast > 4.5:1) */
    --hbs-gruen-hell: #f8f9e4;     /* hinterlegte Flächen */
    --hbs-schwarz: #1a1a1a;
    --hbs-text: #2e2e2e;
    --hbs-grau: #5a5f55;           /* Datum, Nebeninfos */
    --hbs-linie: #e4e8dc;
    --hbs-band: #f6f7f3;           /* graue Bänder, z. B. Aktuelles */
    --hbs-platzhalter: #d8e0cb;
    --hbs-panel-deckkraft: 0.72;   /* Titel-Panel über Bildern: 1 = deckend schwarz, 0 = durchsichtig */

    /* Schrift */
    --hbs-font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
    --hbs-font-text: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

    /* Maße */
    --hbs-breite: 1200px;
    --hbs-rand: clamp(16px, 5vw, 48px);
    --hbs-radius: 4px;
    --hbs-abstand: clamp(40px, 5vw, 64px);

    /* Barrierefreie Contao-Navigation */
    --nav-breakpoint: 1024;
    --nav-color: var(--hbs-schwarz);
    --nav-active-color: var(--hbs-gruen-text);
    --nav-font-size: 17px;
    --nav-font-weight: 500;
    --nav-submenu-background: #fff;
    --nav-mobile-background: var(--hbs-schwarz);
    --nav-mobile-color: #fff;
    --nav-mobile-active-background: var(--hbs-schwarz);
    --nav-mobile-active-color: var(--hbs-gruen);
    --nav-mobile-active-border-color: var(--hbs-gruen);
    --nav-mobile-btn-clr: var(--hbs-gruen);
    --nav-mobile-padding: 110px 24px 32px;
    --nav-burger-line-color: var(--hbs-gruen);
    --skip-background: var(--hbs-schwarz);
    --skip-color: #fff;
    --skip-focus-border-color: var(--hbs-gruen);
}

/* 2. Grundlagen ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
    margin: 0;
    background: #fff;
    color: var(--hbs-text);
    font-family: var(--hbs-font-text);
    font-size: 1.0625rem;
    line-height: 1.6;
    overflow-x: clip; /* verhindert seitliches Scrollen bei vollbreiten Bändern */
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-weight: 600;
    line-height: 1.15;
    /* Lange Wörter („Berufsorientierungszentrum“) trennen statt überstehen (seit 1.46.0) */
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.25; }
h4 { font-size: 1.2rem; }

p, ul, ol, table, figure { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
/* Videos und eingebettete Inhalte nie breiter als ihre Spalte (sonst springt das Video beim Abspielen auf seine volle Größe, z. B. 1920 px) */
video, audio, iframe, embed, object { max-width: 100%; }

a { color: var(--hbs-gruen-text); text-underline-offset: 0.15em; }
a:hover { color: var(--hbs-schwarz); }

:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }

.hbs-container {
    width: 100%;
    max-width: calc(var(--hbs-breite) + 2 * var(--hbs-rand));
    margin-inline: auto;
    padding-inline: var(--hbs-rand);
}

.hbs-skip {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    padding: 12px 20px;
    background: var(--hbs-schwarz);
    color: #fff;
    font-weight: 700;
    border-radius: 0 0 4px 4px;
}
.hbs-skip:focus { top: 0; color: #fff; }

/* 3. Servicebar, Kopfbereich, Navigation ----------------------------------- */

.hbs-servicebar {
    background: var(--hbs-schwarz);
    color: #d9d9d9;
    font-size: 0.875rem;
    border-bottom: 1px solid #2e2e2e;
}
.hbs-servicebar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    min-height: 44px;
}
.hbs-servicebar__links { display: flex; align-items: center; gap: 24px; }
.hbs-servicebar__label {
    color: var(--hbs-gruen);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hbs-servicebar ul { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.hbs-servicebar a { color: #fff; font-weight: 600; text-decoration: none; }
.hbs-servicebar a:hover { color: var(--hbs-gruen); }
.hbs-servicebar__kontakt { display: flex; gap: 24px; }
.hbs-servicebar__kontakt a { display: inline-flex; align-items: center; gap: 8px; color: #d9d9d9; font-weight: 400; }

.hbs-header {
    position: relative;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid var(--hbs-linie);
}
.hbs-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    min-height: 96px;
}

.hbs-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--hbs-schwarz);
    text-decoration: none;
    position: relative;
    z-index: 7;
}
.hbs-logo img { height: 72px; width: auto; max-width: none; }
.hbs-logo :is(figure, .mod_randomImage, .image_container) { margin: 0; }
.hbs-logo__mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: var(--hbs-gruen);
    font-family: var(--hbs-font-display);
    font-weight: 700;
    font-size: 1.2rem;
}
.hbs-logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.hbs-logo__text strong { font-family: var(--hbs-font-display); font-weight: 600; font-size: 1.3rem; }
.hbs-logo__text span { font-size: 0.875rem; color: var(--hbs-grau); }

.hbs-header__nav { display: flex; align-items: center; gap: 16px; }

/* Desktop-Navigation */
body.nav-is-desktop .navigation-main .level_1 > li > :is(a, strong) {
    font-family: var(--hbs-font-display);
    padding: 12px 4px;
}
body.nav-is-desktop .navigation-main .level_1 > li > :is(a.trail, strong) {
    color: var(--hbs-schwarz);
    box-shadow: inset 0 -3px 0 var(--hbs-gruen);
}
body.nav-is-desktop .navigation-main .level_1 ul { border-radius: 0; border-top: 4px solid var(--hbs-gruen); }
/* Pfeil zum Aufklappen vertikal zur Beschriftung ausrichten und etwas Luft zum nächsten Punkt */
body.nav-is-desktop .navigation-main .level_1 { gap: 0 1.75rem; }
body.nav-is-desktop .navigation-main .level_1 > li.submenu { padding-right: 26px; }
body.nav-is-desktop .navigation-main .level_1 > li > .btn-toggle-submenu {
    top: 0;
    bottom: 0;
    width: 26px;
    height: auto;
}
body.nav-is-desktop .navigation-main .level_1 > li > .btn-toggle-submenu::after { background-size: 16px; }

/* Suchfeld im Kopfbereich (Modul "Suchmaschine" im Slot navigation) */
.hbs-header .mod_search form,
.hbs-header .mod_search .formbody { display: flex; gap: 8px; margin: 0; }
.hbs-header .mod_search input[type="search"] {
    width: 11rem;
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid var(--hbs-schwarz);
    border-radius: 4px;
    font: inherit;
}
.hbs-header .mod_search button { display: none; }

/* Eilmeldung: rotes Band unter dem Kopf (Inhaltselement „Eilmeldung“) */
.hbs-eilmeldung { background: #b3261e; color: #fff; }
.hbs-eilmeldung__inner {
    display: flex;
    align-items: center;
    gap: 14px 18px;
    padding-block: 14px;
}
.hbs-eilmeldung__inner + .hbs-eilmeldung__inner { border-top: 1px solid rgb(255 255 255 / 0.35); }
.hbs-eilmeldung__symbol { flex: 0 0 auto; }
.hbs-eilmeldung__text { flex: 1 1 auto; min-width: 0; }
.hbs-eilmeldung__text p { margin: 0; line-height: 1.4; }
.hbs-eilmeldung__titel { font-family: var(--hbs-font-display); font-size: 1.125rem; font-weight: 700; }
.hbs-eilmeldung__label {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fff;
    color: #b3261e;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 0.15em;
}
.hbs-eilmeldung__link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 2px solid #fff;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.hbs-eilmeldung__link:hover { background: #fff; color: #b3261e; }
.hbs-eilmeldung__link:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 699px) {
    .hbs-eilmeldung__inner { flex-wrap: wrap; align-items: flex-start; }
    .hbs-eilmeldung__symbol { width: 22px; height: 22px; margin-top: 2px; }
    .hbs-eilmeldung__text { flex-basis: calc(100% - 40px); }
    .hbs-eilmeldung__link { margin-left: 40px; }
}

/* 4. Hero ------------------------------------------------------------------ */

.hbs-hero { position: relative; }
.hbs-hero .mod_article { position: relative; }
.hbs-hero figure { margin: 0; background: #cdd6be; }
.hbs-hero img { width: 100%; height: clamp(240px, 38vw, 520px); object-fit: cover; }

/* Die erste Überschrift im Hero liegt als schwarzes Panel über dem Bild */
.hbs-hero .mod_article > :is(.content-headline, .content-text) {
    position: relative;
    z-index: 2;
    width: min(780px, calc(100% - 2 * var(--hbs-rand)));
    margin: 0;
    padding: 40px 48px 44px;
    background: var(--hbs-schwarz);
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    border-radius: 4px;
}
.hbs-hero .mod_article > :is(.content-headline, .content-text)::before {
    content: "";
    display: block;
    width: 64px;
    height: 6px;
    margin-bottom: 20px;
    background: var(--hbs-gruen);
}

/* Panel als Text-Element: Begrüßung (h1) und kurze Unterzeile */
.hbs-hero .mod_article > .content-text h1 { margin: 0; color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
.hbs-hero .mod_article > .content-text h1::before { display: none; }
.hbs-hero .mod_article > .content-text p { max-width: 60ch; margin: 14px 0 0; color: #e8e8e8; font-family: var(--hbs-font-text); font-size: 1.05rem; line-height: 1.55; }
.hbs-hero .mod_article > .content-text strong { color: #fff; }

/* Auf breiten Bildschirmen ragt das Panel unten 64px aus dem Bild heraus */
@media (min-width: 1024px) {
    .hbs-hero .mod_article > :is(.content-headline, .content-text) {
        position: absolute;
        bottom: -64px;
        left: max(var(--hbs-rand), calc((100% - var(--hbs-breite)) / 2));
    }
    .hbs-hero + .hbs-content { padding-top: calc(64px + 40px); }
}

/* Seitenkopf der Unterseiten: Headerbild mit Panel für Bereich und Titel */
.hbs-seitenkopf { position: relative; }
.hbs-seitenkopf__bild { background: #cdd6be; }
.hbs-seitenkopf__bild :is(figure, picture) { display: block; margin: 0; }
.hbs-seitenkopf__bild img { width: 100%; height: clamp(200px, 25vw, 360px); object-fit: cover; }
.hbs-seitenkopf__panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px var(--hbs-rand) 26px;
    background: var(--hbs-schwarz);
    color: #fff;
}
.hbs-seitenkopf__bereich {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--hbs-gruen);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.hbs-seitenkopf__bereich::before { content: ""; width: 40px; height: 5px; background: var(--hbs-gruen); }
.hbs-seitenkopf h1 { margin: 0; color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.1; }
.hbs-seitenkopf__panel:not(:has(.hbs-seitenkopf__bereich)) h1::before {
    content: "";
    display: block;
    width: 40px;
    height: 5px;
    margin-bottom: 14px;
    background: var(--hbs-gruen);
}

@media (min-width: 1024px) {
    .hbs-seitenkopf:not(.hbs-seitenkopf--ohne-bild) .hbs-seitenkopf__panel {
        position: absolute;
        bottom: -48px;
        left: max(var(--hbs-rand), calc((100% - var(--hbs-breite)) / 2));
        min-width: 460px;
        max-width: 780px;
        padding: 28px 40px 32px;
        border-radius: 4px;
    }
    .hbs-seitenkopf:not(.hbs-seitenkopf--ohne-bild) + .hbs-content { padding-top: calc(48px + 40px); }
    .hbs-seitenkopf--ohne-bild .hbs-seitenkopf__panel { padding-inline: max(var(--hbs-rand), calc((100% - var(--hbs-breite)) / 2)); }
}

/* Titel-Panels über dem Bild leicht durchscheinend mit Unschärfe (nur wo sie über dem Bild liegen) */
@media (min-width: 1024px) {
    .hbs-hero .mod_article > :is(.content-headline, .content-text),
    .hbs-seitenkopf:not(.hbs-seitenkopf--ohne-bild) .hbs-seitenkopf__panel {
        background: rgba(26, 26, 26, var(--hbs-panel-deckkraft));
        -webkit-backdrop-filter: blur(10px) saturate(1.1);
        backdrop-filter: blur(10px) saturate(1.1);
    }
}

/* 5. Inhaltsbereich und Unternavigation ------------------------------------ */

.hbs-content {
    padding-block: var(--hbs-abstand);
    display: grid;
    gap: 56px;
}
.hbs-content:has(> .hbs-sidebar) { grid-template-columns: 260px minmax(0, 1fr); }
.hbs-content:has(> .hbs-randspalte) { grid-template-columns: minmax(0, 1fr) 300px; }
.hbs-content:has(> .hbs-sidebar):has(> .hbs-randspalte) { grid-template-columns: 230px minmax(0, 1fr) 280px; gap: 48px; }
.hbs-main { min-width: 0; container: hauptspalte / inline-size; }
.hbs-main > .mod_article + .mod_article { margin-top: var(--hbs-abstand); }

/* Fließtext nicht zu breit */
.hbs-main { --hbs-lesebreite: 38rem; } /* = 72 Zeichen Fließtext */
.hbs-main .content-text { max-width: var(--hbs-lesebreite); display: flow-root; }
/* hbs-volle-breite (seit 1.46.0 an jedem Element): ohne Lesebreite */
.hbs-main .mod_article > .hbs-volle-breite { max-width: none; }
/* Lesebreite (seit 1.47.0): Nur einspaltiger Fließtext, Überschriften, Bilder und Buttons enden an der
   Lesebreite. Alles mit eigenem Rahmen oder Hintergrund (Kästen, Kontaktkarten, Akkordeon, Downloads,
   Tabellen-Element, Video) und zweispaltige Elemente (hbs-anreise, hbs-portrait, hbs-intro) nutzen
   die volle Breite. Übersichten (Artikel mit Kachel- oder Infokarten-Raster) laufen ganz voll.
   Ausnahme auf Wunsch: Klasse hbs-volle-breite am Element oder (seit 1.47.0) am Artikel.
   Die Startseite bleibt außen vor. */
.hbs-main .mod_article:has(> :is(.hbs-kacheln, .hbs-karten)) > .content-text,
.hbs-main .mod_article.hbs-volle-breite > .content-text { max-width: none; }
.hbs-main .mod_article.hbs-volle-breite .content-image figure { max-width: none; }
body:not(:has(.hbs-hero)) .hbs-main .mod_article:not(.hbs-volle-breite):not(:has(> :is(.hbs-kacheln, .hbs-karten))) > :not(.hbs-volle-breite):is(
    .content-headline, .content-image:not(.hbs-banner), .content-hyperlink, .hbs-button
) { max-width: var(--hbs-lesebreite); }

.hbs-sidebar .navigation-main,
.hbs-sidebar nav ul { margin: 0; padding: 0; list-style: none; }
.hbs-sidebar nav a,
.hbs-sidebar nav strong {
    display: block;
    padding: 10px 14px;
    border-radius: 0;           /* seit 1.58.1: eckig, der grüne Strich schließt gerade ab */
    color: var(--hbs-schwarz);
    text-decoration: none;
    font-weight: 600;
}
.hbs-sidebar nav a:hover { background: var(--hbs-gruen-hell); }
/* Aktuelle Seite */
.hbs-sidebar nav strong { background: var(--hbs-gruen-hell); box-shadow: inset 4px 0 0 var(--hbs-gruen); }
/* Übergeordnete Seite der aktuellen Seite: nur farbig, damit die aktuelle Seite hervorsticht */
.hbs-sidebar nav a.trail { color: var(--hbs-gruen-text); }
/* Aufgeklappte Unterpunkte: eingerückt mit Linie, etwas kleiner */
.hbs-sidebar nav ul ul {
    margin: 2px 0 8px 14px;
    padding-left: 8px;
    border-left: 2px solid var(--hbs-linie);
    font-size: 0.95rem;
}
.hbs-sidebar nav ul ul :is(a, strong) { padding-block: 7px; font-weight: 500; }
.hbs-sidebar nav ul ul strong { font-weight: 700; }
/* Seit 1.60.0: Kein eigener grüner Strich in der zweiten Ebene – die graue Linie läuft an den
   Einträgen entlang und wird neben der aktiven Seite dick und grün (mittig auf der Linie). */
.hbs-sidebar nav ul ul { padding-left: 0; border-left: 0; }
.hbs-sidebar nav ul ul > li { border-left: 2px solid var(--hbs-linie); }
.hbs-sidebar nav ul ul > li.active { margin-left: -1px; border-left: 4px solid var(--hbs-gruen); }
.hbs-sidebar nav ul ul :is(a, strong) { padding-left: 20px; }
.hbs-sidebar nav ul ul > li.active > strong { padding-left: 19px; box-shadow: none; }
/* Seit 1.61.1: Abstand der dritten Ebene bleibt im Eintrag, sonst reißt die graue Linie darunter ab */
.hbs-sidebar nav ul ul > li { display: flow-root; }

/* Kontaktfeld im Inhalt (Elementgruppe hbs_kontakte, je Person ein Text-Element) */
.hbs-kontakte {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
@container hauptspalte (min-width: 560px) {
    .hbs-kontakte:has(> .content-text:nth-of-type(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container hauptspalte (min-width: 860px) {
    .hbs-kontakte:has(> .content-text:nth-of-type(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hbs-kontakte > :is(h3, h4) {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-text);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.hbs-kontakte > .content-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    column-gap: 20px;
    max-width: none;
    padding: 22px 24px;
    border-radius: 0;
    border-top: 4px solid var(--hbs-gruen);
    background: var(--hbs-gruen-hell);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-wrap: break-word;
}
.hbs-kontakte > .content-text:has(> figure) { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.hbs-kontakte > .content-text > figure { float: none; margin: 0; }
.hbs-kontakte > .content-text > figure img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--hbs-gruen);
}
.hbs-kontakte .rte > p { margin: 0 0 0.3em; }
.hbs-kontakte .rte > p:first-child {
    margin-bottom: 0.4em;
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-size: 1.1rem;
    line-height: 1.3;
}
.hbs-kontakte .rte > p:first-child strong { font-weight: 600; }
.hbs-kontakte .rte > :last-child { margin-bottom: 0; }

/* Personenkarten: Abschnittsüberschrift (h2) – Stil aus dem Überschriften-System */
.hbs-kontakte > h2 { grid-column: 1 / -1; }

/* Einzelne Kontaktkarte mit Label (z. B. „Kontakt“, seit 1.46.2): Das Label steht IM Kasten –
   wie „Kontakt“, „Downloads“ und „Weitere Seiten“ in der rechten Spalte. Die Gruppe wird zum Kasten. */
.hbs-main .hbs-kontakte:not(.hbs-kontakte--kompakt):not(:has(> .content-text:nth-of-type(2))):has(> :is(h3, h4)) {
    gap: 0;
    padding: 20px 24px 22px;
    border-radius: 0;
    border-top: 4px solid var(--hbs-gruen);
    background: var(--hbs-gruen-hell);
}
.hbs-main .hbs-kontakte:not(.hbs-kontakte--kompakt):not(:has(> .content-text:nth-of-type(2))):has(> :is(h3, h4)) > :is(h3, h4) {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 122, 12, 0.2);
    font-size: 0.8125rem;
}
.hbs-main .hbs-kontakte:not(.hbs-kontakte--kompakt):not(:has(> .content-text:nth-of-type(2))):has(> :is(h3, h4)) > .content-text {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}
.hbs-main .mod_article > .hbs-kontakte + .hbs-kontakte { margin-top: 48px; }

/* Mehrere große Karten: Foto oben, Text darunter */
.hbs-kontakte:has(> .content-text:nth-of-type(2)) > .content-text:has(> figure) {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 14px;
}
@container hauptspalte (min-width: 860px) {
    .hbs-kontakte:not(.hbs-kontakte--kompakt):has(> .content-text:nth-of-type(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Kompakte Karten für Gremien: ohne Foto, dichter, mehr pro Reihe */
.hbs-kontakte--kompakt { gap: 12px; }
.hbs-kontakte--kompakt > .content-text {
    padding: 14px 18px;
    border-top-width: 3px;
    font-size: 0.9rem;
}
.hbs-kontakte--kompakt .rte > p:first-child { margin-bottom: 0.15em; font-size: 1rem; }
.hbs-kontakte--kompakt .rte > p:not(:first-child) { color: var(--hbs-grau); }
@container hauptspalte (min-width: 560px) {
    .hbs-kontakte--kompakt:has(> .content-text:nth-of-type(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container hauptspalte (min-width: 700px) {
    .hbs-kontakte--kompakt:has(> .content-text:nth-of-type(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container hauptspalte (min-width: 900px) {
    .hbs-kontakte--kompakt:has(> .content-text:nth-of-type(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Rechte Spalte (z. B. Ansprechpartner, Downloads) */
.hbs-randspalte { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
/* Jedes Inhaltselement der rechten Spalte ist ein eigener Kasten */
.hbs-randspalte .mod_article { display: flex; flex-direction: column; gap: 24px; }
.hbs-randspalte .mod_article > * {
    margin: 0;
    padding: 24px;
    border-radius: 0;
    background: var(--hbs-gruen-hell);
    border-top: 4px solid var(--hbs-gruen);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-wrap: break-word;
}
/* Ohne Kasten (seit 1.58.2): Bild, Galerie und Video automatisch, sonst über das Feld
   „Kasten in der rechten Spalte“ (Klasse hbs-ohne-kasten); hbs-mit-kasten erzwingt den Kasten. */
.hbs-randspalte .mod_article > :is(.content-image, .content-gallery, .content-player):not(.hbs-mit-kasten),
.hbs-randspalte .mod_article > .hbs-ohne-kasten {
    padding: 0;
    border-top: 0;
    background: none;
}
.hbs-randspalte .content-text { max-width: none; }
.hbs-randspalte p { margin: 0 0 0.35em; }
.hbs-randspalte .mod_article > * > :last-child,
.hbs-randspalte .rte > :last-child { margin-bottom: 0; }

/* Erste Überschrift als kleine Kennzeichnung, z. B. "Kontakt" */
.hbs-randspalte :is(h2, h3, h4, h5, h6) {
    margin: 1em 0 0.2em;
    font-size: 1rem;
    line-height: 1.3;
}
.hbs-randspalte .mod_article > * > :is(h2, h3, h4, h5, h6):first-child,
.hbs-randspalte .mod_article > * > .rte > :is(h2, h3, h4, h5, h6):first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 122, 12, 0.2);
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-text);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Namen: Absatz, der nur aus fettem Text besteht. Die Namensschrift gilt nur für den
   fetten Namen selbst, damit eine Funktion dahinter (auch nach <br> im <strong>) normal bleibt. */
.hbs-randspalte p:has(> strong:only-child) {
    margin: 0 0 0.3em;
    color: var(--hbs-schwarz);
}
.hbs-randspalte p:has(> strong:only-child) > strong,
.hbs-randspalte .content-text:has(a:is([href^="mailto:"], [href^="tel:"])) p > strong:first-child {
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}
/* Weitere Personen im selben Kasten durch eine Linie trennen */
.hbs-randspalte * + p:has(> strong:only-child) {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(74, 122, 12, 0.2);
}
.hbs-randspalte :is(h2, h3, h4, h5, h6) + p:has(> strong:only-child) {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Abstand zwischen Name (bzw. Funktion) und der ersten Zeile mit Telefon oder E-Mail (seit 1.51.0) */
:is(.hbs-randspalte, .hbs-kontakte) .rte > p:not(:has(a:is([href^="mailto:"], [href^="tel:"]))) + p:has(> a:is([href^="mailto:"], [href^="tel:"])) { margin-top: 10px; }

/* Telefon und E-Mail mit Symbol */
/* Lange E-Mail-Adressen: bevorzugt nach dem @ umbrechen (Skript setzt dort <wbr>), notfalls irgendwo */
a[href^="mailto:"] { overflow-wrap: anywhere; }
/* Lange Adressen als Linktext (z. B. https://…) dürfen umbrechen, statt die Spalte zu sprengen */
.hbs-main .rte a, .hbs-right .rte a { overflow-wrap: anywhere; }
:is(.hbs-randspalte, .hbs-kontakte) a:is([href^="mailto:"], [href^="tel:"]) { min-width: 0; }
/* Adresstext als ein einziges Flex-Element (Skript fasst ihn in span.hbs-mail-text) */
a[href^="mailto:"] .hbs-mail-text { min-width: 0; }
:is(.hbs-randspalte, .hbs-kontakte) a:is([href^="mailto:"], [href^="tel:"]) {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    color: var(--hbs-schwarz);
    font-weight: 600;
    text-decoration: none;
}
:is(.hbs-randspalte, .hbs-kontakte) a:is([href^="mailto:"], [href^="tel:"])::before {
    content: "";
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-top: -3px;
    border-radius: 50%;
    background: #fff no-repeat center / 16px;
}
:is(.hbs-randspalte, .hbs-kontakte) a[href^="mailto:"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/></svg>'); }
:is(.hbs-randspalte, .hbs-kontakte) a[href^="tel:"]::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z"/></svg>'); }
:is(.hbs-randspalte, .hbs-kontakte) a:is([href^="mailto:"], [href^="tel:"]):hover {
    color: var(--hbs-gruen-text);
    text-decoration: underline;
    text-decoration-color: var(--hbs-gruen);
    text-decoration-thickness: 2px;
}
.hbs-randspalte p:has(> a:is([href^="mailto:"], [href^="tel:"]):only-child) { margin-bottom: 0.15em; }

/* Galerie in der rechten Spalte (z. B. Siegel): untereinander, mittig */
.hbs-randspalte .content-gallery ul { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.hbs-randspalte .content-gallery li { margin: 0; }
.hbs-randspalte .content-gallery figure { margin: 0; }
.hbs-randspalte .content-gallery img { width: auto; max-width: 200px; height: auto; border-radius: 4px; background: #fff; }

/* Link-Listen in der rechten Spalte (z. B. „Links“): wie Downloads, mit Symbol für externe Seiten */
.hbs-randspalte .rte ul:has(> li > a) { margin: 0; padding: 0; list-style: none; }
.hbs-randspalte .rte ul:has(> li > a) > li {
    position: relative;
    padding: 9px 0 9px 40px;
    border-top: 1px solid rgba(74, 122, 12, 0.15);
}
.hbs-randspalte .rte ul:has(> li > a) > li:first-child { border-top: 0; }
.hbs-randspalte .rte ul:has(> li > a) > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>') no-repeat center / 15px;
}
.hbs-randspalte .rte ul:has(> li > a) > li > a { color: var(--hbs-schwarz); font-weight: 600; text-decoration: none; }
.hbs-randspalte .rte ul:has(> li > a) > li > a:hover { color: var(--hbs-gruen-text); text-decoration: underline; text-decoration-color: var(--hbs-gruen); }

/* Mehrere Personen mit Foto in einem Kontakt-Kasten: Abstand und Linie über dem Foto */
.hbs-randspalte .content-text:has(a:is([href^="mailto:"], [href^="tel:"])) :not(h2, h3, h4, h5, h6) + :is(figure, p:has(> img:only-child)) {
    margin-top: 20px !important;
    padding-top: 20px;
    border-top: 1px solid rgba(74, 122, 12, 0.2);
}

/* Name direkt nach einem Foto: keine Trennlinie */
.hbs-randspalte :is(figure, p:has(> img:only-child)) + p:has(> strong:only-child) {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Downloads-Kasten: Contao-Element "Downloads" in der rechten Spalte (oder Artikel mit Klasse "hbs-downloads") */
.hbs-randspalte :is(.hbs-downloads, .content-downloads) ul { margin: 0; padding: 0; list-style: none; }
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li {
    position: relative;
    padding: 10px 0 10px 40px;
    border-top: 1px solid rgba(74, 122, 12, 0.15);
}
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li:first-child { border-top: 0; padding-top: 2px; }
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5M12 12v6M9 15l3 3 3-3"/></svg>') no-repeat center / 16px;
}
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li:first-child::before { top: 0; }
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li a {
    display: block;
    color: var(--hbs-schwarz);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li a:hover { color: var(--hbs-gruen-text); text-decoration: underline; text-decoration-color: var(--hbs-gruen); }
/* Die ganze Zeile ist klickbar */
/* Klickfläche nur in den Listenzeilen (seit 1.58.3: sonst deckte sie bei Bildern im selben Artikel die Seite ab) */
.hbs-randspalte :is(.hbs-downloads, .content-downloads) li a::after { content: ""; position: absolute; inset: 0; }
.hbs-randspalte .hbs-dateiinfo { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--hbs-grau); }

/* Links-Kasten: Text-Element mit Klasse „hbs-links“ (Überschrift + Liste von Links), gestaltet wie Downloads */
.hbs-randspalte .hbs-links ul { margin: 0; padding: 0; list-style: none; }
.hbs-randspalte .hbs-links li { position: relative; margin: 0; padding: 10px 0 10px 40px; border-top: 1px solid rgba(74, 122, 12, 0.15); }
.hbs-randspalte .hbs-links li:first-child { border-top: 0; padding-top: 2px; }
.hbs-randspalte .hbs-links li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></svg>') no-repeat center / 16px;
}
.hbs-randspalte .hbs-links li:first-child::before { top: 0; }
.hbs-randspalte .hbs-links li a { display: block; color: var(--hbs-schwarz); font-weight: 600; line-height: 1.35; text-decoration: none; }
.hbs-randspalte .hbs-links li a:hover { color: var(--hbs-gruen-text); text-decoration: underline; text-decoration-color: var(--hbs-gruen); }
.hbs-randspalte .hbs-links li a::after { content: ""; position: absolute; inset: 0; }
.hbs-randspalte .hbs-links li a[target="_blank"] { padding-right: 20px; background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17 17 7M9 7h8v8"/></svg>') no-repeat right 2px top 3px; }
.hbs-randspalte .hbs-linkinfo { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--hbs-grau); }

/* Partner-Kasten: Elementgruppe mit Template hbs_partner (Logo, kurzer Text, Link) */
.hbs-partner {
    position: relative;
    padding: 24px;
    border: 1px solid var(--hbs-linie);
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.15s;
}
.hbs-randspalte .mod_article > .hbs-partner { border: 1px solid var(--hbs-linie); background: #fff; }
.hbs-main .hbs-partner { max-width: 420px; margin: 0 0 1.5em; }
.hbs-partner:has(a):hover { border-color: var(--hbs-gruen); }
.hbs-partner:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-randspalte .mod_article > .hbs-partner > :is(h2, h3, h4, h5, h6):first-child { border-bottom-color: var(--hbs-linie); }
.hbs-partner .content-text { max-width: none; }
.hbs-partner figure { float: none !important; margin: 0 0 14px !important; }
.hbs-randspalte .hbs-partner img,
.hbs-partner img { display: block; width: auto; max-width: 100%; height: auto; max-height: 56px; border-radius: 0; }
.hbs-partner p { margin: 0 0 0.35em; }
.hbs-partner p:last-child:has(> a:only-child) { margin: 12px 0 0; }
.hbs-partner p:last-child > a:only-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hbs-schwarz);
    font-weight: 700;
    text-decoration: none;
}
.hbs-partner p:last-child > a:only-child::before { content: ""; position: absolute; inset: 0; border-radius: 4px; }
.hbs-partner p:last-child > a:only-child:focus-visible { outline: none; }
.hbs-partner p:last-child > a:only-child::after {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') no-repeat center;
}
/* Externe Links: Pfeil nach rechts oben */
.hbs-partner p:last-child > a:only-child:is([target="_blank"], [href^="http"])::after {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17 17 7M9 7h8v8"/></svg>');
}
.hbs-partner:hover p:last-child > a:only-child { text-decoration: underline; text-decoration-color: var(--hbs-gruen); }

/* Zusatzzeilen mit Symbol: Absatz-Klassen hbs-fax, hbs-zeit, hbs-achtung */
.hbs-main p:is(.hbs-fax, .hbs-zeit, .hbs-achtung),
.hbs-randspalte p:is(.hbs-fax, .hbs-zeit, .hbs-achtung) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
}
:is(.hbs-main, .hbs-randspalte) p:is(.hbs-fax, .hbs-zeit, .hbs-achtung)::before {
    content: "";
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-top: -3px;
    border-radius: 50%;
    background: #fff no-repeat center / 16px;
}
:is(.hbs-main, .hbs-randspalte) p.hbs-fax { font-weight: 600; color: var(--hbs-schwarz); }
:is(.hbs-main, .hbs-randspalte) p.hbs-fax::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9V3h12v6"/><rect x="3" y="9" width="18" height="9" rx="2"/><path d="M6 14h12v7H6z"/></svg>'); }
:is(.hbs-main, .hbs-randspalte) p.hbs-zeit::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>'); }
:is(.hbs-main, .hbs-randspalte) p.hbs-achtung { color: #9a4d00; font-weight: 600; }
:is(.hbs-main, .hbs-randspalte) p.hbs-achtung::before { background-color: #fff4e6; background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b35c00" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3l10 18H2z"/><path d="M12 10v5M12 18h.01"/></svg>'); }

/* Kasten mit Foto (Bild hinzufügen) und Überschrift im Text: Überschrift („Kontakt“) steht über dem Foto */
.hbs-randspalte .content-text:has(> figure + .rte > :is(h2, h3, h4, h5, h6):first-child) { display: flex; flex-direction: column; }
.hbs-randspalte .content-text:has(> figure + .rte > :is(h2, h3, h4, h5, h6):first-child) > .rte { display: contents; }
.hbs-randspalte .content-text:has(> figure + .rte > :is(h2, h3, h4, h5, h6):first-child) > .rte > :first-child { order: -1; }
.hbs-randspalte .content-text:has(> figure + .rte > :is(h2, h3, h4, h5, h6):first-child) > figure { align-self: flex-start; }

/* Bilder: Fotos in Kontakt-Kästen rund, sonst über die volle Breite */
.hbs-randspalte figure { float: none !important; margin: 0 0 16px !important; }
.hbs-randspalte img { width: 100%; height: auto; border-radius: 4px; }
/* Mehr Luft zwischen Überschrift (z. B. "Oberstufenleitung") und Foto */
.hbs-randspalte :is(h2, h3, h4, h5, h6) + figure,
.hbs-randspalte :is(h2, h3, h4, h5, h6) + p:has(> img:only-child) { margin-top: 16px !important; }
.hbs-randspalte .content-text:has(a:is([href^="mailto:"], [href^="tel:"])) img {
    width: 136px;
    height: 136px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px var(--hbs-gruen);
}

/* Überschriften – EIN System für alle Inhaltsseiten
   Stufe 1  Seitentitel (h1 im Seitenkopf): Balken oben (siehe Seitenkopf)
   Stufe 2  Abschnitt (h2): IMMER Balken 40×4 oben – egal ob im Text, im Feld „Überschrift“ eines Elements,
            als Element „Überschrift“ oder über einer Gruppe (Kacheln, Kontakte, Zeitstrahl, Downloads, Video …)
   Stufe 3  Unterabschnitt (h3): IMMER Balken 28×3 oben
   Stufe 4  h4–h6: grün, ohne Balken
   Bausteine (Kachel, Karte, Kasten, Akkordeon-Zeile, News, Termine, Jahreszahl im Zeitstrahl): nie Balken
   Einleitung (hbs-intro): seit 1.50.0 wie normaler Text, Überschrift wie jede h2
   Startseite: nicht im System – eigene Bandtitel mit breitem Balken unten (.hbs-titel und Kachelgruppen)
   Spezifität bewusst niedrig (:where), damit Abstände der Bausteine weiter greifen. */
.hbs-main :where(
    .rte > h2,
    .mod_article > :is(.content-text, .content-headline, .content-player, .content-downloads, .content-download, .content-image, .content-gallery, .content-table, .content-accordion, .content-element-group, .hbs-kontakte, .hbs-kacheln, .hbs-zeitstrahl) > h2,
    .mod_article > h2.content-headline,
    .content-element-group > h2,
    .mod_newslist > h2
):where(:not(.hbs-titel, .hbs-unsichtbar, .handorgel__header, .hbs-hinweis > *, .hbs-hero + .hbs-content *)) {
    clear: both;
    margin: 2.2em 0 0.6em;
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
}
.hbs-main :where(
    .rte > h2,
    .mod_article > :is(.content-text, .content-headline, .content-player, .content-downloads, .content-download, .content-image, .content-gallery, .content-table, .content-accordion, .content-element-group, .hbs-kontakte, .hbs-kacheln, .hbs-zeitstrahl) > h2,
    .mod_article > h2.content-headline,
    .content-element-group > h2,
    .mod_newslist > h2
):where(:not(.hbs-titel, .hbs-unsichtbar, .handorgel__header, .hbs-hinweis > *, .hbs-hero + .hbs-content *))::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin-bottom: 14px;
    background: var(--hbs-gruen);
}
.hbs-main :where(
    .rte > h3,
    .mod_article > :is(.content-text, .content-headline, .content-player, .content-downloads, .content-download, .content-image, .content-gallery, .content-table, .content-element-group) > h3,
    .mod_article > h3.content-headline
):where(:not(.hbs-unsichtbar, .handorgel__header, .hbs-hinweis > *, .hbs-kacheln > *, .hbs-karten > *, .hbs-kontakte > *, .hbs-zeitstrahl > *)) {
    clear: both;
    margin: 1.8em 0 0.5em;
    font-size: 1.3rem;
    line-height: 1.3;
}
.hbs-main :where(
    .rte > h3,
    .mod_article > :is(.content-text, .content-headline, .content-player, .content-downloads, .content-download, .content-image, .content-gallery, .content-table, .content-element-group) > h3,
    .mod_article > h3.content-headline
):where(:not(.hbs-unsichtbar, .handorgel__header, .hbs-hinweis > *, .hbs-kacheln > *, .hbs-karten > *, .hbs-kontakte > *, .hbs-zeitstrahl > *))::before {
    content: "";
    display: block;
    width: 28px;
    height: 3px;
    margin-bottom: 10px;
    background: var(--hbs-gruen);
}
.hbs-main :where(.rte, .mod_article > .content-text) > :is(h4, h5, h6) {
    clear: both;
    margin: 1.6em 0 0.35em;
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}
/* Überschriften über Gruppen: Abstand kommt von der Gruppe selbst */
.hbs-main .mod_article > :is(.content-element-group, .hbs-kontakte, .hbs-kacheln, .hbs-zeitstrahl, .content-accordion, .content-downloads, .content-download, .content-player, .content-image, .content-gallery, .content-table) > :is(h2, h3):first-child { margin-top: 0; }
/* Erste Überschrift der Seite: kein Abstand nach oben – der Balken bleibt (gleiches Bild auf jeder Seite) */
.hbs-main .rte > :first-child:not(h2, h3) { margin-top: 0; }
.hbs-main > .mod_article:first-child > :first-child > :is(h2, h3):first-child,
.hbs-main > .mod_article:first-child > :first-child > .rte > :is(h2, h3):first-child,
.hbs-main > .mod_article:first-child > h2.content-headline:first-child { margin-top: 0; }

/* Leitsatz (Motto am Seitenanfang, keine Überschrift): <p class="hbs-leitsatz"> */
.hbs-main .rte > p.hbs-leitsatz {
    margin: 0 0 1em;
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-display);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 600;
    line-height: 1.3;
}

/* Zitate im Text: Kasten mit großem Anführungszeichen */
.hbs-main .rte > blockquote {
    position: relative;
    clear: both;
    margin: 32px 0;
    padding: 28px 32px 26px 84px;
    border-radius: var(--hbs-radius);
    background: var(--hbs-gruen-hell);
}
.hbs-main .rte > blockquote::before {
    content: "\201E";
    position: absolute;
    left: 26px;
    top: -14px;
    color: var(--hbs-gruen);
    font-family: var(--hbs-font-display);
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
}
.hbs-main .rte > blockquote p {
    margin: 0;
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 500;
    line-height: 1.45;
}
.hbs-main .rte > blockquote p:has(> cite) { margin-top: 12px; }
.hbs-main .rte > blockquote cite {
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-text);
    font-size: 0.95rem;
    font-style: normal;
    font-weight: 600;
}
.hbs-main .rte > blockquote cite::before { content: "– "; }
/* Ohne Skript: Absätze mit Klasse hbs-zitat sehen schon wie ein Zitat aus (das Skript fasst sie in <blockquote>) */
.hbs-main .rte > p.hbs-zitat {
    margin: 0;
    padding: 0 32px 0 84px;
    background: var(--hbs-gruen-hell);
    font-family: var(--hbs-font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 500;
}
@media (max-width: 699px) {
    .hbs-main .rte > blockquote { padding: 44px 22px 22px; }
    .hbs-main .rte > blockquote::before { left: 18px; top: -18px; font-size: 4.5rem; }
}

/* Bilder im Fließtext: rechts neben dem Text, mit runden Ecken.
   Kleine Grafiken (Logos, Siegel) behalten ihre Größe, große werden auf 40 % begrenzt. */
.hbs-main .rte > figure,
.hbs-main .rte > a:has(> figure),
.hbs-main .rte > p:has(> img:only-child) {
    float: right;
    clear: right;
    max-width: min(40%, 380px);
    margin: 6px 0 20px 32px;
}
.hbs-main .rte > :is(figure, a, p) img { width: auto; max-width: 100%; height: auto; border-radius: 4px; }
.hbs-main .rte > figure figcaption { margin-top: 6px; font-size: 0.875rem; color: var(--hbs-grau); }
/* Bild ohne Text danach (am Ende, vor einem weiteren Bild, allein im Abschnitt): volle Breite statt klein rechts */
.hbs-main .rte > :is(figure, a:has(> figure), p:has(> img:only-child)):not(:has(+ :is(p, ul, ol, blockquote, table))) {
    float: none;
    max-width: 100%;
    margin: 16px 0 24px;
}
.hbs-main .rte > :is(figure, a:has(> figure), p:has(> img:only-child)):not(:has(+ :is(p, ul, ol, blockquote, table))) img { width: 100%; }

/* Mehrere Bilder direkt hintereinander: als Galerie in einer Reihe */
.hbs-main .rte > figure:has(+ figure),
.hbs-main .rte > figure + figure {
    float: none;
    display: inline-block;
    width: calc(33.333% - 12px);
    max-width: none;
    margin: 8px 12px 12px 0;
    vertical-align: top;
}
.hbs-main .rte > figure:has(+ figure) img,
.hbs-main .rte > figure + figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hbs-main .rte::after { content: ""; display: table; clear: both; }
@media (max-width: 699px) {
    .hbs-main .rte > :is(figure, a:has(> figure), p:has(> img:only-child)) { float: none; max-width: 100%; margin: 12px 0 20px; }
    .hbs-main .rte > figure:has(+ figure),
    .hbs-main .rte > figure + figure { width: calc(50% - 8px); margin: 8px 8px 8px 0; }
}

/* Artikel mit CSS-Klasse "hbs-band" laufen über die volle Breite (grauer Hintergrund) */
.hbs-main > .mod_article.hbs-band {
    margin-inline: calc(50% - 50vw);
    padding: var(--hbs-abstand) max(var(--hbs-rand), calc(50vw - var(--hbs-breite) / 2));
    background: var(--hbs-band);
}
.hbs-content:has(> .hbs-main > .mod_article.hbs-band:last-child) { padding-bottom: 0; }

/* Einleitung: Text-Element mit CSS-Klasse "hbs-intro".
   Zweispaltig nur in breiten Inhaltsspalten (ab 900 px, z. B. Seiten ohne Seitenspalten),
   sonst Überschrift über dem Text. Die Überschrift darf im Überschrift-Feld oder
   als erste Zeile im Text stehen. */
.hbs-main .hbs-intro { max-width: none; }
/* Seit 1.50.0 einheitliche Schrift: Einleitungstext so groß wie der übrige Fließtext,
   eine Überschrift darin wie jede andere h2 (mit Balken). */
.hbs-main .hbs-intro :is(h1, h2):first-child { margin-top: 0; }
@container hauptspalte (min-width: 900px) {
    .hbs-main .hbs-intro,
    .hbs-main .hbs-intro > .rte:only-child {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 80px;
        row-gap: 0;
        align-items: start;
    }
    .hbs-main .hbs-intro:has(> .rte:only-child) { display: block; }
    .hbs-main .hbs-intro > :is(h1, h2):first-child,
    .hbs-main .hbs-intro > .rte:only-child > :is(h1, h2):first-child { grid-column: 1; grid-row: 1 / span 30; margin: 0; }
    .hbs-main .hbs-intro > .rte:only-child > :not(:first-child) { grid-column: 2; }
}

/* Abstände zwischen Bausteinen innerhalb eines Artikels */
.hbs-main .mod_article > :is(.hbs-hinweis, .hbs-kacheln, .hbs-kontakte, .content-image, .content-downloads, .content-element-group, .content-accordion) { margin-block: 32px; }
/* Text direkt vor einem Kasten: kein Restabstand, Kasten gehört sichtbar zum Text */
.hbs-main .mod_article > .content-text:has(+ :is(.hbs-hinweis, .hbs-kacheln, .hbs-kontakte, .content-image, .content-downloads, .content-element-group, .content-accordion)) > .rte > :last-child { margin-bottom: 0; }
/* Neuer Abschnitt nach einem Kasten: zusammen etwa 64 px bis zur Überschrift */
.hbs-main .mod_article > :is(.hbs-hinweis, .hbs-kacheln, .hbs-kontakte, .content-image, .content-downloads, .content-element-group, .content-accordion) + .content-text > .rte > h2:first-child,
.hbs-main .mod_article > :is(.hbs-hinweis, .hbs-kacheln, .hbs-kontakte, .content-image, .content-downloads, .content-element-group, .content-accordion) + .content-text > h2:first-child { margin-top: 32px; }
.hbs-main .mod_article > :first-child { margin-top: 0; }
.hbs-main .mod_article > :last-child { margin-bottom: 0; }
.hbs-main .mod_article > .hbs-button { margin-top: 32px; }

/* Leere Artikel (z. B. wenn der einzige Hinweis-Kasten unsichtbar geschaltet ist) nehmen keinen Platz ein */
.hbs-main > .mod_article:not(:has(> *)) { display: none; }
.hbs-main > .mod_article:not(:has(> *)) + .mod_article { margin-top: 0; }

/* Startseite, alle Breiten: Steht das graue Band direkt unter dem Titelbild (auch wenn der Artikel davor
   leer ist, z. B. ausgeblendeter Kasten), schließt es ohne weißen Streifen an */
.hbs-hero + .hbs-content:has(> .hbs-main > .mod_article.hbs-band:first-child) { padding-top: 0; }
.hbs-hero + .hbs-content > .hbs-main > .mod_article:not(:has(> *)):first-child + .mod_article.hbs-band { margin-top: calc(-1 * var(--hbs-abstand)); }

/* Beginnt die Seite direkt mit dem grauen Band, schließt es ohne weißen Streifen an das Titelbild an;
   das Titel-Panel ragt dann in das Band hinein */
@media (min-width: 1024px) {
    /* (verschachteltes :has() ist nicht erlaubt; bei leerem erstem Artikel zieht ein negativer Abstand das Band hoch) */
    .hbs-hero + .hbs-content:has(> .hbs-main > .mod_article.hbs-band:first-child) { padding-top: 0; }
    .hbs-hero + .hbs-content > .hbs-main > .mod_article:not(:has(> *)):first-child + .mod_article.hbs-band { margin-top: calc(-64px - 40px); }
    .hbs-hero + .hbs-content > .hbs-main > .mod_article.hbs-band:first-child,
    .hbs-hero + .hbs-content > .hbs-main > .mod_article:not(:has(> *)):first-child + .mod_article.hbs-band { padding-top: calc(64px + var(--hbs-abstand)); }
}

/* Überschrift mit grünem Balken: CSS-Klasse "hbs-titel" am Überschrift-Element */
.hbs-titel h2, h2.hbs-titel { margin-bottom: 40px; }
.hbs-titel h2::after, h2.hbs-titel::after {
    content: "";
    display: block;
    width: 64px;
    height: 6px;
    margin-top: 14px;
    background: var(--hbs-gruen);
}

/* 6. Bausteine ------------------------------------------------------------- */

/* Hinweis-Kasten (Elementgruppe hbs_hinweis / hbs_hinweis_wichtig): kompakt, Überschrift über dem Text,
   optional mit Bild links (Bild im Text-Element über „Bild hinzufügen“) */
.hbs-hinweis {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px 28px;
    padding: 26px 30px 28px;
    background: var(--hbs-gruen-hell);
    border-radius: 0;
    border-top: 4px solid var(--hbs-gruen);
}
.hbs-hinweis > :is(h2, h3) { margin: 0; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25; }
.hbs-hinweis a { font-weight: 700; }
.hbs-hinweis .content-text { max-width: none; }
.hbs-hinweis .rte { font-size: 0.98rem; line-height: 1.55; }
.hbs-hinweis .rte > :last-child, .hbs-hinweis p:last-child { margin-bottom: 0; }

/* Mittlere Breite mit Bild: Bild links über die ganze Höhe, rechts Überschrift und Text */
@container hauptspalte (min-width: 560px) and (max-width: 759px) {
    .hbs-hinweis:has(> .content-text > figure) { grid-template-columns: minmax(0, 28%) minmax(0, 1fr); }
    .hbs-hinweis:has(> .content-text > figure) > .content-text { display: contents; }
    .hbs-hinweis:has(> .content-text > figure) > :is(h2, h3) { grid-column: 2; grid-row: 1; }
    .hbs-hinweis:has(> .content-text > figure) > .content-text > .rte { grid-column: 2; }
    .hbs-hinweis > .content-text > figure { grid-column: 1; grid-row: 1 / span 6; align-self: start; }
}
.hbs-hinweis > .content-text > figure { float: none; max-width: none; margin: 0 0 12px; }
.hbs-hinweis > .content-text > figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }

/* Breite Spalte (z. B. Startseite) ohne Bild: links die Überschrift, rechts der Text
   mit gut lesbarer Zeilenlänge. Das Einkürzen hält beide Seiten etwa gleich hoch. */
@container hauptspalte (min-width: 760px) {
    .hbs-hinweis { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); column-gap: 44px; row-gap: 0; padding: 32px 36px 34px; }
    .hbs-hinweis > .content-text { display: contents; }
    .hbs-hinweis > :is(h2, h3) { grid-column: 1; grid-row: 1; align-self: start; font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
    .hbs-hinweis > .content-text > .rte { grid-column: 2; grid-row: 1 / span 3; max-width: 70ch; }
    .hbs-hinweis .hbs-hinweis__mehr { grid-column: 2; grid-row: 4; margin-top: 10px; }
}

/* Bildanordnung im Hinweis-Kasten (seit 1.56.0). Element „Kasten“: Feld „Bildanordnung“;
   Elementgruppe „Hinweis“: CSS-Klasse am Element. Gilt in der breiten Spalte (Startseite);
   in mittleren Spalten steht das Bild links über die ganze Höhe, auf dem Smartphone alles untereinander.
     (Standard) hbs-bild-links   Überschrift oben über die ganze Breite, darunter Bild links, Text rechts
                hbs-bild-rechts  Überschrift oben, Text links, Bild rechts
                hbs-bild-breit   Überschrift oben, Bild als breites Band (3:1), Text darunter über die ganze Breite
                hbs-bild-klein   wie Standard, Bild nur 220 px breit
                hbs-bild-spalte  Überschrift und Bild (16:9) in der linken Spalte, Text rechts */
@container hauptspalte (min-width: 760px) {
    .hbs-hinweis:has(> .content-text > figure) > :is(h2, h3) { grid-column: 1 / -1; grid-row: 1; margin-bottom: 20px; }
    /* align-self: start – sonst wird die Figur so hoch wie der Text und das KI-Kennzeichen rutscht unter das Bild */
    .hbs-hinweis:has(> .content-text > figure) > .content-text > figure { grid-column: 1; grid-row: 2 / span 4; align-self: start; margin: 0; }
    /* Text läuft wie die Überschrift bis zum rechten Rand (keine 70-Zeichen-Grenze neben dem Bild) */
    .hbs-hinweis:has(> .content-text > figure) > .content-text > .rte { grid-column: 2; grid-row: 2 / span 2; max-width: none; }
    .hbs-hinweis:has(> .content-text > figure) > .content-text > .rte > * { max-width: none; }
    .hbs-hinweis:has(> .content-text > figure) .hbs-hinweis__mehr { grid-column: 2; grid-row: 4; }
    .hbs-hinweis:has(> .content-text > figure) .hbs-hinweis__link { grid-column: 2; grid-row: 5; }

    .hbs-hinweis.hbs-bild-rechts:has(> .content-text > figure) { grid-template-columns: minmax(0, 1fr) minmax(0, 34%); }
    .hbs-hinweis.hbs-bild-rechts:has(> .content-text > figure) > .content-text > figure { grid-column: 2; }
    .hbs-hinweis.hbs-bild-rechts:has(> .content-text > figure) > .content-text > .rte,
    .hbs-hinweis.hbs-bild-rechts:has(> .content-text > figure) :is(.hbs-hinweis__mehr, .hbs-hinweis__link) { grid-column: 1; }

    .hbs-hinweis.hbs-bild-klein:has(> .content-text > figure) { grid-template-columns: 220px minmax(0, 1fr); }

    .hbs-hinweis.hbs-bild-spalte:has(> .content-text > figure) > :is(h2, h3) { grid-column: 1; margin-bottom: 18px; }
    .hbs-hinweis.hbs-bild-spalte:has(> .content-text > figure) > .content-text > .rte { grid-row: 1 / span 3; }
    .hbs-hinweis.hbs-bild-spalte > .content-text > figure img { aspect-ratio: 16 / 9; }
}
@container hauptspalte (min-width: 560px) {
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) { grid-template-columns: minmax(0, 1fr); }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) > :is(h2, h3) { grid-column: 1; grid-row: 1; margin-bottom: 20px; }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) > .content-text > figure { grid-column: 1; grid-row: 2; align-self: start; margin: 0 0 20px; }
    .hbs-hinweis.hbs-bild-breit > .content-text > figure img { aspect-ratio: 3 / 1; }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) > .content-text > .rte { grid-column: 1; grid-row: 3; max-width: none; }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) > .content-text > .rte > * { max-width: none; }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) .hbs-hinweis__mehr { grid-column: 1; grid-row: 4; }
    .hbs-hinweis.hbs-bild-breit:has(> .content-text > figure) .hbs-hinweis__link { grid-column: 1; grid-row: 5; }
}

/* Einkürzen (Häkchen an der Elementgruppe): Text begrenzt, "Weiterlesen" per Skript */
.hbs-hinweis[data-hbs-einkuerzen] .rte.ist-gekuerzt {
    max-height: 9.5em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 60%, transparent);
    mask-image: linear-gradient(#000 60%, transparent);
}
.hbs-hinweis__mehr {
    justify-self: start;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hbs-gruen-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.hbs-hinweis__mehr::after { content: " ▾"; }
.hbs-hinweis__mehr[aria-expanded="true"]::after { content: " ▴"; }
.hbs-hinweis__mehr:hover { text-decoration: underline; }

/* Link allein im letzten Absatz eines Hinweis-Kastens (Elementgruppe „Hinweis“ oder Element „Kasten“):
   Pfeil-Link wie bei den Kacheln – Datei/PDF mit Download-Pfeil, externe Seite mit Pfeil schräg (seit 1.54.1).
   Datei geht vor „neues Fenster“: die Regel für externe Links steht in :where() (Gewicht 0, seit 1.54.2).
   In eingekürzten Kästen nimmt hbs-helfer.js den Absatz aus dem Text (Klasse hbs-hinweis__link). */
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link) > a:only-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--hbs-schwarz);
    font-weight: 700;
    text-decoration: none;
}
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link) > a:only-child::after {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') no-repeat center;
}
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link) > a:only-child:where([target="_blank"], [href^="http"]:not([href*="heinrich-boell-schule.de"]))::after {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17 17 7M9 7h8v8"/></svg>');
}
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link) > a:only-child:is([href*="files/"], [href*="file="], [href$=".pdf" i], [href*=".pdf?" i], [download])::after {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v12M6 11l6 6 6-6M5 20h14"/></svg>');
}
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link) > a:only-child:hover { text-decoration: underline; text-decoration-color: var(--hbs-gruen); }
.hbs-hinweis .rte > p:last-child:has(> a:only-child) { margin-top: 4px; }
.hbs-hinweis__link { margin: 4px 0 0; }
@container hauptspalte (min-width: 760px) {
    .hbs-hinweis .hbs-hinweis__link { grid-column: 2; grid-row: 5; }
}

.hbs-hinweis:has(> .content-text > figure) .hbs-hinweis__mehr { grid-column: -2; }

/* News-Liste als Kartenraster: Modul "Nachrichtenliste" mit Template news_hbs_karte */
.mod_newslist:has(.hbs-news-karte) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.mod_newslist:has(.hbs-news-karte) > :is(h2, h3, .pagination) { grid-column: 1 / -1; }

.hbs-news-karte {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--hbs-linie);
    border-radius: var(--hbs-radius);
    overflow: hidden;
}
.hbs-news-karte:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-news-karte__bild { position: relative; flex: 0 0 auto; aspect-ratio: 16 / 10; min-height: 0; overflow: hidden; background: var(--hbs-platzhalter); }
.hbs-news-karte__bild :is(figure, a, picture) { display: block; height: 100%; margin: 0; }
.hbs-news-karte__bild img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hbs-news-karte__bild figcaption { display: none; }
.hbs-news-karte__text { display: flex; flex-direction: column; gap: 12px; flex-grow: 1; padding: 24px; }
.hbs-news-karte__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 0.875rem; color: var(--hbs-grau); }
.hbs-news-karte__titel { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.hbs-news-karte__titel a { color: var(--hbs-schwarz); text-decoration: none; }
.hbs-news-karte__titel a:focus-visible { outline: none; }
/* Die ganze Karte ist klickbar */
.hbs-news-karte__titel a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hbs-news-karte { transition: border-color 0.15s; }
.hbs-news-karte:hover { border-color: var(--hbs-gruen); }
.hbs-news-karte:hover .hbs-news-karte__titel a { text-decoration: underline; text-decoration-color: var(--hbs-gruen); text-decoration-thickness: 2px; }
.hbs-news-karte__teaser { font-size: 0.95rem; line-height: 1.55; color: #3d3d3d; }
.hbs-news-karte__teaser p { margin: 0; }
/* „Weiterlesen“ mit Pfeil wie bei den Kacheln (die ganze Karte ist verlinkt) */
.hbs-news-karte__mehr {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    color: var(--hbs-schwarz);
    font-weight: 700;
}
.hbs-news-karte__mehr::after {
    content: "";
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') no-repeat center;
    transition: transform 0.15s;
}
.hbs-news-karte:hover .hbs-news-karte__mehr { text-decoration: underline; text-decoration-color: var(--hbs-gruen); }

.hbs-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--hbs-gruen);
    color: var(--hbs-schwarz);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Kacheln: Elementgruppe hbs_kacheln / hbs_kacheln_hervorgehoben. Jedes Text-Element darin wird automatisch zur Kachel. */
.hbs-kacheln {
    display: grid;
    grid-template-columns: minmax(0, 1fr); /* schmale Spalte: Kacheln als Liste untereinander */
    gap: 16px;
}
/* Breite Spalte (z. B. Startseite): Spaltenzahl nach Anzahl der Kacheln –
   1, 2 und 4 Kacheln nebeneinander bzw. 2×2, sonst Drittel */
@container hauptspalte (min-width: 760px) {
    .hbs-kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
    .hbs-kacheln:not(:has(> div:nth-of-type(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hbs-kacheln:not(:has(> div:nth-of-type(2))) { grid-template-columns: minmax(0, 1fr); }
    .hbs-kacheln:has(> div:nth-of-type(4)):not(:has(> div:nth-of-type(5))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hbs-kacheln > * { min-width: 0; }
.hbs-kacheln > :is(h2, h3) { grid-column: 1 / -1; margin-bottom: 16px; }
.hbs-hero + .hbs-content .hbs-kacheln > :is(h2, h3)::after {
    content: "";
    display: block;
    width: 64px;
    height: 6px;
    margin-top: 14px;
    background: var(--hbs-gruen);
}
.hbs-kacheln--hervorgehoben > :is(.hbs-kachel, .hbs-kacheln > .content-text) { background: var(--hbs-gruen-hell); border-color: transparent; }

:is(.hbs-kachel, .hbs-kacheln > .content-text) {
    container: kachel / inline-size;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: none !important;
    padding: 32px;
    border: 1px solid var(--hbs-linie);
    border-radius: var(--hbs-radius);
    background: #fff;
}
:is(.hbs-kachel, .hbs-kacheln > .content-text) > :is(h2, h3, h4) {
    margin: 0 0 8px;
    /* Schriftgröße nach Kachelbreite: 26 px in breiten, bis 19 px in schmalen Kacheln (seit 1.46.0) */
    font-size: clamp(1.2rem, 0.4rem + 7.5cqi, 1.6rem);
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
}
/* Bild oben in der Kachel, über die volle Breite */
:is(.hbs-kachel, .hbs-kacheln > .content-text) { position: relative; overflow: hidden; }
:is(.hbs-kachel, .hbs-kacheln > .content-text) > figure {
    order: -1;
    margin: -32px -32px 20px;
    aspect-ratio: 16 / 9;
    overflow: hidden; /* hält das Seitenverhältnis ein, auch bei hohen Bildern */
    background: var(--hbs-platzhalter);
}
:is(.hbs-kachel, .hbs-kacheln > .content-text) > figure :is(a, picture) { display: block; width: 100%; height: 100%; }
:is(.hbs-kachel, .hbs-kacheln > .content-text) > figure img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Bildposition frei wählbar über die Contao-Einstellung „Bildausrichtung“ im Text-Element:
   oberhalb (Standard), unterhalb, links oder rechts. Links/rechts gilt in breiten Spalten,
   in schmalen Spalten (Unterseiten mit Seitenspalten, Tablet) zeigt die Liste das Bild links, auf dem Handy oben. */
:is(.hbs-kachel, .hbs-kacheln > .content-text).media--below > figure { order: 99; margin: 20px -32px -32px; }

@container hauptspalte (min-width: 760px) {
    :is(.hbs-kachel, .hbs-kacheln > .content-text):is(.media--left, .media--right):has(> figure) {
        display: grid;
        grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        column-gap: 28px;
        align-items: start;
    }
    :is(.hbs-kachel, .hbs-kacheln > .content-text):is(.media--left, .media--right):has(> figure) > figure {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: stretch;
        margin: -32px 0 -32px -32px;
        aspect-ratio: auto;
        min-height: 220px;
    }
    :is(.hbs-kachel, .hbs-kacheln > .content-text):is(.media--left, .media--right):has(> figure) > :not(figure) { grid-column: 2; }
    :is(.hbs-kachel, .hbs-kacheln > .content-text):is(.media--left, .media--right):has(> figure) > .rte { align-self: stretch; }

    :is(.hbs-kachel, .hbs-kacheln > .content-text).media--right:has(> figure) { grid-template-columns: minmax(0, 1fr) minmax(0, 38%); }
    :is(.hbs-kachel, .hbs-kacheln > .content-text).media--right:has(> figure) > figure { grid-column: 2; margin: -32px -32px -32px 0; }
    :is(.hbs-kachel, .hbs-kacheln > .content-text).media--right:has(> figure) > :not(figure) { grid-column: 1; }
}

/* Schmale Spalte: kompakte Liste, Bild links als Vorschaubild */
@container hauptspalte (min-width: 440px) and (max-width: 759px) {
    :is(.hbs-kachel, .hbs-kacheln > .content-text):has(> figure) {
        display: grid;
        grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        column-gap: 20px;
        padding: 22px 24px;
    }
    :is(.hbs-kachel, .hbs-kacheln > .content-text):has(> figure) > figure {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: stretch;
        margin: -22px 0 -22px -24px !important;
        aspect-ratio: auto;
        min-height: 150px;
    }
    :is(.hbs-kachel, .hbs-kacheln > .content-text):has(> figure) > :not(figure) { grid-column: 2; }
}
@container hauptspalte (max-width: 759px) {
    :is(.hbs-kachel, .hbs-kacheln > .content-text) { padding: 22px 24px; }
    :is(.hbs-kachel, .hbs-kacheln > .content-text) > figure { margin: -22px -24px 16px; }
    :is(.hbs-kachel, .hbs-kacheln > .content-text) > :is(h2, h3, h4) { font-size: 1.25rem; }
}

/* Zwei Kacheln passen auch in schmale Spalten nebeneinander: dort Bild oben statt links */
@container hauptspalte (min-width: 440px) and (max-width: 759px) {
    .hbs-kacheln:not(:has(> div:nth-of-type(3))):has(> div:nth-of-type(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hbs-kacheln:not(:has(> div:nth-of-type(3))) > :is(.content-text, .hbs-kachel):has(> figure) { display: flex; flex-direction: column; }
    .hbs-kacheln:not(:has(> div:nth-of-type(3))) > :is(.content-text, .hbs-kachel) > figure {
        margin: -22px -24px 16px !important;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }
}

/* Der Textbereich füllt die Kachel, damit die Links aller Kacheln einer Reihe unten auf gleicher Höhe stehen */
:is(.hbs-kachel, .hbs-kacheln > .content-text) > .rte { display: flex; flex-direction: column; flex-grow: 1; }
:is(.hbs-kachel, .hbs-kacheln > .content-text) > .rte > p { margin-bottom: 0.75em; }
:is(.hbs-kachel, .hbs-kacheln > .content-text) p:last-child { margin: auto 0 0; padding-top: 8px; }
:is(.hbs-kachel, .hbs-kacheln > .content-text) p:last-child > a:only-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--hbs-schwarz);
    font-weight: 700;
    text-decoration: none;
}
:is(.hbs-kachel, .hbs-kacheln > .content-text) p:last-child > a:only-child::after {
    content: "";
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') no-repeat center;
}
:is(.hbs-kachel, .hbs-kacheln > .content-text) p:last-child > a:only-child:hover { text-decoration: underline; text-decoration-color: var(--hbs-gruen); }

/* Infokarten (Elementgruppe hbs_karten): Kachel-Raster ohne Link, grüner Akzent oben, Text bleibt oben */
/* Info-Flächen (seit 1.45.0): hellgrüner Grund + grüne Oberkante 4 px = Information, kein Link.
   Weiß mit grauem Rahmen = klickbare Kachel. Infokarten deshalb wie Kontaktkarten. */
.hbs-karten > .content-text {
    padding: 24px 26px;
    border: 0;
    border-top: 4px solid var(--hbs-gruen);
    border-radius: 0;
    background: var(--hbs-gruen-hell);
}
.hbs-karten > .content-text p:last-child { margin: 0; padding-top: 0; }
.hbs-karten > .content-text > .rte > :last-child { margin-bottom: 0; }
.hbs-karten > .content-text > :is(h3, h4) { font-size: 1.25rem; }
.hbs-karten > .content-text .rte ul { margin: 0.4em 0 0.6em; }
.hbs-karten > .content-text .rte li + li { margin-top: 0.25em; }
.hbs-karten > .content-text .rte p + ul { margin-top: 0.2em; }
@container hauptspalte (max-width: 759px) {
    .hbs-karten > .content-text > :is(h3, h4) { font-size: 1.15rem; }
}
/* Mittlere Spaltenbreite (Unterseiten mit Navigation und rechter Spalte): Karten ohne Bild
   zu zweit nebeneinander statt als lange Liste */
@container hauptspalte (min-width: 440px) and (max-width: 759px) {
    .hbs-karten:not(:has(figure)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* In Akkordeon-Abschnitten etwas Abstand zum Text davor und danach */
.hbs-main .content-accordion .hbs-karten { margin-block: 20px; }

/* Silbentrennung in Infokarten (seit 1.49.0): keine großen Lücken am Zeilenende */
.hbs-karten > .content-text > .rte {
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
    overflow-wrap: break-word;
}

/* Infokarten im Akkordeon (seit 1.49.0): in mittleren und schmalen Spalten untereinander statt
   zu zweit – jede Karte nutzt die volle Breite, längere Aufzählungen laufen zweispaltig. */
@container hauptspalte (max-width: 759px) {
    .hbs-main .content-accordion .hbs-karten { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
}
@container hauptspalte (min-width: 440px) and (max-width: 759px) {
    .hbs-main .content-accordion .hbs-karten > .content-text { padding: 20px 26px; }
    .hbs-main .content-accordion .hbs-karten > .content-text > :is(h3, h4) { margin-bottom: 6px; }
    .hbs-main .content-accordion .hbs-karten .rte ul:has(> li:nth-child(4)) { columns: 2; column-gap: 32px; }
    .hbs-main .content-accordion .hbs-karten .rte ul:has(> li:nth-child(4)) > li { break-inside: avoid; }
    .hbs-main .content-accordion .hbs-karten .rte ul:has(> li:nth-child(4)) > li:first-child { margin-top: 0; }
}

/* Infokarten mit Bild in mittleren Spalten (seit 1.49.0): Bild links mit festem Seitenverhältnis 4:3
   und eigenem Rand, statt über die ganze Kartenhöhe gestreckt – bei langen Texten sonst ein schmaler Streifen. */
@container hauptspalte (min-width: 440px) and (max-width: 759px) {
    .hbs-karten > .content-text:has(> figure) { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); column-gap: 24px; padding: 22px 24px; }
    .hbs-karten > .content-text:has(> figure) > figure {
        align-self: start;
        margin: 0 !important;
        aspect-ratio: 4 / 3;
        min-height: 0;
        border-radius: 4px;
    }
}

/* Buttons: Hyperlink-Element mit CSS-Klasse "hbs-button" oder Link mit Klasse */
.hbs-button a, a.hbs-button, .mod_newslist .more a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 4px;
    background: var(--hbs-schwarz);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.hbs-button a:hover, a.hbs-button:hover { background: var(--hbs-gruen); color: var(--hbs-schwarz); }

/* Einfache Elementgruppen (ohne HBS-Template, z. B. in Akkordeon-Abschnitten): Abstand zwischen den Elementen */
.hbs-main .content-element-group:not([class*="hbs-"]) > * + * { margin-top: 20px; }
.hbs-main .content-element-group:not([class*="hbs-"]) > .content-text > .rte > :last-child { margin-bottom: 0; }
.hbs-main .content-element-group:not([class*="hbs-"]) > .content-image figure { margin: 0; }

/* Tabellen, z. B. Unterrichtszeiten und Ferientermine */
.hbs-main table { width: 100%; border-collapse: collapse; font-size: 0.975rem; }
/* Breite Tabellen scrollen seitlich statt abgeschnitten zu werden (Hülle setzt hbs-helfer.js) */
.hbs-tabelle { overflow-x: auto; margin: 0 0 1em; -webkit-overflow-scrolling: touch; }
.hbs-tabelle > table { margin: 0; }
.hbs-tabelle:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-main th, .hbs-main td { padding: 10px 12px; border-bottom: 1px solid var(--hbs-linie); text-align: left; vertical-align: top; }
.hbs-main th { background: var(--hbs-gruen-hell); font-weight: 700; color: var(--hbs-schwarz); }

/* Bild-Elemente im Inhalt: Einzelbilder und Infografiken vollständig, nie größer als das Original */
.hbs-main .content-image:not(.hbs-banner) figure { margin: 0; max-width: var(--hbs-lesebreite); }
.hbs-main .content-image:not(.hbs-banner) img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    border-radius: 4px;
}
/* Video/Audio (Contao-Element „Video/Audio“): volle Spaltenbreite, Seitenverhältnis bis zum Laden 16:9 */
.hbs-main .content-player figure { margin: 0; max-width: none; }
.hbs-main .content-player video { display: block; width: 100%; height: auto; aspect-ratio: auto 16 / 9; background: #000; border-radius: 4px; }
.hbs-main .content-player audio { display: block; width: 100%; }
.hbs-main .content-player figcaption { margin-top: 8px; color: var(--hbs-grau); font-size: 0.9rem; }
.hbs-randspalte .content-player video { display: block; width: 100%; height: auto; border-radius: 4px; }

/* Bild über die volle Spaltenbreite (Klasse hbs-volle-breite), z. B. Organigramm */
.hbs-main .content-image.hbs-volle-breite figure { max-width: none; }
.hbs-main .content-image.hbs-volle-breite img { width: 100%; }
.hbs-main .content-image figcaption { margin-top: 8px; text-align: center; font-size: 0.875rem; color: var(--hbs-grau); }

/* Banner (Bild-Element mit Template hbs_banner): breiter Streifen mit Parallax */
.hbs-banner figure {
    position: relative;
    height: clamp(260px, 50cqi, 440px);
    margin: 0;
    overflow: hidden;
    border-radius: var(--hbs-radius);
    background: var(--hbs-platzhalter);
}
.hbs-banner :is(picture, a) { display: block; height: 100%; }
.hbs-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Parallax: das Bild ist höher als der Banner und wird per Skript (hbs-theme.js) verschoben */
.hbs-banner img { height: 130%; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
    .hbs-banner img { height: 100%; transform: none !important; }
}
/* Auf Unterseiten (mit Unternavigation) höchstens so breit wie der Text und flacher */
.hbs-content:has(> .hbs-sidebar) .hbs-main .hbs-banner figure {
    max-width: 72ch;
    height: clamp(200px, 36cqi, 320px);
}

/* Bildansicht (Lightbox) */
html.hbs-lightbox-offen { overflow: hidden; }
.hbs-lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 56px 72px 48px;
    border: 0;
    background: transparent;
    color: #fff;
}
.hbs-lightbox::backdrop { background: rgba(10, 10, 10, 0.9); }
.hbs-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.hbs-lightbox__bild { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; margin: 0; }
.hbs-lightbox__bild img { max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; border-radius: 4px; }
.hbs-lightbox__bild figcaption { max-width: 70ch; text-align: center; font-size: 0.95rem; color: #e6e6e6; }
.hbs-lightbox__zaehler { position: absolute; top: 20px; left: 24px; font-size: 0.875rem; color: #bdbdbd; }
.hbs-lightbox button {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12) no-repeat center / 22px;
    cursor: pointer;
}
.hbs-lightbox button:hover { background-color: rgba(200, 213, 48, 0.35); }
.hbs-lightbox button.hbs-lightbox__schliessen { top: 12px; right: 16px; background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>'); }
.hbs-lightbox button.hbs-lightbox__zurueck { left: 12px; top: 50%; transform: translateY(-50%); background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 6l-6 6 6 6"/></svg>'); }
.hbs-lightbox button.hbs-lightbox__weiter { right: 12px; top: 50%; transform: translateY(-50%); background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'); }
.hbs-lightbox--einzeln button:is(.hbs-lightbox__zurueck, .hbs-lightbox__weiter) { display: none; }
@media (max-width: 699px) {
    .hbs-lightbox { padding: 56px 12px 32px; }
    .hbs-lightbox button:is(.hbs-lightbox__zurueck, .hbs-lightbox__weiter) { top: auto; bottom: 16px; transform: none; }
}
/* Verlinkte Bilder zeigen beim Überfahren, dass sie sich vergrößern lassen */
.hbs-main a:is([href$=".jpg" i], [href$=".jpeg" i], [href$=".png" i], [href$=".webp" i], [data-lightbox]) img { cursor: zoom-in; }

/* Akkordeon (Contao-Element „Akkordeon“) */
.hbs-main .content-accordion { display: flex; flex-direction: column; gap: 10px; }
.hbs-main .content-accordion > :is(h2, h3) { margin: 0 0 6px; }
.hbs-main .content-accordion .handorgel__header { margin: 0; font-size: inherit; }
.hbs-main .content-accordion .handorgel__header::before { display: none; }
.hbs-main .content-accordion .handorgel__header__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    border: 0;
    border-radius: 4px;
    background: var(--hbs-gruen-hell);
    color: var(--hbs-schwarz);
    font-family: var(--hbs-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}
.hbs-main .content-accordion .handorgel__header__button::after {
    content: "";
    flex: 0 0 22px;
    height: 22px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat center / 22px;
    transition: transform 0.2s;
}
.hbs-main .content-accordion .handorgel__header--open .handorgel__header__button {
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 -3px 0 var(--hbs-gruen);
}
.hbs-main .content-accordion .handorgel__header--open .handorgel__header__button::after { transform: rotate(180deg); }
.hbs-main .content-accordion .handorgel__header__button:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-main .content-accordion .handorgel__content { border: 0; }
.hbs-main .content-accordion .handorgel__content__inner {
    padding: 20px 22px 8px;
    border: 1px solid var(--hbs-linie);
    border-top: 0;
    border-radius: 0 0 4px 4px;
}
.hbs-main .content-accordion .handorgel__content__inner .content-text { max-width: none; }

/* Galerien: Contao-Element „Galerie“ und importierte Bilderlisten */
.hbs-main .content-gallery ul,
.hbs-main .rte ul:has(> li > figure) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}
.hbs-main .content-gallery ul:not(:has(> li:nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container hauptspalte (max-width: 559px) {
    .hbs-main :is(.content-gallery ul, .rte ul:has(> li > figure)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) li { margin: 0; padding: 0; }
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) li::before { display: none; }
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) figure { position: relative; float: none; max-width: none; margin: 0; }
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) img { width: 100%; height: auto; border-radius: 4px; }
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) figcaption { margin-top: 6px; font-size: 0.875rem; color: var(--hbs-grau); text-align: center; }
/* Lupe auf vergrößerbaren Bildern */
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) figure:has(> a) > a { position: relative; display: block; }
.hbs-main :is(.content-gallery, .rte ul:has(> li > figure)) figure:has(> a) > a::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.7) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.4" stroke-linecap="round"><circle cx="11" cy="11" r="6"/><path d="M20 20l-4.5-4.5M11 8v6M8 11h6"/></svg>') no-repeat center / 18px;
}

/* Wichtiger Hinweis (Kasten „Wichtig“ bzw. Elementgruppe hbs_hinweis_wichtig): angepinntes Post-it
   oben rechts, ragt über die Oberkante. Für Screenreader setzt hbs-helfer.js „Wichtig:“ vor die Überschrift. */
.hbs-hinweis--wichtig {
    position: relative;
    background: #fff4e6;
    border-top-color: #e8890c;
}
.hbs-hinweis--wichtig > :is(h2, h3) { padding-right: 96px; }
.hbs-hinweis--wichtig::after {
    content: "";
    position: absolute;
    top: -18px;
    right: 28px;
    width: 86px;
    height: 86px;
    background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23ffe873'/><stop offset='1' stop-color='%23ffd84a'/></linearGradient></defs><path d='M8 12h84v70c0 0-6 10-24 10H8z' fill='url(%23g)'/><path d='M68 92c8 0 18-4 24-10c-10 2-18 2-24 10z' fill='%23e9bf2c'/><g stroke-linecap='round'><g transform='rotate(-14 28 56)'><path d='M28 36v22' stroke='%231d4ed8' stroke-width='7'/><circle cx='28' cy='70' r='4.2' fill='%231d4ed8'/></g><path d='M50 30v28' stroke='%23d32f2f' stroke-width='9'/><circle cx='50' cy='72' r='5.5' fill='%23d32f2f'/><g transform='rotate(14 72 56)'><path d='M72 36v22' stroke='%231d4ed8' stroke-width='7'/><circle cx='72' cy='70' r='4.2' fill='%231d4ed8'/></g></g><circle cx='20' cy='16' r='6.5' fill='%232b2b2b'/><circle cx='18' cy='14' r='2.2' fill='%239e9e9e'/></svg>") no-repeat center / contain;
    transform: rotate(5deg);
    filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.18));
    pointer-events: none;
}
@container hauptspalte (min-width: 760px) {
    .hbs-hinweis--wichtig { padding-right: 132px; }
    .hbs-main .hbs-hinweis.hbs-hinweis--wichtig { padding-right: 132px; }
    .hbs-hinweis--wichtig > :is(h2, h3) { padding-right: 0; }
}
@media (max-width: 699px) {
    .hbs-hinweis--wichtig::after { top: -14px; right: 16px; width: 60px; height: 60px; }
    .hbs-hinweis--wichtig > :is(h2, h3) { padding-right: 64px; }
}

/* Trauer (Inhaltselement Kasten, Art „Trauer“): schlicht grau, dunkler Akzent, ohne Symbol */
.hbs-hinweis--trauer {
    background: #f3f3f1;
    border-top-color: #2b2b2b;
    box-shadow: inset 0 0 0 1px #dcdcd7;
}
.hbs-hinweis--trauer > :is(h2, h3) { color: var(--hbs-schwarz); }
.hbs-hinweis--trauer a { color: var(--hbs-schwarz); text-decoration-color: #2b2b2b; }
.hbs-hinweis--trauer .hbs-hinweis__mehr { color: var(--hbs-schwarz); }

/* Kachel (Inhaltselement hbs_kachel): die ganze Kachel ist klickbar, Links im Text bleiben anklickbar */
.hbs-kachel > .rte a:not(.hbs-kachel__ziel) { position: relative; z-index: 1; }
.hbs-kachel .hbs-kachel__ziel::before { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.hbs-kachel:has(.hbs-kachel__ziel) { cursor: pointer; transition: border-color 0.15s; }
.hbs-kachel:has(.hbs-kachel__ziel:hover) { border-color: var(--hbs-gruen); }
.hbs-kachel:has(.hbs-kachel__ziel:focus-visible) { outline: 3px solid var(--hbs-gruen); outline-offset: 3px; }
.hbs-kachel .hbs-kachel__ziel:focus-visible { outline: none; }

/* Anreise: Text-Element mit Klasse hbs-anreise, Bild (Lageplan) links, Liste rechts */
.hbs-main .content-text.hbs-anreise { max-width: none; }
@container hauptspalte (min-width: 700px) {
    .hbs-main .content-text.hbs-anreise:has(> figure) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto;
        column-gap: 40px;
        align-items: start;
    }
    .hbs-main .content-text.hbs-anreise > .rte { display: contents; }
    .hbs-main .content-text.hbs-anreise > .rte > :is(h2, h3) { grid-column: 1 / -1; grid-row: 1; }
    .hbs-main .content-text.hbs-anreise > figure { grid-column: 1; grid-row: 2 / span 5; align-self: start; float: none; max-width: none; margin: 0; }
    .hbs-main .content-text.hbs-anreise > .rte > :not(h2, h3) { grid-column: 2; }
}
.hbs-main .content-text.hbs-anreise > figure img { width: 100%; height: auto; border: 1px solid var(--hbs-linie); border-radius: 4px; }
.hbs-main .content-text.hbs-anreise ul { padding-left: 1.1em; }
.hbs-main .content-text.hbs-anreise li { margin-bottom: 0.8em; }
.hbs-main .content-text.hbs-anreise li::marker { color: var(--hbs-gruen); }

/* Personalliste (Inhaltselement) */
.hbs-personal__filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 8px;
    padding: 0 0 16px;          /* seit 1.58.0: schlichte Zeile mit Trennlinie statt Fläche */
    border-bottom: 1px solid var(--hbs-linie);
}
.hbs-personal__filter :is(input, select) {
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--hbs-linie);
    border-radius: 4px;
    background: #fff;
    font: inherit;
}
.hbs-personal__filter input { flex: 1 1 240px; min-width: 0; }
.hbs-personal__filter select { flex: 0 1 220px; }
.hbs-personal__filter :is(input, select):focus { border-color: var(--hbs-gruen); outline: none; box-shadow: 0 0 0 3px rgba(200, 213, 48, 0.35); }
.hbs-personal__anzahl { margin: 0 0 0 auto; font-size: 0.875rem; color: var(--hbs-grau); }
.hbs-personal__liste {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px 28px;             /* seit 1.58.1: mehr Abstand zwischen den Zeilen */
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
@container hauptspalte (min-width: 560px) { .hbs-personal__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container hauptspalte (min-width: 860px) { .hbs-personal__liste { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hbs-personal__karte {             /* seit 1.58.0: keine Fläche, nur grüner Strich links */
    margin: 0;
    padding: 6px 0 6px 16px;
    border-left: 3px solid var(--hbs-gruen);
    font-size: 0.9rem;
    line-height: 1.45;
}
.hbs-personal__karte[hidden] { display: none; }
.hbs-personal__karte p { margin: 0 0 0.2em; }
.hbs-personal__name { color: var(--hbs-schwarz); font-family: var(--hbs-font-display); font-size: 1rem; }
.hbs-personal__name strong { font-weight: 600; }
.hbs-personal__kuerzel {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 4px;
    background: var(--hbs-gruen-hell);
    color: var(--hbs-gruen-text);
    font-family: var(--hbs-font-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: 1px;
}
.hbs-personal__faecher, .hbs-personal__einsaetze { color: var(--hbs-grau); }
.hbs-personal__mail a { color: var(--hbs-schwarz); font-weight: 600; text-decoration: none; }
.hbs-personal__mail a:hover { color: var(--hbs-gruen-text); text-decoration: underline; }
.hbs-personal__leer { padding: 16px; color: var(--hbs-grau); }

/* Porträt neben langem Text (Text-Element mit Bild und CSS-Klasse hbs-portrait), z. B. Grußwort */
.hbs-main .content-text.hbs-portrait { max-width: none; }
.hbs-main .content-text.hbs-portrait > figure { float: none; max-width: none; margin: 0 auto 24px; text-align: center; }
.hbs-main .content-text.hbs-portrait > figure img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #fff;
    box-shadow: 0 0 0 3px var(--hbs-gruen);
}
.hbs-main .content-text.hbs-portrait > figure figcaption { margin-top: 10px; font-size: 0.9rem; font-weight: 600; color: var(--hbs-grau); }
.hbs-main .content-text.hbs-portrait > .rte { max-width: 72ch; }
@container hauptspalte (min-width: 860px) {
    .hbs-main .content-text.hbs-portrait:has(> figure) {
        display: grid;
        grid-template-columns: minmax(0, 72ch) 260px;
        column-gap: 64px;
        align-items: start;
    }
    .hbs-main .content-text.hbs-portrait > .rte { grid-column: 1; grid-row: 1; }
    .hbs-main .content-text.hbs-portrait > figure { grid-column: 2; grid-row: 1; position: sticky; top: 32px; margin: 8px 0 0; }
    .hbs-main .content-text.hbs-portrait > figure img { width: 240px; height: 240px; }
}

/* KI-Hinweis auf Bildern (Dateiverwaltung › KI-Kennzeichnung).
   Der Hinweis steht im <figure> (ggf. im Link darin); das <figure> ist der Bezugsrahmen,
   damit er auch in Kacheln und im mobilen Seitenkopf auf dem Bild sitzt. */
figure:has(.hbs-ki-hinweis) { position: relative; }
.hbs-ki-hinweis[hidden] { display: none; }
.hbs-lightbox__rahmen { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.hbs-lightbox__rahmen .hbs-ki-hinweis { top: 10px; bottom: auto; line-height: 1.3; }
.hbs-news-karte__bild .hbs-ki-hinweis { z-index: 1; }
/* Mit Bildunterschrift oben statt unten, sonst läge er auf der Unterschrift */
figure:has(> figcaption) .hbs-ki-hinweis { top: 10px; bottom: auto; }
.hbs-ki-hinweis {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 4px 9px 4px 7px;
    border-radius: 4px;
    background: rgba(26, 26, 26, 0.72);
    color: #fff;
    font-family: var(--hbs-font-text);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: default;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.hbs-ki-hinweis::before {
    content: "";
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="%23c8d530"><path d="M12 2l2.2 6.3L20.5 10.5l-6.3 2.2L12 19l-2.2-6.3L3.5 10.5l6.3-2.2z"/></svg>') no-repeat center / contain;
}
/* Kurzform „✦ KI“ (seit 1.51.0): Der volle Text ist eingeklappt und erscheint beim Überfahren
   des Bildes mit der Maus oder nach dem Antippen (Klasse hbs-ki-hinweis--offen, hbs-helfer.js).
   In der Lightbox steht der Text ohne innere Hülle – dort immer ausgeschrieben. */
.hbs-ki-hinweis__text {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    vertical-align: bottom;
    transition: max-width 0.25s ease, opacity 0.2s ease;
}
.hbs-ki-hinweis:has(> .hbs-ki-hinweis__text)::after { content: "KI"; content: "KI" / ""; }
:is(:hover > .hbs-ki-hinweis, .hbs-ki-hinweis:hover, .hbs-ki-hinweis--offen, .hbs-ki-hinweis--schwebt) > .hbs-ki-hinweis__text { max-width: 14em; opacity: 1; }
:is(:hover > .hbs-ki-hinweis, .hbs-ki-hinweis:hover, .hbs-ki-hinweis--offen, .hbs-ki-hinweis--schwebt):has(> .hbs-ki-hinweis__text)::after { content: none; }
@media (prefers-reduced-motion: reduce) {
    .hbs-ki-hinweis__text { transition: none; }
}
/* Video (seit 1.54.0): Kennzeichen oben links – unten liegt die Bedienleiste des Players */
.content-player figure { position: relative; }
.content-player .hbs-ki-hinweis { top: 10px; bottom: auto; left: 10px; }

/* Im Seitenkopf und Titelbild nicht vom Panel verdecken lassen: rechts unten */
:is(.hbs-seitenkopf, .hbs-hero) .hbs-ki-hinweis { left: auto; right: 16px; bottom: 16px; }

/* Seitennavigation (News, Termine, Suche) -------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--hbs-linie);
}
.pagination > p { order: 2; margin: 0; font-size: 0.875rem; color: var(--hbs-grau); }
.pagination ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pagination li { margin: 0; padding: 0; }
.pagination li::before { display: none; }
.pagination :is(a, strong) {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 1px solid var(--hbs-linie);
    border-radius: 4px;
    background: #fff;
    color: var(--hbs-schwarz);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}
.pagination a:hover { border-color: var(--hbs-gruen); background: var(--hbs-gruen-hell); }
.pagination a:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
/* Aktuelle Seite: schwarz mit grünem Balken wie die Überschriften */
.pagination strong.active { border-color: var(--hbs-schwarz); background: var(--hbs-schwarz); color: #fff; box-shadow: inset 0 -4px 0 var(--hbs-gruen); }
/* Anfang/Zurück/Weiter/Ende als Pfeile; die Beschriftung bleibt für Screenreader im Link */
.pagination :is(.first, .previous, .next, .last) > a { width: 44px; padding: 0; overflow: hidden; text-indent: 100px; white-space: nowrap; }
.pagination :is(.first, .previous, .next, .last) > a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: no-repeat center / 20px;
}
.pagination .previous > a::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%231a1a1a" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M11 6l-6 6 6 6"/></svg>'); }
.pagination .next > a::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%231a1a1a" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>'); }
.pagination .first > a::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%231a1a1a" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5v14M18 6l-6 6 6 6"/></svg>'); }
.pagination .last > a::before { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%231a1a1a" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M19 5v14M6 6l6 6-6 6"/></svg>'); }
@media (max-width: 559px) {
    .pagination { justify-content: center; }
    .pagination > p { order: 0; width: 100%; text-align: center; }
    .pagination ul { justify-content: center; gap: 4px; }
    .pagination :is(a, strong) { min-width: 40px; height: 40px; padding: 0 6px; }
    .pagination :is(.first, .previous, .next, .last) > a { width: 40px; }
    .pagination :is(.first, .last) { display: none; }
}

/* News-Einzelansicht (Template news_hbs_voll) ------------------------------ */

.hbs-news-voll { max-width: 72ch; }
.hbs-news-voll__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 20px; color: var(--hbs-grau); font-weight: 600; }
.hbs-news-voll__text > * + * { margin-top: 24px; }
.hbs-news-voll__anhang { margin-top: 40px; padding: 24px 28px; border-radius: var(--hbs-radius); background: var(--hbs-gruen-hell); }
.hbs-news-voll__anhang h2 { margin: 0 0 12px; font-size: 1.15rem; }
.hbs-news-voll__anhang ul { margin: 0; padding: 0; list-style: none; }
.hbs-news-voll__anhang li { margin: 0; padding: 10px 0; border-top: 1px solid var(--hbs-linie); }
.hbs-news-voll__anhang li:first-child { border-top: 0; padding-top: 0; }
.hbs-news-voll__anhang li::before { display: none; }
.hbs-news-voll__anhang a { font-weight: 600; }
.hbs-news-voll__anhang .hbs-dateiinfo { display: block; font-size: 0.8rem; color: var(--hbs-grau); }
.hbs-news-voll__zurueck { margin: 48px 0 0; }
.hbs-news-voll__zurueck .hbs-button::before {
    content: "";
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M11 6l-6 6 6 6"/></svg>') no-repeat center;
}
.hbs-news-voll__zurueck .hbs-button:hover::before { filter: invert(1); }

/* Weitere Meldungen (rechte Spalte der News-Einzelansicht) ---------------- */

.hbs-weitere ul { margin: 0; padding: 0; list-style: none; }
.hbs-weitere li { position: relative; margin: 0; padding: 12px 0; border-top: 1px solid rgba(74, 122, 12, 0.15); }
.hbs-weitere li:first-child { border-top: 0; padding-top: 0; }
.hbs-weitere li::before { display: none; }
.hbs-weitere__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 4px; font-size: 0.8125rem; color: var(--hbs-grau); }
.hbs-weitere .hbs-label { font-size: 0.75rem; }
.hbs-randspalte .hbs-weitere__titel { margin: 0; font-family: var(--hbs-font-text); font-size: 0.95rem; font-weight: 700; line-height: 1.35; }
.hbs-weitere__titel a { color: var(--hbs-schwarz); text-decoration: none; }
/* Der ganze Eintrag ist klickbar */
.hbs-weitere__titel a::after { content: ""; position: absolute; inset: 0; }
.hbs-weitere li:hover .hbs-weitere__titel a { color: var(--hbs-gruen-text); text-decoration: underline; text-decoration-color: var(--hbs-gruen); }
.hbs-weitere__titel a:focus-visible { outline: none; }
.hbs-weitere li:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; border-radius: 4px; }
.hbs-weitere__alle { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(74, 122, 12, 0.2); }
.hbs-weitere__alle a { display: inline-flex; align-items: center; gap: 8px; color: var(--hbs-schwarz); font-weight: 700; text-decoration: none; }
.hbs-weitere__alle a::after {
    content: "";
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>') no-repeat center;
}
.hbs-weitere__alle a:hover { text-decoration: underline; text-decoration-color: var(--hbs-gruen); }

/* Zeitstrahl (Elementgruppe hbs_zeitstrahl, z. B. Schulgeschichte). Je Jahr ein Text-Element:
   Überschrift = Jahr, Absätze = Ereignisse. Schmal: Jahr über dem Text, Linie links.
   Breit: Jahr links, Linie mit Punkt, Ereignisse rechts. Absatz-Klasse hbs-meilenstein hebt hervor. */
.hbs-zeitstrahl {
    --zs-linie: #e4ea98;
    --zs-jahr: 0px;          /* Breite der Jahresspalte (0 = Jahr über dem Text) */
    --zs-achse: 8px;         /* Mitte der Linie ab der Jahresspalte */
    --zs-einzug: 36px;       /* Abstand Text ab der Jahresspalte */
    max-width: 72ch;
}
.hbs-main .mod_article > .hbs-zeitstrahl { margin-block: 40px; }
.hbs-zeitstrahl > :is(h2, h3) { margin: 0 0 22px; }

.hbs-zeitstrahl > .content-text {
    position: relative;
    max-width: none;
    margin: 0;
    padding: 0 0 26px calc(var(--zs-jahr) + var(--zs-einzug));
}
/* Linie */
.hbs-zeitstrahl > .content-text::before {
    content: "";
    position: absolute;
    left: calc(var(--zs-jahr) + var(--zs-achse) - 1px);
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--zs-linie);
}
.hbs-zeitstrahl > .content-text:first-of-type::before { top: 10px; }
.hbs-zeitstrahl > .content-text:last-child { padding-bottom: 8px; }
.hbs-zeitstrahl > .content-text:last-child::before { background: linear-gradient(var(--zs-linie) 50%, transparent); }

/* Jahr mit Punkt auf der Linie */
.hbs-zeitstrahl > .content-text > :is(h2, h3, h4) {
    position: relative;
    margin: 0 0 6px;
    font-family: var(--hbs-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hbs-gruen-text);
    font-variant-numeric: tabular-nums;
}
.hbs-zeitstrahl > .content-text > :is(h2, h3, h4)::before {
    content: "";
    position: absolute;
    left: calc(var(--zs-achse) - var(--zs-einzug) - 8px);
    top: 0.2em;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 3px solid var(--hbs-gruen);
    border-radius: 50%;
    background: #fff;
}
.hbs-zeitstrahl > .content-text:has(.hbs-meilenstein) > :is(h2, h3, h4)::before {
    left: calc(var(--zs-achse) - var(--zs-einzug) - 10px);
    top: 0.1em;
    width: 20px;
    height: 20px;
    border-color: var(--hbs-gruen);
    background: var(--hbs-gruen);
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--hbs-gruen-hell);
}

/* Ereignisse */
.hbs-zeitstrahl .rte > p { margin: 0 0 10px; }
.hbs-zeitstrahl .rte > :last-child { margin-bottom: 0; }
.hbs-zeitstrahl .rte a { font-weight: 600; color: var(--hbs-schwarz); text-decoration-color: var(--hbs-gruen); text-decoration-thickness: 2px; }
.hbs-zeitstrahl .rte a:hover { color: var(--hbs-gruen-text); }
.hbs-zeitstrahl .hbs-dateiinfo { display: block; margin-top: 1px; font-size: 0.8125rem; color: var(--hbs-grau); }
.hbs-zeitstrahl .rte > :is(p, details).hbs-meilenstein {
    padding: 12px 16px;
    border-left: 4px solid var(--hbs-gruen);
    border-radius: 0 4px 4px 0;
    background: var(--hbs-gruen-hell);
}

/* Breite Spalte: Jahr links neben der Linie */
@container hauptspalte (min-width: 560px) {
    .hbs-zeitstrahl { --zs-jahr: 8rem; --zs-achse: 22px; --zs-einzug: 48px; }
    .hbs-zeitstrahl > .content-text > :is(h2, h3, h4) {
        position: absolute;
        left: 0;
        top: 0;
        width: var(--zs-jahr);
        margin: 0;
        text-align: right;
    }
    .hbs-zeitstrahl > .content-text > :is(h2, h3, h4)::before { left: calc(100% + var(--zs-achse) - 8px); }
    .hbs-zeitstrahl > .content-text:has(.hbs-meilenstein) > :is(h2, h3, h4)::before { left: calc(100% + var(--zs-achse) - 10px); }
    .hbs-zeitstrahl > .content-text > .rte { min-height: 1.6rem; }
    .hbs-zeitstrahl .rte > :is(p, details).hbs-meilenstein:first-child { margin-top: -12px; }
}

/* Zeitstrahl: Ereignis mit Beschreibung zum Aufklappen (hbs-helfer.js) */
.hbs-zeitstrahl .rte > details { margin: 0 0 10px; }
.hbs-zeitstrahl__ereignis > summary {
    display: inline;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--hbs-schwarz);
    text-decoration: underline;
    text-decoration-color: var(--hbs-gruen);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.hbs-zeitstrahl__ereignis > summary::-webkit-details-marker { display: none; }
.hbs-zeitstrahl__ereignis > summary::after {
    content: "";
    display: inline-block;
    width: 0.45em;
    height: 0.45em;
    margin-left: 0.5em;
    border-right: 2px solid var(--hbs-gruen-text);
    border-bottom: 2px solid var(--hbs-gruen-text);
    vertical-align: 0.2em;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.hbs-zeitstrahl__ereignis[open] > summary::after { transform: rotate(-135deg); vertical-align: -0.05em; }
.hbs-zeitstrahl__ereignis > summary:hover { color: var(--hbs-gruen-text); }
.hbs-zeitstrahl__karte {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 4px;
    background: var(--hbs-band);
    font-size: 0.9375rem;
}
.hbs-zeitstrahl .rte > details.hbs-meilenstein .hbs-zeitstrahl__karte { background: #fff; }
.hbs-zeitstrahl__karte > * { margin: 0 0 8px; }
.hbs-zeitstrahl__karte > :last-child { margin-bottom: 0; }
.hbs-zeitstrahl__karte > ul { margin: 0; padding: 0; list-style: none; }
.hbs-zeitstrahl__karte > ul > li { margin: 4px 0 0; padding: 0 0 0 1.2em; position: relative; }
.hbs-zeitstrahl__karte > ul > li::before { content: "→"; position: absolute; left: 0; color: var(--hbs-gruen-text); }
.hbs-zeitstrahl__link .hbs-dateiinfo { display: inline; margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .hbs-zeitstrahl__ereignis > summary::after { transition: none; } }

/* Sprungleiste zu Abschnitten (Liste mit Klasse hbs-sprungleiste im Text) */
.hbs-main .rte ul.hbs-sprungleiste { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2em 0 0; padding: 0; list-style: none; }
.hbs-main .rte ul.hbs-sprungleiste > li { margin: 0; padding: 0; }
.hbs-main .rte ul.hbs-sprungleiste > li::before { content: none; }
.hbs-main .rte ul.hbs-sprungleiste a {
    display: inline-block;
    padding: 5px 14px;
    border: 2px solid var(--hbs-gruen);
    border-radius: 4px;
    color: var(--hbs-schwarz);
    font-weight: 600;
    text-decoration: none;
}
.hbs-main .rte ul.hbs-sprungleiste a:hover,
.hbs-main .rte ul.hbs-sprungleiste a:focus-visible { background: var(--hbs-gruen-hell); }

/* 7. Fußzeile -------------------------------------------------------------- */

.hbs-footer {
    background: var(--hbs-schwarz);
    color: #d6d6d6;
    border-top: 6px solid var(--hbs-gruen);
    font-size: 0.95rem;
}
.hbs-footer a { color: #fff; }
.hbs-footer a:hover { color: var(--hbs-gruen); }
.hbs-footer p { margin: 0; line-height: 1.6; }
.hbs-footer__inhalt {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px 48px;
    padding-top: 44px;
    padding-bottom: 36px;
}
.hbs-footer__schule { display: flex; flex-wrap: wrap; gap: 16px 56px; }
.hbs-footer__name { font-family: var(--hbs-font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.3 !important; color: var(--hbs-gruen); }
.hbs-footer__name span { display: block; margin-top: 4px; font-family: var(--hbs-font-text); font-size: 0.875rem; font-weight: 400; color: #bdbdbd; }
.hbs-footer__kontakt { display: flex; flex-wrap: wrap; gap: 16px 56px; font-style: normal; }
.hbs-footer__kontakt a { text-decoration: none; }
.hbs-footer__kontakt a:hover { text-decoration: underline; }

/* Slot footer: Schulträger (Überschrift als kleines Label, Logo darunter) */
.hbs-footer__slot:not(:has(*)) { display: none; }
.hbs-footer__slot :is(h2, h3, h4, h5) { margin: 0 0 10px; font-family: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #a3a3a3; }
.hbs-footer__slot figure { margin: 0; }
.hbs-footer__slot figure img { display: block; max-width: 170px; height: auto; padding: 10px 14px; background: #fff; border-radius: 4px; }
.hbs-footer__slot a:hover img { outline: 2px solid var(--hbs-gruen); outline-offset: 2px; }

.hbs-kompakt { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; line-height: 1.45; }
.hbs-kompakt time { font-size: 0.8125rem; color: #a3a3a3; }
.hbs-kompakt a { text-decoration: none; }
.hbs-main .hbs-kompakt time { color: var(--hbs-grau); }
.hbs-main .hbs-kompakt a { color: var(--hbs-schwarz); font-weight: 600; }

.hbs-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 28px;
    padding-top: 20px;
    padding-bottom: 24px;
    border-top: 1px solid #333;
    font-size: 0.875rem;
    color: #bdbdbd;
}
.hbs-footer__bottom ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.hbs-footer__bottom a { color: #bdbdbd; text-decoration: none; }

/* 8. Mobil und Hilfsklassen ------------------------------------------------ */

@media (max-width: 1023px) {
    .hbs-servicebar__label,
    .hbs-servicebar__kontakt { display: none; }
    .hbs-servicebar__links, .hbs-servicebar ul { width: 100%; justify-content: space-between; gap: 8px; }
    .hbs-servicebar a { display: inline-block; padding: 12px 2px; }

    .hbs-header__inner { min-height: 72px; }
    .hbs-logo img { height: 52px; }
    .hbs-logo__mark { width: 44px; height: 44px; font-size: 0.95rem; border-radius: 4px; }
    .hbs-logo__text strong { font-size: 1.05rem; }
    .hbs-logo__text span { font-size: 0.8125rem; }
    .hbs-header .mod_search { display: none; }

    .hbs-content:has(> .hbs-sidebar) { grid-template-columns: 1fr; }
    .hbs-content:is(:has(> .hbs-sidebar), :has(> .hbs-randspalte)),
    .hbs-content:has(> .hbs-sidebar):has(> .hbs-randspalte) { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .hbs-sidebar { order: 2; }

    .hbs-hero .mod_article > :is(.content-headline, .content-text) { width: 100%; margin: 0; padding: 28px var(--hbs-rand) 32px; border-radius: 0; }

    .hbs-hinweis { padding: 22px 20px 24px; }

    :is(.hbs-kachel, .hbs-kacheln > .content-text).media--below > figure { margin: 16px -24px -24px; }
}

@media (max-width: 640px) {
    /* News-Karten werden zu kompakten Zeilen mit kleinem Bild */
    .mod_newslist:has(.hbs-news-karte) { grid-template-columns: 1fr; gap: 12px; }
    .hbs-news-karte { flex-direction: row; gap: 14px; padding: 12px; border-radius: 4px; }
    .hbs-news-karte__bild { flex: 0 0 96px; height: 96px; aspect-ratio: auto; border-radius: 4px; overflow: hidden; }
    .hbs-news-karte__text { padding: 0; gap: 8px; }
    .hbs-news-karte__titel { font-size: 1rem; }
    .hbs-news-karte__teaser, .hbs-news-karte__mehr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

.invisible {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   PDF zum Blättern (Inhaltselement hbs_flipbook)
   ------------------------------------------------------------------ */
.hbs-flipbook {
    --hbs-seitenformat: 0.7071;
    margin-block: 32px;
}
.hbs-flipbook__buehne {
    position: relative;
    padding: clamp(12px, 3vw, 32px);
    background: var(--hbs-band);
    border-radius: var(--hbs-radius);
}
.hbs-flipbook__buch { margin-inline: auto; }
/* StPageFlip setzt eine Mindestbreite inline – auf kleinen Handys zu breit */
.hbs-flipbook .stf__parent { min-width: 0 !important; }
/* Schmale Spalte (einzelne Seiten): nicht breiter als nötig, sonst wird das Heft zu hoch.
   Die Klasse setzt hbs-flipbook.js nach der Breite der Bühne, nicht nach der Ausrichtung. */
.hbs-flipbook--schmal .hbs-flipbook__buch { max-width: 30rem; }
.hbs-flipbook__blatt {
    background: #fff;
    overflow: hidden;
}
.hbs-flipbook__blatt img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.hbs-flipbook__status {
    margin: 0;
    padding: 48px 16px;
    text-align: center;
    color: var(--hbs-grau);
}
.hbs-flipbook--fehler .hbs-flipbook__buch { display: none; }

.hbs-flipbook__leiste {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
.hbs-flipbook__leiste[hidden] { display: none; }
.hbs-flipbook__knopf {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--hbs-schwarz);
    color: #fff;
    cursor: pointer;
}
.hbs-flipbook__knopf[hidden] { display: none; }
.hbs-flipbook__knopf svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hbs-flipbook__knopf:hover:not(:disabled) { background: var(--hbs-gruen-text); }
.hbs-flipbook__knopf:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-flipbook__knopf:disabled { opacity: 0.3; cursor: default; }
.hbs-flipbook__lupe { margin-left: 12px; }
.hbs-flipbook__lupe + .hbs-flipbook__vollbild { margin-left: 0; }
.hbs-flipbook__vollbild { margin-left: 12px; }
.hbs-flipbook__seite {
    min-width: 11em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--hbs-grau);
}
.hbs-flipbook__download { margin: 12px 0 0; text-align: center; }
.hbs-flipbook__download .hbs-dateiinfo { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--hbs-grau); }

/* Vollbild: Heft so groß wie möglich, Höhe begrenzt die Breite */
.hbs-flipbook:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 16px;
    background: var(--hbs-schwarz);
}
.hbs-flipbook:fullscreen .hbs-flipbook__buehne { padding: 0; background: none; }
.hbs-flipbook:fullscreen .hbs-flipbook__buch {
    max-width: min(100%, calc((100vh - 120px) * var(--hbs-seitenformat) * 2));
}
.hbs-flipbook--schmal:fullscreen .hbs-flipbook__buch {
    max-width: min(100%, calc((100vh - 120px) * var(--hbs-seitenformat)));
}
.hbs-flipbook:fullscreen .hbs-flipbook__seite,
.hbs-flipbook:fullscreen .hbs-flipbook__download,
.hbs-flipbook:fullscreen .hbs-flipbook__download a { color: #fff; }
.hbs-flipbook:fullscreen .hbs-flipbook__knopf { background: #fff; color: var(--hbs-schwarz); }
.hbs-flipbook:fullscreen .hbs-flipbook__download .hbs-dateiinfo { display: none; }

/* ------------------------------------------------------------------
   Termine (Inhaltselement/Modul hbs_termine)
   ------------------------------------------------------------------ */
.hbs-termine {
    --kat-ferien: #c8d530;
    --kat-unterricht: #3d6fb6;
    --kat-veranstaltung: #c8641e;
    --kat-abitur: #7a4fa0;
    --kat-konferenz: #6b7066;
    --kat-sonstiges: #9aa093;
}
.hbs-termin--ferien, .hbs-termine__kat--ferien, .hbs-monat__chip--ferien { --kat: var(--kat-ferien); }
.hbs-termin--unterricht, .hbs-termine__kat--unterricht, .hbs-monat__chip--unterricht { --kat: var(--kat-unterricht); }
.hbs-termin--veranstaltung, .hbs-termine__kat--veranstaltung, .hbs-monat__chip--veranstaltung { --kat: var(--kat-veranstaltung); }
.hbs-termin--abitur, .hbs-termine__kat--abitur, .hbs-monat__chip--abitur { --kat: var(--kat-abitur); }
.hbs-termin--konferenz, .hbs-termine__kat--konferenz, .hbs-monat__chip--konferenz { --kat: var(--kat-konferenz); }
.hbs-termin--sonstiges, .hbs-termine__kat--sonstiges, .hbs-monat__chip--sonstiges { --kat: var(--kat-sonstiges); }

.hbs-termine__werkzeuge {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    margin-bottom: 24px;
}
.hbs-termine__werkzeuge [hidden] { display: none; }
.hbs-termine__ansicht {
    display: inline-flex;
    padding: 3px;
    border-radius: 4px;
    background: var(--hbs-band);
}
.hbs-termine__ansicht button,
.hbs-termine__kat {
    font: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    border-radius: 4px;
}
.hbs-termine__ansicht button {
    padding: 6px 16px;
    border: 0;
    background: none;
    color: var(--hbs-text);
}
.hbs-termine__ansicht button[aria-pressed="true"] { background: var(--hbs-schwarz); color: #fff; }
.hbs-termine__filter { display: flex; flex-wrap: wrap; gap: 8px; }
.hbs-termine__kat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 10px;
    border: 1px solid var(--hbs-linie);
    background: #fff;
    color: var(--hbs-grau);
}
.hbs-termine__kat::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--kat);
}
.hbs-termine__kat[aria-pressed="true"] { border-color: var(--kat); color: var(--hbs-text); }
.hbs-termine__kat[aria-pressed="true"]::before { background: var(--kat); }
.hbs-termine button:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }

/* Liste */
.hbs-termine__monat + .hbs-termine__monat { margin-top: 32px; }
.hbs-termine__monat[hidden] { display: none; }
.hbs-termine .hbs-termine__monatsname { font-size: 1.25rem; margin: 0 0 8px; }
.hbs-termine ul { margin: 0; padding: 0; list-style: none; }
.hbs-termin {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--hbs-linie);
    /* wie die Terminkarten: heller Ton als Fläche, dunkler Ton als Schrift */
    --kat-flaeche: color-mix(in srgb, var(--kat) 14%, #fff);
    --kat-schrift: color-mix(in srgb, var(--kat) 52%, #000);
}
.hbs-termin[hidden] { display: none; }
.hbs-termin:target { background: var(--hbs-gruen-hell); }
/* Seit 1.60.2 wie die Terminkarten: Datumskasten fester Größe, „bis …“ als eigener kleiner Kasten */
.hbs-termin__datum {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--kat-schrift);
    line-height: 1.05;
    text-align: center;
}
.hbs-termin__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 4.25rem;
    padding: 6px 2px;
    border-radius: 4px;
    background: var(--kat-flaeche);
}
.hbs-termin__wtag, .hbs-termin__mon { font-size: 0.8125rem; font-weight: 600; }
.hbs-termin__tag { font-family: var(--hbs-font-display); font-size: 1.5rem; font-weight: 700; }
.hbs-termin__bis { padding: 4px 2px; border-radius: 4px; background: var(--kat-flaeche); font-size: 0.75rem; }
.hbs-termin__text p { margin: 0; }
.hbs-termin__titel { font-weight: 600; }
.hbs-termin__info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 4px !important;
    font-size: 0.875rem;
    color: var(--hbs-grau);
}
.hbs-termin__label { display: inline-flex; align-items: center; gap: 6px; }
.hbs-termin__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kat); }
.hbs-termin__teaser { margin-top: 6px; font-size: 0.9375rem; }
.hbs-termine__leer { color: var(--hbs-grau); }
.hbs-termine__leer[hidden] { display: none; }

/* Karten der nächsten Termine (Ansicht „Karten“, z. B. Startseite unter Aktuelles).
   Schmal: kompakte Zeilen untereinander, ab 760 px zwei, ab 1000 px vier nebeneinander. */
.hbs-terminkarten { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container hauptspalte (min-width: 760px) {
    .hbs-terminkarten { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@container hauptspalte (min-width: 1000px) {
    .hbs-terminkarten { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}
.hbs-terminkarte {
    position: relative;
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--hbs-linie);
    border-radius: var(--hbs-radius);
    background: #fff;
    transition: border-color 0.15s;
    /* Kategoriefarbe: heller Ton als Fläche, dunkler Ton als Schrift (Kontrast > 4.5:1) */
    --kat-flaeche: color-mix(in srgb, var(--kat) 14%, #fff);
    --kat-schrift: color-mix(in srgb, var(--kat) 52%, #000);
}
.hbs-terminkarte::before { display: none; }
/* Seit 1.60.1: Datumskasten immer gleich groß; „bis …“ steht als eigener kleiner Kasten darunter */
.hbs-terminkarte__datum {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--kat-schrift);
    line-height: 1.05;
    text-align: center;
}
.hbs-terminkarte__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 4.75rem;
    padding: 8px 2px;
    border-radius: 4px;
    background: var(--kat-flaeche);
}
.hbs-terminkarte__wtag, .hbs-terminkarte__mon { font-size: 0.8125rem; font-weight: 600; }
.hbs-terminkarte__tag { font-family: var(--hbs-font-display); font-size: 1.65rem; font-weight: 700; }
.hbs-terminkarte__bis { padding: 4px 2px; border-radius: 4px; background: var(--kat-flaeche); font-size: 0.75rem; }
.hbs-terminkarte__text p { margin: 0; }
.hbs-terminkarte__kat {
    display: inline-block;
    margin-bottom: 6px !important;
    padding: 2px 9px;
    border-radius: 4px;
    background: var(--kat-flaeche);
    color: var(--kat-schrift);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}
.hbs-terminkarte__titel { color: var(--hbs-schwarz); font: 600 1rem/1.3 var(--hbs-font-display); overflow-wrap: break-word; hyphens: auto; }
.hbs-terminkarte__titel a { color: inherit; text-decoration: none; }
.hbs-terminkarte__titel a:focus-visible { outline: none; }
/* Die ganze Karte ist klickbar */
.hbs-terminkarte__titel a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hbs-terminkarte { transition: border-color 0.15s; }
.hbs-terminkarte:has(a):hover { border-color: var(--hbs-gruen); }
.hbs-terminkarte:hover .hbs-terminkarte__titel a { text-decoration: underline; text-decoration-color: var(--hbs-gruen); text-decoration-thickness: 2px; }
.hbs-terminkarte:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-terminkarte__info {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 6px !important;
    font-size: 0.875rem;
    color: var(--hbs-grau);
}
.hbs-terminkarte__jetzt { display: inline-flex; align-items: center; gap: 6px; color: var(--hbs-gruen-text); font-weight: 600; }
.hbs-terminkarte__jetzt::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hbs-gruen); }

/* Aktuelles, rechte Spalte: Termine als Liste in einer weißen Fläche statt einzelner Karten */
.hbs-aktuelles-termine .hbs-terminkarten {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    overflow: hidden;
    border-radius: 0;
    background: #fff;
}
.hbs-aktuelles-termine .hbs-terminkarte {
    grid-template-columns: 3.4rem minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 0;
    border-radius: 0;
}
.hbs-aktuelles-termine .hbs-terminkarte + .hbs-terminkarte { border-top: 1px solid var(--hbs-linie); }
.hbs-aktuelles-termine .hbs-terminkarte:has(a):hover { background: var(--hbs-gruen-hell); }
.hbs-aktuelles-termine .hbs-terminkarte:focus-within { outline-offset: -3px; }
.hbs-aktuelles-termine .hbs-terminkarte__block { min-height: 3.9rem; padding: 6px 2px; }
.hbs-aktuelles-termine .hbs-terminkarte__tag { font-size: 1.35rem; }
.hbs-aktuelles-termine .hbs-terminkarte__wtag,
.hbs-aktuelles-termine .hbs-terminkarte__mon { font-size: 0.75rem; }
.hbs-aktuelles-termine .hbs-terminkarte__bis { padding: 3px 2px; font-size: 0.6875rem; }
.hbs-aktuelles-termine .hbs-terminkarte__kat { margin-bottom: 4px !important; padding: 1px 8px; font-size: 0.6875rem; }
.hbs-aktuelles-termine .hbs-terminkarte__titel { font-size: 0.9375rem; line-height: 1.3; }
.hbs-aktuelles-termine .hbs-terminkarte__info { margin-top: 4px !important; font-size: 0.8125rem; }

/* Monatsansicht */
.hbs-termine__kalender[hidden] { display: none; }
.hbs-monat__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hbs-termine .hbs-monat__name { margin: 0; font-size: 1.25rem; }
.hbs-monat__blaettern {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--hbs-schwarz);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.hbs-monat__blaettern:disabled { opacity: 0.25; cursor: default; }
/* Das Raster ist immer 100 % breit (table-layout: fixed). Titel mehrtägiger Termine laufen
   als Balken über die Folgetage und dürfen am Sonntag nicht über den Rand hinausragen:
   abschneiden statt eine Scrollleiste zu erzeugen. */
.hbs-monat__huelle { overflow-x: clip; }
.hbs-monat__raster { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hbs-monat__raster th { padding: 6px 0; font-size: 0.8125rem; font-weight: 600; color: var(--hbs-grau); text-align: center; }
.hbs-monat__raster td { height: 6.5rem; padding: 0; border: 1px solid var(--hbs-linie); vertical-align: top; } /* Höhe = Mindesthöhe, Zelle wächst mit */
.hbs-monat__wochenende { background: #fafaf8; }
.hbs-monat__ferien { background: var(--hbs-gruen-hell); }
.hbs-monat__fremd { background: #fafaf8; color: #c0c4bb; }
.hbs-monat__fremd .hbs-monat__zahl { display: block; padding: 6px 8px; font-size: 0.8125rem; }
.hbs-monat__tag {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 4px 0 6px;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hbs-monat__tag:hover { background: rgba(0, 0, 0, 0.03); }
.hbs-monat__tag[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--hbs-schwarz); }
.hbs-monat__zahl { padding: 0 8px; font-size: 0.8125rem; }
.hbs-monat__heute .hbs-monat__zahl { font-weight: 700; color: var(--hbs-gruen-text); }
.hbs-monat__chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Eintägige Termine: bis zu drei Zeilen, danach „…“; die Woche wird bei Bedarf höher */
.hbs-monat__chip {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin: 0 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--kat);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    overflow-wrap: break-word;
    hyphens: auto;
}
/* Seit 1.60.2: unsichtbare Lücke, damit Balken auf ihrer Spur bleiben */
.hbs-monat__chip--leer { visibility: hidden; }
.hbs-monat__chip--einzeilig { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Mehrtägige Termine: durchgehender einzeiliger Balken. Der Titel steht im ersten
   Stück der Woche und läuft über die folgenden Tage (--tage = Zahl der Tage). */
.hbs-monat__chip:is(.hbs-monat__chip--anfang, .hbs-monat__chip--mitte, .hbs-monat__chip--ende) {
    display: block;
    overflow: visible;
    white-space: nowrap;
}
.hbs-monat__chip-text {
    position: relative;
    z-index: 1;
    display: block;
    width: calc(var(--tage, 1) * (100% + 16px) - 21px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.hbs-monat__chip--ferien { color: var(--hbs-schwarz); }
.hbs-monat__chip--anfang { margin-right: -1px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.hbs-monat__chip--mitte { margin-inline: -1px; border-radius: 0; }
.hbs-monat__chip--ende { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.hbs-monat__mehr { padding: 0 8px; font-size: 0.75rem; color: var(--hbs-grau); }
.hbs-monat__tagesliste { margin-top: 24px; }
.hbs-monat__tagesliste h3 { margin: 0 0 8px; }
.hbs-monat__tagesliste .hbs-termin { grid-template-columns: 1fr; border-left: 4px solid var(--kat); padding-left: 12px; }

/* Schmale Spalte / Handy: Punkte statt Titel im Raster */
@container hauptspalte (max-width: 759px) {
    .hbs-monat__raster td { height: 3.25rem; }
    .hbs-monat__chips { flex-direction: row; flex-wrap: wrap; gap: 3px; padding: 0 6px; }
    .hbs-monat__chip, .hbs-monat__chip:is(.hbs-monat__chip--anfang, .hbs-monat__chip--mitte, .hbs-monat__chip--ende) { display: block; width: 8px; height: 8px; margin: 0; padding: 0; border-radius: 50%; font-size: 0; }
    .hbs-monat__chip-text { display: none; }
    .hbs-monat__mehr { display: none; }
    .hbs-termin { grid-template-columns: 4.25rem 1fr; gap: 12px; }
}

.hbs-termine__fuss { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--hbs-linie); font-size: 0.9375rem; }
.hbs-termine__fuss p { margin: 0 0 6px; }
.hbs-termine__hinweis { color: var(--hbs-grau); }
.mod_hbs_termine .hbs-termine__alle { margin-top: 8px; }

/* ------------------------------------------------------------------------
   Seite Aktuelles: Top-Meldungen (mod_newslist_hbs_top / news_hbs_top):
   Top 1 groß über die ganze Breite, Top 2–4 als Kartenreihe wie auf der Startseite
   ------------------------------------------------------------------------ */
.hbs-unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hbs-top.mod_newslist { display: block; margin: 0 0 48px; }
.hbs-top__ueberschrift { margin: 0 0 20px; }
.hbs-top__reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }

/* Jede Meldung bringt beide Darstellungen mit: groß nur oben, Karte nur in der Reihe */
.hbs-top__haupt .hbs-news-karte,
.hbs-top__reihe .hbs-top-meldung { display: none; }

.hbs-top-meldung {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    background: var(--hbs-schwarz);
    color: #fff;
    border-radius: 4px;
    overflow: hidden;
}
.hbs-top-meldung:not(:has(.hbs-top-meldung__bild)) { grid-template-columns: minmax(0, 1fr); }
.hbs-top-meldung__bild { position: relative; min-height: 100%; }
.hbs-top-meldung__bild :is(figure, picture) { margin: 0; display: block; height: 100%; }
.hbs-top-meldung__bild img { display: block; width: 100%; height: 100%; min-height: 280px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0; }
.hbs-top-meldung__text { display: flex; flex-direction: column; gap: 12px; padding: 28px 30px 28px; }
.hbs-top-meldung__meta { margin: 0; }
.hbs-top-meldung__titel { margin: 0; color: #fff; font: 600 1.65rem/1.2 var(--hbs-font-display); }
.hbs-top-meldung__titel a { color: inherit; text-decoration: none; }
.hbs-top-meldung__titel a::after { content: ""; position: absolute; inset: 0; }
.hbs-top-meldung { transition: box-shadow 0.15s; }
.hbs-top-meldung:hover { box-shadow: 0 0 0 3px var(--hbs-gruen); }
.hbs-top-meldung:hover .hbs-top-meldung__titel a { text-decoration: underline; text-decoration-color: var(--hbs-gruen); text-decoration-thickness: 2px; }
.hbs-top-meldung:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 3px; }
.hbs-top-meldung__teaser { color: #d5d8d2; }
.hbs-top-meldung__teaser p { margin: 0; }
.hbs-top-meldung__fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: auto 0 0; padding-top: 6px; }
.hbs-top-meldung__fuss time { color: #b7bbb3; font-size: 0.9rem; }
.hbs-top-meldung__mehr { background: #fff; color: var(--hbs-schwarz); font: 600 0.95rem var(--hbs-font-display); padding: 10px 16px; border-radius: 4px; }

/* News als Textzeile (news_hbs_zeile), z. B. „Weitere Meldungen“ */
.mod_newslist:has(.hbs-news-zeile) > :is(h2, h3) { margin: 0 0 8px; }
.hbs-news-zeile { position: relative; padding: 14px 0; border-top: 1px solid var(--hbs-linie); }
.mod_newslist:has(.hbs-news-zeile) > .hbs-news-zeile:last-of-type { border-bottom: 1px solid var(--hbs-linie); }
.hbs-news-zeile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 4px; color: var(--hbs-grau); font-size: 0.875rem; }
.hbs-news-zeile .hbs-label { font-size: 0.75rem; }
.hbs-news-zeile__titel { margin: 0; font: 600 1.08rem/1.35 var(--hbs-font-display); }
.hbs-news-zeile__titel a { color: var(--hbs-schwarz); text-decoration: none; }
.hbs-news-zeile__titel a::after { content: ""; position: absolute; inset: 0; }
.hbs-news-zeile:hover .hbs-news-zeile__titel a { color: var(--hbs-gruen-text); text-decoration: underline; text-decoration-color: var(--hbs-gruen); }
.hbs-news-zeile:focus-within { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }

/* Weitere Meldungen (links) und nächste Termine (rechts) */
.hbs-aktuelles-zeile { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.hbs-aktuelles-zeile > * + * { margin-top: 0; }
.hbs-aktuelles-news > * + * { margin-top: 24px; }
.hbs-aktuelles-news .mod_newslist:has(.hbs-news-karte) { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hbs-aktuelles-termine {
    padding: 22px 22px 20px;
    background: var(--hbs-gruen-hell);
    border-top: 4px solid var(--hbs-gruen);
    border-radius: 0;
}
.hbs-aktuelles-termine > :is(h2, h3) { margin: 0 0 14px; }
.hbs-aktuelles-termine > * + * { margin-top: 14px; }
.hbs-aktuelles-termine .rte ul { margin: 0; padding: 14px 0 0; list-style: none; border-top: 1px solid rgba(74, 122, 12, 0.25); }
.hbs-aktuelles-termine .rte li { margin: 0; padding: 4px 0; }
.hbs-aktuelles-termine .rte li::before { content: none; }
.hbs-aktuelles-termine .rte a { font-weight: 600; color: var(--hbs-schwarz); text-decoration: none; }
.hbs-aktuelles-termine .rte a:hover { color: var(--hbs-gruen-text); text-decoration: underline; }
.hbs-aktuelles-termine .rte p { margin: 0; }

@container hauptspalte (max-width: 760px) {
    .hbs-top-meldung { grid-template-columns: minmax(0, 1fr); }
    .hbs-top-meldung__bild img { min-height: 0; }
    .hbs-top__reihe { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .hbs-aktuelles-zeile { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .hbs-aktuelles-termine { order: -1; }
}
@container hauptspalte (max-width: 520px) {
    .hbs-top-meldung__text { padding: 20px 20px 22px; }
    .hbs-top-meldung__titel { font-size: 1.35rem; }
}

/* Leitsatz-Liste (seit 1.45.0): <ol class="hbs-leitsaetze">, z. B. Leitbild.
   Große grüne Ziffer, Luft zwischen den Punkten, Kernsatz am Anfang fett (<strong>). */
.hbs-main .rte ol.hbs-leitsaetze { margin: 1.4em 0 1.6em; padding: 0; list-style: none; counter-reset: leitsatz; }
.hbs-main .rte ol.hbs-leitsaetze > li { position: relative; min-height: 44px; padding-left: 64px; counter-increment: leitsatz; }
.hbs-main .rte ol.hbs-leitsaetze > li + li { margin-top: 1.6em; }
.hbs-main .rte ol.hbs-leitsaetze > li::before {
    content: counter(leitsatz);
    position: absolute;
    top: -6px;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hbs-gruen);
    color: #fff;
    font-family: var(--hbs-font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 44px;
    text-align: center;
}
.hbs-main .rte ol.hbs-leitsaetze > li > strong:first-child { color: var(--hbs-schwarz); }
.hbs-main .rte ol.hbs-leitsaetze :is(ul, ol) { margin: 0.6em 0 0; }
.hbs-main .rte ol.hbs-leitsaetze ul > li + li { margin-top: 0.4em; }
@container hauptspalte (max-width: 559px) {
    .hbs-main .rte ol.hbs-leitsaetze > li { min-height: 36px; padding-left: 50px; }
    .hbs-main .rte ol.hbs-leitsaetze > li::before { top: -3px; width: 36px; height: 36px; font-size: 1.05rem; line-height: 36px; }
}

/* Zoom-Ansicht des Blätter-Hefts (seit 1.46.0): Seite groß, zoomen mit +/−, Strg+Mausrad, zwei Fingern */
html.hbs-zoom-offen { overflow: hidden; }
.hbs-zoom {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(10, 10, 10, 0.94);
    color: #fff;
}
.hbs-zoom[open] { display: flex; flex-direction: column; }
.hbs-zoom::backdrop { background: rgba(10, 10, 10, 0.94); }
.hbs-zoom__leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 56px 10px 12px;
    font-size: 0.9375rem;
}
.hbs-zoom__leiste button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: 600 1.25rem/1 var(--hbs-font-text);
    cursor: pointer;
}
.hbs-zoom__leiste button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hbs-zoom__leiste button:hover:not(:disabled) { background: rgba(200, 213, 48, 0.45); }
.hbs-zoom__leiste button:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: 2px; }
.hbs-zoom__leiste button:disabled { opacity: 0.35; cursor: default; }
.hbs-zoom__seite, .hbs-zoom__stufe { min-width: 6.5em; text-align: center; font-variant-numeric: tabular-nums; }
.hbs-zoom__stufe { min-width: 3.5em; }
.hbs-zoom__trenner { width: 1px; height: 24px; margin: 0 6px; background: rgba(255, 255, 255, 0.25); }
.hbs-zoom__leiste .hbs-zoom__schliessen { position: absolute; top: 10px; right: 12px; }
.hbs-zoom__flaeche {
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
    cursor: grab;
}
.hbs-zoom__flaeche:active { cursor: grabbing; }
.hbs-zoom__flaeche:focus-visible { outline: 3px solid var(--hbs-gruen); outline-offset: -3px; }
.hbs-zoom__flaeche img {
    display: block;
    max-width: none;
    height: auto;
    margin: 0 auto 24px;
    background: #fff;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}
@media (max-width: 559px) {
    .hbs-zoom__leiste { gap: 4px; padding-right: 52px; }
    .hbs-zoom__leiste button { width: 36px; height: 36px; }
    .hbs-zoom__trenner { display: none; }
}

/* Pfeil-Links in Kacheln, Infokarten, Partner- und Hinweis-Kästen (seit 1.54.3, seit 1.55.1 am Dateiende,
   damit die gleich starken Regeln für Kacheln und Partner-Kästen weiter oben nicht gewinnen): Link als normaler
   Textfluss, Pfeil direkt hinter dem letzten Wort. Vorher stand der Pfeil bei zweizeiligen Links
   (z. B. „Partnerschulen der Goethe-Universität“) am rechten Rand zwischen den Zeilen.
   U+2060 (Wortverbinder) hält den Pfeil am letzten Wort; padding-block erhält die Tippfläche. */
:is(.hbs-kachel, .hbs-kacheln > .content-text, .hbs-partner, .hbs-hinweis) :is(p:last-child, .hbs-hinweis__link) > a:only-child {
    display: inline;
    min-height: 0;
    padding-block: 10px;
    line-height: 1.4;
}
:is(.hbs-kachel, .hbs-kacheln > .content-text, .hbs-partner, .hbs-hinweis) :is(p:last-child, .hbs-hinweis__link) > a:only-child::after {
    content: "\2060";
    display: inline;
    width: auto;
    height: auto;
    padding-left: 26px;
    background-position: right center;
    background-size: 18px 18px;
    background-repeat: no-repeat;
}
:is(.hbs-kachel, .hbs-kacheln > .content-text) p:last-child:has(> a:only-child),
.hbs-hinweis :is(.rte > p:last-child, .hbs-hinweis__link):has(> a:only-child) { padding-block: 10px; }

/* Pfeil-Links in Kacheln, Partner- und Hinweis-Kästen einheitlich (seit 1.56.2):
   Datei/PDF → Download-Pfeil, externe Seite oder neues Fenster → Pfeil schräg, sonst Pfeil nach rechts.
   Steht am Ende, damit es gegen die einzelnen Regeln der Bausteine gewinnt; Datei geht vor „extern“. */
:is(.hbs-kachel, .hbs-kacheln > .content-text, .hbs-partner, .hbs-hinweis) :is(p:last-child, .hbs-hinweis__link) > a:only-child:where([target="_blank"], [href^="http"]:not([href*="heinrich-boell-schule.de"]))::after {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17 17 7M9 7h8v8"/></svg>');
}
:is(.hbs-kachel, .hbs-kacheln > .content-text, .hbs-partner, .hbs-hinweis) :is(p:last-child, .hbs-hinweis__link) > a:only-child:is([href*="files/"], [href*="file="], [href$=".pdf" i], [href*=".pdf?" i], [download])::after {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23566a06" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v12M6 11l6 6 6-6M5 20h14"/></svg>');
}
