/* ==========================================================================
   FestlNoe - Foto-Galerie
   Ergänzt style.css und nutzt dieselben Design-Tokens (--primary, --gray-*, ...)
   ========================================================================== */

/* --- Navigation ---------------------------------------------------------
   Gleiche Maße wie auf den übrigen Seiten (index.html, expired_events.html),
   die diese Werte inline überschreiben. Ohne das wären die Buttons hier
   höher und die längeren Beschriftungen würden umbrechen.                  */

.nav-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    height: 60px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .nav-text {
        display: none;
    }

    .nav-links a {
        padding: 0.75rem;
        min-width: 48px;
        justify-content: center;
        height: 50px;
    }
}

/* --- Seiten-Intro ------------------------------------------------------- */

.gallery-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto var(--space-2xl);
}

.gallery-intro h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: var(--space-sm);
}

.gallery-intro p {
    color: var(--gray-600);
    font-size: 1.05rem;
}

.gallery-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.gallery-stat {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    min-width: 130px;
    box-shadow: var(--shadow-sm);
}

body.dark-mode .gallery-stat {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.gallery-stat strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--primary);
}

.gallery-stat span {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Suche (gleiche Optik wie die Event-Suche auf der Startseite) -------- */

.search-filter-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 2rem;
    border-radius: var(--radius-2xl);
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

body.dark-mode .search-filter-section {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    border-color: var(--gray-200);
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-header h3 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.search-header p {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0;
}

body.dark-mode .search-header h3 { color: var(--gray-900); }
body.dark-mode .search-header p  { color: var(--gray-700); }

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 3;
}

body.dark-mode .search-icon { color: var(--gray-500); }

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--gray-900);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-input {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-900);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.clear-search {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 3;
    display: none;
}

.clear-search:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.clear-search.visible {
    display: block;
}

.search-results-info {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-weight: 600;
}

.search-results-info.visible {
    display: flex;
}

.results-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.results-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
}

.clear-filters-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: inherit;
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.no-results-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--gray-200);
    margin: 2rem 0;
    display: none;
}

body.dark-mode .no-results-message {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.no-results-message.visible {
    display: block;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results-message h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.no-results-message p {
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

body.dark-mode .no-results-message h3 { color: var(--gray-900); }
body.dark-mode .no-results-message p  { color: var(--gray-700); }

/* Am Handy standen Kennzahlen und Suchkasten zusammen fast einen ganzen
   Bildschirm hoch - die erste Galerie lag dadurch unter der Falz, und wer
   nicht weiterscrollte, sah nur einen grossen Suchkasten. Beides wird hier
   auf das Noetige eingedampft. Am Rechner bleibt alles, wie es war. */
@media (max-width: 767px) {
    .gallery-intro {
        margin-bottom: var(--space-lg);
    }

    .gallery-intro p {
        font-size: 0.95rem;
    }

    /* Die drei Kennzahlen in EINE Zeile statt umgebrochen 2 + 1.
       min-width: 0 hebt die 130px auf, sonst passen sie nicht nebeneinander. */
    .gallery-stats {
        flex-wrap: nowrap;
        gap: var(--space-sm);
        margin-top: var(--space-md);
    }

    .gallery-stat {
        flex: 1 1 0;
        min-width: 0;
        padding: var(--space-sm) var(--space-xs);
        text-align: center;
    }

    .gallery-stat strong {
        font-size: 1.25rem;
    }

    .gallery-stat span {
        font-size: 0.7rem;
        letter-spacing: 0.02em;
    }

    /* Aus dem Suchkasten wird eine schmale Leiste. Ueberschrift und
       Erklaertext sagen nichts, was Lupe und Platzhalter nicht schon
       sagen - der Kasten drumherum entfaellt deshalb ganz. */
    .search-filter-section {
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
        margin-bottom: var(--space-lg);
    }

    body.dark-mode .search-filter-section {
        background: none;
        border: none;
    }

    .search-header {
        display: none;
    }

    .search-input {
        padding: 0.75rem 2.75rem;
        font-size: 0.95rem;
    }

    .search-icon {
        left: 0.9rem;
        font-size: 1.05rem;
    }

    .clear-search {
        right: 0.9rem;
    }

    .search-results-info {
        margin-top: var(--space-md);
        padding: 0.75rem 1rem;
    }

    .gallery-filters {
        margin-bottom: var(--space-lg);
    }
}

/* --- Übersicht: Galerie-Karten ------------------------------------------ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.gallery-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

body.dark-mode .gallery-card {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.gallery-card-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--gray-100);
}

.gallery-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover .gallery-card-cover img {
    transform: scale(1.06);
}

.gallery-card-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--gradient-primary);
    color: white;
    opacity: 0.85;
}

.gallery-card-count {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: rgba(17, 24, 39, 0.78);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.gallery-card-draft {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: var(--warning);
    color: #78350f;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.gallery-card-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.gallery-card-body h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
}

.gallery-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.gallery-card-desc {
    color: var(--gray-600);
    font-size: 0.93rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.gallery-card-footer {
    margin-top: auto;
    padding-top: var(--space-sm);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.92rem;
}

/* --- Detailseite: Kopf --------------------------------------------------- */

.gallery-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-xl);
}

.gallery-header h2 {
    margin-bottom: var(--space-sm);
}

.gallery-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
    color: var(--gray-600);
    font-size: 0.95rem;
}

