:root{
    --gallery-primary:#392c7d;
    --gallery-primary-dark:#2d0160;
    --gallery-accent:#ff4667;
    --gallery-ink:#202c45;
    --gallery-muted:#64748b;
    --gallery-soft:#f8f6ff;
    --gallery-border:#d6d4e4;
}

/* ===============================
   SECTION
================================= */

.gallery-section{
    padding:70px 0;
    background:linear-gradient(180deg,#fff 0%,var(--gallery-soft) 100%);
}

.gallery-section .section-header{
    max-width:760px;
    margin:0 auto;
}

.gallery-section .section-header h2{
    color:var(--gallery-ink);
    margin-bottom:12px;
}

.gallery-section .section-header p{
    color:var(--gallery-muted);
}

/* ===============================
   FILTER BUTTONS
================================= */

.gallery-filter{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    margin-bottom:30px;
}

.gallery-filter .btn{
    margin-top:30px;
    margin-bottom:30px;
    margin-right:8px;
}

.gallery-filter .btn small{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    height:24px;
    padding:0 6px;
    border-radius:999px;
    background:rgba(0,0,0,.08);
    font-size:11px;
    font-weight:700;
}

.gallery-filter .btn-secondary small{
    background:rgba(255,255,255,.20);
    color:#fff;
}

[data-bs-theme="dark"] .gallery-filter .btn-light{
    color:#fff;
}

/* ===============================
   GALLERY GRID
================================= */

.hasc-gallery{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    grid-auto-rows:245px;
    grid-auto-flow:dense;
    gap:24px;
}

.gallery-card{
    position:relative;
    min-height:245px;
    overflow:hidden;
    border-radius:14px;
    background:#eef4ff;
    box-shadow:0 16px 34px rgba(15,23,42,.10);
    cursor:pointer;
    isolation:isolate;
}

.gallery-card.is-tall{
    grid-row:span 2;
}

.gallery-card img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transform:scale(1.01);
    transition:all .45s ease;
}

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

.gallery-card::before{
    content:"";
    position:absolute;
    inset:0;
    z-index:1;
     background:linear-gradient(
        180deg,
        rgba(15,23,42,.05) 20%,
        rgba(15,23,42,.85) 100%
    );
}

.gallery-card::after{
    content:"\f00e";
    font-family:"Font Awesome 6 Free","Font Awesome 5 Free";
    font-weight:900;
    position:absolute;
    top:18px;
    right:18px;
    z-index:2;
    width:44px;
    height:44px;
    border-radius:50%;
    background:rgba(255,255,255,.92);
    color:var(--gallery-primary);
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    transition:.3s;
}

.gallery-card:hover::after{
    opacity:1;
}

.gallery-card figcaption{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    z-index:2;
    padding:22px;
    color:#fff;
}

.gallery-card figcaption span{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 10px;
    border-radius:999px;
    background:#00a7e8;
    font-size:12px;
    font-weight:800;
    margin-bottom:10px;
}

.gallery-card figcaption h3{
    color:#fff;
    font-size:20px;
    font-weight:800;
    margin-bottom:0;
}

/* ===============================
   EMPTY STATE
================================= */

.gallery-empty{
    display:none;
    margin-top:24px;
    padding:22px;
    border:1px solid var(--gallery-border);
    border-radius:12px;
    background:#fff;
    color:var(--gallery-muted);
    text-align:center;
    font-weight:700;
}

/* ===============================
   LIGHTBOX
================================= */

.gallery-lightbox{
    position:fixed;
    inset:0;
    z-index:99999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:28px;
    background:rgba(15,23,42,.92);
}

.gallery-lightbox.open{
    display:flex;
}

.gallery-lightbox-dialog{
    width:min(1080px,100%);
}

.gallery-lightbox-frame{
    position:relative;
    overflow:hidden;
    border-radius:16px;
    background:#d1d5db; /* gray side area */
    box-shadow:0 24px 80px rgba(0,0,0,.5);
}

.gallery-lightbox img{
    width:100%;
    max-height:78vh;
    object-fit:contain;
    display:block;
    background:#d1d5db;
}

.gallery-lightbox-caption{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:16px 20px;
    background:#fff;
}

