/*
 * Groninger Sieben Ankündigungen — Standarddesign für die Website.
 *
 * Liegt bewusst in einer CSS-Cascade-Layer. Normale, nicht gelayerte
 * Stylesheets der Website haben dadurch Vorrang, unabhängig von der
 * Ladereihenfolge. Eine Gemeinde gestaltet also im eigenen Stylesheet und
 * muss hier nichts überschreiben.
 *
 * Die Farben hängen an Variablen. Wer nur die Leitfarbe setzen will, kommt
 * mit drei Zeilen aus:
 *
 *   .ank-band--hinweis { --ank-flaeche: var(--brand); --ank-schrift: #fff; }
 */

@layer ankuendigungen {

.ank-band,
.ank-modal {
    --ank-flaeche: #1d61d6;
    --ank-schrift: #ffffff;
    --ank-rand: transparent;
    --ank-ecke: 10px;
    --ank-breite: 68rem;
    font: inherit;
}

/* Drei Stufen, drei Flächen. Die Werte sind dieselben wie im Backend
   (DESIGN.md), damit Redakteur und Besucher dasselbe Rot sehen. */
/* »Hinweis« folgt dem Farbklima der Website (Einstellungen der G7-Module),
   »wichtig« und »dringend« behalten ihre Farbe: Sie sagen etwas. */
.ank-band--hinweis,  .ank-modal--hinweis  { --ank-flaeche: var(--g7-akzent, #1d61d6); --ank-schrift: var(--g7-akzent-schrift, #ffffff); }
.ank-band--wichtig,  .ank-modal--wichtig  { --ank-flaeche: #a26910; }
.ank-band--dringend, .ank-modal--dringend { --ank-flaeche: #b94242; }

/* ----------------------------------------------------------------- Band */

.ank-band {
    display: block;
    background: var(--ank-flaeche);
    color: var(--ank-schrift);
    border-bottom: 1px solid var(--ank-rand);
}

/* !important: Themes mit HTML5-Reset setzen ohne Layer »aside { display: block }«
   und schlagen sonst diese Regel in der Layer; der Streifen bliebe nach dem
   Schließen stehen (Musikfest 8878, 01.12.2026, S4). */
.ank-band[hidden] { display: none !important; }

.ank-band__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.1rem;
    max-width: var(--ank-breite);
    margin: 0 auto;
    padding: 0.85rem 1.2rem;
}

.ank-band__text {
    flex: 1 1 18rem;
    margin: 0;
    line-height: 1.4;
}

.ank-band__titel { font-weight: 700; }

/* Titel und Satz stehen in einem Absatz, getrennt durch einen Abstand statt
   durch einen Umbruch: auf dem Telefon soll die Zeile fließen dürfen. */
.ank-band__satz { margin-left: 0.5em; }

.ank-band__link {
    flex: 0 0 auto;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ank-band__link:hover { text-decoration-thickness: 2px; }

.ank-band__zu {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 36 px Trefferfläche, auch wenn das Kreuz 16 px misst */
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.ank-band__zu:hover { background: rgba(255, 255, 255, 0.16); }
.ank-band__zu:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* --------------------------------------------------------------- Fenster
 *
 * Ohne JavaScript ist das hier ein Block am Anfang der Seite. Erst
 * js/frontend.js setzt .ank-modal--bereit und macht daraus ein Fenster.
 * Andersherum — als Fenster gebaut und per JS eingeblendet — wäre der Inhalt
 * ohne JavaScript unsichtbar, und das ist der Fehler, den wir nicht machen.
 */

.ank-modal {
    display: block;
    background: var(--ank-flaeche);
    color: var(--ank-schrift);
}

.ank-modal[hidden] { display: none !important; }   /* wie beim Streifen, S4 */

.ank-modal__blatt {
    max-width: var(--ank-breite);
    margin: 0 auto;
    padding: 1.1rem 1.2rem 1.3rem;
}

.ank-modal__titel {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
    line-height: 1.25;
}

.ank-modal__text {
    margin: 0;
    line-height: 1.5;
}

.ank-modal__fuss {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.ank-modal__link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ank-modal__zu {
    min-height: 36px;
    padding: 0.5em 1.1em;
    border: 1px solid currentColor;
    border-radius: var(--ank-ecke) 0 0 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ank-modal__zu:hover { background: rgba(255, 255, 255, 0.16); }
.ank-modal__zu:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* Das Blatt bekommt beim Öffnen den Fokus (tabindex -1, siehe js/frontend.js);
   ein Rahmen um das ganze Fenster wäre nur Störung. */
.ank-modal__blatt:focus { outline: none; }

/* Ab hier gilt das Fenster. */

.ank-modal--bereit {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgba(18, 22, 30, 0.62);
    color: inherit;
}

.ank-modal--bereit .ank-modal__blatt {
    max-width: 32rem;
    width: 100%;
    max-height: calc(100vh - 2.4rem);
    overflow-y: auto;
    padding: 1.7rem 1.8rem 1.8rem;
    border-radius: 0 0 calc(var(--ank-ecke) * 2.4) 0;
    background: var(--ank-flaeche);
    color: var(--ank-schrift);
    box-shadow: 0 24px 60px rgba(10, 14, 22, 0.35);
}

.ank-modal--bereit .ank-modal__titel { font-size: 1.45rem; }

/* Das Erscheinen ist eine Bewegung von unten, kurz und ohne Federung.
   Wer Bewegung abbestellt hat, bekommt sie nicht. */
@media (prefers-reduced-motion: no-preference) {
    .ank-modal--bereit .ank-modal__blatt {
        animation: ank-auf 0.22s ease-out;
    }
}

@keyframes ank-auf {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 30rem) {
    .ank-band__inner { padding: 0.75rem 1rem; }
    .ank-modal--bereit .ank-modal__blatt { padding: 1.3rem 1.3rem 1.4rem; }
}

}   /* @layer */

/* ------------------------------------------------- Außerhalb der Layer
 *
 * Alles oben ist gelayert, damit das Stylesheet der Website Vorrang hat.
 * Diese paar Zeilen nicht — und zwar mit Grund:
 *
 * Fast jede Website färbt ihre Links (»a { color: var(--brand) }«). Auf der
 * farbigen Fläche des Bandes ergibt das die Leitfarbe auf der Leitfarbe: der
 * Link ist praktisch unlesbar. Gemessen am 22.09.2026 auf kirche-anhausen.de,
 * Terrakotta auf Blau.
 *
 * Schriftfarbe auf farbigem Grund ist hier keine Geschmacksfrage, sondern
 * Lesbarkeit. Wer die Farben ändern will, setzt --ank-flaeche und
 * --ank-schrift; beides wirkt weiter, weil hier »inherit« steht und nicht
 * ein fester Wert.
 */
.ank-band a,
.ank-band button,
.ank-modal a,
.ank-modal button {
    color: inherit;
}

/* ------------------------------------------- Schriftfarbe auf der Fläche
 *
 * Dasselbe für Überschrift und Text. Die Website färbt oft auch ihre
 * Überschriften (»h2 { color: var(--ink) }«): Im Fenster stand der Titel so
 * dunkelbraun auf Terrakotta, 2,93:1 statt 4,5:1 (Prüfstelle, 22.10.2026,
 * 2.2.24-Kopie mit dem Live-Abzug von Anhausen).
 *
 * Eine einfache Klassenregel reicht dafür nicht: Ein Theme mit
 * ».content h2« oder »#main h2« ist spezifischer. Deshalb !important, und
 * zwar in der Layer. Wichtige Angaben drehen die Reihenfolge der Layer um:
 * !important in einer Layer schlägt jedes !important außerhalb, unabhängig
 * von der Spezifität. Gegen diese Regel gewinnt also kein Website-CSS.
 *
 * Gestalten bleibt trotzdem möglich: Der Wert ist die Variable, nicht eine
 * feste Farbe. Wer eine andere Schrift auf der Fläche will, setzt
 * --ank-schrift, auch an einzelnen Elementen einer eigenen Vorlage
 * (».ank-modal__titel { --ank-schrift: #fff; }«).
 *
 * Nicht betroffen ist die abgedunkelte Fläche um das Fenster: Gefärbt wird
 * nur, was auf dem Band oder auf dem Blatt steht.
 */
@layer ankuendigungen {
    .ank-band,
    .ank-band *,
    .ank-modal__blatt,
    .ank-modal__blatt * {
        color: var(--ank-schrift) !important;
    }

    /* Die Kehrseite: Ist die Schrift erzwungen, darf der Grund der
       Schließknöpfe nicht von der Website kommen. Eine Regel wie
       »button { background: #fff }« oder »button:focus { background:
       gelb }« legte sonst weiße Schrift auf Weiß (Prüfstelle, Nachprüfung
       Runde 2, Verdacht). Gestaltbar über --ank-knopf-flaeche und
       --ank-knopf-hover. Der Fokusrahmen nimmt die Schriftfarbe, damit
       eine Website-Regel »:focus-visible { outline-color: var(--brand) }«
       nicht Leitfarbe auf Leitfarbe zeichnet. */
    .ank-band__zu,
    .ank-modal__zu {
        background-color: var(--ank-knopf-flaeche, transparent) !important;
        background-image: none !important;
    }
    .ank-band__zu:hover,
    .ank-modal__zu:hover {
        background-color: var(--ank-knopf-hover, rgba(255, 255, 255, 0.16)) !important;
    }
    .ank-band :focus-visible,
    .ank-modal__blatt :focus-visible {
        outline-color: var(--ank-schrift) !important;
    }
}


/* ------------------------------------------------- Bild-Ankündigung (2026.11.30)
 *
 * Ein Bild ohne Rahmen über der Seite, etwa ein Störer mit transparentem
 * Grund. Es nutzt das Fenster-Verhalten (.ank-modal, js/frontend.js), hebt
 * aber Fläche, Polster und Schatten des Blatts auf: Der Schatten folgt der
 * Form des Bildes (drop-shadow), nicht einem Kasten.
 *
 * Die tragenden Angaben stehen mit !important in der Layer, aus demselben
 * Grund wie die Schriftfarbe oben: Themes stylen »button« und »figure«
 * kräftig (HTML5 UP: feste Höhe, Polster, Hintergrund). Gestaltbar bleibt es
 * über --ank-bild-breite (pro Ankündigung im Backend), --ank-bild-zu-flaeche
 * und --ank-bild-zu-schrift.
 *
 * z-index nur für das Bild über 100000: Feste Kopf- und Menüleisten liegen
 * oft bei 10000 und mehr (Nachbau Musikfest: 10001/10002). Das Text-Fenster
 * behält 1200, damit sich bei bestehenden Websites nichts ändert.
 */
@layer ankuendigungen {
    .ank-modal--bild {
        background: transparent;
    }
    .ank-modal--bild.ank-modal--bereit {
        z-index: 100000;
        background: rgba(18, 22, 30, 0.62);
    }
    .ank-modal--bild .ank-bild {
        position: relative !important;
        display: block !important;
        width: fit-content !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        max-height: none !important;
    }
    /* Das Bild bekommt beim Öffnen den Fokus (tabindex -1, js/frontend.js),
       ist aber kein Tabulatorhalt. Ein Fokusrahmen der Website (»:focus {
       outline: … }«, unlayered) legte sonst einen Kasten um den Störer
       (gemessen 30.11.2026 auf der Kopie von Anhausen). Nur beim Bild; das
       Text-Fenster bleibt, wie es ist. */
    .ank-modal--bild .ank-bild:focus,
    .ank-modal--bild .ank-bild:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

    /* Nicht ohne JavaScript: Dann steht das Bild als Block am Seitenanfang. */
    .ank-modal--bild:not(.ank-modal--bereit) { padding: 1rem; }

    /* Name des Fensters für Screenreader, nicht sichtbar. */
    .ank-bild__titel {
        position: absolute !important;
        width: 1px !important; height: 1px !important;
        margin: -1px !important; padding: 0 !important;
        overflow: hidden !important; clip: rect(0 0 0 0) !important;
        white-space: nowrap !important; border: 0 !important;
    }

    .ank-bild__link { display: block !important; border: 0 !important; }

    /* Hinweis »öffnet in neuem Fenster« (S5, 2026.12.01.2): für Screenreader,
       nicht sichtbar. */
    .ank-vh {
        position: absolute !important;
        width: 1px !important; height: 1px !important;
        margin: -1px !important; padding: 0 !important;
        overflow: hidden !important; clip: rect(0 0 0 0) !important;
        white-space: nowrap !important; border: 0 !important;
    }
    /* Fokusrahmen ohne JavaScript: Das Bild steht dann auf dem Seitengrund,
       dessen Farbe das Modul nicht kennt. Dunkler Ring mit weißem Innenrand,
       auf hellem wie dunklem Grund zu sehen. Im geöffneten Fenster (dunkle
       Fläche) weiß (Prüfstelle 2026.11.30, B6; WCAG 2.4.7). */
    .ank-bild__link:focus-visible {
        outline: 3px solid #12161e !important;
        outline-offset: 2px;
        box-shadow: 0 0 0 2px #ffffff !important;
    }
    .ank-modal--bereit .ank-bild__link:focus-visible {
        outline-color: #ffffff !important;
        outline-offset: 4px;
        box-shadow: none !important;
    }
    /* Ohne JavaScript schließt das Kreuz nichts, also nicht zeigen (B6). */
    .ank-modal--bild:not(.ank-modal--bereit) .ank-bild__zu { display: none !important; }

    /* Breite aus dem Backend, auf kleinen Bildschirmen höchstens 90 % der
       Breite und 85 % der Höhe. width/height auto mit beiden Obergrenzen:
       Der Browser hält dabei das Seitenverhältnis. */
    .ank-bild__bild {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: min(var(--ank-bild-breite, 500px), 90vw) !important;
        max-height: 85vh !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        filter: drop-shadow(0 18px 36px rgba(10, 14, 22, 0.38));
    }

    /* Schließkreuz: dunkler Kreis mit weißem Rand, auf jedem Motiv lesbar.
       44 px Trefferfläche, an der Ecke des Bildes etwas nach außen versetzt. */
    .ank-bild__zu {
        position: absolute !important;
        top: -10px !important;
        right: -10px !important;
        display: grid !important;
        place-items: center !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 2px solid var(--ank-bild-zu-schrift, #ffffff) !important;
        border-radius: 50% !important;
        background: var(--ank-bild-zu-flaeche, #12161e) !important;
        background-image: none !important;
        color: var(--ank-bild-zu-schrift, #ffffff) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
        line-height: 1 !important;
        text-indent: 0 !important;
        letter-spacing: 0 !important;
        cursor: pointer;
    }
    .ank-bild__zu:hover { background: var(--ank-bild-zu-hover, #2b3240) !important; }
    .ank-bild__zu:focus-visible { outline: 3px solid #ffffff !important; outline-offset: 3px; }
    .ank-bild__zu svg { display: block; }

    @media (max-width: 30rem) {
        .ank-bild__zu { top: 4px !important; right: 4px !important; }
    }
}
