/* ============================================================
   Hochzeitsalbum Sarah & David
   Palette: Terrakotta #D85A30 · Creme #FAF6F1 · Anthrazit #2E2A27
   ============================================================ */

:root {
    --accent: #D85A30;
    --accent-dark: #B94722;
    --accent-soft: #F7E3DA;
    --cream: #FAF6F1;
    --white: #FFFFFF;
    --text: #2E2A27;
    --text-soft: #7A716A;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(46, 42, 39, 0.08);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Erzwingt das native hidden-Verhalten, auch wenn eine Klasse (z. B. .modal,
   .lightbox mit display:flex) sonst dieselbe Spezifität hätte und gewinnen würde. */
[hidden] { display: none !important; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

/* ---------- Layout ---------- */

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.container--wide { max-width: 1100px; }

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 62vh;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(155deg, #E8A184 0%, var(--accent) 55%, #8C3316 100%);
    overflow: hidden;
}

.hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(20, 12, 8, 0) 30%, rgba(20, 12, 8, 0.72) 100%);
}

.hero__content {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 40px;
    color: #fff;
    text-align: center;
}

.hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.78rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.hero__names {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero__names .amp { color: var(--accent-soft); font-style: italic; }

.hero__welcome {
    font-size: 0.98rem;
    opacity: 0.92;
    max-width: 46ch;
    margin: 0 auto;
}

/* ---------- Topbar (Unterseiten) ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(250, 246, 241, 0.92);
    backdrop-filter: blur(8px);
    padding: 14px 16px;
    border-bottom: 1px solid rgba(46, 42, 39, 0.07);
}

.topbar__back {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    color: var(--text);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.topbar__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: var(--radius);
    padding: 14px 22px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 18px rgba(216, 90, 48, 0.35);
}
.btn--primary:hover { background: var(--accent-dark); }

.btn--secondary {
    background: var(--white);
    color: var(--accent);
    border: 2px solid var(--accent);
}
.btn--secondary:hover { background: var(--accent-soft); }

.btn--tertiary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid rgba(46, 42, 39, 0.25);
}
.btn--tertiary:hover { background: rgba(46, 42, 39, 0.05); }

.btn--big { width: 100%; padding: 17px 22px; font-size: 1.06rem; }
.btn--small { padding: 9px 16px; font-size: 0.9rem; }

.btn--danger {
    background: transparent;
    color: #B3362A;
    border: 1.5px solid #B3362A;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 20px;
}

/* ---------- Eingaben ---------- */

.input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid rgba(46, 42, 39, 0.2);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font);
    margin: 14px 0;
    background: var(--white);
    color: var(--text);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(216, 90, 48, 0.15);
}

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

.countdown-card { text-align: center; }

.countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 6px;
}

.countdown__unit {
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 12px 4px;
    min-width: 0;
    flex: 1;
    max-width: 90px;
    overflow: hidden;
}

.countdown__num {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    font-weight: 700;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
}

.countdown__label {
    display: block;
    font-size: clamp(0.58rem, 2.3vw, 0.72rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    overflow-wrap: break-word;
    word-break: break-word;
}

.countdown-note, .countdown-pending {
    color: var(--text-soft);
    font-size: 0.92rem;
    margin-top: 8px;
}

.released-card { text-align: center; }

/* ---------- Upload-Panel ---------- */

.upload-list { list-style: none; }

.upload-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(46, 42, 39, 0.07);
    font-size: 0.92rem;
}

.upload-list li:last-child { border-bottom: none; }

