/**
 * Stundenplan – Frontend
 *
 * Bewusst ohne eigene font-family: alles erbt die Schriften des Themes
 * (Geist für Fliesstext, Boldonse für Überschriften). Farben greifen auf die
 * CSS-Variablen des Themes zu, mit Rückfallwerten für den Notfall.
 */

.emd-sp {
    --emd-akzent: var(--primary-color, #9AB48A);
    --emd-text: var(--third-color, #423939);
    --emd-leise: var(--secondary-color, #776e6e);
    --emd-linie: rgba(26, 26, 26, .14);
    --emd-spalte: rgba(26, 26, 26, .2);
    --emd-flaeche: var(--body_bg-color, #fff);
    --emd-kontur: #1a1a1a;

    /* EIN Radius für alle Bubbles. Bei kleinen Elementen wirkt er wie eine
       Pille, bei grossen bleibt die Rundung optisch gleich stark. */
    --emd-radius: 14px;

    /* Dieselbe Angabe, die Conferio für h1–h6 setzt. Ändert sich die
       Theme-Schrift, muss dieser eine Wert nachgezogen werden. */
    --emd-display: "Boldonse", serif;

    color: var(--emd-text);
}

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

.emd-sp-versteckt {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- Legende */

.emd-sp-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
}

.emd-sp-legende__item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 15px 7px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-farbe, #fff);
    font-family: var(--emd-display);
    font-size: .625rem;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--emd-kontur);
}

.emd-sp-legende__punkt { display: none; }

/* ============================================================== ÜBERSICHT */
/* Zeitstrahl: links die Abschnitte, rechts die Tage als klar getrennte
   Spalten. Jede Bubble steht für sich – keine Bubble in einer Bubble. */

.emd-tl-huelle {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}

.emd-tl-huelle:focus-visible {
    outline: 2px solid var(--emd-kontur);
    outline-offset: 2px;
    border-radius: var(--emd-radius);
}

.emd-tl { min-width: 940px; }

/* Kopfzeile */

.emd-tl__kopf { display: flex; align-items: flex-end; }

.emd-tl__achskopf { flex: 0 0 116px; }

.emd-tl__tagkoepfe { flex: 1 1 auto; display: flex; min-width: 0; }

.emd-tl__tagkopf {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px 11px;
    border-left: 1px solid var(--emd-spalte);
    background: rgba(26, 26, 26, .028);
}

.emd-tl__tagkopf:nth-child(even) { background: rgba(26, 26, 26, .062); }

.emd-tl__tagkopf:last-child { border-right: 1px solid var(--emd-spalte); }

.emd-tl__tagname {
    margin: 0;
    font-size: clamp(13px, 1.1vw, 16px);
    line-height: 1.45;
}

.emd-tl__datum {
    display: block;
    margin-top: 4px;
    font-size: .75rem;
    color: var(--emd-leise);
}

/* Körper */

.emd-tl__leib { display: flex; height: var(--emd-hoehe, 760px); }

/* Linke Achse: benennt die Abschnitte des Tages */

.emd-tl__achse { position: relative; flex: 0 0 116px; }

.emd-tl__schiene {
    position: absolute;
    left: 0;
    right: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    text-align: right;
}

.emd-tl__schienenname {
    font-family: var(--emd-display);
    font-size: .5625rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-leise);
}

.emd-tl__flaeche { position: relative; flex: 1 1 auto; min-width: 0; }

.emd-tl__raster { position: absolute; inset: 0; pointer-events: none; }

.emd-tl__raster span {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--emd-linie);
}

/* Tagesspalten – deutlich abgesetzt, damit die Tage lesbar bleiben */

.emd-tl__tage { position: absolute; inset: 0; display: flex; }

.emd-tl__tag {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border-left: 1px solid var(--emd-spalte);
    background: rgba(26, 26, 26, .028);
}

.emd-tl__tag:nth-child(even) { background: rgba(26, 26, 26, .062); }

