/*
Theme Name: Theater in Stein – Bühne
Theme URI: https://theater-in-stein.de/
Author: Numelle
Description: Zweischichtiges Theme für den Theaterverein Stein. Der äußere "Rahmen" trägt Vereins-Logik, Logo und Basis-Navigation und bleibt über die Jahre stabil. Der innere Bereich – die "Bühne" – wird pro Spielzeit von einem austauschbaren Skin gestaltet (siehe skins/README.md).
Version: 0.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: tis-buehne
Tags: theater, verein, custom-menu, translation-ready
*/

/* ==========================================================================
   0. Design-Tokens des VEREINS (Rahmen)
   --------------------------------------------------------------------------
   SPERRZONE: Diese Tokens bilden das Vereins-CD ab und gelten für den gesamten
   Rahmen. Ein Spielzeit-Skin darf sie NICHT überschreiben – Skins setzen
   ausschließlich ihre eigenen --tis-skin-* Tokens auf .tis-stage.

   Das CD stammt aus dem Vereinslogo: Magenta, Schwarz, Weiß.
   Dazu das Grün der Vereinskleidung als Signalfarbe.
   ========================================================================== */
:root {
    /* --- Logo-Farben (aus theater in stein_logo_prepress.png ausgelesen) --- */
    --tis-magenta:     #ea2e7f; /* Primärer Akzent, aktive Zustände          */
    --tis-magenta-tief:#c01d64; /* Hover, dunklere Fläche                    */
    --tis-schwarz:     #000000; /* Flächen, Balken, Logo-Schwarz             */
    --tis-weiss:       #ffffff;

    /* --- Vereinskleidung: Neongrün als Signalfarbe ---------------------------
       ACHTUNG Kontrast: #00ff00 hat auf Weiß nur 1,37:1 – als Textfarbe auf
       hellem Grund unlesbar. Verwendung deshalb ausschließlich als FLÄCHE mit
       schwarzer Schrift darauf (15,3:1) oder als Akzent auf Schwarz.
       Für grünen TEXT auf Weiß ist --tis-gruen-tief da (4,53:1, WCAG AA).     */
    --tis-gruen:       #00ff00;
    --tis-gruen-tief:  #008a00;

    /* --- Abgeleitete Rollen ---------------------------------------------- */
    --tis-text:        #141414; /* Fließtext                                 */
    --tis-text-leise:  #5c5c5c; /* Meta, Bildunterschriften                  */
    --tis-bg:          #ffffff; /* Seitenhintergrund                         */
    --tis-flaeche:     #f4f4f4; /* Karten, abgesetzte Flächen                */
    --tis-linie:       rgba(0, 0, 0, 0.13);

    /* --- Typografie ---------------------------------------------------------
       PLATZHALTER bis die CD-Schriften vorliegen. Die Logo-Wortmarke ist eine
       schwere, leicht schmale Grotesk – der System-Stack kommt dem am nächsten.
       Beim Nachrüsten: Dateien nach assets/fonts/, @font-face in
       inc/enqueue.php, hier nur den Namen voranstellen. Kein Google-CDN.       */
    --tis-font-body:     system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tis-font-headline: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* --- Maße ------------------------------------------------------------ */
    --tis-rahmen-hoehe:        88px;
    --tis-rahmen-hoehe-scroll: 66px;
    --tis-breite:              1160px;
    --tis-radius:              0px;   /* Das CD ist kantig-plakativ.         */
    --tis-schatten:            0 2px 16px rgba(0, 0, 0, 0.12);
    --tis-tempo:               200ms;
}

/* ==========================================================================
   1. Reset & Grundlagen
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--tis-bg);
    color: var(--tis-text);
    font-family: var(--tis-font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--tis-font-headline);
    color: var(--tis-schwarz);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

a { color: var(--tis-magenta-tief); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--tis-schwarz); }

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

/* Grün als Fokusring: auf Weiß wie auf Schwarz sofort sichtbar. */
:focus-visible { outline: 3px solid var(--tis-gruen); outline-offset: 2px; }

.tis-wrap { width: min(100% - 2.5rem, var(--tis-breite)); margin-inline: auto; }

.tis-skip {
    position: absolute; left: -9999px;
    background: var(--tis-gruen); color: var(--tis-schwarz);
    font-weight: 700; padding: 0.75rem 1.25rem; z-index: 999;
}
.tis-skip:focus { left: 1rem; top: 1rem; }

