/* ============================================
   gallery.css - Purnam Yogashala
   ============================================ */

/* Banner */
.banner {
    position: relative;
    height: 380px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), color-mix(in srgb, var(--primary-color) 82%, transparent));
}
.banner_content { position: relative; z-index: 1; }
.banner_heading {
    font-family: 'Kanit', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1.2;
    margin-bottom: 8px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.banner_para {
    font-family: 'Gabarito', sans-serif;
    font-size: 16px;
    color: rgba(255,255,255,0.88);
    margin: 0;
}
@media (max-width: 767px) {
    .banner { height: auto; padding: 70px 0 20px; }
    .banner_heading { font-size: 32px; letter-spacing: 2px; }
}

/* ============================================
   Gallery Section
   ============================================ */
.gallery-section {
    padding: 60px 0 80px;
    background: #fff;
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 36px 0 40px;
}
.gallery-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 50px;
    border: 1.5px solid rgba(170,35,64,0.25);
    background: transparent;
    color: #555;
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gallery-filter:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(170,35,64,0.05);
}
.gallery-filter--active {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* Individual item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1.5px solid rgba(170,35,64,0.1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    background: #f0ebe8;
}
.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(170,35,64,0.14);
    border-color: var(--primary-color);
}

/* Portrait images span 2 rows for visual variety */
.gallery-item:has(img[width="800"][height="1000"]) {
    aspect-ratio: auto;
    grid-row: span 2;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
}
.gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-link img {
    transform: scale(1.06);
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--primary-color) 70%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay i {
    font-size: 28px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ============================================
   Custom Lightbox
   ============================================ */
.pys-lb {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pys-lb[hidden] { display: none; }

.pys-lb__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,0.93);
}
.pys-lb__backdrop[hidden] { display: none; }

.pys-lb__img-wrap {
    position: relative;
    z-index: 10000;
    max-width: min(90vw, 1000px);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#pysLbImg {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pys-lb__caption {
    color: rgba(255,255,255,0.85);
    font-family: 'Gabarito', sans-serif;
    font-size: 14px;
    text-align: center;
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
}
.pys-lb__counter {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    color: rgba(255,255,255,0.7);
    font-family: 'Kanit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    background: rgba(0,0,0,0.4);
    padding: 4px 14px;
    border-radius: 20px;
}

.pys-lb__close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 10001;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.pys-lb__close:hover { background: var(--primary-color); border-color: var(--primary-color); }

.pys-lb__arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.pys-lb__arrow:hover { background: var(--primary-color); border-color: var(--primary-color); }
.pys-lb__arrow--prev { left: 16px; }
.pys-lb__arrow--prev:hover { transform: translateY(-50%) scale(1.1); }
.pys-lb__arrow--next { right: 16px; }
.pys-lb__arrow--next:hover { transform: translateY(-50%) scale(1.1); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1199px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .gallery-section { padding: 44px 0 60px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-item:has(img[width="800"][height="1000"]) { grid-row: span 1; aspect-ratio: 4/3; }
    .pys-lb__arrow { width: 40px; height: 40px; font-size: 15px; }
    .pys-lb__arrow--prev { left: 8px; }
    .pys-lb__arrow--next { right: 8px; }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gallery-filters { gap: 8px; }
    .gallery-filter { font-size: 12px; padding: 7px 16px; }
}