.gallery-lightbox-caption span{
    display:block;
    color:var(--gallery-accent);
    font-size:13px;
    font-weight:800;
    margin-bottom:4px;
}

.gallery-lightbox-caption strong{
    display:block;
    color:var(--gallery-ink);
    font-size:17px;
}

.gallery-counter{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:62px;
    min-height:34px;
    padding:7px 12px;
    border-radius:999px;
    background:var(--gallery-soft);
    color:var(--gallery-primary);
    font-weight:800;
}

/* ===============================
   LIGHTBOX BUTTONS
================================= */

.gallery-lightbox button{
    position:absolute;
    z-index:2;
    width:46px;
    height:46px;
    border:0;
    border-radius:50%;
    background:#fff;
    color:var(--gallery-primary);
    font-size:18px;
    cursor:pointer;
    box-shadow:0 10px 26px rgba(0,0,0,.22);
    transition:all .25s ease;
}

.gallery-lightbox button:hover{
    background:var(--gallery-accent);
    color:#fff;
}

.gallery-close{
    top:24px;
    right:24px;
}

.gallery-prev{
    left:24px;
    top:50%;
    transform:translateY(-50%);
}

.gallery-next{
    right:24px;
    top:50%;
    transform:translateY(-50%);
}

/* ===============================
   DARK MODE
================================= */

[data-bs-theme="dark"] .gallery-section,
.dark-mode .gallery-section{
    background:linear-gradient(
        180deg,
        #161127 0%,
        #211a3b 100%
    );
}

[data-bs-theme="dark"] .gallery-section h2,
.dark-mode .gallery-section h2{
    color:#fff;
}

[data-bs-theme="dark"] .gallery-section p,
.dark-mode .gallery-section p{
    color:#b9b5cf;
}

[data-bs-theme="dark"] .gallery-filter button,
.dark-mode .gallery-filter button{
    background:#211a3b;
    border-color:#342777;
    color:#d6dade;
}

[data-bs-theme="dark"] .gallery-card,
.dark-mode .gallery-card{
    background:#211a3b;
}

[data-bs-theme="dark"] .gallery-empty,
.dark-mode .gallery-empty{
    background:#211a3b;
    border-color:#342777;
    color:#b9b5cf;
}

[data-bs-theme="dark"] .gallery-lightbox-frame,
.dark-mode .gallery-lightbox-frame{
    background:#4b5563;
}

[data-bs-theme="dark"] .gallery-lightbox img,
.dark-mode .gallery-lightbox img{
    background:#4b5563;
}

[data-bs-theme="dark"] .gallery-lightbox-caption,
.dark-mode .gallery-lightbox-caption{
    background:#211a3b;
}

[data-bs-theme="dark"] .gallery-lightbox-caption strong,
.dark-mode .gallery-lightbox-caption strong{
    color:#fff;
}

[data-bs-theme="dark"] .gallery-counter,
.dark-mode .gallery-counter{
    background:#342777;
    color:#fff;
}

[data-bs-theme="dark"] .gallery-lightbox button,
.dark-mode .gallery-lightbox button{
    background:#2b214d;
    color:#fff;
}

[data-bs-theme="dark"] .gallery-lightbox button:hover,
.dark-mode .gallery-lightbox button:hover{
    background:var(--gallery-accent);
}

.gallery-pagination{
    margin-top:40px;
	text-align:center;
}

.gallery-pagination button{
    width:42px;
    height:42px;
    margin:4px;
    border:none;
    border-radius:8px;
    background:#f1f5f9;
    font-weight:600;
	cursor:pointer;
}

.gallery-pagination button.btn-secondary{
    color:#fff;
}

.gallery-pagination button.active{
    background:#392c7d;
    color:#fff;
}


@media(max-width:767px){

    .gallery-pagination{
        text-align:center;
    }

	
	.gallery-pagination button{
        width:36px;
        height:36px;
        font-size:13px;
    }

}
/* ==========================================
   EXTRA LARGE DEVICES (1400px and below)
========================================== */
@media screen and (max-width: 1399px) {

    .gallery-section{
        padding:60px 0;
    }

    .hasc-gallery{
        grid-template-columns:repeat(3,1fr);
        gap:20px;
    }

    .gallery-card{
        min-height:220px;
    }

    .gallery-card figcaption h3{
        font-size:18px;
    }

}

