/*
   Campe-Template-2026
   Campe-Gymnasium Holzminden
*/

:root {
    --campe-gruen: rgb(197, 210, 0);
    --campe-blau: rgb(0, 77, 143);
    --campe-orange: rgb(241, 145, 0);
    --campe-rot: rgb(165, 34, 65);

    --text: rgb(40, 54, 66);
    --text-soft: rgb(98, 112, 124);
    --paper: rgba(255, 255, 255, 0.9);
    --paper-side: rgba(255, 255, 255, 0.68);
    --paper-antik: rgba(247, 226, 194, 0.97);

    --shadow-main: 0 26px 80px rgba(0, 0, 0, 0.20);
    --shadow-side: 0 10px 30px rgba(0, 0, 0, 0.10);
    --radius-main: 32px;
    --radius-side: 22px;

    --font: "Source Sans 3", "Open Sans", Arial, sans-serif;
    --z-fixed: 2147483647;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding-top: 92px;
    padding-bottom: 50px;
    overflow-x: hidden;
    font-family: var(--font);
    color: var(--text);
    background: #eef3f6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url("images/atrium.png") center / cover no-repeat;
    filter: saturate(0.85) brightness(1.03);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(120deg, rgba(255,255,255,0.84), rgba(255,255,255,0.42)),
        radial-gradient(circle at 18% 16%, rgba(197,210,0,0.22), transparent 30%),
        radial-gradient(circle at 90% 78%, rgba(0,77,143,0.24), transparent 36%);
}

img {
    max-width: 100%;
    height: auto;
}

p,
li,
a {
    font-size: 1.07rem;
    line-height: 1.72;
}

p {
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--campe-blau);
}

/* Mailadressen bleiben erkennbar und duerfen bei Platzmangel umbrechen. */
a[href^="mailto:"],
a.email-link {
    color: var(--campe-blau);
    text-decoration: underline;
    text-decoration-color: rgba(0,77,143,0.34);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    -webkit-hyphens: none;
    hyphens: none;
    overflow-wrap: anywhere;
    word-break: normal;
}

h1,
h2,
h3 {
    hyphens: none;
}

h1 {
    margin-bottom: 0.35em;
    font-size: clamp(2.35rem, 4.2vw, 4rem);
    font-weight: 880;
    line-height: 0.98;
    letter-spacing: -0.065em;
    color: var(--campe-blau);
}

h2 {
    margin-bottom: 0.65em;
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 780;
    line-height: 1.05;
    letter-spacing: -0.045em;
    color: var(--text);
}

h3 {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-soft);
    text-align: right;
}

/*
   Rueckwaertskompatibilitaet fuer bestehende WBCE-Inhalte:
   h4 wird dort als „Weiterlesen“-Flaeche verwendet, h5 fuer
   Bildunterschriften.
*/
h4 {
    display: block;
    width: min(80%, 34rem);
    margin: 1.5rem auto;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    background: rgba(250,235,215,0.9);
    box-shadow: 0 8px 22px rgba(0,0,0,0.16);
    color: var(--campe-blau);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    user-select: none;
}

h4 a {
    display: block;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

h4:hover {
    background: white;
}

h5 {
    display: block;
    width: min(100%, 52rem);
    margin: 0.45rem auto 1.35rem;
    padding: 0 0.5rem;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-wrap: pretty;
}

/* Eine neue Ueberschrift nach einer Tabelle braucht sichtbar Luft. */
table + h2 {
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

hr {
    height: 1px;
    margin: 1.25rem 0 2rem;
    border: 0;
    background: rgba(0,77,143,0.22);
}

.rand hr {
    margin-bottom: 1.15rem;
}

/* Kopf- und Fußleiste ----------------------------------------------------- */

#kontakt,
footer {
    position: fixed;
    left: 0;
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 1.25rem;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    box-shadow: 0 0 32px rgba(0,0,0,0.16);
}

#kontakt {
    top: 0;
    height: 92px;
    justify-content: space-between;
    gap: 1.4rem;
}

.kontakt-logo {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 0 0 auto;
    padding: 0.35rem 1.2rem 0.35rem 0;
}

.kontakt-logo img {
    display: block;
    width: auto;
    height: 72px;
}

.kontakt-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex: 1 1 auto;
    min-width: 0;
}

.kontakt-line {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    line-height: 1.2;
    white-space: nowrap;
}

