/* Galéria - 3 oszlopos grid, alulról egyvonalban végződő oszlopok */

.fg-gallery {
    --fg-h: 508px;
    --fg-h-mobile: 400px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 1280px;
    box-sizing: border-box;
    align-items: stretch;
}

.fg-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Felső eltolás oszloponként (a szövegek miatt) */
.fg-col-0 { padding-top: 140px; }
.fg-col-1 { padding-top: 0; }
.fg-col-2 { padding-top: 269px; }

/* Oszlop szövegek */
.fg-col-text {
    padding: 0 4px 8px;
    line-height: 1.4;
}

.fg-col-0 .fg-col-text {
    color: #004A2F;
    font-family: Montserrat, sans-serif;
    font-size: 86px;
    font-weight: 800;
    line-height: 82px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.fg-col-2 .fg-col-text {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    line-height: 140%;
    letter-spacing: -0.22px;
    margin-bottom: 0;
}

/* Képek */
.fg-item {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    cursor: zoom-in;
    line-height: 0;
    height: var(--fg-h);
    flex: 0 0 auto;
    transition: box-shadow .25s ease;
}

.fg-gallery .fg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.fg-gallery .fg-item:hover img { transform: scale(1.04); }

/* Trükk: minden oszlop UTOLSÓ képe kitölti a maradék helyet,
   így az oszlopok ALULRÓL egyvonalban végződnek (az oszlopok
   magassága a grid align-items: stretch miatt egyforma). */
.fg-col > .fg-item:last-child {
    flex: 1 1 auto;
    height: auto;
    min-height: 200px;
}

/* Reszponzív: mobilon egy oszlop, fix 400px képmagasság */
@media (max-width: 768px) {
    .fg-gallery {
        grid-template-columns: 1fr;
    }
    .fg-col-0, .fg-col-2 { padding-top: 0; }
    .fg-col > .fg-item,
    .fg-col > .fg-item:last-child {
        flex: 0 0 auto;
        height: var(--fg-h-mobile);
        min-height: 0;
    }
    .fg-col-0 .fg-col-text { font-size: 48px; line-height: 48px; }
}

/* ---------- Lightbox ---------- */
.fg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    user-select: none;
}
.fg-lightbox.is-open { display: flex; }

.fg-lb-stage {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.fg-lb-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.fg-lb-counter {
    color: #fff;
    font-family: sans-serif;
    font-size: 14px;
    opacity: .8;
}
.fg-lb-close,
.fg-lb-prev,
.fg-lb-next {
    position: absolute;
    background: rgba(255,255,255,.1);
    color: #fff;
    border: 0;
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}
.fg-lb-close:hover,
.fg-lb-prev:hover,
.fg-lb-next:hover { background: rgba(255,255,255,.25); }

.fg-lb-close { top: 20px;  right: 20px; }
.fg-lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.fg-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
    .fg-lb-close { top: 10px; right: 10px; }
    .fg-lb-prev  { left: 5px; }
    .fg-lb-next  { right: 5px; }
}