.upload-list .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-list .status { font-size: 1.1rem; min-width: 24px; text-align: center; }
.upload-list .status--error { color: #B3362A; font-size: 0.85rem; min-width: auto; }

.progress {
    flex: 0 0 90px;
    height: 6px;
    background: var(--accent-soft);
    border-radius: 3px;
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.2s ease;
}

/* ---------- Galerie / Masonry ---------- */

.masonry {
    columns: 2;
    column-gap: 12px;
}

@media (min-width: 700px)  { .masonry { columns: 3; } }
@media (min-width: 1000px) { .masonry { columns: 4; } }

.tile {
    break-inside: avoid;
    margin-bottom: 12px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tile__media {
    position: relative;
    background: var(--accent-soft);
    cursor: default;
}

.tile__media img, .tile__media video { width: 100%; height: auto; }

.tile--open .tile__media { cursor: pointer; }

/* Verpixelung während der Sperrzeit: Quelle ist ohnehin nur 24 px breit,
   der Blur ist zusätzliche kosmetische Sicherheit. */
.tile--locked .tile__media img {
    filter: blur(14px) saturate(1.15);
    transform: scale(1.12);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.tile--locked .tile__media { overflow: hidden; }

.tile__lock {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tile__placeholder {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: var(--accent);
    background: var(--accent-soft);
}

.tile__badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.tile__info {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
}

.tile__text { flex: 1 1 auto; min-width: 0; }

.tile__name {
    font-weight: 600;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile__date {
    font-size: 0.75rem;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile__delete {
    border: none;
    background: none;
    color: #B3362A;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 4px;
    text-decoration: underline;
    flex-shrink: 0;
    white-space: nowrap;
}

.tile__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tile__dl {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--accent);
    background: var(--accent-soft);
}

/* Play-Overlay für Videos (Video lädt erst beim Antippen) */
.tile__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.tile__play-btn {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.3rem;
    padding-left: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Album-Toolbar ("Alles herunterladen") */
.album-toolbar {
    text-align: center;
    margin-bottom: 20px;
}

.album-toolbar .hint { margin-top: 8px; }

.gallery-empty {
    text-align: center;
    color: var(--text-soft);
    padding: 48px 16px;
}

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 10, 8, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox__content img,
.lightbox__content video {
    max-width: 92vw;
    max-height: 78vh;
    border-radius: 8px;
}

.lightbox__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox__meta {
    color: rgba(255, 255, 255, 0.85);
    margin-top: 14px;
    font-size: 0.9rem;
    text-align: center;
}

/* ---------- Modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(46, 42, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal__box { width: 100%; max-width: 420px; margin-bottom: 0; }
.modal__box .btn { width: 100%; }

/* ---------- Install-Hinweis ---------- */

.install-hint { font-size: 0.92rem; }

.install-hint__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    z-index: 200;
    box-shadow: var(--shadow);
    max-width: 90vw;
    text-align: center;
}

/* ---------- Footer ---------- */

.footer {
    text-align: center;
    padding: 24px 16px 40px;
    font-size: 0.85rem;
}

.footer a { color: var(--text-soft); }

/* ---------- Impressum ---------- */

.legal h2 { font-size: 1.05rem; margin: 20px 0 6px; }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--text-soft); }

/* ---------- Admin ---------- */

.admin-header {
    background: var(--text);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 { font-size: 1.1rem; font-family: var(--font-display); }
.admin-header a { color: rgba(255, 255, 255, 0.8); font-size: 0.88rem; }

.admin-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 800px) { .admin-grid { grid-template-columns: 1fr 1fr; } }

.storage-bar {
    height: 12px;
    background: var(--accent-soft);
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0 6px;
}

.storage-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
    min-width: 2px;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

.admin-table th, .admin-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(46, 42, 39, 0.08);
    text-align: left;
    vertical-align: middle;
}

.admin-table img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.admin-thumb-placeholder {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 1.3rem;
}

.msg {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.msg--ok    { background: #E5F2E4; color: #2C5E2A; }
.msg--error { background: #F9E2DF; color: #8C2318; }

.field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 14px;
    color: var(--text-soft);
}

.hint { font-size: 0.82rem; color: var(--text-soft); margin-top: 6px; }

/* ---------- Sammel-Download: Archivteile ---------- */

.album-toolbar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
}

.zip-parts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 12px;
}

.zip-parts__size {
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.85em;
}

.zip-parts__stale {
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
}
