/* ============================================================
   DiaRama — Fach-Styles (Alben, Fotoraster, Lightbox, Sichten).
   Basis-Layout, Shell, Konten, Gruppen, Chat und Mitteilungen
   kommen aus dem WDT30.AppKit (_content/WDT30.AppKit/appkit.css).
   Markenfarben: warmes Sepia/Bernstein statt Kit-Grün.
   ============================================================ */

:root {
    /* Kit- und WDT-Variablen überschreiben — Dia-Projektor-Stimmung */
    --kendo-color-primary: #8C5A2B;
    --kendo-color-primary-hover: #7C4F25;
    --kendo-color-primary-active: #6C441F;
    --kendo-color-primary-emphasis: #543317;
    --kendo-color-primary-subtle: rgba(140, 90, 43, 0.10);
    --kendo-color-primary-subtle-hover: rgba(140, 90, 43, 0.18);
    --kendo-color-primary-subtle-active: rgba(140, 90, 43, 0.26);
    --kendo-color-primary-on-subtle: #543317;
    --kendo-color-primary-on-surface: #6C441F;
    --kendo-color-primary-rgb: 140, 90, 43;
    --kendo-color-on-primary: #ffffff;
    --kendo-color-primary-darker: #6C441F;

    --wdt-color-primary: #8C5A2B;
    --wdt-color-on-primary: #ffffff;
    --wdt-color-secondary: #6B6157;

    --webet-green: #8C5A2B;
    --webet-green-soft: #F3E7D7;
    --webet-gold: #B98A2E;
    --webet-gold-soft: #F8EFD8;
    --webet-bg: #F6F2EB;
    --webet-surface: #FFFFFF;
    --webet-ink: #241D15;
    --webet-muted: #6B6157;
    --webet-line: #E5DDD1;
}

/* Topbar-Akzent („Rama") — Kit-Standard ist WeBet-Mint */
.webet-brand-accent {
    color: #F5D9A8;
}

/* ---------- Breite Bildschirme (PC, Tablet quer) ----------
   Die Kit-Shell ist handy-schmal (560px). Foto-lastige Seiten markieren
   sich mit .dia-wide/.dia-medium und bekommen auf breiten Bildschirmen
   mehr Raum — Login, Gruppen und Chat bleiben bewusst schmal. */

@media (min-width: 700px) {
    .webet-main-inner:has(.dia-wide) { max-width: 1200px; }
    .webet-main-inner:has(.dia-medium) { max-width: 820px; }

    /* Aktionsleisten nicht auf Bildschirmbreite aufblasen */
    .dia-wide .dia-albumactions,
    .dia-wide .webet-btn-block,
    .dia-wide .dia-importprogress,
    .dia-wide .dia-suggestform {
        max-width: 560px;
    }
}

/* ---------- Zurück-Navigation ---------- */

.dia-backrow {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dia-backrow .webet-pagetitle {
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dia-backrow-sub {
    /* bündig unter dem Titel (Pfeilbreite + Lücke) */
    margin: 2px 0 0 46px;
}

.dia-backbtn {
    font: inherit;
    font-size: 17px;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid var(--webet-line);
    border-radius: 10px;
    background: var(--webet-surface);
    color: var(--webet-ink);
    cursor: pointer;
}

.dia-backbtn:active {
    background: var(--webet-green-soft);
}

/* ---------- Alben ---------- */

.dia-albumform {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--webet-surface);
    border: 1px dashed var(--webet-line);
    border-radius: 12px;
    padding: 14px;
    margin: 10px 0;
}

.dia-albumgrid {
    display: grid;
    /* Handy: 2 Spalten; PC/Tablet: so viele Karten, wie Platz ist */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.dia-albumcard {
    font: inherit;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0 10px;
    border-radius: 14px;
    border: 1px solid var(--webet-line);
    background: var(--webet-surface);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    color: var(--webet-ink);
}

.dia-albumcover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: var(--webet-green-soft);
    color: var(--webet-green);
    font-size: 34px;
    overflow: hidden;
}

.dia-albumcover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dia-albumname {
    font-weight: 700;
    font-size: 14.5px;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dia-albummeta {
    font-size: 12.5px;
    padding: 0 10px;
}

.dia-albumhead { margin-bottom: 4px; }
.dia-albumhead .webet-pagetitle { margin-bottom: 2px; }

/* ---------- Dia-Import ---------- */

.dia-importlist {
    display: flex;
    flex-direction: column;
    background: var(--webet-surface);
    border: 1px solid var(--webet-line);
    border-radius: 12px;
    padding: 4px 12px;
    max-height: 320px;
    overflow-y: auto;
}

.dia-importrow {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--webet-line);
    font-size: 14px;
}

.dia-importrow:last-child { border-bottom: none; }

.dia-importname {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dia-importrow .webet-muted { white-space: nowrap; font-size: 12.5px; }

.dia-importprogress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--webet-surface);
    border: 1px solid var(--webet-line);
    border-radius: 12px;
    padding: 14px;
}