.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ==========================================================================
   2. RAHMEN – Kopfleiste mit Logo und Basis-Navigation
   --------------------------------------------------------------------------
   SPERRZONE. Der Rahmen ist über alle Spielzeiten identisch. Er bleibt
   fixiert, damit die Basisfunktionen immer erreichbar sind, egal wie
   experimentell der Skin darunter gestaltet ist.
   ========================================================================== */
.tis-rahmen {
    position: fixed; inset: 0 0 auto 0; z-index: 500;
    height: var(--tis-rahmen-hoehe);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 3px solid var(--tis-schwarz);
    transition: height var(--tis-tempo) ease, background var(--tis-tempo) ease;
}
.tis-rahmen.is-scrolled {
    height: var(--tis-rahmen-hoehe-scroll);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--tis-schatten);
}
.admin-bar .tis-rahmen { top: 32px; }
@media (max-width: 782px) { .admin-bar .tis-rahmen { top: 46px; } }

.tis-rahmen__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; height: 100%;
}

.tis-logo { display: flex; align-items: center; text-decoration: none; }
.tis-logo img {
    height: calc(var(--tis-rahmen-hoehe) - 22px);
    width: auto; display: block;
    transition: height var(--tis-tempo) ease;
}
.is-scrolled .tis-logo img { height: calc(var(--tis-rahmen-hoehe-scroll) - 18px); }

.tis-nav ul { display: flex; align-items: center; gap: 1.6rem; margin: 0; padding: 0; list-style: none; }
.tis-nav a {
    display: block; padding: 0.4rem 0; text-decoration: none;
    font-size: 0.9rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--tis-schwarz); border-bottom: 3px solid transparent;
}
.tis-nav a:hover, .tis-nav a:focus-visible { border-bottom-color: var(--tis-gruen); }
.tis-nav .current-menu-item > a,
.tis-nav .current_page_item > a,
.tis-nav .current-menu-ancestor > a { color: var(--tis-magenta); border-bottom-color: var(--tis-magenta); }

/* Hervorgehobener Menüpunkt (z. B. "Mitmachen"):
   im Menü-Editor die CSS-Klasse "tis-signal" am Eintrag setzen.
   Schwarz auf Neongrün – 15,3:1 und aus jeder Entfernung sichtbar. */
.tis-nav .tis-signal > a {
    background: var(--tis-gruen); color: var(--tis-schwarz);
    padding: 0.5rem 1rem; border-bottom-color: transparent;
}
.tis-nav .tis-signal > a:hover,
.tis-nav .tis-signal > a:focus-visible { background: var(--tis-schwarz); color: var(--tis-gruen); }

.tis-burger {
    display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer;
    color: var(--tis-schwarz);
}
.tis-burger svg { display: block; width: 28px; height: 28px; }

@media (max-width: 900px) {
    .tis-burger { display: block; }
    .tis-nav {
        position: absolute; inset: 100% 0 auto 0;
        background: var(--tis-weiss);
        border-bottom: 3px solid var(--tis-schwarz);
        box-shadow: var(--tis-schatten);
        display: none;
    }
    .tis-rahmen.is-open .tis-nav { display: block; }
    .tis-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1.25rem 1.25rem; }
    .tis-nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--tis-linie); }
    .tis-nav .tis-signal > a { margin-top: 0.75rem; text-align: center; }
}

/* ==========================================================================
   3. BÜHNE – Übergabepunkt an den Spielzeit-Skin
   --------------------------------------------------------------------------
   .tis-stage ist die einzige Fläche, auf die ein Skin zugreifen darf.
   Alle --tis-skin-* Tokens werden hier gesetzt (siehe inc/skin-loader.php),
   damit ein Skin nicht in den Rahmen ausbrechen kann.
   ========================================================================== */
.tis-stage {
    padding-top: var(--tis-rahmen-hoehe);
    min-height: 60vh;
    background: var(--tis-skin-bg, var(--tis-bg));
    color: var(--tis-skin-text, var(--tis-text));
}
.tis-stage__inner { padding-block: 3rem; }

.tis-content > * + * { margin-top: 1.1em; }
.tis-content h2 { margin-top: 2em; }
.tis-content blockquote {
    margin: 2em 0; padding: 0.4em 0 0.4em 1.4em;
    border-left: 5px solid var(--tis-skin-akzent, var(--tis-magenta));
    font-size: 1.2rem; font-style: italic;
}
.tis-content figure { margin: 2em 0; }
.tis-content figcaption { font-size: 0.85rem; color: var(--tis-text-leise); margin-top: 0.5em; }