.kontakt-line span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4em;
    color: var(--campe-blau);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.kontakt-line a {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.kontakt-links {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.kontakt-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    font-weight: 700;
}

.kontakt-links a:hover {
    color: white;
    background: var(--campe-blau);
}

.nodek:hover {
    text-decoration: none;
}

#kontakt p,
#kontakt a,
footer p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.2;
}

footer {
    bottom: 0;
    height: 50px;
    justify-content: center;
    text-align: center;
}

/* Moderne Header-Suche ---------------------------------------------------- */

.header-search {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-height: 36px;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    overflow: hidden;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.header-search:focus-within {
    background: rgba(255,255,255,0.96);
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.search-toggle-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-toggle,
.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.search-toggle:hover,
.search-submit:hover {
    color: white;
    background: var(--campe-blau);
}

.search-toggle svg,
.search-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.search-input {
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    outline: none;
    opacity: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.98rem;
    transition: width 0.22s ease, padding 0.22s ease, opacity 0.18s ease;
}

.header-search:focus-within .search-input,
.search-toggle-checkbox:checked ~ .search-input {
    width: 230px;
    padding: 0 0.35rem 0 0.8rem;
    opacity: 1;
}

.search-submit {
    display: none;
}

.header-search:focus-within .search-submit,
.search-toggle-checkbox:checked ~ .search-submit {
    display: inline-flex;
}

.header-search:focus-within .search-toggle,
.search-toggle-checkbox:checked ~ .search-toggle {
    display: none;
}

/* Hero -------------------------------------------------------------------- */

.hero {
    position: relative;
    isolation: isolate;
    min-height: clamp(560px, 68vh, 860px);
    display: grid;
    align-items: end;
    margin-bottom: 0;
    overflow: hidden;
    background: var(--campe-blau);
}

.hero::before {
    content: "";
    position: absolute;
    inset: -36vh 0;
    z-index: -2;
    background-image: var(--page-image, url("images/campe-aussen.jpg"));
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    transform: translate3d(0, var(--hero-shift, 0px), 0);
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(0,77,143,0.82), rgba(0,77,143,0.22) 48%, rgba(0,0,0,0.05)),
        linear-gradient(0deg, rgba(0,0,0,0.48), transparent 58%);
}

.hero-top {
    position: relative;
    z-index: 1;
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding: 4.2rem 0 6.2rem;
    transform: translate3d(0, var(--hero-content-shift, 0px), 0);
    will-change: transform;
}

.logo-link img {
    display: block;
    width: min(340px, 62vw);
    margin-bottom: 2rem;
    filter: drop-shadow(0 14px 24px rgba(0,0,0,0.26));
}

.hero-title h1 {
    max-width: 940px;
    color: white;
    font-size: clamp(3.1rem, 7vw, 6.5rem);
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 8 4 4;
    overflow-wrap: normal;
    word-break: normal;
    text-shadow: 0 12px 42px rgba(0,0,0,0.34);
}

.eyebrow {
    margin-bottom: 0.9rem;
    color: var(--campe-gruen);
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: var(--campe-blau);
}

.lead {
    max-width: 650px;
    margin-top: 1.1rem;
    color: rgba(255,255,255,0.94);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.42;
}

/* Navigation --------------------------------------------------------------- */

.nav-wrap {
    position: sticky;
    top: 100px;
    z-index: 5000;
    width: min(1100px, 92vw);
    margin: -34px auto 3.2rem;
}

#menu-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-button {
    display: none;
}

nav {
    width: 100%;
    padding: 0.45rem;
    border: 1px solid rgba(255,255,255,0.58);
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-main);
    user-select: none;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
}

nav > ul > li {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

nav > ul > li > a {
    display: block;
    padding: 0.74rem 0.65rem;
    border-radius: 999px;
    color: darkslategray;
    font-weight: 800;
    line-height: 1.12;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease;
}

nav > ul > li:hover > a {
    color: white;
    background: var(--campe-blau);
}

nav li ul {
    position: absolute;
    top: 100%;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: 230px;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-4px);
    border-radius: 20px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-main);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

nav > ul > li::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 18px;
}

nav li:hover > ul {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

nav li ul a {
    display: block;
    padding: 0.72rem 1rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.25;
}

nav li ul a:hover {
    color: var(--campe-blau);
    background: rgba(197,210,0,0.16);
}

/* WBCE-Struktur: rand | mitte | rand -------------------------------------- */

#wrapper {
    width: min(1220px, calc(100% - 2rem));
    min-width: 0;
    max-width: 100%;
    margin: 0 auto 4.5rem;
}

