/* Gestaltung: gemeinsam/unterseiten.css – aus dem bestätigten Unterseiten-Design. */

.subpage { color: #d1cfd5; }
.subpage p, .subpage h3, .subpage h4, .subpage .text-link { overflow-wrap: anywhere; }
.subpage h2, .subpage h3, .subpage h4 { color: #fff; }
.subpage h2 { font-size: clamp(30px,3.1vw,44px); line-height: 1.18; }
.subpage-hero { background: #160c0d; overflow: hidden; }
.subpage-hero-grid { min-height: 465px; position: relative; display: flex; align-items: center; }
.subpage-hero-copy { width: 60%; position: relative; z-index: 2; padding-block: 65px; }
.subpage-hero-copy h1 { font-size: clamp(40px,4.7vw,65px); font-weight: 500; line-height: 1.12; letter-spacing: -2.3px; margin: 0 0 26px; color: #fff; }
.subpage-hero-copy h1 span { text-decoration: underline; text-decoration-color: var(--ci-red); text-decoration-thickness: 3px; text-underline-offset: 10px; }
.subpage-hero-copy > p:not(.eyebrow) { font-size: 20px; max-width: 475px; color: #d4c8c8; margin: 0 0 25px; }
.subpage-hero-copy .eyebrow { color: #d1c6c7; }
.subpage-hero-copy .text-link { font-size: 16px; }
.subpage-hero-photo { position: absolute; right: -100px; width: 76%; height: 100%; object-fit: cover; object-position: center; }
.subpage-hero-grid::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg,#160c0d 24%,#160c0de0 43%,#160c0d05 85%); pointer-events: none; }
.subpage-band { background: #232326; padding-block: 80px; }
/* Rubrikhinweise: wie auf der Startseite heller Text mit rotem Balken. */
.subpage .eyebrow:not(.subpage-hero .eyebrow),
.martin-page > section:not(.martin-hero) .eyebrow {
    color: var(--rubrik-hinweis-farbe);
    font-size: var(--rubrik-hinweis-groesse);
    letter-spacing: 1.4px;
    border-left: 2px solid var(--ci-red);
    padding-left: 12px;
}
.section-heading { display: grid; grid-template-columns: 1fr .65fr; align-items: end; gap: 60px; margin-bottom: 38px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin: 0; max-width: 420px; }
.archive-link { margin: 40px 0 0; }
.archive-link .text-link { font-size: 16px; }
.quiet-button { border: 1px solid #69666e; background: transparent; color: #f1eef3; padding: 13px 18px; min-height: 48px; font-size: 16px; }
.quiet-button:hover { border-color: var(--ci-red); background: #333136; }
.ortsfoto { margin: 24px 0 0; }
.ortsfoto img { display: block; width: 100%; height: auto; }
.ortsfoto figcaption { margin-top: 8px; font-size: .9rem; }
.math-form label { display: block; font-size: 16px; line-height: 1.6; }
.math-form input { display: block; width: 100%; border: 1px solid #68636d; background: #171719; color: #f6f3f8; border-radius: 0; padding: 13px; margin-top: 8px; min-height: 49px; outline: none; }
.math-form input:focus { border-color: var(--ci-red); box-shadow: 0 0 0 1px var(--ci-red); }

@media (max-width:900px) {
    .subpage-hero-copy { width: 76%; }
}

@media (max-width:900px) {
    .subpage-hero-photo { width: 95%; }
}

@media (max-width:900px) {
    .section-heading { gap: 30px; }
}
@media (max-width:600px) {
    .subpage .section, .subpage-band { padding-block: 50px; }
}
@media (max-width:600px) {
    .subpage-hero-grid { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
}
@media (max-width:600px) {
    .subpage-hero-copy { width: 100%; padding: 38px 0 28px; }
}
@media (max-width:600px) {
    .subpage-hero-copy h1 { font-size: clamp(35px,9.5vw,52px); letter-spacing: -1.7px; }
}
@media (max-width:600px) {
    .subpage-hero-copy > p:not(.eyebrow) { font-size: 18px; }
}
@media (max-width:600px) {
    .subpage-hero-photo { position: relative; right: auto; width: calc(100% + 40px); max-width: none; margin-inline: -20px; height: auto; aspect-ratio: 1.8; object-fit: cover; }
}
@media (max-width:600px) {
    .subpage-hero-grid::after { display: none; }
}
@media (max-width:600px) {
    .section-heading { grid-template-columns: 1fr; gap: 25px; }
}
@media (max-width:600px) {
    .section-heading { margin-bottom: 30px; }
}
.error-page { min-height: 60vh; padding-block: 90px; }
.error-page h1 { font-size: clamp(34px,5vw,58px); max-width: 700px; }

/****************************************************
 * AUTOMATISCHE RUBRIKFARBEN FÜR DIE UNTERSEITEN
 * Direkte sichtbare section-Elemente zählen. Die Programm-Verweisrubrik
 * ist als nav ausgezeichnet und zählt ebenfalls. Hero, Themen-Navigation,
 * Dialoge und ausgeblendete Rubriken zählen nicht.
 * Ganze Rubriken verschieben/ergänzen; keine Farben je Seite pflegen.
 ****************************************************/
:is(.subpage, .martin-page) > :nth-child(odd of :is(section, .programme-related):not(.subpage-hero, .martin-hero, [hidden])) {
    background-color: var(--bereich-dunkel);
}
:is(.subpage, .martin-page) > :nth-child(even of :is(section, .programme-related):not(.subpage-hero, .martin-hero, [hidden])) {
    background-color: var(--bereich-anthrazit);
}
/* Nach einer dunklen letzten Rubrik folgt ein anthrazitfarbener Footer. */
:is(.subpage, .martin-page):has(> :nth-child(odd of :is(section, .programme-related):not(.subpage-hero, .martin-hero, [hidden])):nth-last-child(1 of :is(section, .programme-related):not(.subpage-hero, .martin-hero, [hidden]))) + .footer {
    --footer-hintergrund: var(--bereich-anthrazit);
}
/* Bestehende Rubriken mit .wrap erhalten volle Hintergrundbreite.
   Ihr Inhalt bleibt auf dieselben 1180px und Seitenabstände begrenzt.
   So sind keine Umbauten in jeder einzelnen Programm-PHP-Datei nötig. */
:is(.subpage, .martin-page) > :is(section, .programme-related).wrap {
    width: 100%;
    padding-inline: max(40px, calc((100% - 1180px) / 2));
}
@media (max-width: 760px) {
    :is(.subpage, .martin-page) > :is(section, .programme-related).wrap {
        padding-inline: 20px;
    }
    .subpage .eyebrow:not(.subpage-hero .eyebrow),
    .martin-page > section:not(.martin-hero) .eyebrow { font-size: 15px; }
}

/****************************************************
 * PROGRAMMÜBERSICHT: BREITERES KARTENMOTIV MIT WEICHEM AUSLAUF
 * Das Foto reicht weiter nach links, blendet dort aber in den Hintergrund aus.
 * Text liegt darüber; auf dem Handy folgen Text und Foto aufeinander.
 ****************************************************/
.programme-hero { position: relative; display: grid; background: #160c0d; }
.programme-hero > .subpage-hero-photo {
    position: absolute;
    display: block;
    top: auto;
    bottom: 0;
    right: -12%;
    width: min(92%, 1920px);
    max-width: none;
    height: auto;
    margin: 0;
    aspect-ratio: auto;
    object-fit: contain;
    /* Das Kartenband am unteren Bildrand ist das Hauptmotiv.
       Natürliche Proportionen statt cover; 8% entfernen nur den dunklen Fußrand. */
    transform: translateY(8%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
}
.programme-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #160c0d 0%, #160c0d00 8%);
    pointer-events: none;
    z-index: 1;
}
.programme-hero .subpage-hero-grid {
    position: relative;
    min-height: 465px;
    align-items: center;
    z-index: 2;
}
.programme-hero .subpage-hero-grid::after { display: none; }
.programme-hero .subpage-hero-copy { width: 60%; padding-block: 65px; }
@media (max-width: 600px) {
    .programme-hero { display: flex; flex-direction: column; }
    .programme-hero .subpage-hero-grid { min-height: 0; order: -1; }
    .programme-hero .subpage-hero-copy { width: 100%; padding-block: 38px 28px; }
    .programme-hero > .subpage-hero-photo {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        transform: none;
        -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 85%, transparent 100%);
        mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 85%, transparent 100%);
    }
    .programme-hero::after { display: none; }
}

/* Die Ortsseiten beginnen direkt mit dem zweispaltigen Inhalt. */
.subpage .orts-inhalt {
    padding-top: clamp(36px, 5vw, 64px);
}

.orts-inhalt .programme-prose {
    margin-top: 0;
}

.orts-anfrage {
    display: grid;
    place-items: center;
    padding-block: 12px;
}

.orts-anfrage .button {
    transform-origin: center;
}

.orts-trennlinie {
    border: 0;
    border-top: 2px solid var(--ci-red);
    margin: 24px 0;
}
