/* ===================================
   BARLOW — LOCAL SELF-HOSTED
   =================================== */
 
@font-face
{
    font-family: 'Barlow';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('fonts/barlow-v13-latin_latin-ext-300.woff2') format('woff2');
}
 
@font-face
{
    font-family: 'Barlow';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/barlow-v13-latin_latin-ext-regular.woff2') format('woff2');
}
 
@font-face
{
    font-family: 'Barlow';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/barlow-v13-latin_latin-ext-500.woff2') format('woff2');
}
 
@font-face
{
    font-family: 'Barlow';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/barlow-v13-latin_latin-ext-600.woff2') format('woff2');
}
 
@font-face
{
    font-family: 'Barlow';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/barlow-v13-latin_latin-ext-700.woff2') format('woff2');
}

@font-face
{
    font-family: 'DM Serif Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/dm-serif-display-v17-latin_latin-ext-regular.woff2') format('woff2');
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --navy: #050d20;
            --navy-light: #0a1a3a;
            --navy-mid: #112244;
            --gold: #c9a84c;
            --gold-dim: rgba(201,168,76,0.3);
            --gold-glow: rgba(201,168,76,0.15);
            --cream: #e8e0d0;
            --text: #c5bfb3;
            --text-dim: #8a8478;
            --white: #f5f0e8;
            --font-display: 'DM Serif Display', Georgia, serif;
            --font-body: 'Barlow', sans-serif;
        }

        body {
            font-family: var(--font-body);
            background: var(--navy);
            color: var(--text);
            line-height: 1.6;
            overflow-x: hidden;
        }

        /* ===== HEADER ===== */
        .gallery-header {
            text-align: center;
            padding: 80px 24px 60px;
            position: relative;
        }

        .gallery-header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 60px;
            height: 1px;
            background: var(--gold);
        }

        .gallery-back {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--gold);
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            margin-bottom: 32px;
            transition: gap 0.3s ease;
        }

        .gallery-back:hover { gap: 12px; }
        .gallery-back svg { transition: transform 0.3s ease; }
        .gallery-back:hover svg { transform: translateX(-4px); }

        .gallery-header h1 {
            font-family: var(--font-display);
            font-size: clamp(2.2rem, 5vw, 3.5rem);
            color: var(--white);
            font-weight: 400;
            margin-bottom: 16px;
        }

        .gallery-header p {
            font-size: 1.05rem;
            color: var(--text-dim);
            max-width: 600px;
            margin: 0 auto;
        }

        /* ===== TIMELINE ===== */
        .timeline-gallery {
            max-width: 1100px;
            margin: 0 auto;
            padding: 60px 24px 100px;
            position: relative;
        }

        /* linia pionowa */
        .timeline-gallery::before {
            content: '';
            position: absolute;
            left: 40px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: linear-gradient(
                to bottom,
                transparent 0%,
                var(--gold-dim) 5%,
                var(--gold-dim) 95%,
                transparent 100%
            );
        }

        @media (min-width: 768px) {
            .timeline-gallery::before { left: 60px; }
        }

        /* ===== EPOCH (sekcja timeline) ===== */
        .epoch {
            position: relative;
            margin-bottom: 48px;
            padding-left: 80px;
        }

        @media (min-width: 768px) {
            .epoch { padding-left: 110px; }
        }

        /* kropka na timeline */
        .epoch::before {
            content: '';
            position: absolute;
            left: 33px;
            top: 24px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--navy);
            border: 2px solid var(--gold);
            z-index: 2;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        @media (min-width: 768px) {
            .epoch::before { left: 53px; }
        }

        .epoch.is-open::before {
            background: var(--gold);
            box-shadow: 0 0 12px var(--gold-glow);
        }

        /* naglowek epoki */
        .epoch-header {
            cursor: pointer;
            user-select: none;
            padding: 20px 0;
            display: flex;
            align-items: baseline;
            gap: 16px;
            flex-wrap: wrap;
        }

        .epoch-year {
            font-family: var(--font-display);
            font-size: 1.6rem;
            color: var(--gold);
            white-space: nowrap;
            min-width: 100px;
        }

        .epoch-title {
            font-size: 1.15rem;
            font-weight: 600;
            color: var(--white);
            flex: 1;
        }

        .epoch-count {
            font-size: 0.8rem;
            color: var(--text-dim);
            letter-spacing: 1px;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .epoch-toggle {
            width: 32px;
            height: 32px;
            border: 1px solid var(--gold-dim);
            border-radius: 50%;
            background: transparent;
            color: var(--gold);
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .epoch-toggle svg {
            transition: transform 0.3s ease;
            width: 14px;
            height: 14px;
        }

        .epoch.is-open .epoch-toggle svg {
            transform: rotate(180deg);
        }

        .epoch-toggle:hover {
            background: var(--gold);
            color: var(--navy);
        }

        /* okładka */
        .epoch-cover {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            margin-bottom: 4px;
            max-height: 400px;
        }

        .epoch-cover img {
            width: 100%;
            height: 100%;
            max-height: 400px;
            object-fit: cover;
            display: block;
            transition: transform 0.6s ease;
        }

        .epoch-cover:hover img {
            transform: scale(1.03);
        }

        .epoch-cover-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 24px;
            background: linear-gradient(transparent, rgba(5,13,32,0.85));
            pointer-events: none;
        }

        .epoch-cover-caption {
            font-size: 0.9rem;
            color: var(--cream);
            font-style: italic;
        }

        /* siatka rozwijanych zdjec */
        .epoch-grid-wrapper {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.5s ease;
        }

        .epoch.is-open .epoch-grid-wrapper {
            max-height: 5000px;
            transition: max-height 0.8s ease;
        }

        .epoch-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 8px;
            padding-top: 8px;
        }

        @media (min-width: 768px) {
            .epoch-grid {
                grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
                gap: 10px;
            }
        }

        .epoch-thumb {
            position: relative;
            border-radius: 6px;
            overflow: hidden;
            cursor: pointer;
            aspect-ratio: 4/3;
            background: var(--navy-light);
        }

        .epoch-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: transform 0.4s ease, filter 0.4s ease;
            filter: brightness(0.85);
        }

        .epoch-thumb:hover img {
            transform: scale(1.06);
            filter: brightness(1);
        }

        .epoch-thumb-caption {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 8px 12px;
            background: linear-gradient(transparent, rgba(5,13,32,0.8));
            font-size: 0.75rem;
            color: var(--cream);
            opacity: 0;
            transform: translateY(4px);
            transition: all 0.3s ease;
        }

        .epoch-thumb:hover .epoch-thumb-caption {
            opacity: 1;
            transform: translateY(0);
        }

        /* ===== LIGHTBOX ===== */
        .lightbox {
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: rgba(2, 5, 12, 0.96);
            display: none;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .lightbox.is-active {
            display: flex;
            opacity: 1;
        }

        .lightbox-image-wrapper {
            position: relative;
            max-width: 90vw;
            max-height: 85vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .lightbox-image-wrapper img {
            max-width: 90vw;
            max-height: 82vh;
            object-fit: contain;
            border-radius: 4px;
            box-shadow: 0 8px 60px rgba(0,0,0,0.6);
            user-select: none;
        }

        .lightbox-caption {
            position: absolute;
            bottom: -40px;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 0.9rem;
            color: var(--text-dim);
            font-style: italic;
        }

        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 24px;
            width: 48px;
            height: 48px;
            border: none;
            background: none;
            color: var(--white);
            font-size: 2rem;
            cursor: pointer;
            opacity: 0.6;
            transition: opacity 0.3s ease;
            z-index: 10;
        }

        .lightbox-close:hover { opacity: 1; }

        .lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 52px;
            height: 52px;
            border: 1px solid rgba(201,168,76,0.3);
            border-radius: 50%;
            background: rgba(5,13,32,0.6);
            color: var(--gold);
            font-size: 1.4rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            backdrop-filter: blur(8px);
            z-index: 10;
        }

        .lightbox-nav:hover {
            background: rgba(201,168,76,0.15);
            border-color: var(--gold);
        }

        .lightbox-prev { left: 20px; }
        .lightbox-next { right: 20px; }

        .lightbox-counter {
            position: absolute;
            top: 28px;
            left: 28px;
            font-size: 0.85rem;
            color: var(--text-dim);
            letter-spacing: 1px;
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 600px) {
            .epoch-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 6px;
            }

            .epoch-cover { max-height: 250px; }
            .epoch-cover img { max-height: 250px; }
            .epoch-year { font-size: 1.3rem; min-width: auto; }
            .epoch-title { font-size: 1rem; }
            .epoch { padding-left: 64px; }

            .lightbox-nav { width: 40px; height: 40px; font-size: 1.1rem; }
            .lightbox-prev { left: 10px; }
            .lightbox-next { right: 10px; }
        }

        /* ===== ANIMACJE WEJSCIA ===== */
        .epoch {
            opacity: 0;
            transform: translateY(30px);
            transition: opacity 0.6s ease, transform 0.6s ease;
        }

        .epoch.visible {
            opacity: 1;
            transform: translateY(0);
        }