:root {
    --page-bg: #f4f5f7;
    --surface: #ffffff;
    --surface-soft: #eef1f4;
    --text: #26292d;
    --muted: #666d75;
    --accent: #385b4f;
    --accent-dark: #27443a;
    --line: #d9dee3;
    --shadow-soft: 0 10px 28px rgba(27, 33, 39, 0.09);
    --shadow-large: 0 24px 70px rgba(0, 0, 0, 0.32);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Roboto Slab", serif;
}

body.viewer-open {
    overflow: hidden;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

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

.gallery-header {
    padding: clamp(28px, 5vw, 58px) 20px clamp(34px, 5vw, 64px);
    background:
        radial-gradient(circle at 15% 20%, rgba(56, 91, 79, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
}

.gallery-header__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: clamp(30px, 5vw, 54px);
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 15px rgba(27, 33, 39, 0.05);
    color: var(--accent-dark);
    font-family: "Roboto", sans-serif;
    font-size: 0.94rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(56, 91, 79, 0.45);
    outline: none;
    box-shadow: 0 8px 20px rgba(27, 33, 39, 0.10);
}

.club-name {
    margin: 0 0 14px;
    color: var(--muted);
    font-family: "Roboto", sans-serif;
    font-size: clamp(1rem, 2.2vw, 1.45rem);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.gallery-header h1 {
    margin: 0;
    color: var(--text);
    font-family: "Roboto", sans-serif;
    font-size: clamp(2.8rem, 8vw, 5.4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.title-line {
    width: 54px;
    height: 4px;
    margin: 24px auto 0;
    border-radius: 999px;
    background: var(--accent);
}

.gallery-section {
    width: min(1380px, 100%);
    margin: 0 auto;
    padding: 18px clamp(14px, 3.5vw, 48px) clamp(46px, 7vw, 90px);
}

.gallery-intro {
    margin: 0 auto clamp(26px, 4vw, 42px);
    text-align: center;
}

.gallery-intro h2 {
    margin: 0 0 9px;
    font-family: "Roboto", sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 700;
}

.gallery-intro p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.94rem, 1.6vw, 1.05rem);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(155px, 100%), 1fr));
    gap: clamp(12px, 2vw, 22px);
}

.gallery-item {
    position: relative;
    min-width: 0;
    padding: 7px;
    overflow: hidden;
    cursor: zoom-in;
    border: 1px solid rgba(32, 40, 47, 0.08);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gallery-item::after {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: rgba(20, 26, 30, 0.72);
    color: #ffffff;
    content: "+";
    font-family: "Roboto", sans-serif;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
    z-index: 1;
    transform: translateY(-5px);
    border-color: rgba(56, 91, 79, 0.38);
    outline: none;
    box-shadow: 0 16px 36px rgba(27, 33, 39, 0.16);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 9px;
    object-fit: cover;
    background: var(--surface-soft);
    transition: transform 260ms ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.035);
}

.gallery-credit {
    margin: clamp(34px, 5vw, 58px) 0 0;
    color: var(--text);
    font-family: "Roboto", sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-style: italic;
    font-weight: 700;
    text-align: left;
}

.gallery-empty {
    margin: 32px auto;
    padding: 20px;
    border: 1px solid #dfc8c8;
    border-radius: 12px;
    background: #fff7f7;
    color: #7a3838;
    text-align: center;
}

/* Große Ansicht */
.gallery-viewer {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    visibility: hidden;
    place-items: center;
    padding: clamp(14px, 3vw, 34px);
    opacity: 0;
    transition: visibility 0s linear 220ms, opacity 220ms ease;
}

.gallery-viewer.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 22, 25, 0.82);
    backdrop-filter: blur(7px);
}

.viewer-shell {
    position: relative;
    z-index: 1;
    width: min(1320px, 100%);
    transform: translateY(14px) scale(0.985);
    transition: transform 220ms ease;
}

.gallery-viewer.is-open .viewer-shell {
    transform: translateY(0) scale(1);
}

.viewer-stage {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: clamp(10px, 2vw, 22px);
    align-items: center;
}

.viewer-figure {
    min-width: 0;
    margin: 0;
}

.viewer-image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: min(82vh, 900px);
    padding: clamp(8px, 1.4vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-large);
}

.viewer-image-frame img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: contain;
    user-select: none;
}

.viewer-counter {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    text-align: center;
}

.viewer-arrow,
.viewer-close {
    display: inline-grid;
    cursor: pointer;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    transition: transform 170ms ease, background 170ms ease, border-color 170ms ease;
}

.viewer-arrow {
    width: 58px;
    height: 58px;
    font-family: "Roboto", sans-serif;
    font-size: 1.8rem;
}

.viewer-arrow:hover,
.viewer-arrow:focus-visible,
.viewer-close:hover,
.viewer-close:focus-visible {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.55);
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

.viewer-close {
    position: absolute;
    z-index: 2;
    top: -17px;
    right: 62px;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 1;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(135px, 100%), 1fr));
    }

    .viewer-stage {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 8px;
    }

    .viewer-arrow {
        width: 48px;
        height: 48px;
        font-size: 1.45rem;
    }

    .viewer-close {
        top: -12px;
        right: 48px;
    }
}

@media (max-width: 640px) {
    .gallery-header {
        padding-right: 14px;
        padding-left: 14px;
    }

    .gallery-section {
        padding-right: 10px;
        padding-left: 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-item {
        padding: 5px;
        border-radius: 10px;
    }

    .gallery-item img {
        border-radius: 7px;
    }

    .gallery-credit {
        padding-left: 4px;
    }

    .gallery-viewer {
        padding: 56px 9px 18px;
    }

    .viewer-shell {
        width: 100%;
    }

    .viewer-stage {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 4px;
    }

    .viewer-image-frame {
        height: calc(100vh - 126px);
        max-height: 760px;
        padding: 5px;
        border-radius: 12px;
    }

    .viewer-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
        background: rgba(20, 26, 30, 0.64);
    }

    .viewer-close {
        top: -47px;
        right: 2px;
        width: 42px;
        height: 42px;
        background: rgba(20, 26, 30, 0.64);
    }

    .viewer-counter {
        margin-top: 7px;
        font-size: 0.84rem;
    }
}

@media (max-width: 390px) {
    .viewer-stage {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
    }

    .viewer-arrow {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}