#content {
    display: grid;
    grid-template-columns: minmax(190px, 0.82fr) minmax(0, 2.2fr) minmax(190px, 0.82fr);
    align-items: start;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 1.15rem;
}

#mitte,
.rand {
    min-width: 0;
    max-width: 100%;
}

#mitte {
    position: relative;
    z-index: 2;
    scroll-margin-top: 10rem;
}

/*
   Ruhige Grundflaeche unter jedem belegten WBCE-Bereich. Sie besitzt bewusst
   weder einen eigenen Rahmen noch einen Schatten: .weiss und .antik bleiben
   dadurch als einzelne, deutlich erkennbare Sinneinheiten erhalten.
*/
#mitte.content-surface,
.rand.content-surface {
    padding: clamp(1rem, 1.8vw, 1.5rem);
    border: 0;
    background: rgba(255,255,255,0.36);
    backdrop-filter: blur(7px);
    box-shadow: none;
}

#mitte.content-surface {
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border-radius: calc(var(--radius-main) + 8px);
    background: rgba(255,255,255,0.42);
}

/* Typografie in der schmaleren Artikelspalte bewusst kompakter halten. */
#mitte h1 {
    font-size: clamp(2.1rem, 3.15vw, 3rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

#mitte h2 {
    font-size: clamp(1.3rem, 1.75vw, 1.7rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

#mitte p,
#mitte li {
    font-size: 1.03rem;
    line-height: 1.65;
}

.rand.content-surface {
    border-radius: calc(var(--radius-side) + 7px);
}

.content-surface > :last-child {
    margin-bottom: 0;
}

#mitte .weiss {
    margin-bottom: 1.25rem;
    background: var(--paper);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.68);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-main);
    padding: clamp(1.6rem, 3.2vw, 3.1rem);
}

/* Nur .antik erhaelt die Optik eines alten, angehefteten Papierblatts. */
.antik::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    z-index: 1;
    width: clamp(68px, 22%, 98px);
    height: 22px;
    transform: translateX(-50%);
    border-radius: 2px;
    border: 1px solid rgba(133,91,39,0.2);
    background: linear-gradient(90deg, rgba(222,195,139,0.82), rgba(242,222,177,0.9), rgba(210,179,119,0.8));
    box-shadow: 0 3px 7px rgba(70,42,15,0.16);
    pointer-events: none;
}

/* Kleine Illustrationen bleiben scharf und erhalten Abstand zum Text. */
#mitte .weiss img[style*="float: right"],
#mitte .weiss img[style*="float:right"] {
    margin: 0.15rem 0 1rem 1.25rem;
}

#mitte .weiss img[style*="float: left"],
#mitte .weiss img[style*="float:left"] {
    margin: 0.15rem 1.25rem 1rem 0;
}

/* Ein Bild innerhalb einer h1 behaelt seine im Editor festgelegte Groesse
   und sein echtes Floating. Nur Abstand und Textausrichtung werden geglaettet;
   Bildrahmen, Schatten oder eine kuenstliche Vergroesserung gibt es hier nicht. */
#mitte h1 > img[style*="float"] {
    max-width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#mitte h1:has(> img[style*="float: right"]),
#mitte h1:has(> img[style*="float:right"]) {
    text-align: left;
}

#mitte h1:has(> img[style*="float: right"]) > img[style*="float: right"],
#mitte h1:has(> img[style*="float:right"]) > img[style*="float:right"] {
    margin: 0.05em 0 0.55em 0.7em;
}

#mitte h1:has(> img[style*="float: left"]),
#mitte h1:has(> img[style*="float:left"]) {
    text-align: right;
}

#mitte h1:has(> img[style*="float: left"]) > img[style*="float: left"],
#mitte h1:has(> img[style*="float:left"]) > img[style*="float:left"] {
    margin: 0.05em 0.7em 0.55em 0;
}

/* Neben umflossenen Bildern ist linksbuendiger Satz ruhiger als Blocksatz. */
#mitte p:has(> img[style*="float"]) {
    text-align: left;
    text-align-last: left;
}

/* Wird nur grossen, alleinstehenden Artikelfotos automatisch zugewiesen. */
#mitte img.article-photo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.25rem auto;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow-side);
}

/* Kleinere frei stehende Bilder ohne .weiss oder .antik werden wie
   eigenstaendige Abbildungen behandelt, aber nicht kuenstlich vergroessert. */
#mitte img.article-illustration {
    display: block;
    width: auto;
    max-width: min(100%, 32rem);
    height: auto;
    margin: 1.25rem auto;
    padding: 0.35rem;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 16px;
    background: rgba(255,255,255,0.92);
    box-shadow: var(--shadow-side);
}

