/* =========================================================
   GALLERY.CSS
   Dynamic School Gallery
   ========================================================= */


/* =========================================================
   1. HERO
   ========================================================= */

.gallery-page-hero {
    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(34, 197, 94, 0.18),
            transparent 32%
        ),
        radial-gradient(
            circle at 85% 25%,
            rgba(14, 165, 233, 0.12),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #07150d,
            var(--primary-dark),
            var(--primary)
        );
}

.gallery-page-hero::before {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(255,255,255,0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,0.035) 1px,
            transparent 1px
        );

    background-size: 45px 45px;

    pointer-events: none;
}

.gallery-page-hero::after {
    content: "";

    position: absolute;

    width: 320px;
    height: 320px;

    right: -130px;
    bottom: -180px;

    background:
        rgba(255,255,255,0.05);

    border-radius: 50%;
}

.gallery-page-hero .container,
.gallery-page-hero .page-hero-content {
    position: relative;
    z-index: 2;
}

.gallery-hero-badge {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 15px;
    padding: 8px 14px;

    color: var(--secondary);

    background:
        rgba(255,255,255,0.08);

    border:
        1px solid
        rgba(255,255,255,0.12);

    border-radius:
        var(--radius-full);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;

    text-transform: uppercase;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}


/* =========================================================
   2. GRADIENT TEXT
   ========================================================= */

.gallery-gradient-text {
    color: transparent;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--primary-light)
        );

    background-clip: text;
    -webkit-background-clip: text;
}


/* =========================================================
   3. FEATURED SECTION
   ========================================================= */

.gallery-featured-section {
    padding: 75px 0;

    background:
        linear-gradient(
            180deg,
            var(--bg-soft),
            var(--white)
        );
}

.gallery-featured-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    grid-auto-rows: 220px;

    gap: 14px;
}

.gallery-featured-item {
    position: relative;

    padding: 0;

    background: var(--bg-soft);

    border: 0;
    border-radius: 20px;

    overflow: hidden;

    cursor: pointer;

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.gallery-featured-item:hover {
    transform:
        translateY(-4px);

    box-shadow: var(--shadow-lg);
}

.gallery-featured-main {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-featured-item img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.55s ease;
}

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

.gallery-featured-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    justify-content: flex-end;
    flex-direction: column;

    padding: 20px;

    text-align: left;

    color: var(--white);

    background:
        linear-gradient(
            to top,
            rgba(7, 21, 13, 0.88),
            rgba(7, 21, 13, 0.08) 68%,
            transparent
        );
}

.gallery-featured-overlay span {
    display: block;

    margin-bottom: 4px;

    color: var(--secondary);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;

    text-transform: uppercase;
}

.gallery-featured-overlay h3 {
    max-width: 85%;

    color: var(--white);

    font-size: 16px;
    line-height: 1.45;
}

.gallery-featured-main
.gallery-featured-overlay h3 {
    font-size:
        clamp(
            21px,
            3vw,
            32px
        );
}

.gallery-featured-overlay > i {
    position: absolute;

    top: 17px;
    right: 17px;

    width: 39px;
    height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--white);

    background:
        rgba(255,255,255,0.14);

    border:
        1px solid
        rgba(255,255,255,0.16);

    border-radius: 11px;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    opacity: 0;
    transform:
        translateY(-7px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.gallery-featured-item:hover
.gallery-featured-overlay > i {
    opacity: 1;

    transform: translateY(0);
}


/* =========================================================
   4. GALLERY LIST SECTION
   ========================================================= */

.gallery-list-section {
    background: var(--white);
}

.gallery-list-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 28px;
}

.gallery-list-heading .section-title {
    margin-bottom: 0;
}

.gallery-total {
    min-width: 90px;

    padding: 10px 15px;

    text-align: center;

    background:
        rgba(34,197,94,0.08);

    border:
        1px solid
        rgba(34,197,94,0.12);

    border-radius: 13px;
}

.gallery-total strong {
    display: block;

    color: var(--primary);

    font-size: 20px;
}

.gallery-total span {
    display: block;

    margin-top: 2px;

    color: var(--text-light);

    font-size: 8px;
    font-weight: 700;

    text-transform: uppercase;
}


/* =========================================================
   5. FILTER FORM
   ========================================================= */

.gallery-filter-form {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        220px
        auto
        auto;

    gap: 12px;

    margin-bottom: 35px;
    padding: 20px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );

    border:
        1px solid var(--border);

    border-radius: 18px;

    box-shadow: var(--shadow-sm);
}

.gallery-search-box,
.gallery-category-filter {
    position: relative;
}

.gallery-search-box > i,
.gallery-category-filter > i {
    position: absolute;

    left: 14px;
    top: 50%;

    z-index: 2;

    transform:
        translateY(-50%);

    color: var(--text-light);

    font-size: 11px;

    pointer-events: none;
}

