/* ============================================================
   GENIENT TECHNOLOGIES
   GALLERY PAGE
   ============================================================ */

:root {
    --primary-color: #EF410E;
    --secondary-color: #760980;
    --bg-color: #F5F1F5;

    --gradient-left-to-right:
        linear-gradient(86deg, #76097F 22.66%, #EF410F 100%);

    --gradient-top-to-bottom:
        linear-gradient(180deg, #760980 0%, #E83E16 100%);

    --text-color: #444;
    --black: #2c2b2b;
    --white: #fff;

    --border-radius-10: 10px;
    --border-radius-8: 10px;

    --font-weight-400: "GeneralSans-Regular";
    --font-weight-500: "GeneralSans-Medium";
    --font-weight-600: "GeneralSans-Semibold";
    --font-weight-700: "GeneralSans-Semibold";
    --font-weight-800: "GeneralSans-Semibold";
    --font-weight__bold: "Montserrat";

    --gallery-border: rgba(118, 9, 128, 0.10);
    --gallery-shadow:
        0 8px 30px rgba(118, 9, 128, 0.07);

    --gallery-shadow-hover:
        0 18px 45px rgba(118, 9, 128, 0.14);
}


/* ============================================================
   PAGE
   ============================================================ */

.genient-gallery-page {
    background: var(--bg-color);
    overflow: hidden;
}


/* ============================================================
   HERO
   Uses existing .top_heading structure
   ============================================================ */

.gallery-top-heading {
    position: relative;
    overflow: hidden;
}

.gallery-top-heading::before {
    content: "";
    position: absolute;

    width: 420px;
    height: 420px;

    right: -180px;
    top: -230px;

    border-radius: 50%;

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

    pointer-events: none;
}

.gallery-top-heading::after {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    left: -160px;
    bottom: -190px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(239, 65, 14, 0.15),
            transparent 68%
        );

    pointer-events: none;
}


/* ============================================================
   INTRO
   ============================================================ */

.gallery-intro {
    position: relative;
}

.gallery-kicker {
    display: inline-flex;

    align-items: center;

    padding: 7px 14px;

    margin-bottom: 12px;

    border-radius: 50px;

    background: rgba(118, 9, 128, 0.07);

    color: var(--secondary-color);

    font-family: var(--font-weight-600);
    font-size: 12px;

    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.gallery-intro h2 {
    margin-bottom: 12px;
}

.gallery-intro p {
    max-width: 760px;
}


/* ============================================================
   SEARCH
   ============================================================ */

.gallery-search {
    position: relative;

    width: 100%;
    max-width: 420px;

    margin-left: auto;
}

.gallery-search i {
    position: absolute;

    left: 18px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--secondary-color);

    font-size: 14px;

    z-index: 2;
}

.gallery-search input {
    width: 100%;
    height: 52px;

    padding: 0 18px 0 48px;

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

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

    background: var(--white);

    color: var(--text-color);

    font-family: var(--font-weight-400);

    font-size: 14px;

    outline: none;

    box-shadow:
        0 8px 25px rgba(118, 9, 128, 0.05);

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

.gallery-search input::placeholder {
    color: #999;
}

.gallery-search input:focus {
    border-color: var(--primary-color);

    box-shadow:
        0 0 0 4px rgba(239, 65, 14, 0.08);
}


/* ============================================================
   FILTER AREA
   ============================================================ */

.gallery-filter-wrap {
    padding: 14px 16px;

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

    background: var(--white);

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

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

.gallery-filters {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.gallery-filter {
    position: relative;

    border: 1px solid rgba(118, 9, 128, 0.13);

    border-radius: 50px;

    padding: 8px 17px;

    background: var(--white);

    color: var(--secondary-color);

    font-family: var(--font-weight-600);

    font-size: 12px;

    line-height: 1;

    cursor: pointer;

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

.gallery-filter:hover {
    transform: translateY(-1px);

    border-color: var(--primary-color);

    color: var(--primary-color);
}

.gallery-filter.active {
    border-color: transparent;

    color: var(--white);

    background: var(--gradient-left-to-right);

    box-shadow:
        0 7px 18px rgba(118, 9, 128, 0.18);
}


/* ============================================================
   RESULT BAR
   ============================================================ */

.gallery-result-bar {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    color: #777;

    font-size: 13px;

    font-family: var(--font-weight-400);
}

.gallery-result-bar strong {
    color: var(--black);

    font-family: var(--font-weight-600);
}


/* ============================================================
   MASONRY GALLERY
   ============================================================ */

.gallery-grid {
    column-count: 4;

    column-gap: 20px;

    width: 100%;
}


/* ============================================================
   GALLERY CARD
   ============================================================ */

.gallery-card {
    position: relative;

    display: inline-block;

    width: 100%;

    margin: 0 0 20px;

    vertical-align: top;

    break-inside: avoid;

    overflow: hidden;

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

    background: var(--white);

    border: 1px solid rgba(118, 9, 128, 0.07);

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

    cursor: pointer;

    transition:
        transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
        box-shadow 0.35s ease;
}

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

    box-shadow: var(--gallery-shadow-hover);
}


/* ============================================================
   IMAGE
   IMPORTANT:
   No fixed height.
   Original image ratio is preserved.
   ============================================================ */

.gallery-image-wrap {
    position: relative;

    overflow: hidden;

    background: #ece7ed;

    line-height: 0;
}

.gallery-image-wrap img {
    display: block;

    width: 100%;

    height: auto;

    max-width: 100%;

    object-fit: contain;

    transition:
        transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 0.4s ease;
}

.gallery-card:hover .gallery-image-wrap img {
    transform: scale(1.035);

    filter: brightness(0.92);
}


/* ============================================================
   IMAGE OVERLAY
   ============================================================ */

.gallery-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: flex-end;

    padding: 18px;

    opacity: 0;

    background:
        linear-gradient(
            to top,
            rgba(118, 9, 128, 0.94) 0%,
            rgba(118, 9, 128, 0.55) 38%,
            transparent 78%
        );

    transition: opacity 0.3s ease;
}

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

.gallery-overlay-content {
    width: 100%;
}

.gallery-category {
    display: inline-flex;

    align-items: center;

    padding: 5px 10px;

    margin-bottom: 7px;

    border-radius: 50px;

    background: var(--primary-color);

    color: var(--white);

    font-family: var(--font-weight-600);

    font-size: 10px;

    line-height: 1;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

.gallery-overlay-title {
    margin: 0;

    color: var(--white);

    font-family: var(--font-weight-600);

    font-size: 14px;

    line-height: 1.4;
}


/* ============================================================
   CARD INFORMATION
   ============================================================ */

.gallery-card-info {
    padding: 14px 15px 15px;
}

.gallery-card-info h3 {
    margin: 0 0 8px;

    color: var(--black);

    font-family: var(--font-weight-600);

    font-size: 15px;

    line-height: 1.4;

    display: -webkit-box;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;
}

.gallery-card-meta {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    color: #888;

    font-size: 11px;

    font-family: var(--font-weight-400);
}

.gallery-priority {
    color: var(--secondary-color);

    font-family: var(--font-weight-600);
}


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

.gallery-empty {
    display: none;

    padding: 70px 20px;

    text-align: center;

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

    background: var(--white);

    border: 1px dashed rgba(118, 9, 128, 0.18);
}

.gallery-empty.show {
    display: block;
}

.gallery-empty i {
    margin-bottom: 15px;

    color: var(--primary-color);

    font-size: 40px;
}

.gallery-empty h3 {
    margin-bottom: 6px;

    color: var(--black);
}

.gallery-empty p {
    margin: 0;

    color: #777;
}


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

.gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 25px;

    background:
        rgba(42, 4, 45, 0.95);

    backdrop-filter: blur(12px);
}

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

.lightbox-inner {
    position: relative;

    width: min(1180px, 100%);

    height: min(92vh, 900px);

    display: flex;

    flex-direction: column;

    justify-content: center;
}


/* Image */

.lightbox-image-area {
    width: 100%;

    height: calc(100% - 72px);

    display: flex;

    align-items: center;

    justify-content: center;
}

.lightbox-image {
    display: block;

    max-width: 100%;

    max-height: 100%;

    width: auto;

    height: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35);
}


/* Top close */

.lightbox-top {
    position: absolute;

    right: 0;

    top: 0;

    z-index: 5;
}

.lightbox-btn {
    width: 42px;

    height: 42px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 50%;

    color: var(--white);

    background: var(--secondary-color);

    cursor: pointer;

    transition: background 0.25s ease;
}

.lightbox-btn:hover {
    background: var(--primary-color);
}


/* Counter */

.lightbox-counter {
    position: absolute;

    top: 12px;

    left: 12px;

    z-index: 5;

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

    font-size: 12px;
}


/* Prev / Next */

.lightbox-prev,
.lightbox-next {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    z-index: 5;

    width: 48px;

    height: 48px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 50%;

    color: var(--white);

    background: rgba(118, 9, 128, 0.88);

    cursor: pointer;

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

.lightbox-prev {
    left: 8px;
}

.lightbox-next {
    right: 8px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);

    transform:
        translateY(-50%)
        scale(1.05);
}


/* Bottom */

.lightbox-bottom {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding-top: 12px;
}

.lightbox-caption {
    min-width: 0;
}

.lightbox-caption h3 {
    margin: 0 0 4px;

    color: var(--white);

    font-family: var(--font-weight-600);

    font-size: 15px;
}

.lightbox-caption p {
    margin: 0;

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

    font-size: 11px;
}

.lightbox-actions {
    display: flex;

    gap: 8px;

    flex-shrink: 0;
}

.lightbox-action {
    min-height: 40px;

    padding: 0 14px;

    display: inline-flex;

    align-items: center;

    gap: 7px;

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

    border-radius: 8px;

    color: var(--white);

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

    font-size: 12px;

    cursor: pointer;

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.lightbox-action:hover {
    border-color: var(--primary-color);

    background: var(--primary-color);
}


/* ============================================================
   BODY LOCK WHEN LIGHTBOX OPEN
   ============================================================ */

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


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1199px) {

    .gallery-grid {
        column-count: 3;
    }

}


@media (max-width: 991px) {

    .gallery-grid {
        column-count: 2;
    }

    .gallery-search {
        max-width: none;

        margin-left: 0;
    }

}


@media (max-width: 767px) {

    .gallery-grid {
        column-count: 2;

        column-gap: 14px;
    }

    .gallery-card {
        margin-bottom: 14px;

        border-radius: 8px;
    }

    .gallery-card-info {
        padding: 11px 12px 13px;
    }

    .gallery-card-info h3 {
        font-size: 13px;
    }

    .gallery-filter-wrap {
        padding: 12px;
    }

    .gallery-filter {
        padding: 8px 13px;

        font-size: 11px;
    }

    .gallery-result-bar {
        align-items: flex-start;

        flex-direction: column;

        gap: 5px;
    }

    .gallery-lightbox {
        padding: 10px;
    }

    .lightbox-inner {
        height: 95vh;
    }

    .lightbox-image-area {
        height: calc(100% - 115px);
    }

    .lightbox-bottom {
        align-items: stretch;

        flex-direction: column;

        gap: 10px;
    }

    .lightbox-actions {
        flex-wrap: wrap;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;

        height: 40px;
    }

    .lightbox-prev {
        left: 3px;
    }

    .lightbox-next {
        right: 3px;
    }

}


@media (max-width: 575px) {

    .gallery-grid {
        column-count: 1;
    }

    .gallery-top-heading::before {
        width: 250px;
        height: 250px;

        right: -150px;
        top: -130px;
    }

    .gallery-top-heading::after {
        width: 200px;
        height: 200px;

        left: -120px;
        bottom: -130px;
    }

    .gallery-search input {
        height: 48px;
    }

    .gallery-filter-wrap {
        border-radius: 8px;
    }

    .gallery-card {
        margin-bottom: 16px;
    }

}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.gallery-card:focus-visible,
.gallery-filter:focus-visible,
.gallery-search input:focus-visible,
.lightbox-btn:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible,
.lightbox-action:focus-visible {
    outline: 2px solid var(--primary-color);

    outline-offset: 3px;
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

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

    .gallery-card,
    .gallery-image-wrap img,
    .gallery-filter,
    .lightbox-action,
    .lightbox-prev,
    .lightbox-next {
        transition: none !important;
    }

}