.rand {
    position: relative;
    z-index: 1;
}

.rand .weiss,
.rand .antik {
    margin-bottom: 1rem;
    padding: clamp(1rem, 2vw, 1.45rem);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.48);
    border-radius: var(--radius-side);
    box-shadow: var(--shadow-side);
}

.rand .weiss {
    background: var(--paper-side);
}

/* Bereits vorhandene Kartenklasse aus dem bisherigen Campe-Template. */
.antik {
    position: relative;
    width: 100%;
    margin: 0 0 1rem;
    padding: clamp(1rem, 2vw, 1.45rem);
    color: rgb(72,55,38);
    border: 1px solid rgba(119,78,36,0.4);
    border-radius: 3px 5px 8px 4px;
    background-color: var(--paper-antik);
    background-image:
        radial-gradient(circle at 7% 12%, rgba(108,63,23,0.18), transparent 22%),
        radial-gradient(circle at 91% 10%, rgba(138,84,28,0.2), transparent 27%),
        radial-gradient(circle at 18% 87%, rgba(255,247,220,0.35), transparent 30%),
        radial-gradient(circle at 82% 80%, rgba(115,70,28,0.13), transparent 24%),
        repeating-linear-gradient(
            3deg,
            rgba(94,61,29,0.018) 0,
            rgba(94,61,29,0.018) 1px,
            transparent 1px,
            transparent 5px
        ),
        linear-gradient(145deg, rgba(250,233,201,0.98), var(--paper-antik) 58%, rgba(229,197,151,0.98));
    box-shadow:
        inset 0 0 42px rgba(92,55,20,0.18),
        0 2px 3px rgba(70,42,15,0.15),
        0 18px 38px rgba(70,42,15,0.2);
}

.antik > * {
    position: relative;
    z-index: 2;
}

.rand h1 {
    margin-bottom: 0.7rem;
    padding-bottom: 0.45rem;
    border-bottom: 3px solid var(--campe-gruen);
    font-size: 1.3rem;
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--campe-blau);
}

.rand h2 {
    margin-bottom: 0.6rem;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.rand p,
.rand li,
.rand a {
    font-size: 0.97rem;
    line-height: 1.55;
}

.rand p {
    margin-bottom: 0.65rem;
}

/* Eine neue Ueberschrift erhaelt nach einer abgeschlossenen Papierflaeche
   deutlich mehr Luft. WBCE kann dazwischen einen unsichtbaren Anker setzen. */
#mitte :is(.weiss, .antik) + h2,
.rand :is(.weiss, .antik) + h2,
#mitte :is(.weiss, .antik) + .section_anchor + h2,
.rand :is(.weiss, .antik) + .section_anchor + h2 {
    margin-top: clamp(2.25rem, 3.5vw, 3rem);
}

/*
   Laengere Fliesstexte werden ruhig im Blocksatz gesetzt. Durch die links
   ausgerichtete letzte Zeile bleiben kurze Absaetze und Hinweise unverzerrt.
*/
#mitte p,
.rand p {
    text-align: justify;
    text-align-last: left;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Eine im WBCE-Editor ausdrücklich gewählte Zentrierung hat Vorrang vor
   der links ausgerichteten letzten Zeile des allgemeinen Blocksatzes. */
#mitte p[style*="text-align: center"],
#mitte p[style*="text-align:center"],
.rand p[style*="text-align: center"],
.rand p[style*="text-align:center"] {
    text-align-last: center;
}

/* Mail-Icon und Adresse bilden auch bei mehrzeiligen Adressen eine Einheit. */
.email-row {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr);
    align-items: start;
    gap: 0.45rem;
    text-align: left !important;
    text-align-last: left;
}

.email-row .email-icon {
    display: block;
    width: 1.35rem;
    height: auto;
    color: var(--campe-blau);
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.email-row .email-link {
    min-width: 0;
    align-self: center;
    line-height: 1.45;
}

/* Das WBCE-Schutzmodul setzt @ und Punkt in eigene Spans. Genau dort darf
   der Browser deshalb bevorzugt umbrechen; anywhere bleibt nur die Reserve. */
.email-row .email-link span::after {
    content: "\200B";
}

.rand ul {
    padding-left: 1.1rem;
}

.rand .muted {
    opacity: 0.82;
}

.image-side {
    text-align: center;
}

.image-side img {
    width: min(220px, 80%);
    margin: 0 auto 1rem;
}

.link-card p {
    margin: 0.15rem 0;
}

.link-card a {
    display: block;
    padding: 0.42rem 0.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.52);
}

.link-card a:hover {
    color: white;
    background: var(--campe-blau);
}

.main-card > p,
.main-card > ul,
.main-card > table {
    max-width: 78ch;
}

.article-image {
    margin: 2rem -1rem;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: var(--shadow-side);
}

.article-image img {
    display: block;
    width: 100%;
    height: auto;
}

.zitat {
    margin: 2rem 0;
    padding: 1.35rem 1.5rem;
    border-left: 8px solid var(--campe-gruen);
    border-radius: 18px;
    background: rgba(255,255,255,0.58);
}

.zitat p {
    margin-bottom: 0;
    font-size: 1.22rem;
    line-height: 1.48;
    color: var(--text);
}

#mitte ul {
    margin: 1rem 0 1.4rem;
    padding-left: 1.3rem;
}

