/* @import url("/assets/css/fonts.css"); */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #FFECCC;
}

@media (max-width: 768px) {
    body {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

.container {
    display: grid;
    gap: 10px;
    background-color: #fff;
}

/* Siatka dla dużych ekranów */
@media (min-width: 768px) {
    .container {
        grid-template-rows: repeat(3, 1fr);
        grid-template-columns: repeat(3, 1fr);
        width: 100vh;
        height: 100vh;
        margin: 0 auto;
    }
}

/* Siatka dla małych ekranów */
@media (max-width: 767px) {
    html, body {
        overflow-y: auto;
    }
    .container {
        grid-template-rows: none;
        grid-template-columns: 1fr;
        width: 100%;
        height: auto;
    }

    .grid-item {
        height: auto;
        width: 100%;
    }
}

/* Uniwersalne style dla elementów */
.grid-item {
    aspect-ratio: 1 / 1;
    background-color: #FFECCC;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-size: 24px;
    position: relative;
    overflow: hidden;
}

.grid-item {
    perspective: 1000px;
}

.grid-item a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.grid-item h2 {
    margin: 0;
}

/* Ukrycie nagłówków domyślnie */
.hidden-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    display: none; /* ukryte domyślnie */
    justify-content: center;
    align-items: center;
    
    font-family: "Cutive Mono", monospace;
    color: #E00000;
    font-size: 1.6em;
    font-weight: bold;
    text-align: center;
    line-height: 130%;
    
    pointer-events: none; /* pozwala kliknąć przez tekst */

}

/* Efekt hover */
@media (min-width: 768px) {
    .grid-item a:hover img {
        display: none;
    }

    .grid-item a:hover .hidden-text {
        display: flex;
    }
}


.grid-item img {
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
}

.rotate {
    transform: rotateY(180deg);
}

/* Alternatywna rotacja dla urządzeń mobilnych */
@media (max-width: 768px) {
    .rotate {
        transform: scaleX(-1);
    }
}

.grid-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.grid-item a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
        
/* Animacja obrotu */
.rotate {
    transform: rotateY(180deg);
    transition: transform 0.5s ease-in-out;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: #FFECCC;
    border: 6px solid #E00000;
    border-radius: 20px;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.lightbox.active {
    opacity: 1;
}

/* Dla urządzeń mobilnych */
@media (max-width: 768px) {
    .lightbox {
        width: 90vw;
        height: 90vh;
    }
}

/* Treść lightboxa */
.lightbox-content {
    font-family: "Cutive Mono", monospace;
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    text-align: left;
    color: #171717;
    line-height: 150%;
}

.lightbox-content h1, h2, h3, h4, h5, h6 {
    color: #E00000;
    margin-bottom: 0;
    line-height: 150%;
}

.lightbox-content p {
    margin-top: 0;
}

/* Zmiana ikony dla urządzeń mobilnych */
@media (max-width: 768px) {
    .lightbox-content h1, h2, h3, h4, h5, h6 {
        text-align: left;
    }
}

.lightbox-content {
    font-size: 24px;
}

.lightbox-content span.cena {
    font-family: "Cutive Mono", monospace;
    display: inline-block;
    background-color: #E00000;
    color: #FFECCC;
    border-radius: 10px;
    padding: 20px;
    font-weight: 700;
    font-size: 34px;
}

/* Przycisk zamknięcia */
.close-btn {
    font-family: 'Arial', sans-serif;
    position: fixed; /* zamiast absolute */
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    font-size: 24px;
    cursor: pointer;
    background: #E00000;
    color: #FFECCC;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

body.iphone .close-btn {
    top: calc(env(safe-area-inset-top, 0px) + 50px); /* 20px + dodatkowe 30px */
}

/* Zmiana ikony dla urządzeń mobilnych */
@media (max-width: 768px) {
    .close-btn::before {
        content: "☰"; /* Unicode dla hamburgera */
        font-size: 28px;
    }
}

/* Aktywacja lightbox */
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
