/* ================================================================
   AHNAF.KZ — GALLERY PAGE
   public/assets/site/css/gallery.css
================================================================ */

.gal-page { padding: 36px 0 72px; }

.gal-wrap {
    max-width: 800px;
    margin: 0 auto;
}

/* ── Шапка ───────────────────────────────────────────────────── */
.gal-head { margin-bottom: 28px; }
.gal-eyebrow {
    font-size: 10.5px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--teal); display: block; margin-bottom: 6px;
}
.gal-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 400; color: var(--ink);
    line-height: 1.1; margin-bottom: 5px;
}
.gal-count { font-size: 13px; color: var(--muted); }

/* ── Сетка 4 колонки ─────────────────────────────────────────── */
.gal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 32px;
}
@media (max-width: 640px) { .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; } }

/* ── Элемент галереи ─────────────────────────────────────────── */
.gal-item {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--r-sm);
    cursor: zoom-in;
    padding: 0; border: none;
    background: var(--cream-2);
    position: relative;
}
.gal-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .4s ease;
}
.gal-item:hover img { transform: scale(1.06); }

/* hover overlay */
.gal-item::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(0,0,0,0);
    transition: background .25s ease;
    border-radius: var(--r-sm);
}
.gal-item:hover::after { background: rgba(0,0,0,.18); }

/* ── Пусто ───────────────────────────────────────────────────── */
.gal-empty {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
    padding: 60px 24px; text-align: center;
    color: var(--muted);
}
.gal-empty svg { color: var(--cream-2); }
.gal-empty p { font-size: 15px; font-weight: 500; color: var(--ink-2); }

/* ══════════════════════════════════════════════════════════════
   ПАГИНАЦИЯ (те же классы что в posts_list.css)
══════════════════════════════════════════════════════════════ */
.pagination-custom {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--cream-2);
}
.pg-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border: 1px solid var(--cream-2);
    border-radius: var(--r-sm);
    font-size: 14px; font-weight: 500;
    color: var(--ink-2); background: var(--white);
    text-decoration: none;
    transition: border-color var(--tr), color var(--tr), background var(--tr);
}
.pg-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--mint); }
.pg-btn--disabled { color: var(--cream-2); cursor: default; pointer-events: none; }

.pg-info { display: flex; align-items: center; gap: 8px; }
.pg-select {
    height: 36px; padding: 0 10px;
    border: 1px solid var(--cream-2);
    border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 500;
    color: var(--ink); font-family: var(--font-body);
    background: var(--white); cursor: pointer; outline: none;
    transition: border-color var(--tr);
}
.pg-select:focus { border-color: var(--teal); }
.pg-label { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX (тот же дизайн что в posts/show)
══════════════════════════════════════════════════════════════ */
.lightbox {
    position: fixed; inset: 0; z-index: 9900;
    background: rgba(5, 5, 8, .94);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__close {
    position: absolute; top: 18px; right: 18px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%; color: #fff; cursor: pointer;
    transition: background .2s; z-index: 2;
}
.lightbox__close:hover { background: rgba(255,255,255,.28); }

.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%; color: #fff; cursor: pointer;
    transition: background .2s; z-index: 2;
}
.lightbox__nav:hover { background: rgba(255,255,255,.24); }
.lightbox__prev { left: 18px; }
.lightbox__next { right: 18px; }
@media (max-width: 480px) {
    .lightbox__prev { left: 8px; }
    .lightbox__next { right: 8px; }
}

.lightbox__img-wrap {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 80px);
    display: flex; align-items: center; justify-content: center;
}
@media (max-width: 480px) { .lightbox__img-wrap { max-width: calc(100vw - 20px); } }

.lightbox__img {
    max-width: 100%; max-height: calc(100vh - 80px);
    object-fit: contain;
    border-radius: var(--r-sm);
    user-select: none; display: block;
}

.lightbox__counter {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.5); font-size: 12.5px;
    letter-spacing: .06em; pointer-events: none;
}