#mitte li {
    margin-bottom: 0.35rem;
}

/* Buttons ----------------------------------------------------------------- */

.buttonumgebung {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.85rem;
    margin: 1.5rem 0;
}

/* Besteht ein Bereich ausschliesslich aus einer Button-Gruppe, liefert das
   Bereichs-Padding bereits rundum den gleichen Abstand. */
.content-surface > .buttonumgebung:only-child,
.content-surface > .section_anchor:first-child + .buttonumgebung:last-child,
.weiss > .buttonumgebung:only-child,
.antik > .buttonumgebung:only-child {
    margin-top: 0;
    margin-bottom: 0;
}

.button {
    display: flex;
    flex: 0 0 180px;
    width: 180px;
    max-width: 100%;
    background: rgba(255,255,255,0.92);
    border-radius: 20px;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.05);
    transition: transform .25s ease, box-shadow .25s ease;
}

.button:hover {
    transform: translateY(-4px);
    box-shadow:
        0 18px 35px rgba(0,0,0,0.12),
        0 4px 10px rgba(0,0,0,0.08);
}

.button a {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    min-height: 164px;
    padding: 0.9rem;
    text-align: center;
    text-align-last: center;
    text-decoration: none;
}

.button img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.65rem;
    transition: transform .25s ease;
}

.button:hover img {
    transform: scale(1.05);
}

#mitte .button p,
.rand .button p,
.button p {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
    text-align-last: center;
    line-height: 1.2;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--campe-blau);
    text-wrap: balance;
    overflow-wrap: break-word;
}

#mitte .button p + p,
.rand .button p + p,
.button p + p {
    margin-top: 0.12rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

/* In den schmalen Randspalten nutzen die Buttons die gesamte Inhaltsbreite.
   Am ersten und letzten Rand liefert das Flaechen-Padding dadurch exakt den
   gleichen sichtbaren Abstand wie links und rechts. */
.rand .buttonumgebung {
    width: 100%;
    margin: 0.75rem 0;
    gap: 0.85rem;
}

.rand .button {
    flex-basis: 180px;
    width: 180px;
    max-width: 180px;
}

.rand .button a {
    width: 100%;
    min-height: 148px;
    padding: 0.75rem 0.85rem;
}

.rand .button img {
    width: 72px;
    height: 72px;
    margin-bottom: 0.55rem;
}

/* Bestehende zweispaltige Inhaltskaesten des bisherigen Templates. */
.zweier,
.hzweier {
    width: 45%;
    min-width: 0;
    margin: 0.65rem 1%;
    padding: clamp(1rem, 2vw, 1.5rem);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-side);
    background: rgba(250,235,215,0.68);
    box-shadow: var(--shadow-side);
}

.hzweier {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.hzweier:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.82);
}

/* Tabellen ---------------------------------------------------------------- */

table {
    width: 100%;
    margin: 2rem 0 0;
    overflow: hidden;
    border-collapse: collapse;
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow-side);
    table-layout: auto;
}

/* Alte Breitenangaben aus dem WBCE-Editor verzerren Tabellen leicht.
   Die Spalten werden deshalb aus ihrem Inhalt und dem verfügbaren Platz
   berechnet. Bewusst gesetzte colspan-Strukturen bleiben erhalten. */