.gallery-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.gallery-notice {
    background: var(--gray-100);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
}

.download-hint {
    color: var(--gray-500);
    font-size: 0.88rem;
    margin-bottom: var(--space-lg);
}

/* --- Detailseite: Fotoraster -------------------------------------------- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: zoom-in;
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-tile:hover,
.photo-tile:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    outline: none;
}

.photo-tile:focus-visible {
    box-shadow: 0 0 0 3px var(--primary);
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-tile:hover img {
    transform: scale(1.07);
}

.photo-tile-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 12px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
    color: white;
    font-size: 0.82rem;
    text-align: left;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-tile:hover .photo-tile-overlay,
.photo-tile:focus-visible .photo-tile-overlay {
    opacity: 1;
}

/* --- Reaktionen auf ein Foto (🔥 👍 ♥️) ----------------------------------
   Die Kachel selbst ist ein Button (öffnet die Lightbox), deshalb liegen die
   Reaktionsknöpfe daneben in einer gemeinsamen Zelle - Buttons dürfen nicht
   ineinander stecken.                                                       */

.photo-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.photo-cell .photo-tile {
    width: 100%;
}

.foto-reaktionen {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.reaktion-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.reaktion-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.reaktion-btn.aktiv {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary);
}

.reaktion-btn:disabled {
    cursor: default;
}

/* Kurze Sperre nach einem Klick - gegen Dauerklicken */
.reaktion-btn.cooldown {
    opacity: 0.5;
    cursor: progress;
    transform: none;
}

.reaktion-emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.reaktion-count {
    min-width: 0.9em;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.reaktion-count.bump {
    display: inline-block;
    animation: reaktionBump 0.35s ease;
}

@keyframes reaktionBump {
    50% { transform: scale(1.35); }
}

/* In der Lightbox: gleiche Knöpfe, aber auf dunklem Grund */
.lightbox-reaktionen {
    padding-top: var(--space-md);
}

.lightbox-reaktionen[hidden] {
    display: none;
}

.lightbox-reaktionen .reaktion-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 7px 14px;
    font-size: 0.9rem;
}

.lightbox-reaktionen .reaktion-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.45);
}

/* "Die habe ich vergeben" - in der Lightbox genauso deutlich wie in der
   Kachel. Etwas mehr Weiß auf dunklem Grund sieht man dort nicht; deshalb
   dieselbe Markenfarbe wie in der Übersicht, dazu ein heller Rand und ein
   feiner Ring. Der Dark-Mode-Selektor steht mit dabei, damit die Regel
   weiter unten nicht doch wieder alles einebnet. */
