/* ── Gallery grid ────────────────────────────────────────────────────────── */
/*
 * auto-fill + minmax(280px, 1fr):
 *   >= 4 × 280 px = 1120 px + mezery → 4 sloupce
 *   >= 3 × 280 px =  840 px + mezery → 3 sloupce
 *   >= 2 × 280 px =  560 px + mezery → 2 sloupce
 *   jinak → 1 sloupec
 * Přesné počty závisí na gap a šířce kontejneru – nepotřebujeme media queries.
 */
.gvi-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* ── Jednotlivý náhled ───────────────────────────────────────────────────── */
.gvi-thumb {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e9ef;
    border-radius: 16px;
    box-shadow: rgba(100, 100, 111, 0.12) 0px 7px 20px 0px;
    overflow: hidden;
    cursor: pointer;
    /* Záměrně bez transition – dle zadání */
}

.gvi-thumb:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* ── Holder – drží výšku a centrovuje img-wrap ───────────────────────────── */
.gvi-thumb__holder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 205px;          /* pevná výška boxu */
    min-height: 0;
    overflow: hidden;
        padding: 12px;
}

/* ── Obrázková část ──────────────────────────────────────────────────────── */
.gvi-thumb__img-wrap {
    width: 100%;
    height: 100%;
    background: #e5e9f1;    /* tmavé pozadí sjednotí různé poměry stran */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.gvi-thumb__img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* ── Popisek ─────────────────────────────────────────────────────────────── */
.gvi-thumb__caption {
    flex-shrink: 0;
    padding: 7px 12px 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid #e5e9ef;
    background: #fff;
}

/* ── Lightbox overlay ────────────────────────────────────────────────────── */
.gvi-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: gviFadeIn .18s ease;
    outline: none;
}

@keyframes gviFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gvi-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(96vw, 1400px);
    max-height: 80vh;
    width: 100%;
}

.gvi-lb-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    user-select: none;
    display: block;
}

/* ── Lightbox tlačítka ───────────────────────────────────────────────────── */
.gvi-lightbox button {
    position: absolute;
    background: rgba(255,255,255,.13);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
    line-height: 1;
}

.gvi-lightbox button:hover  { background: rgba(255,255,255,.28); }
.gvi-lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gvi-lb-close { top: 18px; right: 20px; font-size: 18px !important; }
.gvi-lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.gvi-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

/* ── Popisek a čítač ─────────────────────────────────────────────────────── */
.gvi-lb-caption {
    margin-top: 14px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    text-align: center;
    max-width: 700px;
    min-height: 1.4em;
    padding: 0 70px;
}

.gvi-lb-counter {
    margin-top: 6px;
    color: rgba(255,255,255,.45);
    font-size: 12px;
    letter-spacing: .04em;
}