table:not(.page-header) th,
table:not(.page-header) td {
    width: auto !important;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Die Pagination des News-Moduls ist ebenfalls eine Tabelle, aber keine
   Datentabelle. Sie erhält drei verlässlich ausgerichtete Bereiche. */
table.page-header {
    table-layout: fixed;
    margin-top: 1rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

table.page-header td {
    width: 33.333% !important;
    padding: 0.35rem 0.2rem;
    background: transparent;
    vertical-align: middle;
}

.page-left {
    text-align: left;
}

.page-center {
    text-align: center;
}

.page-right {
    text-align: right;
}

/* Der unsichtbare WBCE-Anker vor dem ersten Inhalt darf keine eigene
   Zeilenhoehe erzeugen. So beginnt auch eine anschliessende Tabelle exakt
   innerhalb des gleichmaessigen Bereichs-Paddings. */
.content-surface > .section_anchor:first-child {
    display: block;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* Steht eine Tabelle am Anfang eines Inhaltsbereichs oder einer Karte,
   bestimmt allein deren gleichmaessiges Padding den Abstand zu den Raendern. */
#mitte table:first-child,
.rand table:first-child,
#mitte > .section_anchor:first-child + table,
.rand > .section_anchor:first-child + table {
    margin-top: 0;
}

th,
td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
}

th {
    color: white;
    background: var(--campe-blau);
}

tr:nth-child(even) {
    background: rgba(250,235,215,0.72);
}

/* Unteres Bildband --------------------------------------------------------- */

.image-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 66vh;
    margin: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 620px));
    align-items: center;
    justify-content: center;
    gap: 2rem;

    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem);
    background: var(--campe-blau);
}

.image-band::before,
.image-band::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.image-band::before {
    inset: -36vh 0;
    z-index: -2;
    background: var(--page-image, url("images/campe-aussen.jpg")) center bottom / cover no-repeat;
    transform: translate3d(0, var(--band-shift, 0px), 0);
    will-change: transform;
}

.image-band::after {
    z-index: -1;
    background: linear-gradient(
        90deg,
        rgba(0,77,143,0.62),
        rgba(0,77,143,0.08)
    );
}

.band-panel {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    max-width: 500px;
    justify-self: center;

    padding: clamp(0.85rem, 1.8vw, 1.35rem);

    border-radius: var(--radius-main);

    border: 1px solid rgba(255,255,255,0.48);
    background: rgba(255,255,255,0.38);
    backdrop-filter: blur(6px);

    box-shadow: 0 18px 52px rgba(0,0,0,0.16);
}

.band-panel p:last-child {
    margin-bottom: 0;
}

.calendar-band-panel {
    align-items: center;
    text-align: center;
}

.calendar-band-panel[hidden] {
    display: none;
}

#calendar-band-container,
.calendar-entry {
    width: 100%;
}

.calendar-entry + .calendar-entry {
    margin-top: 2rem;
}

.calendar-entry p {
    margin-bottom: 0.15rem;
    text-align: center;
}

.calendar-entry h2 {
    margin-bottom: 0.85rem;
    color: var(--campe-blau);
    text-align: center;
}

.calendar-image {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow-side);
    cursor: pointer;
}

.calendar-image:focus-visible {
    outline: 3px solid var(--campe-gruen);
    outline-offset: 4px;
}

.calendar-entry h5 {
    margin-top: 0.55rem;
    margin-bottom: 0;
    color: rgb(27, 43, 56);
    font-size: 0.96rem;
    font-weight: 750;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* Persönlichkeiten-Kachel: gemeinsame Darstellung für Modul und Campe-Rückfall. */
.calendar-band-panel,
.campe-quote-panel {
    align-self: center;
    justify-content: center;
}

.campe-quote-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.15rem, 2.5vw, 1.8rem);
    text-align: center;
}

.campe-quote-image {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 12px 14px rgba(0,0,0,0.16));
}

.campe-quote-figure {
    width: min(100%, 34rem);
    min-width: 0;
    margin: 0;
}

.campe-quote-text {
    margin: 0;
    color: var(--campe-blau);
    font-size: clamp(1.15rem, 1.65vw, 1.5rem);
    font-style: italic;
    font-weight: 650;
    line-height: 1.42;
    text-align: center;
    text-align-last: center;
    text-wrap: balance;
    hyphens: auto;
}

.campe-quote-text::before {
    content: "„";
}

.campe-quote-text::after {
    content: "“";
}

.campe-quote-caption {
    margin-top: 1.1rem;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.campe-quote-caption cite {
    font-weight: 700;
}

.campe-quote-name,
.campe-quote-description {
    display: block;
}

.campe-quote-description {
    margin-top: 0.3rem;
    color: rgba(40,54,66,0.86);
    font-weight: 600;
}

.campe-quote-source {
    display: none;
}

.campe-quote-name {
    color: rgb(27, 43, 56);
    font-weight: 800;
}

.campe-quote-caption a {
    color: var(--campe-blau);
    font-size: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0,77,143,0.62);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.15em;
    overflow-wrap: anywhere;
}

