/*
 * PictureGrove – Startseite / Home
 * ------------------------------------------------------------
 * Zweck:
 *   Dieses Stylesheet steuert die Desktop-/Basisansicht der
 *   Startseite hinter der Willkommensseite.
 *
 * Aktueller Entwicklungsstand:
 *   - erste echte Botschafterbilder werden angezeigt
 *   - die Kacheln greifen auf lokal erzeugte tile.webp-Derivate zu
 *   - extreme Querformate können per Sonderklasse mit "contain"
 *     statt "cover" dargestellt werden
 *
 * Gestalterische Leitidee:
 *   ruhige Bühne, fester Innenbereich, 5:4-Bildfenster,
 *   klare Zwischenräume und zurückhaltende Textmetadaten.
 */

/* ============================================================
   GRUNDVARIABLEN / SEITENRAHMEN
   ============================================================ */
:root {
    --stage-bg: #0d0b09;
    --bg: #151311;
    --text: #f1ece2;
    --muted: #cfc6b8;
    --soft: #9f9689;
    --max-page: 1440px;
    --home-content-width: 1320px;
}


/* ============================================================
   BASIS / RESET
   ============================================================ */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--stage-bg);

    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    min-height: 100vh;
    max-width: 1120px;
    margin: 0 auto;
    background: var(--bg);
}

.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}


/* ============================================================
   HERO / EINLEITUNG
   ------------------------------------------------------------
   Die Startseite beginnt mit einem knappen redaktionellen Einstieg.
   Noch bewusst zurückhaltend, damit das Grid schnell sichtbar wird.
   ============================================================ */
.home-hero {
    padding: 56px 0 30px;
}

.home-hero-inner {
    max-width: var(--home-content-width);
    margin: 0 auto;
}

.home-kicker {
    font-size: 0.84rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--soft);
    margin-bottom: 12px;
}

h1 {
    margin: 0;
    font-size: clamp(1.95rem, 3.6vw, 3.1rem);
    line-height: 1.05;
    font-weight: 300;
    letter-spacing: -0.035em;
}

.home-intro {
    margin: 16px 0 0;
    max-width: 56rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--muted);
}


/* ============================================================
   GRIDBEREICH
   ------------------------------------------------------------
   3 Spalten im aktuellen Innenbereich.
   Die Kacheln folgen der besprochenen Logik:
   - 5:4 Bildfenster
   - Titel + Fotograf darunter
   - keine sichtbaren Kartenrahmen
   - Luft zwischen den Elementen statt App-Anmutung
   - Sonderbehandlung für extreme Querformate über "contain"
   ============================================================ */
.home-content {
    padding: 8px 0 80px;
}

.home-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
}

.tile {
    min-width: 0;
}

.tile-image {
    aspect-ratio: 5 / 4;
    width: 100%;
    background: linear-gradient(
        180deg,
        rgba(220, 220, 220, 0.82) 0%,
        rgba(176, 176, 176, 0.82) 100%
    );
    border-radius: 6px;
    overflow: hidden;
}

.tile-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tile-image--contain {
    background: #0d0c0a;
}

.tile-image--contain .tile-img {
    object-fit: contain;
}

.tile-meta {
    padding-top: 12px;
}

.tile-title {
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-author {
    margin-top: 4px;
    font-size: 0.93rem;
    line-height: 1.35;
    color: #918570;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   "MEHR"-BUTTON
   ------------------------------------------------------------
   Noch ohne echte Funktion; dient zunächst nur der Platzierung
   und der späteren Logik des kontrollierten Nachladens.
   ============================================================ */
.home-more {
    max-width: var(--home-content-width);
    margin: 0 auto;
    padding-top: 40px;
    display: flex;
    justify-content: center;
}

.more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 11px 22px;
    border-radius: 7px;
    border: 1px solid rgba(214, 175, 77, 0.78);
    color: #e4cf89;
    font-size: 0.98rem;
    line-height: 1;
    background: linear-gradient(
        180deg,
        rgba(62, 48, 20, 0.44) 0%,
        rgba(36, 29, 14, 0.36) 100%
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 245, 210, 0.07),
        inset 0 -1px 0 rgba(0, 0, 0, 0.20),
        0 6px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, background 0.18s ease;
}

.more-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(
        180deg,
        rgba(72, 56, 24, 0.50) 0%,
        rgba(42, 34, 16, 0.40) 100%
    );
}

/* ------------------------------------------------------------
   Viewer-Grundgerüst
------------------------------------------------------------ */

.viewer-overlay[hidden] {
    display: none;
}

.viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    color: #f1ece2;
}

.viewer-stage {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
}

.viewer-prev {
    grid-column: 1;
}

.viewer-media {
    grid-column: 2;
}

.viewer-next {
    grid-column: 3;
}

.viewer-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 12px 0 84px;
}

.viewer-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.viewer-close,
.viewer-prev,
.viewer-next {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.viewer-close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 2;
    font-size: 34px;
    line-height: 1;
}

.viewer-prev,
.viewer-next {
    width: 72px;
    height: 72px;
    font-size: 42px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 72px;
    padding: 12px 18px 14px;
    background: rgba(20, 20, 20, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    align-items: center;
    text-align: center;
}

.viewer-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-line-1 {
    font-size: 15px;
    line-height: 1.3;
}

.viewer-line-2 {
    font-size: 13px;
    line-height: 1.3;
    color: #cfc6b8;
}

.viewer-prev:disabled,
.viewer-next:disabled {
    display: none;
}

.tile[data-doc-id=""] {
    opacity: 0.34;
}

.tile[data-doc-id=""] .tile-image {
    background: linear-gradient(180deg, #d7d7d7 0%, #cfcfcf 100%);
}

.tile[data-doc-id=""] .tile-meta {
    opacity: 0;
}

.viewer-mobile-dummy {
    display: none;
}