.emd-tl__tag:last-child { border-right: 1px solid var(--emd-spalte); }

.emd-tl__ueber { position: absolute; inset: 0; pointer-events: none; }

/* Gruppe gleichzeitiger Angebote: trägt nur die Position, ist selbst
   unsichtbar. Die Bubbles darin teilen sich die Höhe des Zeitraums. */

.emd-tl__gruppe {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 3px;
}

.emd-tl__gruppe .emd-tl__inhalt {
    flex: 1 1 0;
    min-height: 26px;
}

.emd-tl__oder {
    flex: 0 0 auto;
    padding: 4px 0;
    font-family: var(--emd-display);
    font-size: .5625rem;
    line-height: 1.4;
    text-align: center;
    color: rgba(26, 26, 26, .5);
}

/* Bubbles: aussen nur Position, innen die eine sichtbare Fläche */

.emd-tl__bubble {
    position: absolute;
    box-sizing: border-box;
    padding: 3px;
    min-height: 30px;
}

.emd-tl__inhalt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
    overflow: hidden;
    padding: 6px 11px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-farbe, #DCE6D4);
    text-align: center;
}

.emd-tl__bubble--durch .emd-tl__inhalt {
    /* Ein durchlaufender Balken ist so hoch, dass eine mittig gesetzte
       Beschriftung hinter dem Mittagspausen-Balken verschwände. */
    justify-content: flex-start;
    padding: 9px 7px;
}

.emd-tl__text {
    font-family: var(--emd-display);
    font-size: .5625rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-kontur);
    overflow-wrap: normal;
    hyphens: auto;
}

.emd-tl__bubble--gemeinsam .emd-tl__text,
.emd-tl__bubble--uebergreifend .emd-tl__text { font-size: .625rem; }

.emd-tl__zeit {
    font-size: .5625rem;
    color: rgba(26, 26, 26, .6);
    font-variant-numeric: tabular-nums;
    text-transform: none;
}

.emd-sp-scrollhinweis { display: none; }

@media (max-width: 1000px) {
    .emd-sp--uebersicht .emd-sp-scrollhinweis {
        display: block;
        margin: 10px 2px 0;
        font-size: .8125rem;
        color: var(--emd-leise);
    }
}

/* =============================================================== DETAIL */
/* Gleiche Formensprache wie die Übersicht: Konturen, Pillen, Versalien. */

.emd-sp-tag { margin: 0 0 48px; }

.emd-sp-tag__kopf {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-bottom: 12px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--emd-kontur);
}

.emd-sp-tag__titel { margin: 0; font-size: 1.5rem; line-height: 1.45; }

.emd-sp-tag__datum { font-size: .8125rem; color: var(--emd-leise); }

.emd-sp-block { margin: 0 0 26px; }

.emd-sp-block__titel {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-family: var(--emd-display);
    font-size: .625rem;
    line-height: 1.4;
    text-transform: uppercase;
    margin: 0 0 12px;
    color: var(--emd-leise);
}

.emd-sp-block__zeit { font-family: inherit; text-transform: none; }

.emd-sp-zeilen {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.emd-sp-zeile {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin: 0;
    padding: 13px 22px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-farbe, #DCE6D4);
    text-align: center;
}

.emd-sp-zeile__titel {
    font-family: var(--emd-display);
    font-size: .6875rem;
    text-transform: uppercase;
    color: var(--emd-kontur);
}

.emd-sp-zeile__meta { font-size: .8125rem; color: var(--emd-leise); }

.emd-sp-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 16px;
}

.emd-sp-kachel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 18px 18px 20px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-flaeche);
    transition: transform .18s ease, box-shadow .18s ease;
}

.emd-sp-kachel:hover {
    transform: translateY(-3px);
    box-shadow: 4px 5px 0 0 var(--emd-kontur);
}

