/* =============================================================
   Öffentliche Galerie, Lightbox, Urkunden-Vorschau, Cookie-Banner
   ============================================================= */

.gallery-hero {
    position: relative;
    background:
        radial-gradient(120% 140% at 50% -20%, #2f6f37 0%, var(--green-dark) 55%, #163b1c 100%);
    color: #fff;
    padding: 3rem 1.2rem 3.2rem;
    text-align: center;
    overflow: hidden;
    border-bottom: 4px solid var(--amber);
}
/* Feine diagonale "Racing"-Streifen als Textur */
.gallery-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px);
    pointer-events: none;
}
.gallery-hero .hero-eyebrow {
    position: relative;
    text-transform: uppercase; letter-spacing: .28em; font-size: .72rem;
    font-weight: 600; color: var(--amber); opacity: .95; margin-bottom: .9rem;
}
.gallery-hero h1 {
    position: relative; margin: 0 auto; max-width: 22ch;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 1.1rem + 2.6vw, 3rem);
    font-weight: 700; line-height: 1.08; letter-spacing: -.01em;
    text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.gallery-hero .hero-date {
    position: relative; display: inline-block; margin-top: 1rem;
    font-size: 1rem; opacity: .95;
    padding-top: .8rem; border-top: 1px solid rgba(255,255,255,.25);
}

.gallery-toolbar {
    max-width: 1200px; margin: 0 auto; padding: 1.4rem 1.2rem .4rem;
    display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
}
.gallery-toolbar .count {
    font-family: Georgia, serif; font-size: 1.15rem; color: var(--green-dark); font-weight: 700;
}

/* Galerie-Raster */
.photo-grid {
    max-width: 1200px; margin: 0 auto; padding: .4rem 1.2rem 3.5rem;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem;
}
.photo-tile {
    position: relative; aspect-ratio: 3/2; border-radius: 14px; overflow: hidden;
    cursor: pointer; background: #e9eceb;
    box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 8px 22px rgba(20,40,25,.10);
    transition: transform .18s ease, box-shadow .18s ease;
}
.photo-tile::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,30,18,.55) 0%, rgba(15,30,18,0) 42%);
    opacity: .85; transition: opacity .18s ease;
}
.photo-tile:hover { transform: translateY(-4px) scale(1.012); box-shadow: 0 6px 10px rgba(0,0,0,.12), 0 18px 40px rgba(20,40,25,.22); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .tile-badge {
    position: absolute; left: .6rem; bottom: .55rem; z-index: 2;
    background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(4px);
    font-size: .74rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px;
}
/* Hover-Hinweis "Urkunde ansehen" */
.photo-tile .tile-hint {
    position: absolute; z-index: 2; right: .6rem; bottom: .55rem;
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--amber); color: #fff; font-size: .74rem; font-weight: 600;
    padding: .18rem .6rem; border-radius: 999px;
    opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease;
}
.photo-tile:hover .tile-hint { opacity: 1; transform: translateY(0); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; background: rgba(15,20,17,.92); z-index: 1000;
    display: none; flex-direction: column; align-items: center; justify-content: center; padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox .lb-stage {
    display: flex; align-items: center; justify-content: center;
    width: 92vw; min-height: 62vh;
}
.lightbox img.lb-photo { max-width: 92vw; max-height: 62vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox img.lb-photo.is-loading { display: none; }
.lightbox .lb-spinner {
    display: none; width: 54px; height: 54px; border-radius: 50%;
    border: 4px solid rgba(255,255,255,.25); border-top-color: #fff;
    animation: lb-spin .8s linear infinite;
}
.lightbox .lb-spinner.show { display: block; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lightbox .lb-actions { margin-top: 1.1rem; display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }
.lightbox .lb-close {
    position: absolute; top: 1rem; right: 1.2rem; background: rgba(255,255,255,.15); color: #fff;
    border: none; width: 42px; height: 42px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.28); }
.lightbox .lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15);
    color: #fff; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer;
}
.lightbox .lb-prev { left: 1rem; } .lightbox .lb-next { right: 1rem; }
.lightbox .lb-nav:hover { background: rgba(255,255,255,.28); }
.lightbox .lb-caption { color: #cfd8d3; font-size: .85rem; margin-top: .6rem; }

/* Urkunden-Vorschau (PDF im iframe) */
.cert-modal {
    position: fixed; inset: 0; background: rgba(15,20,17,.92); z-index: 1100;
    display: none; flex-direction: column; padding: 1rem;
}
.cert-modal.open { display: flex; }
.cert-modal .cert-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    color: #fff; padding: .2rem .4rem 1rem; flex-wrap: wrap;
}
.cert-modal .cert-head h3 { color: #fff; margin: 0; }
.cert-modal iframe {
    flex: 1; width: 100%; border: none; border-radius: 8px; background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.cert-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Cookie-/Datenschutz-Consent */
.consent-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
    background: #fff; border-top: 3px solid var(--green); box-shadow: 0 -4px 20px rgba(0,0,0,.15);
    padding: 1rem 1.2rem; display: none;
}
.consent-bar.show { display: block; }
.consent-inner {
    max-width: 900px; margin: 0 auto; display: flex; gap: 1rem; align-items: center;
    justify-content: space-between; flex-wrap: wrap;
}
.consent-inner p { margin: 0; font-size: .9rem; color: var(--text); flex: 1 1 320px; }
.consent-inner .consent-actions { display: flex; gap: .6rem; }

/* Hinweis-Box auf der Galerie */
.gallery-note {
    max-width: 760px; margin: 1.6rem auto .4rem; padding: .85rem 1.2rem;
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--amber);
    border-radius: 10px; box-shadow: var(--shadow);
    color: var(--text); font-size: .95rem; display: flex; gap: .6rem; align-items: center;
}
.gallery-note .icon { color: var(--amber); flex: 0 0 auto; width: 1.3em; height: 1.3em; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

@media (max-width: 600px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .55rem; padding: 0 .7rem 3rem; }
    .lightbox img.lb-photo { max-height: 55vh; }
    .lightbox .lb-stage { min-height: 55vh; }
    .gallery-hero h1 { font-size: 1.25rem; }
}
