/* =========================================================
   GŁÓWNY UKŁAD STRONY
   ========================================================= */

:root {
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    margin: 0;
    padding: 20px;
    font-family: Inter, Georgia, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #111;
}


/* =========================================================
   GŁÓWNY KONTENER
   ========================================================= */

.wrap {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}


/* =========================================================
   NAGŁÓWEK
   ========================================================= */

h1 {
    font-size: 20px;
    margin: 0 0 16px;
}


/* =========================================================
   MASONRY
   ========================================================= */

.masonry {
    width: 100%;
    column-count: 4;
    column-gap: 0;
}


/* 4 kolumny */

@media (max-width: 1200px) {

    .masonry {
        column-count: 4;
    }

}


/* 3 kolumny */

@media (max-width: 900px) {

    .masonry {
        column-count: 3;
    }

}


/* 2 kolumny */

@media (max-width: 650px) {

    .masonry {
        column-count: 2;
    }

}


/* 1 kolumna */

@media (max-width: 420px) {

    .masonry {
        column-count: 1;
    }

}


/* =========================================================
   KAFELEK
   ========================================================= */

.tile {
    width: 100%;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;

    margin: 0;
    padding: 0;

    background: white;
    border: 1px solid #777;

    overflow: hidden;
}


/* Kafelki są połączone ze sobą */

.tile + .tile {
    border-top: 0;
}


/* =========================================================
   OBSZAR ZDJĘCIA
   ========================================================= */

.media {
    width: 100%;
    display: block;
    overflow: hidden;
    background: #ddd;
}


/* Proporcje */

.media--square {
    aspect-ratio: 1 / 1;
}

.media--4-3 {
    aspect-ratio: 4 / 3;
}

.media--16-9 {
    aspect-ratio: 16 / 9;
}

.media--tall {
    aspect-ratio: 3 / 4;
}


/* =========================================================
   ZDJĘCIA W KAFELKACH
   ========================================================= */

.media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transform-origin: center center;

    transition: transform 0.35s ease;

    will-change: transform;
}


/* Powiększenie po najechaniu */

.tile:hover .media img {
    transform: scale(1.12);
}


/* =========================================================
   OPIS KAFELKA
   ========================================================= */

.desc {
    padding: 5px;
    line-height: 1.3;
}


/* =========================================================
   LOSOWE ZDJĘCIE
   ========================================================= */

.losowe-zdjecie-container {
    width: 100%;
    max-width: 600px;

    margin: 25px auto;

    text-align: center;
}


.losowe-zdjecie-container .losowe-zdjecie {
    display: block;

    width: 100%;
    max-width: 600px;

    height: auto;

    margin: 0 auto;
}


/* =========================================================
   RESPONSYWNOŚĆ
   ========================================================= */


/* TABLET */

@media (max-width: 900px) {

    body {
        padding: 15px;
    }

}


/* TELEFON */

@media (max-width: 650px) {

    body {
        padding: 10px;
    }

    .wrap {
        width: 100%;
        max-width: none;
    }

    .losowe-zdjecie-container {
        width: 100%;
        max-width: none;

        margin-top: 20px;
        margin-bottom: 20px;
    }

    .losowe-zdjecie-container .losowe-zdjecie {
        width: 100%;
        max-width: none;
    }

}


/* BARDZO MAŁY TELEFON */

@media (max-width: 420px) {

    body {
        padding: 5px;
    }

}