/* =========================================================
   SNP GROUP — GALLERY SECTION
   Premium Card Layout
========================================================= */

.snp-gallery {
    --gallery-blue: #0756d9;
    --gallery-blue-dark: #0344b4;
    --gallery-navy: #101a2b;
    --gallery-text: #172033;
    --gallery-muted: #697386;
    --gallery-border: #e5eaf1;
    --gallery-bg: #ffffff;

    width: 100%;
    padding: 90px 0;

    background: var(--gallery-bg);

    overflow: hidden;

    font-family: "Manrope", sans-serif;
}


/* =========================================================
   CONTAINER
========================================================= */

.snp-gallery-container {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;
}


/* =========================================================
   HEADER
========================================================= */

.snp-gallery-header {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 50px;

    margin-bottom: 48px;
}


/* LEFT HEADING */

.snp-gallery-heading {
    max-width: 680px;
}


/* SMALL LABEL */

.snp-gallery-label {
    display: inline-flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 15px;

    color: var(--gallery-blue);

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 2px;

    line-height: 1;

    text-transform: uppercase;
}


.snp-gallery-label-line {
    width: 28px;

    height: 2px;

    display: inline-block;

    background: var(--gallery-blue);
}


/* MAIN HEADING */

.snp-gallery-heading h2 {
    margin: 0;

    color: var(--gallery-navy);

    font-size: clamp(34px, 4vw, 52px);

    font-weight: 800;

    line-height: 1.1;

    letter-spacing: -1.5px;
}


.snp-gallery-heading h2 span {
    color: var(--gallery-blue);
}


/* RIGHT INTRO */

.snp-gallery-intro {
    width: 100%;

    max-width: 360px;
}


.snp-gallery-intro p {
    margin: 0;

    color: var(--gallery-muted);

    font-size: 15px;

    line-height: 1.8;
}


/* =========================================================
   GALLERY GRID
========================================================= */

.snp-gallery-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 28px;
}


/* =========================================================
   CARD
========================================================= */

.snp-gallery-card {
    position: relative;

    display: flex;

    flex-direction: column;

    width: 100%;

    min-width: 0;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid var(--gallery-border);

    border-radius: 18px;

    color: inherit;

    text-decoration: none;

    box-shadow:
        0 8px 28px rgba(16, 26, 43, 0.055);

    opacity: 0;

    transform: translateY(22px);

    animation:
        snpGalleryCardReveal
        0.6s
        ease
        forwards;

    animation-delay:
        calc(var(--card-index) * 0.08s);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}


.snp-gallery-card:hover {
    transform: translateY(-7px);

    border-color: rgba(7, 86, 217, 0.25);

    box-shadow:
        0 20px 50px rgba(16, 26, 43, 0.12);
}


/* =========================================================
   CARD IMAGE
========================================================= */

.snp-gallery-card-image {
    position: relative;

    width: 100%;

    height: 315px;

    overflow: hidden;

    background: #e9edf3;
}


.snp-gallery-card-image img {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition:
        transform 0.65s
        cubic-bezier(0.22, 1, 0.36, 1);
}


.snp-gallery-card:hover
.snp-gallery-card-image img {
    transform: scale(1.07);
}


/* =========================================================
   IMAGE OVERLAY
========================================================= */

.snp-gallery-card-overlay {
    position: absolute;

    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(16, 26, 43, 0.04) 0%,
            rgba(16, 26, 43, 0.08) 42%,
            rgba(16, 26, 43, 0.72) 100%
        );
}


/* =========================================================
   CATEGORY BADGE
========================================================= */

.snp-gallery-category {
    position: absolute;

    left: 22px;

    bottom: 20px;

    z-index: 3;

    display: inline-flex;

    align-items: center;

    padding: 9px 14px;

    background: rgba(255, 255, 255, 0.96);

    border-radius: 7px;

    color: var(--gallery-blue);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.4px;

    line-height: 1;

    text-transform: uppercase;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   TOP RIGHT ARROW
========================================================= */

.snp-gallery-top-arrow {
    position: absolute;

    top: 20px;

    right: 20px;

    z-index: 3;

    display: flex;

    align-items: center;

    justify-content: center;

    width: 45px;

    height: 45px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.96);

    color: var(--gallery-navy);

    font-size: 20px;

    line-height: 1;

    opacity: 0;

    transform: translateY(-5px);

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.08);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.3s ease,
        color 0.3s ease;
}


.snp-gallery-card:hover
.snp-gallery-top-arrow {
    opacity: 1;

    transform: translateY(0);

    background: var(--gallery-blue);

    color: #ffffff;
}


/* =========================================================
   CARD CONTENT
========================================================= */

.snp-gallery-card-content {
    display: block;

    width: 100%;

    padding: 24px 28px 22px;

    background: #ffffff;
}