.emd-sp-kachel__kategorie {
    align-self: flex-start;
    max-width: 100%;
    padding: 6px 13px 7px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-farbe, #fff);
    font-family: var(--emd-display);
    font-size: .5625rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-kontur);
    overflow-wrap: anywhere;
}

.emd-sp-kachel__titel {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.emd-sp-kachel__nummer { color: var(--emd-leise); }

.emd-sp-kachel__meta,
.emd-sp-kachel__referenten {
    margin: 0;
    font-size: .8125rem;
    line-height: 1.45;
    color: var(--emd-leise);
}

.emd-sp-kachel__referenten { font-style: italic; }

.emd-sp-kachel__details summary {
    cursor: pointer;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--emd-kontur);
    list-style: none;
    text-decoration: underline;
}

.emd-sp-kachel__details summary::-webkit-details-marker { display: none; }

.emd-sp-kachel__text {
    margin-top: 8px;
    font-size: .875rem;
    line-height: 1.6;
}

.emd-sp-kachel__text > *:first-child { margin-top: 0; }
.emd-sp-kachel__text > *:last-child { margin-bottom: 0; }

.emd-sp-block--durchgehend {
    padding-top: 20px;
    border-top: 2px dashed var(--emd-linie);
}

.emd-sp-hinweis {
    padding: 14px 20px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: #FDF6E3;
}

@media (max-width: 600px) {
    .emd-sp-kacheln { grid-template-columns: 1fr; }
}

/* ================================================== Bewegung und Reaktion */

/* Beim Überfahren anheben – dieselbe Geste wie die Kacheln der Fehlerseite. */

.emd-tl__inhalt,
.emd-pille {
    transition: transform .2s ease, box-shadow .2s ease;
}

.emd-tl__bubble:hover .emd-tl__inhalt,
.emd-tl__gruppe .emd-tl__inhalt:hover {
    transform: translateY(-2px);
    box-shadow: 3px 4px 0 0 var(--emd-kontur);
    z-index: 2;
    position: relative;
}

.emd-sp-legende__item {
    transition: transform .2s ease;
}

.emd-sp-legende__item:hover {
    transform: translateY(-2px) rotate(-1.5deg);
}

/*
 * Aufbau beim Hereinscrollen. Die Klasse emd-sp--animiert setzt das Skript;
 * ohne JavaScript greift nichts davon und alles ist sofort sichtbar.
 */

.emd-sp--animiert .emd-tl__gruppe,
.emd-sp--animiert .emd-tl__bubble,
.emd-sp--animiert .emd-sp-kachel,
.emd-sp--animiert .emd-sp-zeile,
.emd-sp--animiert .emd-sp-legende__item {
    opacity: 0;
    transform: translateY(14px) scale(.97);
}

.emd-sp--animiert.emd-sp--sichtbar .emd-tl__gruppe,
.emd-sp--animiert.emd-sp--sichtbar .emd-tl__bubble,
.emd-sp--animiert.emd-sp--sichtbar .emd-sp-kachel,
.emd-sp--animiert.emd-sp--sichtbar .emd-sp-zeile,
.emd-sp--animiert.emd-sp--sichtbar .emd-sp-legende__item {
    opacity: 1;
    transform: none;
    transition: opacity .5s ease var(--emd-verzoegerung, 0ms),
                transform .5s cubic-bezier(.2, .7, .3, 1) var(--emd-verzoegerung, 0ms);
}

