/* ==================================================
   REALIZACJE - GALERIA

   Główna galeria pokazuje wyłącznie zdjęcia.

   Informacje o realizacji:
   - nazwa,
   - opis,
   - cena

   pojawiają się dopiero po interakcji.
   ================================================== */


/* ==================================================
   GALERIA

   Automatyczna liczba kolumn zależna od szerokości
   ekranu.
   ================================================== */

.gallery {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));

    gap: 25px;

    width: 100%;
}


/* ==================================================
   KAFEL REALIZACJI

   Kafelek jest całym zdjęciem.
   ================================================== */

.gallery-card {
    position: relative;

    overflow: hidden;

    aspect-ratio: 4 / 3;

    border-radius: var(--ui-radius-surface);
    corner-shape: var(--ui-corner-shape);
    clip-path: var(--ui-clip-surface);

    cursor: pointer;

    border: 1px solid color-mix(in srgb, var(--ui-color-primary) 45%, transparent);

    box-shadow:
        0 10px 30px rgba(58, 48, 40, 0.08);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


/* ==================================================
   ZDJĘCIE

   Zdjęcie zawsze wypełnia cały kafelek.
   ================================================== */

.gallery-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.5s ease;
}


/* ==================================================
   EFEKT HOVER

   Delikatne powiększenie zdjęcia po najechaniu.
   ================================================== */

.gallery-card:hover .gallery-image {
    transform: scale(1.04);
}


/* ==================================================
   INFORMACJE NA ZDJĘCIU

   Ta warstwa jest niewidoczna domyślnie.

   Na komputerze pojawia się po najechaniu
   kursorem.
   ================================================== */

.gallery-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    padding: 25px;

    background:
        linear-gradient(
            to top,
            rgba(35, 28, 23, 0.72),
            rgba(35, 28, 23, 0.0) 65%
        );

    color: white;

    opacity: 0;

    transition:
        opacity 0.3s ease;
}


/* ==================================================
   POKAZANIE INFORMACJI

   Działa na urządzeniach posiadających prawdziwy
   kursor myszy.
   ================================================== */

@media (hover: hover) and (pointer: fine) {

    .gallery-card:hover .gallery-overlay {
        opacity: 1;
    }

}


/* ==================================================
   NAZWA REALIZACJI NA MINIATURZE
   ================================================== */

.gallery-overlay h2 {
    margin: 0;

    font-family: var(--ui-font-heading);

    font-size: 1.8rem;

    font-weight: 500;

    letter-spacing: 0.04em;
}


/* ==================================================
   CENA NA MINIATURZE
   ================================================== */

.gallery-overlay-price {
    margin-top: 6px;

    font-family: var(--ui-font-body);

    font-size: 0.75rem;

    letter-spacing: 0.08em;
}


/* ==================================================
   OKNO SZCZEGÓŁÓW

   Pojawia się po kliknięciu realizacji.
   ================================================== */

.gallery-modal {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

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

    padding: 30px;

    background: rgba(30, 24, 20, 0.65);

    backdrop-filter: blur(8px);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


/* ==================================================
   AKTYWNE OKNO SZCZEGÓŁÓW
   ================================================== */

.gallery-modal.active {
    opacity: 1;

    visibility: visible;
}


/* ==================================================
   ZAWARTOŚĆ OKNA
   ================================================== */

.gallery-modal-content {
    position: relative;

    width: min(1000px, 100%);

    max-height: 90vh;

    overflow: auto;

    display: grid;

    grid-template-columns: 1.2fr 0.8fr;

    background: var(--ui-color-surface);
    color: var(--ui-color-text);

    border-radius: var(--ui-radius-surface);
    corner-shape: var(--ui-corner-shape);
    clip-path: var(--ui-clip-surface);

    overflow: hidden;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25);
}


/* ==================================================
   DUŻE ZDJĘCIE W OKNIE
   ================================================== */

.gallery-modal-image {
    width: 100%;
    height: 100%;

    min-height: 500px;

    object-fit: cover;
}


/* ==================================================
   INFORMACJE W OKNIE
   ================================================== */

.gallery-modal-info {
    display: flex;

    flex-direction: column;

    justify-content: center;

    padding: 45px;
}


/* ==================================================
   TYTUŁ W OKNIE
   ================================================== */

.gallery-modal-info h2 {
    margin: 0;

    font-family: var(--ui-font-heading);

    font-size: 2.5rem;

    font-weight: 500;

    color: var(--ui-color-text);
}


/* ==================================================
   OPIS W OKNIE
   ================================================== */

.gallery-modal-description {
    margin-top: 20px;

    font-family: var(--ui-font-body);

    font-size: 0.9rem;

    line-height: 1.8;

    color: var(--ui-color-text-muted);
}


/* ==================================================
   CENA W OKNIE
   ================================================== */

.gallery-modal-price {
    margin-top: 25px;

    font-family: var(--ui-font-body);

    font-size: 0.85rem;

    font-weight: 500;

    letter-spacing: 0.08em;

    color: var(--ui-color-primary-text);
}


/* ==================================================
   PRZYCISK ZAMKNIĘCIA

   Widoczny w prawym górnym rogu okna.
   ================================================== */

.gallery-modal-close {
    position: absolute;

    top: 15px;
    right: 18px;

    width: 40px;
    height: 40px;

    display: flex;

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

    border: none;

    background: color-mix(in srgb, var(--ui-color-surface) 75%, transparent);

    border-radius: 50%;

    cursor: pointer;

    font-size: 1.4rem;

    color: var(--ui-color-text);

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


.gallery-modal-close:hover {
    transform: scale(1.05);

    background: var(--ui-color-surface);
}


/* ==================================================
   WERSJA MOBILNA
   ================================================== */

@media (max-width: 600px) {

    .gallery {
        grid-template-columns: 1fr;

        gap: 20px;
    }


    /* ----------------------------------------------
       OKNO SZCZEGÓŁÓW NA TELEFONIE
       ---------------------------------------------- */

    .gallery-modal {
        padding: 15px;
    }


    .gallery-modal-content {
        display: flex;

        flex-direction: column;

        max-height: 92vh;
    }


    .gallery-modal-image {
        height: 45vh;

        min-height: 250px;
    }


    .gallery-modal-info {
        padding: 25px;
    }


    .gallery-modal-info h2 {
        font-size: 2rem;
    }

}