/* =========================================================
   CARD TEXT
========================================================= */

.snp-gallery-card-text {
    display: block;

    width: 100%;
}


.snp-gallery-card-text h3 {
    margin: 0 0 10px;

    color: var(--gallery-navy);

    font-size: 22px;

    font-weight: 800;

    line-height: 1.3;

    letter-spacing: -0.3px;

    transition:
        color 0.3s ease;
}


.snp-gallery-card:hover
.snp-gallery-card-text h3 {
    color: var(--gallery-blue);
}


.snp-gallery-card-text p {
    margin: 0;

    max-width: 100%;

    color: var(--gallery-muted);

    font-size: 14px;

    font-weight: 500;

    line-height: 1.7;
}


/* =========================================================
   CARD BOTTOM
========================================================= */

.snp-gallery-card-bottom {
    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    padding-top: 18px;

    margin-top: 20px;

    border-top: 1px solid var(--gallery-border);
}


/* EXPLORE TEXT */

.snp-gallery-explore {
    color: var(--gallery-navy);

    font-size: 12px;

    font-weight: 800;

    line-height: 1.2;

    letter-spacing: 0.4px;

    transition:
        color 0.3s ease;
}


.snp-gallery-card:hover
.snp-gallery-explore {
    color: var(--gallery-blue);
}


/* =========================================================
   BOTTOM ARROW
========================================================= */

.snp-gallery-bottom-arrow {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 42px;

    height: 42px;

    flex-shrink: 0;

    border: 1px solid var(--gallery-blue);

    border-radius: 50%;

    background: var(--gallery-blue);

    color: #ffffff;

    font-size: 18px;

    line-height: 1;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;
}


.snp-gallery-card:hover
.snp-gallery-bottom-arrow {
    transform: translateX(5px);

    background: var(--gallery-blue-dark);

    border-color: var(--gallery-blue-dark);
}


/* =========================================================
   CARD REVEAL ANIMATION
========================================================= */

@keyframes snpGalleryCardReveal {

    0% {
        opacity: 0;

        transform: translateY(22px);
    }

    100% {
        opacity: 1;

        transform: translateY(0);
    }

}


/* =========================================================
   IMAGE ERROR FALLBACK
========================================================= */

.snp-gallery-image-error {
    background:
        linear-gradient(
            135deg,
            #edf2f8,
            #dce5f1
        );
}