@media (prefers-reduced-motion: reduce) {
    .emd-sp--animiert .emd-tl__gruppe,
    .emd-sp--animiert .emd-tl__bubble,
    .emd-sp--animiert .emd-sp-kachel,
    .emd-sp--animiert .emd-sp-zeile,
    .emd-sp--animiert .emd-sp-legende__item {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .emd-tl__inhalt,
    .emd-pille,
    .emd-sp-legende__item {
        transition: none;
    }
}

/* Die Pille – Grundelement der Website. Wird in der Kurzfassung des
   Stundenplans verwendet. */

.emd-pille {
    display: inline-block;
    max-width: 100%;
    margin: 0;
    padding: 6px 13px 7px;
    border: 2px solid var(--emd-kontur, #1a1a1a);
    border-radius: var(--emd-radius, 14px);
    background: var(--emd-farbe, #fff);
    font-family: var(--emd-display, "Boldonse", serif);
    font-size: .5625rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-kontur, #1a1a1a);
    overflow-wrap: anywhere;
}

/* ============================================ Bausteine für die Startseite */

.emd-knopf {
    display: inline-block;
    padding: 0 26px;
    border: 2px solid var(--emd-kontur, #1a1a1a);
    border-radius: 999px;
    background: transparent;
    color: var(--emd-kontur, #1a1a1a);
    font-family: var(--emd-display, "Boldonse", serif);
    font-size: .6875rem;
    line-height: 44px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.emd-knopf:hover,
.emd-knopf:focus-visible {
    transform: translateY(-2px);
    box-shadow: 4px 5px 0 0 var(--emd-kontur, #1a1a1a);
}

/* ---------------------------------------------------------- Countdown */

.emd-countdown {
    --emd-kontur: #1a1a1a;
    --emd-display: "Boldonse", serif;
    text-align: center;
}

.emd-countdown__titel {
    margin: 0 0 16px;
    font-family: var(--emd-display);
    font-size: .6875rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--secondary-color, #776e6e);
}

.emd-countdown__felder {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.emd-countdown__feld {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 104px;
    padding: 16px 14px 14px;
    border: 2px solid var(--emd-kontur);
    border-radius: 14px;
    background: var(--emd-farbe, #EFCCFF);
}

.emd-countdown__zahl {
    font-family: var(--emd-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.25;
    color: var(--emd-kontur);
    font-variant-numeric: tabular-nums;
}

.emd-countdown__label {
    font-family: var(--emd-display);
    font-size: .5625rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-kontur);
}

.emd-countdown__ziel {
    margin: 16px 0 0;
    font-size: .9375rem;
    color: var(--secondary-color, #776e6e);
}

.emd-countdown--erreicht .emd-countdown__titel::after { content: " – jetzt!"; }

/* ------------------------------------------------------- Modul-Übersicht */

.emd-module__liste {
    display: grid;
    /* 190px, damit die fünf Module im 1300px-Container in eine Reihe passen. */
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.emd-module__karte {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 20px 20px 22px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-farbe, #fff);
    transition: transform .18s ease, box-shadow .18s ease;
}

.emd-module__karte:hover {
    transform: translateY(-3px);
    box-shadow: 4px 5px 0 0 var(--emd-kontur);
}

.emd-module__name {
    font-family: var(--emd-display);
    font-size: .6875rem;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--emd-kontur);
}

.emd-module__text {
    margin: 0;
    font-size: .875rem;
    line-height: 1.55;
    color: var(--emd-kontur);
}

.emd-module__aktion { margin: 26px 0 0; text-align: center; }

/* --------------------------------------------- Stundenplan, Kurzfassung */

.emd-kurz__tage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.emd-kurz__tag {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 18px 18px 20px;
    border: 2px solid var(--emd-kontur);
    border-radius: var(--emd-radius);
    background: var(--emd-flaeche, #fff);
}

.emd-kurz__name {
    font-family: var(--emd-display);
    font-size: .8125rem;
    line-height: 1.45;
    text-transform: uppercase;
    color: var(--emd-kontur);
}

.emd-kurz__datum {
    font-size: .8125rem;
    color: var(--emd-leise);
    margin-bottom: 6px;
}

.emd-kurz__arten {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.emd-kurz__leer {
    font-size: .875rem;
    color: var(--emd-leise);
}

.emd-kurz__aktion { margin: 26px 0 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .emd-knopf,
    .emd-module__karte { transition: none; }
}