.lightbox-reaktionen .reaktion-btn.aktiv,
body.dark-mode .lightbox-reaktionen .reaktion-btn.aktiv {
    background: rgba(99, 102, 241, 0.8);
    border-color: #c7d2fe;
    color: white;
    box-shadow: 0 0 0 2px rgba(199, 210, 254, 0.4);
}

.lightbox-reaktionen .reaktion-btn.aktiv:hover:not(:disabled),
body.dark-mode .lightbox-reaktionen .reaktion-btn.aktiv:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.95);
    border-color: white;
}

body.dark-mode .reaktion-btn {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-700);
}

body.dark-mode .reaktion-btn.aktiv {
    background: rgba(129, 140, 248, 0.22);
    border-color: var(--primary);
    color: var(--gray-900);
}

body.dark-mode .lightbox-reaktionen .reaktion-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* --- Lightbox ------------------------------------------------------------ */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 18, 0.94);
    z-index: 2000;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

.lightbox.open {
    display: flex;
    animation: lightboxFade 0.22s ease;
}

@keyframes lightboxFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: white;
    flex-wrap: wrap;
}

.lightbox-counter {
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.85;
}

.lightbox-tools {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius-md);
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
    color: white;
}

.lightbox-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 var(--space-md);
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.26);
}

.lightbox-nav.prev { left: var(--space-md); }
.lightbox-nav.next { right: var(--space-md); }

.lightbox-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    font-size: 0.95rem;
    min-height: 1.5em;
}

.lightbox-loading {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* --- Admin: Galerie-Verwaltung ------------------------------------------ */

.admin-gallery-form {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-2xl);
}

body.dark-mode .admin-gallery-form {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--space-lg);
}

.admin-gallery-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--gray-700);
    font-size: 0.92rem;
}

.admin-gallery-form input[type="text"],
.admin-gallery-form input[type="date"],
.admin-gallery-form input[type="email"],
.admin-gallery-form input[type="file"],
.admin-gallery-form select,
.admin-gallery-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    color: var(--gray-900);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

