/* ==========================================
   USTAWIENIA GŁÓWNE
========================================== */

:root {
    color-scheme: dark;
    --black: #000;
    --gray: #303031;
    --white: #fff;
    --muted: #cfcfd0;
    --gap: 0px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: #303031;
    color: var(--white);
    font-family: Poppins, sans-serif;
}

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

button:focus-visible,
a:focus-visible {
    outline: 3px solid #a8b0ff;
    outline-offset: 4px;
}


/* ==========================================
   NAGŁÓWEK GALERII
========================================== */

.intro {
    padding: 40px clamp(20px, 4vw, 48px) 40px;
}

.brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .035em;
    color: #fff;
    text-decoration: underline;
}

.brand:hover {
    text-decoration: none;
}

.brand-dot {
    color: #2c3ccd;
}

.intro h1 {
    font-size: 23px;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.04em;
    margin: 28px 0 14px;
}

.intro p {
    font-size: clamp(16px, 2vw, 22px);
    color: var(--muted);
    margin: 0;
}


/* ==========================================
   GALERIA - SIATKA MINIATUREK
========================================== */

.gallery-grid {
    display: grid;

    /* LICZBA MINIATUREK NA DUŻYM MONITORZE */
    grid-template-columns: repeat(6, minmax(0, 1fr));

    gap: var(--gap);
    background-color: #303031;
}


/* ==========================================
   POJEDYNCZA MINIATURKA
========================================== */

.gallery-item {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 0;
    padding: 0;
    background-color: #303031;
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;

    transition:
        transform .35s ease,
        opacity .35s ease;

    opacity: 0;
}

.gallery-item img.loaded {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.065);
}

.gallery-error {
    padding: 20px;
    color: #fff;
}


/* ==========================================
   SEKCJA POD GALERIĄ
========================================== */

.outro {
    padding:
        clamp(48px, 7vw, 48px)
        clamp(20px, 4vw, 48px)
        30px;

    background-color: #121d82;
}

.outro h2 {
    font-size: 23px;
    line-height: 1.2;
    margin: 0 0 20px;
}

.outro p {
    max-width: 650px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 28px;
}


/* ==========================================
   LINK POWROTU DO STRONY GŁÓWNEJ
========================================== */

.back-link {
    display: inline-block;
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 5px;
    font-size: 16px;
}

.back-link:hover {
    text-decoration: none;
}


/* ==========================================
   LIGHTBOX - POWIĘKSZONE ZDJĘCIE
========================================== */

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: grid;
    grid-template-columns:
        minmax(45px, 8vw)
        minmax(0, 1fr)
        minmax(45px, 8vw);

    align-items: center;

    background-color: #303031;

    opacity: 0;
    transition: opacity .2s ease;
}

.lightbox.is-visible {
    opacity: 1;
}


/* ==========================================
   OBSZAR DUŻEGO ZDJĘCIA
========================================== */

.lightbox-stage {
    grid-column: 2;
    grid-row: 1;

    min-width: 0;
    height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px 0;

    touch-action: pan-y;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: calc(100dvh - 96px);

    width: auto;
    height: auto;

    object-fit: contain;

    opacity: 1;
    transition: opacity .16s ease;

    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-stage img.changing {
    opacity: 0;
}


/* ==========================================
   STRZAŁKI I PRZYCISK ZAMYKANIA
========================================== */

.lightbox-arrow,
.lightbox-close {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-family: Arial, sans-serif;
    line-height: 1;
}


/* STRZAŁKI */

.lightbox-arrow {
    grid-row: 1;
    z-index: 1;

    font-size: clamp(46px, 6vw, 80px);
    height: 90px;
}

.lightbox-prev {
    grid-column: 1;
}

.lightbox-next {
    grid-column: 3;
}


/* PRZYCISK X */

.lightbox-close {
    position: absolute;
    z-index: 2;

    top: 12px;
    right: 18px;

    font-size: 48px;

    width: 52px;
    height: 52px;
}


/* EFEKTY PO NAJECHANIU */

.lightbox-arrow:hover,
.lightbox-close:hover {
    color: #bdbdbd;
}


/* BLOKADA PRZEWIJANIA PODCZAS OGLĄDANIA ZDJĘCIA */

body.lightbox-open {
    overflow: hidden;
}


/* ==========================================
   RESPONSYWNOŚĆ - LAPTOP
   EKRANY DO 1300px
========================================== */

@media (max-width: 1300px) {

    .gallery-grid {

        /* LICZBA MINIATUREK NA LAPTOPIE */
        grid-template-columns: repeat(6, minmax(0, 1fr));

    }

}


/* ==========================================
   RESPONSYWNOŚĆ - TABLET
   EKRANY DO 900px
========================================== */

@media (max-width: 900px) {

    .gallery-grid {

        /* LICZBA MINIATUREK NA TABLECIE */
        grid-template-columns: repeat(4, minmax(0, 1fr));

    }

}


/* ==========================================
   RESPONSYWNOŚĆ - TELEFON
   EKRANY DO 600px
========================================== */

@media (max-width: 600px) {

    /* NAGŁÓWEK */

    .intro {
        padding: 30px 20px 34px;
    }

    .intro h1 {
        margin-top: 50px;
    }


    /* MINIATURKI */

    .gallery-grid {

        /* LICZBA MINIATUREK NA TELEFONIE */
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 3px;
    }


    /* LIGHTBOX */

    .lightbox {
        grid-template-columns:
            40px
            minmax(0, 1fr)
            40px;
    }

    .lightbox-stage {
        padding: 50px 0;
    }

    .lightbox-stage img {
        max-height: calc(100dvh - 100px);
    }

    .lightbox-arrow {
        font-size: 48px;
    }

    .lightbox-close {
        top: 6px;
        right: 8px;
    }


    /* DOLNA SEKCJA */

    .outro {
        padding-bottom: 70px;
    }

}


/* ==========================================
   OGRANICZENIE ANIMACJI
   DLA UŻYTKOWNIKÓW, KTÓRZY TEGO WYMAGAJĄ
========================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

}