/* Qalereya: avtomatik dəyişən foto paneli, foto/video şəbəkəsi və böyütmə pəncərəsi */

/* --- Avtomatik dəyişən panel --- */
.gal-stage {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    background: var(--ink);
    aspect-ratio: 16 / 8;
    min-height: 280px;
    box-shadow: 0 24px 70px rgba(11, 15, 25, .25);
}
.gal-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
    pointer-events: none;
}
.gal-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.gal-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
}
.gal-slide.is-active img { animation: galZoom 9s ease-out forwards; }
@keyframes galZoom { from { transform: scale(1); } to { transform: scale(1.07); } }
.gal-slide figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 56px 28px 26px;
    color: #fff;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(16px, 2.2vw, 24px);
    background: linear-gradient(to top, rgba(11, 15, 25, .78), transparent);
}
.gal-btn {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px; height: 48px;
    margin-top: -24px;
    border: 0;
    border-radius: 50%;
    background: rgba(11, 15, 25, .55);
    color: #fff;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .2s;
}
.gal-btn:hover { background: var(--purple); }
.gal-prev { left: 16px; }
.gal-next { right: 16px; }
.gal-controls {
    position: absolute;
    z-index: 3;
    left: 0; right: 0; bottom: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.gal-dots { display: flex; gap: 8px; }
.gal-dot {
    width: 12px; height: 12px;
    border-radius: 99px;
    border: 1.5px solid rgba(255, 255, 255, .85);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: .3s;
}
.gal-dot.is-active { width: 30px; background: #fff; }
.gal-pause {
    position: absolute;
    z-index: 3;
    top: 14px; right: 14px;
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(11, 15, 25, .55);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.gal-pause:hover { background: var(--purple); }
.gal-progress { position: absolute; z-index: 3; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, .18); }
.gal-progress i { display: block; height: 100%; width: 0; background: #9BE7F2; }
.gal-progress i.run { animation: galBar var(--gal-ms, 5000ms) linear forwards; }
@keyframes galBar { from { width: 0; } to { width: 100%; } }

/* --- Süzgəc və şəbəkə --- */
.gal-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 28px; }
.gal-filter button {
    border: 1px solid #D5DAE5;
    background: #fff;
    color: var(--text);
    border-radius: 99px;
    padding: 9px 22px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
}
.gal-filter button:hover { border-color: var(--purple); color: var(--purple); }
.gal-filter button[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.gal-item {
    position: relative;
    border: 0;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    background: var(--ink);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
    box-shadow: 0 8px 28px rgba(11, 15, 25, .12);
    transition: transform .3s, box-shadow .3s;
}
.gal-item:hover, .gal-item:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(11, 15, 25, .22); }
.gal-item img, .gal-item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.gal-item:hover img, .gal-item:hover video { transform: scale(1.06); }
.gal-item .gal-cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 34px 16px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(to top, rgba(11, 15, 25, .75), transparent);
}
.gal-badge {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 2;
    background: rgba(11, 15, 25, .65);
    color: #fff;
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.gal-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.gal-play i {
    width: 62px; height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 168, .9);
    color: #fff;
    font-size: 26px;
    padding-left: 4px;
    box-shadow: 0 8px 24px rgba(11, 15, 25, .4);
}
.gal-empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.gal-more { text-align: center; margin-top: 32px; }

/* --- Böyütmə pəncərəsi --- */
.gal-lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    margin: 0;
    color: #fff;
}
.gal-lightbox::backdrop { background: rgba(5, 8, 15, .92); }
.gal-lb-body { position: absolute; inset: 56px 64px 64px; display: grid; place-items: center; }
.gal-lb-body img, .gal-lb-body video { max-width: 100%; max-height: 100%; border-radius: 12px; background: #000; }
.gal-lb-body iframe { width: min(100%, 1100px); aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.gal-lb-cap { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; padding: 0 70px; font-weight: 600; }
.gal-lb-close, .gal-lb-prev, .gal-lb-next {
    position: absolute;
    border: 0;
    border-radius: 50%;
    width: 46px; height: 46px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.gal-lb-close:hover, .gal-lb-prev:hover, .gal-lb-next:hover { background: var(--purple); }
.gal-lb-close { top: 12px; right: 14px; }
.gal-lb-prev { left: 10px; top: 50%; margin-top: -23px; }
.gal-lb-next { right: 10px; top: 50%; margin-top: -23px; }
.gal-lb-count { position: absolute; top: 22px; left: 20px; font-size: 14px; color: #C9CEDA; }
@media (max-width: 575.98px) {
    .gal-stage { aspect-ratio: 4 / 3; }
    .gal-btn { width: 40px; height: 40px; margin-top: -20px; }
    .gal-lb-body { inset: 56px 8px 64px; }
}
@media (prefers-reduced-motion: reduce) {
    .gal-slide { transition: none; }
    .gal-slide.is-active img { animation: none; }
    .gal-progress i.run { animation: none; }
    .gal-item, .gal-item img, .gal-item video { transition: none; }
}

/* Ana səhifədəki qısa qalereya: 6 foto = 3 sütun × 2 sətir */
.gal-grid[data-limit] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 767.98px) { .gal-grid[data-limit] { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* Мобильные: минимальная высота панели не должна растягивать её шире экрана */
.gal-stage { max-width: 100%; }
@media (max-width: 575.98px) { .gal-stage { min-height: 0; aspect-ratio: 4 / 3; } }