.gallery-search-box input,
.gallery-category-filter select {
    width: 100%;
    min-height: 47px;

    padding:
        10px
        14px
        10px
        40px;

    color: var(--dark);

    background: var(--white);

    border:
        1px solid var(--border);

    border-radius: 11px;

    outline: none;

    font-size: 11px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.gallery-search-box input:focus,
.gallery-category-filter select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(34,197,94,0.09);
}

.gallery-search-btn {
    min-height: 47px;
}

.gallery-clear-btn {
    min-height: 47px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 10px 15px;

    color: var(--danger);

    background: #fef2f2;

    border:
        1px solid #fecaca;

    border-radius: 11px;

    font-size: 10px;
    font-weight: 700;
}

.gallery-clear-btn:hover {
    color: var(--white);

    background: var(--danger);
}


/* =========================================================
   6. GALLERY GRID
   ========================================================= */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}

.gallery-card {
    background: var(--white);

    border:
        1px solid var(--border);

    border-radius: 20px;

    box-shadow: var(--shadow-sm);

    overflow: hidden;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.gallery-card:hover {
    transform:
        translateY(-5px);

    border-color:
        rgba(34,197,94,0.22);

    box-shadow: var(--shadow-lg);
}

.gallery-card-button {
    width: 100%;

    padding: 0;

    text-align: left;

    color: inherit;

    background: transparent;

    border: 0;

    cursor: pointer;
}

.gallery-card-image {
    position: relative;

    height: 245px;

    background: var(--bg-soft);

    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.55s ease;
}

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

.gallery-featured-badge {
    position: absolute;

    top: 13px;
    left: 13px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 6px 9px;

    color: #92400e;

    background:
        rgba(254,243,199,0.96);

    border:
        1px solid #fde68a;

    border-radius:
        var(--radius-full);

    font-size: 8px;
    font-weight: 800;
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(7,21,13,0.48);

    opacity: 0;

    transition:
        opacity 0.3s ease;
}

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

.gallery-view-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--white);

    background:
        rgba(255,255,255,0.14);

    border:
        1px solid
        rgba(255,255,255,0.20);

    border-radius: 15px;

    font-size: 18px;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    transform:
        scale(0.8);

    transition:
        transform 0.3s ease;
}

.gallery-card:hover
.gallery-view-icon {
    transform: scale(1);
}

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

.gallery-category-name {
    display: inline-flex;

    margin-bottom: 6px;

    color: var(--primary);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.4px;

    text-transform: uppercase;
}

.gallery-card-content h3 {
    margin-bottom: 7px;

    font-size: 15px;
    line-height: 1.45;
}

.gallery-card-content p {
    color: var(--text-light);

    font-size: 10px;
    line-height: 1.7;
}


/* =========================================================
   7. EMPTY STATE
   ========================================================= */

.gallery-empty-state {
    padding: 70px 25px;

    text-align: center;

    background: var(--bg-soft);

    border:
        1px dashed #cbd5e1;

    border-radius: 21px;
}

.gallery-empty-icon {
    width: 76px;
    height: 76px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);

    background:
        rgba(34,197,94,0.09);

    border-radius: 50%;

    font-size: 28px;
}

.gallery-empty-state h2 {
    margin-bottom: 8px;

    font-size: 24px;
}

.gallery-empty-state p {
    max-width: 500px;

    margin: 0 auto 20px;

    color: var(--text-light);

    font-size: 12px;
    line-height: 1.8;
}


/* =========================================================
   8. CTA
   ========================================================= */

.gallery-cta-section {
    padding: 15px 0 25px;

    background: var(--white);
}

.gallery-cta-card {
    position: relative;

    min-height: 210px;

    padding: 35px 40px;

    display: grid;

    grid-template-columns:
        70px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 25px;

    color: var(--white);

    background:
        linear-gradient(
            135deg,
            #07150d,
            var(--primary-dark),
            var(--primary)
        );

    border-radius: 24px;

    box-shadow:
        0 25px 55px
        rgba(20,83,45,0.18);

    overflow: hidden;
}

.gallery-cta-card::before {
    content: "";

    position: absolute;

    width: 240px;
    height: 240px;

    right: -110px;
    bottom: -140px;

    background:
        rgba(255,255,255,0.05);

    border-radius: 50%;
}

.gallery-cta-card > * {
    position: relative;
    z-index: 2;
}

.gallery-cta-icon {
    width: 66px;
    height: 66px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--dark);

    background:
        linear-gradient(
            135deg,
            #fde68a,
            var(--secondary)
        );

    border-radius: 19px;

    font-size: 25px;
}

.gallery-cta-card > div:nth-child(2) > span {
    display: block;

    margin-bottom: 4px;

    color: var(--secondary);

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
}

.gallery-cta-card h2 {
    margin-bottom: 7px;

    color: var(--white);

    font-size: 25px;
}

.gallery-cta-card p {
    max-width: 680px;

    color:
        rgba(255,255,255,0.66);

    font-size: 11px;
    line-height: 1.75;
}


/* =========================================================
   9. LIGHTBOX
   ========================================================= */