body.dark-mode .admin-gallery-form input,
body.dark-mode .admin-gallery-form select,
body.dark-mode .admin-gallery-form textarea {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.admin-gallery-form input:focus,
.admin-gallery-form select:focus,
.admin-gallery-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.admin-gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.admin-gallery-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

body.dark-mode .admin-gallery-item {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.admin-gallery-item-cover {
    aspect-ratio: 16 / 9;
    background: var(--gray-100);
    overflow: hidden;
}

.admin-gallery-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-gallery-item-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.admin-gallery-item-body h4 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-live    { background: #d1fae5; color: #065f46; }
.badge-draft   { background: #fef3c7; color: #92400e; }
.badge-count   { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-expire  { background: #fee2e2; color: #991b1b; }
.badge-keep    { background: #e0e7ff; color: #3730a3; }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: auto;
    padding-top: var(--space-sm);
}

/* Foto-Verwaltung */

.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.admin-photo {
    position: relative;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-100);
    transition: border-color 0.2s ease;
}

.admin-photo.is-cover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.admin-photo.is-selected {
    border-color: var(--error);
}

.admin-photo-img {
    aspect-ratio: 1 / 1;
}

.admin-photo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-photo-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    accent-color: var(--error);
    cursor: pointer;
    z-index: 2;
}

.admin-photo-cover-flag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    z-index: 2;
}

.admin-photo-tools {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: white;
}

body.dark-mode .admin-photo-tools {
    background: var(--gray-50);
}

.admin-photo-tools button,
.admin-photo-tools a {
    flex: 1;
    font-size: 0.75rem;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.admin-photo-tools button:hover,
.admin-photo-tools a:hover {
    background: var(--gray-200);
}

.admin-photo-tools .danger {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.admin-photo-caption {
    padding: 0 8px 8px;
}

.admin-photo-caption input {
    width: 100%;
    font-size: 0.75rem;
    padding: 5px 7px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-900);
}

body.dark-mode .admin-photo-caption input {
    background: var(--gray-50);
}

/* Upload-Dropzone */

.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.dropzone-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.dropzone-hint {
    color: var(--gray-500);
    font-size: 0.88rem;
    margin-top: var(--space-xs);
}

.dropzone input[type="file"] {
    display: none;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--space-md);
    justify-content: center;
}

.upload-preview span {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 5px 10px;
    font-size: 0.78rem;
    color: var(--gray-700);
}

/* --- Self-Service-Bearbeitung -------------------------------------------- */

.self-edit-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    max-width: 820px;
    margin: 0 auto var(--space-xl);
}

body.dark-mode .self-edit-card {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.self-edit-card h3 {
    margin-top: 0;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
}

.status-banner {
    max-width: 820px;
    margin: 0 auto var(--space-xl);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.status-banner.live {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.status-banner.cancelled {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.status-banner.pending {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.status-banner.review {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #78350f;
    align-items: flex-start;
}

/* Ohne min-width:0 kann das Flex-Kind nicht schrumpfen und die breite
   Vergleichstabelle schiebt die ganze Seite auf. */
.status-banner > div {
    min-width: 0;
}

.status-banner .status-icon {
    font-size: 1.8rem;
}

/* Hinweis auf die Freigabepflicht */
.review-note {
    max-width: 820px;
    margin: 0 auto var(--space-xl);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
}

body.dark-mode .review-note {
    background: var(--gray-100);
    border-color: var(--gray-300);
    border-left-color: var(--primary);
}

/* Lange Beschriftungen dürfen den Button nicht breiter als die Seite machen */
.self-edit-submit .btn {
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 480px) {
    .self-edit-submit .btn {
        width: 100%;
        padding-left: var(--space-md) !important;
        padding-right: var(--space-md) !important;
    }
}

/* Vorher/Nachher-Vergleich der offenen Änderungen */
.change-preview {
    max-width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-md);
    font-size: 0.87rem;
    display: block;
    overflow-x: auto;
}

.change-preview th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    padding: 0 0.75rem 0.3rem 0;
    font-weight: 700;
    white-space: nowrap;
}

.change-preview td {
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-top: 1px solid rgba(120, 53, 15, 0.15);
    vertical-align: top;
}

.change-preview-field {
    font-weight: 700;
    white-space: nowrap;
}

.change-preview-old {
    text-decoration: line-through;
    opacity: 0.65;
}

.change-preview-new {
    font-weight: 600;
}

.danger-zone {
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 820px;
    margin: 0 auto;
}

.danger-zone h3 {
    color: #991b1b;
    margin-top: 0;
    border-bottom-color: #fecaca;
}

.danger-zone p {
    color: #7f1d1d;
    font-size: 0.93rem;
}

.current-image-box {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.current-image-box img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* --- Leerzustand --------------------------------------------------------- */

.gallery-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    background: white;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-xl);
}

body.dark-mode .gallery-empty {
    background: var(--gray-100);
}

.gallery-empty .empty-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: var(--space-md);
}

.gallery-empty h3 {
    margin-bottom: var(--space-sm);
}

.gallery-empty p {
    color: var(--gray-600);
    max-width: 460px;
    margin: 0 auto;
}

/* --- Filterleiste -------------------------------------------------------- */

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.gallery-filter-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

body.dark-mode .gallery-filter-btn {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.gallery-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.gallery-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-sm);
    }

    .foto-reaktionen {
        gap: 4px;
    }

    .reaktion-btn {
        padding: 4px 7px;
        gap: 3px;
        font-size: 0.75rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .gallery-header {
        flex-direction: column;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .lightbox-bar {
        padding: var(--space-sm) var(--space-md);
    }

    .lightbox-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .admin-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card,
    .gallery-card-cover img,
    .photo-tile,
    .photo-tile img,
    .reaktion-btn {
        transition: none;
    }

    .reaktion-count.bump {
        animation: none;
    }

    .lightbox.open {
        animation: none;
    }
}