.snp-gallery-image-error::after {
    content: "Gallery Image";

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #6b778a;

    font-size: 14px;

    font-weight: 700;

    letter-spacing: 0.5px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 950px) {

    .snp-gallery {
        padding: 75px 0;
    }


    .snp-gallery-container {
        width: min(
            100% - 36px,
            760px
        );
    }


    .snp-gallery-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 18px;

        margin-bottom: 38px;
    }


    .snp-gallery-heading {
        max-width: 100%;
    }


    .snp-gallery-intro {
        max-width: 620px;
    }


    .snp-gallery-grid {
        gap: 22px;
    }


    .snp-gallery-card-image {
        height: 275px;
    }


    .snp-gallery-card-content {
        padding: 23px 24px 21px;
    }


    .snp-gallery-card-text h3 {
        font-size: 20px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {

    .snp-gallery {
        padding: 60px 0;
    }


    .snp-gallery-container {
        width: calc(100% - 28px);

        max-width: 520px;
    }


    /* HEADER */

    .snp-gallery-header {
        gap: 15px;

        margin-bottom: 30px;
    }


    .snp-gallery-label {
        margin-bottom: 13px;

        font-size: 10px;

        letter-spacing: 1.7px;
    }


    .snp-gallery-label-line {
        width: 22px;
    }


    .snp-gallery-heading h2 {
        font-size: 32px;

        line-height: 1.12;

        letter-spacing: -1px;
    }


    .snp-gallery-intro p {
        font-size: 13px;

        line-height: 1.7;
    }


    /* GRID */

    .snp-gallery-grid {
        grid-template-columns: 1fr;

        gap: 20px;
    }


    /* IMAGE */

    .snp-gallery-card-image {
        height: 245px;
    }


    /* CATEGORY */

    .snp-gallery-category {
        left: 17px;

        bottom: 17px;

        padding: 8px 11px;

        font-size: 9px;

        letter-spacing: 1.2px;
    }


    /* TOP ARROW */

    .snp-gallery-top-arrow {
        top: 16px;

        right: 16px;

        width: 42px;

        height: 42px;

        opacity: 1;

        transform: none;

        font-size: 18px;
    }


    /* CONTENT */

    .snp-gallery-card-content {
        padding: 21px 20px 20px;

        min-height: auto;
    }


    .snp-gallery-card-text h3 {
        margin-bottom: 8px;

        font-size: 20px;

        line-height: 1.3;
    }


    .snp-gallery-card-text p {
        font-size: 13px;

        line-height: 1.65;
    }


    /* BOTTOM */

    .snp-gallery-card-bottom {
        padding-top: 16px;

        margin-top: 18px;
    }


    .snp-gallery-explore {
        font-size: 11px;
    }


    .snp-gallery-bottom-arrow {
        width: 39px;

        height: 39px;

        font-size: 17px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 400px) {

    .snp-gallery {
        padding: 50px 0;
    }


    .snp-gallery-container {
        width: calc(100% - 24px);
    }


    .snp-gallery-heading h2 {
        font-size: 29px;
    }


    .snp-gallery-card-image {
        height: 220px;
    }


    .snp-gallery-card-content {
        padding: 19px 17px 18px;
    }


    .snp-gallery-card-text h3 {
        font-size: 19px;
    }


    .snp-gallery-card-text p {
        font-size: 12.5px;
    }


    .snp-gallery-card-bottom {
        padding-top: 15px;

        margin-top: 16px;
    }

}


/* =========================================================
   VERY SMALL DEVICES
========================================================= */

@media (max-width: 340px) {

    .snp-gallery-heading h2 {
        font-size: 27px;
    }


    .snp-gallery-card-image {
        height: 200px;
    }


    .snp-gallery-card-content {
        padding: 17px 15px;
    }


    .snp-gallery-card-text h3 {
        font-size: 18px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .snp-gallery-card {
        opacity: 1;

        transform: none;

        animation: none;

        transition: none;
    }


    .snp-gallery-card-image img,
    .snp-gallery-top-arrow,
    .snp-gallery-bottom-arrow,
    .snp-gallery-card-text h3,
    .snp-gallery-explore {
        transition: none;
    }

}

/* =========================================================
   FINAL MOBILE CARD FIX
========================================================= */

.snp-gallery,
.snp-gallery-container,
.snp-gallery-grid,
.snp-gallery-card {
    max-width: 100%;
    box-sizing: border-box;
}

.snp-gallery-card * {
    box-sizing: border-box;
}


/* Card content ko screen ke andar rakho */

.snp-gallery-card-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}


/* Heading wrap */

.snp-gallery-card-text h3 {
    width: 100%;
    max-width: 100%;

    overflow-wrap: break-word;
    word-break: normal;
}


/* Description wrap */

.snp-gallery-card-text p {
    width: 100%;
    max-width: 100%;

    overflow-wrap: anywhere;
    word-break: normal;
}


/* Bottom button */

.snp-gallery-card-bottom {
    width: 100%;
    max-width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}


/* Explore text */

.snp-gallery-explore {
    min-width: 0;

    flex: 1;

    white-space: nowrap;
}


/* Arrow */

.snp-gallery-bottom-arrow {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    margin-left: auto;
}


/* =========================================================
   MOBILE FINAL FIX
========================================================= */

@media (max-width: 650px) {

    .snp-gallery-container {
        width: calc(100% - 28px);
        max-width: 100%;
    }

    .snp-gallery-grid {
        width: 100%;
        max-width: 100%;

        grid-template-columns: minmax(0, 1fr);
    }

    .snp-gallery-card {
        width: 100%;
        max-width: 100%;

        min-width: 0;

        overflow: hidden;
    }

    .snp-gallery-card-image {
        width: 100%;
        max-width: 100%;
    }

    .snp-gallery-card-content {
        width: 100%;
        max-width: 100%;

        padding: 20px;
    }

    .snp-gallery-card-text {
        width: 100%;
        max-width: 100%;
    }

    .snp-gallery-card-text h3 {
        font-size: 20px;

        line-height: 1.3;

        white-space: normal;

        overflow-wrap: break-word;
    }

    .snp-gallery-card-text p {
        font-size: 13px;

        line-height: 1.65;

        white-space: normal;

        overflow-wrap: anywhere;
    }

    .snp-gallery-card-bottom {
        width: 100%;

        padding-top: 16px;
        margin-top: 18px;

        gap: 12px;
    }

    .snp-gallery-explore {
        font-size: 12px;

        white-space: nowrap;
    }

    .snp-gallery-bottom-arrow {
        flex: 0 0 40px;

        width: 40px;
        height: 40px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .snp-gallery-container {
        width: calc(100% - 20px);
    }

    .snp-gallery-card-content {
        padding: 18px 16px;
    }

    .snp-gallery-card-text h3 {
        font-size: 18px;
    }

    .snp-gallery-card-text p {
        font-size: 12.5px;
    }

    .snp-gallery-explore {
        font-size: 11px;
    }

    .snp-gallery-bottom-arrow {
        flex-basis: 38px;

        width: 38px;
        height: 38px;
    }
}