.campe-quote-caption,
.campe-quote-text {
    overflow-wrap: anywhere;
}

/* Ein selbst gepflegter Inhalt aus Block 5 bleibt unter den beiden
   Standardkacheln mittig erhalten. */
.band-custom-panel {
    grid-column: 1 / -1;
}

.smallkontakt {
    display: none;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1050px) {
    #content {
        grid-template-columns: minmax(0, 1fr);
    }

    .rand-links {
        order: 1;
    }

    #mitte {
        order: 2;
    }

    .rand-rechts {
        order: 3;
    }

    .rand .weiss,
    .rand .antik {
        opacity: 1;
    }

    .rand h1 {
        font-size: 1.45rem;
    }

    .rand h2 {
        font-size: 1.18rem;
    }
}

@media (max-width: 920px) {
    body {
        padding-top: 0;
    }

    #mitte {
        scroll-margin-top: 5rem;
    }

    .hero::before {
        inset: -20vh 0;
        transform: translate3d(0, var(--hero-shift, 0px), 0);
        will-change: transform;
    }

    .image-band::before {
        inset: -20vh 0;
        transform: translate3d(0, var(--band-shift, 0px), 0);
        will-change: transform;
    }

    .hero-top {
        transform: translate3d(0, var(--hero-content-shift, 0px), 0);
        will-change: transform;
    }

    #kontakt {
        position: static;
        height: auto;
        min-height: 64px;
        flex-direction: column;
        justify-content: center;
        gap: 0.45rem;
        padding: 0.75rem;
        text-align: center;
    }

    .kontakt-logo {
        align-self: center;
        height: auto;
        margin: 0 0 0.25rem;
        padding: 0;
    }

    .kontakt-logo img {
        height: 64px;
    }

    .kontakt-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .kontakt-line {
        justify-content: center;
        white-space: normal;
    }

    .kontakt-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-search {
        flex: 1 1 100%;
        max-width: min(360px, 92vw);
    }

    .header-search:focus-within .search-input,
    .search-toggle-checkbox:checked ~ .search-input {
        width: min(250px, calc(92vw - 92px));
    }

    .nav-wrap {
        position: sticky;
        top: 0;
        width: min(92vw, 620px);
        margin: -30px auto 2.4rem;
        left: auto;
        right: auto;
        overflow: visible;
    }

    .menu-button {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.7rem;
        min-height: 54px;
        border-radius: 999px;
        color: white;
        background: var(--campe-blau);
        box-shadow: var(--shadow-main);
        font-weight: 900;
        cursor: pointer;
        user-select: none;
    }

    .menu-button span,
    .menu-button span::before,
    .menu-button span::after {
        content: "";
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 999px;
        background: white;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .menu-button span {
        position: relative;
    }

    .menu-button span::before,
    .menu-button span::after {
        position: absolute;
        left: 0;
    }

    .menu-button span::before {
        top: -7px;
    }

    .menu-button span::after {
        top: 7px;
    }

    #menu-toggle:checked + .menu-button span {
        background: transparent;
    }

    #menu-toggle:checked + .menu-button span::before {
        transform: translateY(7px) rotate(45deg);
    }

    #menu-toggle:checked + .menu-button span::after {
        transform: translateY(-7px) rotate(-45deg);
    }

    #menu-toggle:checked ~ nav {
        display: block;
    }

    nav,
    nav ul,
    nav li,
    nav a {
        max-width: 100%;
    }

    nav {
        display: none;
        width: 100%;
        max-width: 100%;
        margin-top: 0.65rem;
        overflow: hidden;
        padding: 0.5rem;
        border-radius: 28px;
        background: rgba(255,255,255,0.94);
    }

    nav ul {
        display: block;
        width: 100%;
    }

    nav > ul > li,
    nav li {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        text-align: left;
    }

    nav > ul > li > a,
    nav li ul a {
        display: block;
        width: 100%;
        max-width: 100%;
        border-radius: 18px;
        transform: none !important;
        white-space: normal;
    }

    nav > ul > li > a {
        padding: 0.85rem 1rem;
    }

    nav > ul > li:hover > a {
        transform: none !important;
    }

    nav li ul,
    nav li:hover > ul {
        position: static !important;
        left: auto !important;
        top: auto !important;
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        margin: 0 0 0.55rem !important;
        padding: 0.25rem 0 0.35rem 0.6rem !important;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: none;
        background: rgba(250,235,215,0.68);
    }

    nav > ul > li::after {
        display: none !important;
    }

    nav li ul a {
        border-radius: 14px;
        padding-left: 1.6rem;
    }
}

