/* =====================================================
   GALEREYA MODULI — style.css bilan bir xil dizayn tili
   Barcha klasslar "gallery-" prefiksi bilan (to'qnashuvsiz)
===================================================== */

.gallery-section {
    padding-top: 80px;
    padding-bottom: 80px;
    background: #f8fdf9;
}

/* --- Grid: Desktop 3 / Tablet 2 / Mobil 1 --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

@media (max-width: 991.98px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}

@media (max-width: 575.98px) {
    .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* --- Kartochka --- */
.gallery-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius, 12px);
    background: var(--gray-light, #f8f9fa);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.08));
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* aspect-ratio ni qo'llab-quvvatlamaydigan eski brauzerlar uchun zaxira */
@supports not (aspect-ratio: 4 / 3) {
    .gallery-card { height: 0; padding-bottom: 75%; }
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

@supports not (aspect-ratio: 4 / 3) {
    .gallery-card img { position: absolute; inset: 0; }
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md, 0 6px 24px rgba(0,0,0,0.12));
}

.gallery-card:hover img {
    transform: scale(1.06);
}

/* Fokus ko'rinishi (klaviatura) */
.gallery-card:focus-visible {
    outline: 3px solid var(--primary, #2d7a3a);
    outline-offset: 3px;
}

/* Hover — zoom belgisi + qoramtir overlay */
.gallery-card-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(180deg, rgba(30,84,39,0) 40%, rgba(30,84,39,0.55) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-card-zoom i {
    background: rgba(45,122,58,0.9);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.85);
    transition: transform 0.3s ease;
    font-size: 1.15rem;
}

.gallery-card:hover .gallery-card-zoom,
.gallery-card:focus-visible .gallery-card-zoom {
    opacity: 1;
}

.gallery-card:hover .gallery-card-zoom i {
    transform: scale(1);
}

/* --- "Barchasi" tugmasi fokus holati --- */
.gallery-viewall-btn:focus-visible {
    outline: 3px solid var(--secondary, #f4a527);
    outline-offset: 3px;
}

/* =====================================================
   GALLERY.PHP — sahifa uslublari
===================================================== */
.gallery-page {
    padding-top: 60px;
    padding-bottom: 80px;
    background: #f8fdf9;
}

/* Bo'sh holat */
.gallery-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-muted, #6c757d);
}
.gallery-empty i {
    font-size: 3.4rem;
    color: var(--primary-light, #4caf60);
    opacity: 0.55;
}
.gallery-empty p {
    margin-top: 16px;
    font-size: 1.05rem;
}

/* =====================================================
   PAGINATION — responsive, dizaynga mos
===================================================== */
.gallery-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 50px;
    padding: 0;
    list-style: none;
}

.gallery-pagination .page-link,
.gallery-pagination .page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--gray-border, #e9ecef);
    background: #fff;
    color: var(--dark-soft, #2c3e50);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition, all 0.3s ease);
}

.gallery-pagination .page-link:hover {
    background: var(--primary-ultra-light, #e8f5ea);
    border-color: var(--primary-light, #4caf60);
    color: var(--primary-dark, #1e5427);
}

.gallery-pagination .page-link:focus-visible {
    outline: 3px solid var(--primary, #2d7a3a);
    outline-offset: 2px;
}

.gallery-pagination .page-item.active .page-link {
    background: var(--primary, #2d7a3a);
    border-color: var(--primary, #2d7a3a);
    color: #fff;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.08));
}

.gallery-pagination .page-item.disabled .page-link {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.gallery-pagination .page-ellipsis {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

@media (max-width: 575.98px) {
    .gallery-pagination .page-link,
    .gallery-pagination .page-ellipsis {
        min-width: 38px;
        height: 38px;
        font-size: 0.85rem;
        padding: 0 8px;
    }
    /* Mobilda "Oldingi/Keyingi" matnini yashirib, faqat strelka */
    .gallery-pagination .page-nav-text { display: none; }
}
