/* ================= THEME-TOKEN ================= */
:root {
    --bg: #f2efe9;
    --panel-bg: #fbfaf7;
    --panel-bg-alt: #ece7dd;
    --ink: #2b2820;
    --ink-soft: #6b6558;
    --grass: #3f8f3f;
    --diamond: #1f8fa3;
    --redstone: #a52f2b;
    --highlight: hsl(39, 78%, 50%);

    --bevel-light: #ffffff;
    --bevel-dark: #c9c3b5;
    --bevel-border: #37322a;

    --font-display: 'Press Start 2P', 'Courier New', monospace;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #14161a;
    --panel-bg: #23262b;
    --panel-bg-alt: #2b2e34;
    --ink: #e9e6dc;
    --ink-soft: #a9a598;
    --grass: #79b45a;
    --diamond: #4fd6da;
    --redstone: #e0554e;
    --highlight: #eab452;

    --bevel-light: #3a3e45;
    --bevel-dark: #0a0b0d;
    --bevel-border: #000000;

    color-scheme: dark;
}

/* ================= RESET / GRUNDLAGEN ================= */
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    -webkit-tap-highlight-color: transparent;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color .2s ease, color .2s ease;
}
h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.4;
    margin: 0 0 .6em;
}
h1 {
    font-size: 1.3rem;
}
h2 {
    font-size: 1rem;
    color: var(--grass);
}
h3 {
    font-size: .8rem;
}
p {
    margin: 0 0 1em;
    color: var(--ink-soft);
}
a {
    color: var(--diamond);
}
img, svg {
    max-width: 100%;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

section {
    margin-top: 3rem;
}

.eyebrow {
    font-family: var(--font-display);
    font-size: .55rem;
    letter-spacing: .05em;
    color: var(--highlight);
    display: block;
    margin-bottom: .6em;
}

:focus-visible {
    outline: 3px solid var(--diamond);
    outline-offset: 2px;
}

/* ================= BEVEL-BAUSTEIN (Minecraft-GUI-Look) ================= */
.mc-panel, .mc-button, .mc-slot {
    background: var(--panel-bg);
    border: 2px solid var(--bevel-border);
    box-shadow:
        inset 2px 2px 0 0 var(--bevel-light),
        inset -2px -2px 0 0 var(--bevel-dark);
}

/* ================= HEADER ================= */
.site-header {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: .9rem;
}

h1.logo {
    margin: 0;
    line-height: 0;
}
.logo-img {
    display: block;
    height: clamp(48px, 10vw, 72px);
    width: auto;
}

.mc-button {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
    text-decoration: none;
    padding: .7em 1.1em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .5em;
    transition: transform .05s ease;
}
/* Nur bei echten Maus-Zeigern hervorheben – auf Touchscreens bliebe der
   Hover-Zustand nach dem Antippen sonst sichtbar "hängen" */
@media (hover: hover) {
    .mc-button:hover {
        background: var(--panel-bg-alt);
    }
}
.mc-button:active {
    transform: translateY(2px);
    box-shadow:
        inset -2px -2px 0 0 var(--bevel-light),
        inset 2px 2px 0 0 var(--bevel-dark);
}

#theme-toggle {
    font-size: 1.1rem;
    padding: .5em .7em;
}

/* ================= COUNTDOWN / LAUFZEIT ================= */
.countdown {
    padding: 1.5rem;
    text-align: center;
}

.time-slots {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: nowrap;
    margin: 1rem 0 .5rem;
}

.mc-slot.time-slot {
    min-width: 4.5rem;
    padding: .75rem .5rem;
    text-align: center;
}
.time-slot .value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--highlight);
    display: block;
}
.time-slot .unit {
    font-size: .7rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
}

#countdown-caption {
    margin-top: .75rem;
    font-size: .9rem;
}

/* ================= LINKS ================= */
.links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.link-button {
    flex: 1 1 220px;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: .3em;
}
.link-button .link-title {
    font-size: 1.05rem;
}
.link-button .link-sub {
    font-size: .8rem;
    color: var(--ink-soft);
    font-weight: 400;
}

/* ================= HIGHLIGHT-BOARD ================= */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.mc-slot.board-entry {
    padding: 1rem;
    display: flex;
    gap: .75rem;
}
.slot-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex: 0 0 auto;
}
.board-entry-body {
    /* verhindert, dass lange Wörter den Flex-Container sprengen */
    min-width: 0;
}
.board-entry-body h3,
.board-entry-body p {
    overflow-wrap: break-word;
    word-break: break-word;

    hyphens: auto;
}
.board-entry time {
    display: block;
    font-size: .75rem;
    color: var(--highlight);
    margin-bottom: .3em;
}
.board-entry p {
    margin: 0;
    font-size: .9rem;
}

