/* Gallery page */
.gallery-page {
    padding: 48px 0 100px;
    min-height: 70vh;
}

.gallery-intro {
    max-width: 680px;
    margin-bottom: 32px;
}

.gallery-intro h1 {
    font-size: 40px;
    color: var(--ink);
    margin: 12px 0 16px;
}

.gallery-intro p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* Filters */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.gal-filter {
    border: 2px solid transparent;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 999px;
    padding: 10px 22px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gal-filter:hover { color: var(--green-dark); }

.gal-filter.is-active {
    background: var(--green);
    color: var(--white);
}

/* Masonry grid */
.gallery-grid {
    columns: 3;
    column-gap: 20px;
}

.gal-item {
    break-inside: avoid;
    margin: 0 0 20px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    background: var(--green-light);
}

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

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

/* Video: play-ikoon pildi peal */
.gal-item.is-video .gal-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(20, 18, 14, 0.35);
    pointer-events: none;
    transition: transform 0.25s ease;
}

.gal-item.is-video .gal-play svg { width: 30px; height: 30px; margin-left: 3px; }
.gal-item.is-video:hover .gal-play { transform: translate(-50%, -50%) scale(1.08); }

.gal-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 18px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(to top, rgba(20, 18, 14, 0.7), rgba(20, 18, 14, 0));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gal-item:hover figcaption { opacity: 1; }

.gal-item.is-hidden { display: none; }

.gallery-empty {
    display: none;
    text-align: center;
    color: var(--ink-soft);
    font-size: 16px;
    padding: 40px 0;
}

.gallery-empty.is-visible { display: block; }

/* Kategooria kirjeldus (kuvatakse filtri valimisel) */
.gal-cat-desc {
    display: none;
    width: 100%;
    margin: 4px 0 28px;
    padding: 20px 26px;
    background: var(--green-light);
    border-left: 5px solid var(--green);
    border-radius: var(--radius-md);
    box-shadow: none;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
}

.gal-cat-desc.is-visible { display: block; }

/* Kategooria infokastid – võrdse laiusega: 1 tk täislaius, 2 tk pooled, 3 tk kolmandikud */
.gal-cat-cards {
    display: none;
    gap: 20px;
    margin: 0 0 28px;
}

.gal-cat-cards.is-visible { display: flex; }

.gal-card {
    flex: 1 1 0;
    min-width: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 26px 24px;
}

.gal-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.gal-card-icon svg { width: 23px; height: 23px; stroke: var(--green-dark); }

.gal-card h3 {
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 8px;
}

.gal-card p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.gal-card p:last-child { margin-bottom: 0; }

.gal-card ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.gal-card li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.gal-card li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

@media (max-width: 900px) {
    .gal-cat-cards.is-visible { flex-wrap: wrap; }
    .gal-card { flex: 1 1 260px; }
}

/* Responsive */
@media (max-width: 900px) {
    .gallery-intro h1 { font-size: 32px; }
    .gallery-grid { columns: 2; }
}

@media (max-width: 560px) {
    .gallery-grid { columns: 1; }
    .gal-item figcaption { opacity: 1; }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
    .lb-arrow { width: 44px; height: 44px; }
}
