/* ===== Bethang – Mandalas (Issue #44) =====
   Endlose Galerie-Seite: Einführungstext oben, darunter alle Mandalas aus
   img/ (neueste zuerst) als vollständige (unbeschnittene) Quadrate mit Jahr-Overlay und
   optionalem zweitem Overlay (z. B. „verkauft", „NEU"); Klick öffnet die
   Lightbox (assets/gallery.js). Heller Grund, weil die Bilder freigestellt
   bzw. vor weißer Wand fotografiert sind.

   Schrift: Archivo (selbst gehostet, zentral in ../assets/fonts/). Tokens
   wie auf der Startseite (helper/styles.css); Ortsschild wie auf den Karten. */

:root {
    --amber: #f7b500;        /* Markenfarbe (Ortsschild-Gelb, RAL 1023 Verkehrsgelb) */
    --amber-active: #e3a700;
    --paper: #fcfbf8;
    --card: #ffffff;
    --ink: #111111;
    --ink-soft: #46413a;
    --muted: #9a8f78;
    --line: #ece7dc;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    -webkit-text-size-adjust: 100%;   /* kein iOS-Text-Autosizing nach dem Drehen */
    text-size-adjust: 100%;
    color: var(--ink);
    font-family: 'Archivo', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.lightbox-open { overflow: hidden; }

.mono { font-family: 'Spline Sans Mono', ui-monospace, monospace; }
a { color: inherit; }
button { font-family: inherit; }

/* ===== Ortsschild: zurück zur Startseite (reine CSS-Grafik, 3:2) ===== */
.ortsschild {
    position: fixed;
    left: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 50;
    display: block;
    width: 54px;
    height: 36px;
    background: var(--amber);
    border-radius: 6px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .18), 0 6px 18px rgba(0, 0, 0, .16);
    transition: transform .1s ease;
}
.ortsschild::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1.5px solid #111;
    border-radius: 3px;
}
.ortsschild::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-58%, -50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 10px solid #111;
}
.ortsschild:active { transform: scale(.92); }
.ortsschild:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ===== Seite ===== */
.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px) 16px calc(96px + env(safe-area-inset-bottom));
}

.intro { max-width: 720px; margin-bottom: clamp(28px, 5vw, 56px); }
.kicker {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}
.kicker .amber { color: var(--amber); }
h1 {
    margin: 0 0 .5em;
    font-size: clamp(38px, 7vw, 64px);
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1;
}
.intro p {
    margin: 0 0 1em;
    font-size: clamp(16px, 1.9vw, 19px);
    color: var(--ink-soft);
}
.intro p.lead { color: var(--ink); font-weight: 600; }

/* ===== Galerie: Quadrate, Bild vollständig sichtbar ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.mandala {
    position: relative;
    margin: 0;
    aspect-ratio: 1 / 1;
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 28px rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
}
.mandala:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 16px 36px rgba(0, 0, 0, .12); }
.mandala:active { transform: scale(.985); }
.mandala-link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 6%;
    -webkit-tap-highlight-color: transparent;
}
.mandala-link:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; border-radius: 14px; }
.mandala img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;     /* nie beschneiden – das ganze Mandala ist zu sehen */
}

/* Overlays: Jahr unten links, optionaler Text oben rechts */
.mandala figcaption {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.tag {
    position: absolute;
    display: inline-block;
    padding: 4px 9px 5px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.tag-year {
    left: 12px;
    bottom: 12px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink-soft);
}
.tag-text {
    right: 12px;
    top: 12px;
    background: var(--amber);
    color: var(--ink);
    text-transform: uppercase;
}

/* ===== Fußzeile ===== */
.page-footer {
    margin-top: clamp(40px, 7vw, 72px);
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-soft);
}
.page-footer a { text-decoration: none; border-bottom: 1px solid var(--line); }
.page-footer a:hover { color: var(--amber-active); }

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(17, 17, 17, .94);
    color: #fff;
    padding: 16px;
}
.lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-img {
    display: block;
    max-width: min(88vw, 1400px);
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(0, 0, 0, .6);
}
.lightbox-caption {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 26px;
}
.lightbox-caption .tag { position: static; }
.lightbox-count { font-size: 12px; opacity: .7; letter-spacing: .06em; }

.lightbox button {
    position: absolute;
    background: none;
    border: 0;
    margin: 0;
    padding: 0 .3em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
    cursor: pointer;
    opacity: .8;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity .15s;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 64px;
    padding: .2em .25em;
}
.lightbox-prev { left: max(8px, env(safe-area-inset-left)); }
.lightbox-next { right: max(8px, env(safe-area-inset-right)); }
.lightbox-close {
    top: max(8px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    font-size: 40px;
}

@media (max-width: 736px) {
    .gallery { gap: 12px; }
    .mandala { border-radius: 10px; }
    .lightbox { padding: 8px; }
    .lightbox-img { max-width: 96vw; max-height: calc(100dvh - 90px); }
    .lightbox-prev, .lightbox-next { font-size: 48px; }
    .lightbox-prev { left: 0; }
    .lightbox-next { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ortsschild, .mandala, .lightbox button { transition: none; }
}
