/* =========================================================================
   9. Charity Golfturnier – Galerie
   Farb-/Typo-Tokens:
     --green-deep   #1b4332  (Marke, dunkel)
     --green-mid    #2d6a4f  (Akzent)
     --gold         #c9a227  (Charity-/Trophy-Akzent)
     --cream        #f7f5ef  (Seitenhintergrund, angemeldet)
     --ink          #1f2421  (Fließtext)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --green-deep: #1b4332;
    --green-mid: #2d6a4f;
    --gold: #c9a227;
    --cream: #f7f5ef;
    --ink: #1f2421;
    --error: #b3261e;
    /* Füllfarbe hinter Vorschaubildern, wenn Hoch- und Querformat in
       derselben Grid-Reihe stehen (statt grellem Weiß) */
    --thumb-fill: #24282a;
    --font-display: 'Poppins', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: url('/assets/background.jpg') center center / cover no-repeat fixed;
    position: relative;
}

body::before {
    /* Abdunklungs-Layer für ausreichenden Textkontrast, auf jeder Seite */
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.20);
    z-index: 0;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
}

/* ---- Logo (oben links, auf allen Seiten identisch) --------------------- */

.site-logo {
    position: fixed;
    top: 10px;
    left: 10px;
    height: 60px;
    width: auto;
    z-index: 50;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

/* ---- Anmeldeseite -------------------------------------------------------- */

.login-wrap {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: rgba(27, 67, 50, 0.55);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-card label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: #ffffff;
    margin-bottom: 16px;
}

.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    outline: none;
}

.login-card input[type="password"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.35);
}

.login-card button {
    margin-top: 16px;
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    background: var(--gold);
    color: var(--green-deep);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.login-card button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.login-error {
    margin-top: 14px;
    color: #ffd7d2;
    background: rgba(179, 38, 30, 0.35);
    border: 1px solid rgba(255, 180, 170, 0.5);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.92rem;
}

/* ---- Angemeldete Seiten (Startseite / Galerie) -------------------------- */

.page-header {
    position: relative;
    z-index: 1;
    padding: 88px 40px 8px;
}

.breadcrumb {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #f0ece0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    margin: 0 0 28px;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    color: #ffffff;
}

.breadcrumb-home {
    font-weight: 700;
    color: var(--gold);
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #cfc9ba;
}

main {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 0 40px 48px;
}

/* ---- Startseite: Galerie-Kacheln (1. Bild je Ordner) -------------------- */

.folder-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 24px;
}

.folder-card {
    display: flex;
    flex-direction: column;
    width: 320px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(27, 67, 50, 0.18);
}

.folder-card .folder-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: var(--thumb-fill);
    overflow: hidden;
}

.folder-card img {
    display: block;
    width: 320px;
    height: auto;
}

.folder-card .folder-name {
    display: block;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 12px 14px;
    color: var(--green-deep);
    border-top: 3px solid var(--gold);
}

.empty-hint {
    color: #f0ece0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font-size: 0.98rem;
}

/* ---- Galerie-Seite: Bilder-Grid ------------------------------------------ */

.image-grid {
    display: grid;
    grid-template-columns: repeat(5, 320px);
    gap: 20px;
    justify-content: flex-start;
}

.image-grid button.thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    padding: 0;
    border: none;
    background: var(--thumb-fill);
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.image-grid button.thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(27, 67, 50, 0.18);
}

.image-grid button.thumb img {
    display: block;
    width: 320px;
    height: auto;
}

.scroll-sentinel {
    height: 1px;
}

.loading-indicator {
    text-align: center;
    padding: 24px 0;
    color: #f0ece0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
    display: none;
}

.loading-indicator.active {
    display: block;
}

/* Responsive: weniger Spalten auf schmalen Bildschirmen */
@media (max-width: 1720px) {
    .image-grid { grid-template-columns: repeat(4, 320px); }
}
@media (max-width: 1400px) {
    .image-grid { grid-template-columns: repeat(3, 320px); }
}
@media (max-width: 1060px) {
    .image-grid { grid-template-columns: repeat(2, 320px); }
}
@media (max-width: 720px) {
    .page-header, main { padding-left: 16px; padding-right: 16px; }
    .image-grid { grid-template-columns: 1fr; justify-items: center; }
    .image-grid button.thumb, .image-grid button.thumb img,
    .folder-card, .folder-card img { width: 100%; max-width: 320px; }
}

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

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 17, 0.90);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    padding: 40px 20px;
    overflow-y: auto;
    animation: lightbox-fade 0.15s ease;
}

.lightbox-overlay.open {
    display: flex;
}

@keyframes lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    max-width: 720px;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(720px, calc(100vw - 40px));
    /* Bei Hochkantfotos Höhe begrenzen, damit unter dem Bild immer Platz
       für den Download-Link bleibt (statt außerhalb des Bildschirms zu landen) */
    max-height: 78vh;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-download {
    margin-top: 18px;
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--green-deep);
    background: var(--gold);
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 24px;
    transition: filter 0.12s ease;
}

.lightbox-download:hover {
    filter: brightness(1.08);
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

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

footer.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 18px 16px;
    font-size: 0.85rem;
    color: #f0ece0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

footer.site-footer a {
    color: #ffffff;
    text-decoration: none;
}

footer.site-footer a:hover {
    text-decoration: underline;
}

/* Sichtbarer Fokus-Rahmen für Tastaturbedienung */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