/* ==========================================
   LARGE DEVICES (1200px and below)
========================================== */
@media screen and (max-width: 1199px) {

    .gallery-section{
        padding:55px 0;
    }

    .gallery-filter{
        margin-bottom:20px;
    }

    .gallery-filter .btn{
        margin-top:20px;
        margin-bottom:20px;
    }

    .hasc-gallery{
        grid-template-columns:repeat(3,1fr);
        gap:18px;
    }

    .gallery-card{
        min-height:210px;
    }

    .gallery-card figcaption{
        padding:18px;
    }

    .gallery-card figcaption h3{
        font-size:17px;
    }

    .gallery-lightbox-dialog{
        width:95%;
    }

}

/* ==========================================
   TABLET DEVICES (991px and below)
========================================== */
@media screen and (max-width: 991px) {

    .gallery-section{
        padding:50px 0;
    }

    .gallery-filter{
        justify-content:center;
        flex-wrap:wrap;
        gap:8px;
    }

    .gallery-filter .btn{
        margin-top:15px;
        margin-bottom:15px;
        font-size:14px;
    }

    .hasc-gallery{
        grid-template-columns:repeat(2,1fr);
        gap:18px;
    }

    .gallery-card{
        min-height:220px;
    }

    .gallery-card.is-tall{
        grid-row:span 1;
    }

    .gallery-card figcaption{
        padding:16px;
    }

    .gallery-card figcaption h3{
        font-size:16px;
    }

    .gallery-lightbox{
        padding:20px;
    }

    .gallery-lightbox img{
        max-height:70vh;
    }

    .gallery-prev{
        left:15px;
    }

    .gallery-next{
        right:15px;
    }

}

/* ==========================================
   MOBILE DEVICES (767px and below)
========================================== */
@media screen and (max-width: 767px) {

    .gallery-section{
        padding:40px 0;
    }

    .section-header h2{
        font-size:28px;
    }

    .section-header p{
        font-size:14px;
    }

    .gallery-filter{
        display:flex;
        flex-wrap:nowrap;
        justify-content:flex-start;
        overflow-x:auto;
        overflow-y:hidden;
        gap:8px;
        padding-bottom:8px;
        margin-bottom:15px;
        -webkit-overflow-scrolling:touch;
    }

    .gallery-filter::-webkit-scrollbar{
        height:4px;
    }

    .gallery-filter::-webkit-scrollbar-thumb{
        background:#cbd5e1;
        border-radius:20px;
    }

    .gallery-filter .btn{
        flex:0 0 auto;
        white-space:nowrap;
        margin-top:8px;
        margin-bottom:8px;
        margin-right:0;
        font-size:13px;
        padding:8px 14px;
    }

    .gallery-filter .btn small{
        font-size:10px;
    }

    .hasc-gallery{
        grid-template-columns:1fr;
        grid-auto-rows:240px;
        gap:15px;
    }

    .gallery-card{
        min-height:240px;
    }

    .gallery-card figcaption{
        padding:15px;
    }

    .gallery-card figcaption span{
        font-size:11px;
        padding:5px 10px;
    }

    .gallery-card figcaption h3{
        font-size:15px;
        line-height:1.4;
    }

    .gallery-lightbox{
        padding:10px;
    }

    .gallery-lightbox-frame{
        border-radius:10px;
    }

    .gallery-lightbox img{
        max-height:60vh;
        background:#9ca3af;
    }

    .gallery-lightbox-caption{
        flex-direction:column;
        align-items:flex-start;
        gap:8px;
        padding:12px 15px;
    }

    .gallery-lightbox-caption strong{
        font-size:15px;
    }

    .gallery-counter{
        min-width:auto;
        padding:6px 12px;
        font-size:13px;
    }

    .gallery-close,
    .gallery-prev,
    .gallery-next{
        width:40px;
        height:40px;
        font-size:14px;
    }

    .gallery-close{
        top:10px;
        right:10px;
    }

    .gallery-prev{
        left:8px;
    }

    .gallery-next{
        right:8px;
    }
}