/* --- Bausteine, die jede Spielzeit erbt --------------------------------
   Bewusst hier statt in skins/_base/skin.css: Es wird immer nur der AKTIVE
   Skin geladen, ein Skin erbt nichts vom Basis-Skin. Was jede Spielzeit
   braucht, gehört deshalb ins Framework – Skins überschreiben es.        */

.tis-liste {
    display: grid; gap: 1.75rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tis-karte {
    background: var(--tis-skin-flaeche, var(--tis-flaeche));
    border-bottom: 4px solid var(--tis-skin-akzent, var(--tis-magenta));
    display: flex; flex-direction: column;
}
.tis-karte__bild img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.tis-karte__text { padding: 1.25rem; }
.tis-karte h2 { font-size: 1.15rem; margin-bottom: 0.4em; }
.tis-karte h2 a { color: inherit; text-decoration: none; }
.tis-karte h2 a:hover, .tis-karte h2 a:focus-visible { color: var(--tis-skin-akzent, var(--tis-magenta)); }

.tis-titelbild { margin: 0 0 2rem; }
.tis-titelbild img { width: 100%; }

.tis-aktuelles { margin-top: 3.5rem; }

/* Rückfall-Bühne des Themes (front-page.php), wenn ein Skin keine eigene
   Startseite mitbringt. */
.tis-hero {
    position: relative; padding-block: 4rem;
    background: var(--tis-skin-flaeche, var(--tis-flaeche));
    border-bottom: 5px solid var(--tis-skin-akzent, var(--tis-magenta));
}
.tis-hero__bild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.25; }
.tis-hero__text { position: relative; }
.tis-hero__untertitel { font-size: 1.25rem; margin: 0 0 0.6em; }
.tis-hero__premiere { font-weight: 700; color: var(--tis-skin-akzent, var(--tis-magenta)); }

/* ==========================================================================
   4. RAHMEN – Fußzeile
   ========================================================================== */
.tis-fuss {
    background: var(--tis-schwarz); color: #e6e6e6;
    padding-block: 3rem 1.5rem; margin-top: 4rem;
}
.tis-fuss a { color: var(--tis-weiss); }
.tis-fuss a:hover, .tis-fuss a:focus-visible { color: var(--tis-gruen); }
/* Die Wortmarke ist schwarz-magenta – auf dem schwarzen Fuß braucht sie
   eine weiße Fläche, statt sie zu invertieren und das CD zu verfälschen. */
.tis-fuss__logo {
    display: inline-block; margin: 0 0 1rem;
    background: var(--tis-weiss); padding: 0.9rem 1.1rem;
}
.tis-fuss__logo img { display: block; width: 190px; height: auto; }
.tis-fuss__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tis-fuss h2 {
    color: var(--tis-magenta); font-size: 0.95rem;
    letter-spacing: 0.1em; text-transform: uppercase;
}
.tis-fuss ul { list-style: none; margin: 0; padding: 0; }
.tis-fuss li + li { margin-top: 0.45rem; }
.tis-fuss__recht {
    margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
    font-size: 0.85rem;
}
.tis-fuss__recht ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.tis-fuss__recht li + li { margin-top: 0; }

/* ==========================================================================
   5. Hilfsklassen
   ========================================================================== */
.tis-button {
    display: inline-block; padding: 0.8rem 1.6rem;
    background: var(--tis-skin-akzent, var(--tis-magenta)); color: var(--tis-weiss);
    font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    text-decoration: none; border: 3px solid transparent;
    transition: background var(--tis-tempo) ease, color var(--tis-tempo) ease;
}
.tis-button:hover, .tis-button:focus-visible { background: var(--tis-schwarz); color: var(--tis-weiss); }

/* Signal-Variante in der Vereinsfarbe Grün – immer schwarze Schrift. */
.tis-button--signal { background: var(--tis-gruen); color: var(--tis-schwarz); }
.tis-button--signal:hover, .tis-button--signal:focus-visible { background: var(--tis-schwarz); color: var(--tis-gruen); }

.tis-meta {
    font-size: 0.8rem; color: var(--tis-text-leise);
    letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