/* ================= GALERIE ================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.gallery-item {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    margin: 0;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .15s ease;
}

.gallery-item:focus-visible img {
    transform: scale(1.06);
}

/* Der Zoom beim Überfahren macht nur bei echten Maus-Zeigern Sinn –
   auf Touchscreens (Smartphone/Tablet) bliebe er sonst nach dem Antippen "hängen" */
@media (hover: hover) {
    .gallery-item:hover img {
        transform: scale(1.06);
    }
}

/* Bewusst kein Press-Effekt (transform/box-shadow) bei .gallery-item:active –
   das wirkte wie ein leichtes Herunterrutschen des Bildes beim Antippen/Klicken. */

/* Fallback, solange noch kein echtes Bild unter dem Pfad liegt */
.gallery-item--missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg-alt);
}
.gallery-item--missing img {
    display: none;
}
.gallery-item--missing::after {
    content: '🖼️ Bild fehlt';
    font-size: .75rem;
    color: var(--ink-soft);
    text-align: center;
    padding: .5rem;
}

.gallery-more {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

/* ================= UNTERSEITE: GALERIE ================= */
.back-link {
    display: inline-flex;
    margin-top: 2rem;
}

.back-link + section {
    margin-top: 1.5rem;
}

/* ================= LIGHTBOX ================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(95vw, 1200px);
    max-height: 95vh;
    /* oben/unten bewusst gleich groß: das Bild bleibt dadurch senkrecht
       zentriert und die Caption (unten absolut positioniert, siehe
       #lightbox-caption) verändert diesen Rahmen nicht mehr */
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: .5rem;
    right: .5rem;
    padding: .3em .6em;
    line-height: 1;
    font-size: .9rem;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    min-height: 0;
}

.lightbox-stage img {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
}

.lightbox-nav {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: .9rem;
    padding: .6em .8em;
}

#lightbox-caption {
    /* absolut statt im Fluss: die Länge des Texts wirkt sich dadurch nicht
       mehr auf die Höhe von .lightbox-content aus – Bild und Pfeile bleiben
       beim Durchklicken exakt an derselben Stelle. Auf eine Zeile begrenzt,
       damit auch sehr lange Captions das Bild nicht überlappen. */
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: .75rem;
    margin: 0;
    text-align: center;
    font-size: .9rem;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#lightbox-caption:empty {
    display: none;
}

/* Auf schmalen Bildschirmen (v. a. Smartphones im Hochformat) bekommt
   das Bild fast die volle Breite – die Pfeile legen sich dafür als
   halbtransparente Overlays über den Bildrand statt daneben zu stehen. */
@media (max-width: 700px) {
    .lightbox {
        padding: .5rem;
    }
    .lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100%;
        padding: 3rem .4rem;
    }
    .lightbox-stage {
        gap: 0;
    }
    .lightbox-stage img {
        width: 100%;
        max-width: 100%;
        max-height: 72vh;
    }
    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        padding: .55em .7em;
        opacity: .9;
    }
    .lightbox-prev {
        left: .3rem;
    }
    .lightbox-next {
        right: .3rem;
    }
    /* .mc-button:active verschiebt normalerweise um 2px – das würde hier die
       Zentrierung (translateY(-50%)) überschreiben und wie ein Sprung wirken.
       Deshalb bleiben die Pfeile beim Antippen unverändert an Ort und Stelle. */
    .lightbox-nav:active {
        transform: translateY(-50%);
        box-shadow:
            inset 2px 2px 0 0 var(--bevel-light),
            inset -2px -2px 0 0 var(--bevel-dark);
    }
    /* Auch der Schließen-Knopf bleibt beim Antippen ohne Druck-Animation */
    .lightbox-close:active {
        transform: none;
        box-shadow:
            inset 2px 2px 0 0 var(--bevel-light),
            inset -2px -2px 0 0 var(--bevel-dark);
    }
}

/* ================= FOOTER ================= */
footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    font-size: .8rem;
    color: var(--ink-soft);
    text-align: center;
}
footer p {
    margin: 0 0 .6em;
    color: inherit;
}
footer .credit {
    font-size: .7rem;
    opacity: .6;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
    .countdown {
        padding: 1.25rem .75rem;
    }
    .time-slots {
        gap: .4rem;
    }
    .mc-slot.time-slot {
        min-width: 0;
        max-width: 3.8rem;
        flex: 1 1 0;
        padding: .5rem .25rem;
    }
    .time-slot .value {
        font-size: 1.1rem;
    }
    .time-slot .unit {
        font-size: .55rem;
    }
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .mc-button {
        transition: none;
    }
    .mc-button:active {
        transform: none;
    }
}