@media (max-width: 760px) {
    #kontakt {
        display: flex;
    }
}

@media (max-width: 640px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    body {
        padding-bottom: 0;
    }

    #kontakt,
    footer {
        display: none;
    }

    .hero {
        width: 100%;
        min-height: min(78vh, 680px);
    }

    .hero::before {
        inset: -20vh 0;
        transform: translate3d(0, var(--hero-shift, 0px), 0);
        will-change: transform;
    }

    .image-band::before {
        inset: -20vh 0;
        transform: translate3d(0, var(--band-shift, 0px), 0);
        will-change: transform;
    }

    .hero-top {
        width: calc(100% - 2rem);
        padding-bottom: 4rem;
    }

    .hero-title h1 {
        max-width: 100%;
        font-size: clamp(2.45rem, 13vw, 4.2rem);
        line-height: 1;
        -webkit-hyphens: auto;
        hyphens: auto;
        overflow-wrap: normal;
        word-break: normal;
    }

    #wrapper {
        width: auto;
        max-width: none;
        margin-right: 0.75rem;
        margin-left: 0.75rem;
    }

    #content {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #mitte,
    .rand {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    #mitte .weiss,
    .rand .weiss,
    .rand .antik,
    .antik {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
        padding: clamp(1.1rem, 5vw, 1.4rem);
    }

    #mitte .weiss,
    .rand .weiss {
        border-radius: 22px;
    }

    .rand .antik,
    .antik {
        border-radius: 3px 5px 8px 4px;
    }

    #mitte .weiss > *,
    .rand .weiss > *,
    .rand .antik > *,
    .antik > * {
        max-width: 100%;
    }

    .zweier,
    .hzweier {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .article-image {
        width: 100%;
        max-width: 100%;
        margin: 1.5rem 0;
        border-radius: 18px;
    }

    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: separate;
        border-spacing: 0;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        min-width: 7rem;
        padding: 0.65rem 0.55rem;
        overflow-wrap: normal;
        word-break: normal;
    }

    .buttonumgebung {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .button {
        flex-basis: 180px;
        width: 180px;
        max-width: 100%;
    }

    .button a {
        width: 100%;
        max-width: 100%;
    }

    .image-band {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        min-height: 54vh;
        margin: 0;
        padding: 2rem 1rem;
    }

    .band-panel {
        width: 100%;
        min-width: 0;
        max-width: 32rem;
        margin-right: auto;
        margin-left: auto;
    }

    .campe-quote-panel {
        gap: 1rem;
    }

    .campe-quote-image {
        max-width: 150px;
    }

    .campe-quote-text {
        font-size: 1rem;
        text-align: center;
    }

    .campe-quote-caption {
        text-align: center;
    }

    #mitte.content-surface,
    .rand.content-surface {
        padding: 1rem;
    }

    .smallkontakt {
        display: block;
        width: min(92vw, 620px);
        margin: 2rem auto;
        padding: 1rem;
        border-radius: 22px;
        background: rgba(255,255,255,0.86);
        box-shadow: var(--shadow-side);
        text-align: center;
    }

    .smallkontakt p {
        margin-bottom: 0.45rem;
        line-height: 1.45;
    }
}

/*
   Parallax-Hintergruende:
   Hero und Bildband nutzen gemeinsam --page-image.

   Statisch:
   <body style="--page-image: url('images/atrium.png');">

   In WBCE wird die Variable aus dem gemeinsamen Bildauswahl-Block gesetzt.
*/

/* Scroll-Einblendung ------------------------------------------------------- */

.scroll-reveal {
    opacity: 0;
    transform: translateY(36px) scale(0.98);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: none;
}

@media (min-width: 1600px) {
    .hero {
        min-height: clamp(680px, 70vh, 980px);
    }

    .hero-top {
        width: min(1420px, calc(100% - 8rem));
    }

    .image-band {
        grid-template-columns: repeat(2, minmax(0, 680px));
    }

    .band-panel {
        max-width: 540px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero::before,
    .image-band::before,
    .hero-top,
    .scroll-reveal {
        transform: none !important;
        transition: none !important;
        will-change: auto;
    }

    .scroll-reveal {
        opacity: 1;
    }

    .hero::before,
    .image-band::before {
        inset: 0;
    }
}
