
.galerie {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto 80px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

/* JEDNOTLIVÉ FOTKY */

.auto-karta {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    border: 1px solid #303030;
    border-radius: 4px;
    transition: border-color 0.3s, transform 0.3s;
}

.auto-karta:hover {
    border-color: #4545ff;
    transform: translateY(-4px);
}

.auto-karta img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.4s;
}

.auto-karta:hover img {
    transform: scale(1.04);
}

.auto-karta:focus-visible {
    outline: 2px solid #4545ff;
    outline-offset: 3px;
}

/* ZVĚTŠENÍ FOTOGRAFIE */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(0, 0, 0, 0.96);
}

.lightbox.otevreno {
    display: flex;
}

.lightbox-obsah {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* ZAVŘENÍ */

#zavrit {
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 2;
    width: 45px;
    height: 45px;
    border: none;
    background: transparent;
    color: white;
    font-size: 38px;
    cursor: pointer;
}

#zavrit:hover {
    color: #4545ff;
}

/* NÁZEV FOTKY */

#lightbox-nazev {
    width: 100%;
    padding-right: 50px;
    color: white;
    font-family: "Anton", sans-serif;
    font-size: 25px;
    font-weight: normal;
    text-transform: uppercase;
}

/* VELKÁ FOTOGRAFIE A ŠIPKY */

.lightbox-fotka {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#velka-fotka {
    display: block;
    max-width: calc(100% - 110px);
    max-height: 65vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

#predchozi,
#dalsi {
    flex-shrink: 0;
    width: 45px;
    height: 55px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #171717;
    color: white;
    font-size: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

#predchozi:hover,
#dalsi:hover {
    background: #4545ff;
}

/* POČÍTADLO */

#pocitadlo {
    color: #bbb;
    font-size: 12px;
    letter-spacing: 2px;
    text-align: center;
}

/* NÁHLEDY POD FOTKOU */

#nahledy {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

#nahledy button {
    width: 75px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #333;
    background: #111;
    cursor: pointer;
    opacity: 0.65;
}

#nahledy button:hover {
    opacity: 1;
}

#nahledy button.aktivni {
    border-color: #4545ff;
    opacity: 1;
}

#nahledy img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TABLET */

@media (max-width: 800px) {
    .galerie {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    #velka-fotka {
        max-height: 58vh;
    }
}

/* MOBIL */

@media (max-width: 500px) {
    .galerie {
        width: 94%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 25px;
    }

    .lightbox {
        padding: 12px;
    }

    .lightbox-fotka {
        gap: 5px;
    }

    #velka-fotka {
        max-width: calc(100% - 74px);
        max-height: 52vh;
    }

    #predchozi,
    #dalsi {
        width: 32px;
        height: 45px;
        font-size: 24px;
    }

    #lightbox-nazev {
        font-size: 20px;
    }

    #nahledy {
        gap: 5px;
    }

    #nahledy button {
        width: 48px;
        height: 35px;
    }
}