.gallery-lightbox {
    position: fixed;
    inset: 0;

    z-index: 3000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(2, 6, 12, 0.84);

    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 2;

    width: min(
        100%,
        1000px
    );

    max-height:
        calc(100vh - 50px);

    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(260px, 0.5fr);

    background: var(--white);

    border:
        1px solid
        rgba(255,255,255,0.12);

    border-radius: 24px;

    box-shadow:
        0 35px 90px
        rgba(0,0,0,0.42);

    overflow: hidden;

    transform:
        translateY(20px)
        scale(0.98);

    transition:
        transform 0.25s ease;
}

.gallery-lightbox.active
.gallery-lightbox-dialog {
    transform:
        translateY(0)
        scale(1);
}

.gallery-lightbox-close {
    position: absolute;

    top: 14px;
    right: 14px;

    z-index: 5;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--white);

    background:
        rgba(15,23,42,0.58);

    border:
        1px solid
        rgba(255,255,255,0.18);

    border-radius: 12px;

    font-size: 16px;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.gallery-lightbox-close:hover {
    background: var(--danger);

    transform: rotate(4deg);
}

.gallery-lightbox-image {
    min-height: 560px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #050a07;
}

.gallery-lightbox-image img {
    width: 100%;
    height: 100%;
    max-height: 760px;

    object-fit: contain;
}

.gallery-lightbox-content {
    padding: 42px 28px;

    display: flex;
    justify-content: center;
    flex-direction: column;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );
}

.gallery-lightbox-content > span {
    display: block;

    margin-bottom: 7px;

    color: var(--primary);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;

    text-transform: uppercase;
}

.gallery-lightbox-content h2 {
    margin-bottom: 12px;

    font-size: 23px;
    line-height: 1.4;
}

.gallery-lightbox-content p {
    color: var(--text-light);

    font-size: 11px;
    line-height: 1.8;
}


/* =========================================================
   10. BODY LIGHTBOX STATE
   ========================================================= */

body.gallery-lightbox-open {
    overflow: hidden;
}


/* =========================================================
   11. RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .gallery-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .gallery-featured-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {

    .gallery-filter-form {
        grid-template-columns:
            minmax(0, 1fr)
            200px
            auto;
    }

    .gallery-clear-btn {
        grid-column: 1 / -1;

        justify-self: start;
    }

    .gallery-lightbox-dialog {
        grid-template-columns: 1fr;
    }

    .gallery-lightbox-image {
        min-height: 420px;
    }

    .gallery-lightbox-content {
        padding: 25px;
    }
}

@media (max-width: 760px) {

    .gallery-featured-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        grid-auto-rows: 190px;
    }

    .gallery-featured-main {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .gallery-cta-card {
        grid-template-columns:
            60px minmax(0, 1fr);
    }

    .gallery-cta-card > .btn {
        grid-column: 1 / -1;

        justify-self: start;
    }
}

@media (max-width: 620px) {

    .gallery-list-heading {
        align-items: flex-start;
    }

    .gallery-filter-form {
        grid-template-columns: 1fr;
    }

    .gallery-clear-btn {
        grid-column: auto;

        width: 100%;
    }

    .gallery-search-btn {
        width: 100%;
    }

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

    .gallery-lightbox {
        padding: 12px;
    }

    .gallery-lightbox-dialog {
        max-height:
            calc(100vh - 24px);

        border-radius: 18px;
    }

    .gallery-lightbox-image {
        min-height: 330px;
    }
}

@media (max-width: 480px) {

    .gallery-page-hero h1 {
        font-size: 31px;
    }

    .gallery-list-heading {
        flex-direction: column;
    }

    .gallery-total {
        align-self: flex-start;
    }

    .gallery-featured-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-featured-grid {
        grid-auto-rows: 250px;
    }

    .gallery-featured-main {
        grid-column: auto;
        grid-row: auto;
    }

    .gallery-card-image {
        height: 280px;
    }

    .gallery-cta-card {
        grid-template-columns: 1fr;

        padding: 30px 23px;

        text-align: center;
    }

    .gallery-cta-icon {
        margin: 0 auto;
    }

    .gallery-cta-card > .btn {
        width: 100%;

        justify-self: stretch;
    }

    .gallery-lightbox-image {
        min-height: 270px;
    }

    .gallery-lightbox-content {
        padding: 22px 20px;
    }

    .gallery-lightbox-content h2 {
        font-size: 20px;
    }
}


/* =========================================================
   12. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .gallery-featured-item,
    .gallery-featured-item img,
    .gallery-card,
    .gallery-card-image img,
    .gallery-lightbox,
    .gallery-lightbox-dialog {
        transition: none;
    }
}


/* =========================================================
   13. PRINT
   ========================================================= */

@media print {

    .gallery-page-hero,
    .gallery-filter-form,
    .gallery-cta-section,
    .gallery-lightbox {
        display: none !important;
    }

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

    .gallery-card {
        break-inside: avoid;

        box-shadow: none;
    }
}