/* ============================
    GALLERY
============================*/

.gallery {
    padding: 60px 6%;
    margin-top: 0;
}

.gallery-tabs,
.gal-grid {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.gallery h2 {
    text-align: center;
    margin: 0 auto;
    color: var(--cedar-dark);
}

.gal-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.gal-tabs button {
    padding: 8px 22px;
    background: #fff;
    color: var(--cedar-dark);
    border: 1px solid var(--cedar-light);
    border-radius: 40px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.gal-tabs button.active {
    background: var(--cedar-green);
    color: #fff;
    border-color: var(--cedar-green);
}

.gal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    max-width: 1100px;

    max-height: 520px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--cedar-green) transparent;
}

.gal-item {
    padding: 0;
    border: 0;
    background: var(--cedar-pale);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    position: relative;
}

.gal-item img,
.gal-item video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gal-item:hover img,
.gal-item:hover video {
    transform: scale(1.06);
}

.gal-video-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 1;
    padding: 6px 9px;
    color: #fff;
    background: rgba(20, 35, 29, .82);
    border-radius: 20px;
    font-size: 11px;
}

.gal-caption {
    position: absolute;
    inset: auto 0 0;
    padding: 20px 10px 10px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
    font-size: 11px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gal-tabs button:focus-visible,
.gal-item:focus-visible {
    outline: 2px solid var(--cedar-green);
    outline-offset: 3px;
}

.gal-empty {
    text-align: center;
    color: #666;
    margin-top: 20px;
}

/* ---- full-screen viewer ---- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox[hidden] {
    display: none;
}

.lightbox img,
.lightbox video {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox video {
    width: min(92vw, 1100px);
    background: #000;
}

.lightbox [hidden] {
    display: none !important;
}

.lightbox button {
    position: absolute;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox button:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.lb-count {
    position: absolute;
    bottom: 18px;
    color: #fff;
    font-size: 0.95rem;
}

/* mobile */
@media (max-width: 768px) {
    .gal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-height: 60vh;
    }

    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }

    .gal-more{
        margin-left: auto;
    }
}

.gal-more{
    margin-top: 20px;
    margin-left: 115px;
}