.dia-importstats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 13.5px;
}

/* Feste Mindesthöhe: Statuszeile wechselt, ohne dass darunter etwas hüpft */
.dia-importcurrent {
    font-size: 13px;
    min-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Foto-Raster ---------- */

.dia-photogrid {
    display: grid;
    /* Handy: 3 Spalten; PC/Tablet: füllt die Breite mit ~120-180px-Kacheln */
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 4px;
    margin-top: 12px;
}

.dia-photocell {
    position: relative;
    padding: 0;
    border: none;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    background: var(--webet-green-soft);
}

.dia-photocell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dia-favbadge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 999px;
    padding: 1px 6px;
}

/* ---------- Foto-Detail (Vorschläge, Anekdoten) ---------- */

.dia-fotodetail-img {
    width: 100%;
    max-height: 46dvh;
    object-fit: contain;
    border-radius: 12px;
    background: #1B140C;
}

.dia-fotodetail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
    font-size: 14.5px;
    font-weight: 600;
    margin-top: 8px;
}

.dia-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--webet-surface);
    border: 1px solid var(--webet-line);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 6px;
}

.dia-suggestion-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dia-suggestion-main .webet-muted { font-size: 12px; }

.dia-votebtn {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--webet-line);
    background: var(--webet-surface);
    color: var(--webet-ink);
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
}

.dia-votebtn.voted {
    border-color: var(--webet-green);
    background: var(--webet-green-soft);
    color: var(--webet-green);
}

.dia-suggestform {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--webet-surface);
    border: 1px dashed var(--webet-line);
    border-radius: 12px;
    padding: 12px;
    margin: 4px 0 8px;
}

.dia-anecdote {
    background: var(--webet-surface);
    border: 1px solid var(--webet-line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dia-anecdote-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.dia-anecdote-author { font-weight: 700; font-size: 14px; }
.dia-anecdote-head .webet-muted { font-size: 12px; white-space: nowrap; }

.dia-anecdote-text {
    font-size: 14.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.dia-anecdote-actions {
    display: flex;
    gap: 8px;
}

.dia-anecdote-input {
    font: inherit;
    font-size: 14.5px;
    border: 1px solid var(--webet-line);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--webet-bg);
    color: var(--webet-ink);
    resize: vertical;
    min-height: 72px;
}

.dia-anecdote-input:focus {
    outline: 2px solid var(--webet-green);
    outline-offset: -1px;
}

.dia-sichten-info {
    right: auto;
    left: 10px;
}

/* ---------- Foto-Viewer (einfache Lightbox) ---------- */

.dia-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(12, 9, 5, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dia-viewer-img {
    max-width: 100vw;
    /* Platz für die feste Leiste unten — das Bild hüpft nicht, wenn Bedienelemente wechseln */
    max-height: calc(100dvh - 76px - env(safe-area-inset-bottom));
    object-fit: contain;
}

.dia-viewer-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 10px env(safe-area-inset-bottom);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(20, 15, 9, 0.85);
}

.dia-viewer-btn {
    font: inherit;
    font-size: 18px;
    min-width: 48px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #F5EDE0;
    cursor: pointer;
}

.dia-viewer-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.dia-viewer-btn.active {
    background: rgba(245, 217, 168, 0.25);
    color: #F5D9A8;
}

.dia-viewer-heart { font-size: 20px; }

/* ---------- Sichten-Modus ---------- */

.dia-albumactions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.dia-albumactions .wdt-button { width: 100%; }

.dia-sichten {
    /* Fokussierbar für Pfeiltasten, ohne sichtbaren Rahmen */
    outline: none;
    touch-action: pan-y; /* horizontale Wischer gehören uns, vertikal bleibt nativ */
}

.dia-sichten-close {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    right: 10px;
    font: inherit;
    font-size: 18px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(20, 15, 9, 0.7);
    color: #F5EDE0;
    cursor: pointer;
    z-index: 2;
}

.dia-sichten-heart { font-size: 24px; min-width: 72px; }

.dia-sichten-preload {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dia-viewer-count {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    color: #F5EDE0;
    font-size: 13px;
    white-space: nowrap;
    background: rgba(20, 15, 9, 0.7);
    border-radius: 999px;
    padding: 3px 12px;
}
