/* =========================================================
   GALERI DESA KANDANG
========================================================= */

/* =========================================================
   REVEAL
========================================================= */

.gallery-reveal {
    opacity: 0;

    transform: translateY(35px);

    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gallery-reveal.gallery-visible {
    opacity: 1;

    transform: translateY(0);
}

/* =========================================================
   HERO
========================================================= */

.gallery-hero {
    position: relative;

    min-height: 430px;

    display: flex;
    align-items: center;

    overflow: hidden;

    background: #022c22;
}

.gallery-hero-pattern {
    position: absolute;
    inset: 0;

    opacity: 0.12;

    background-image: linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.12) 25%,
            transparent 25%
        ),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%);

    background-size: 60px 60px;
}

.gallery-glow {
    position: absolute;

    width: 470px;
    height: 470px;

    border-radius: 50%;

    opacity: 0.12;

    filter: blur(5px);
}

.gallery-glow-one {
    top: -260px;
    right: -150px;

    background: #34d399;
}

.gallery-glow-two {
    bottom: -270px;
    left: -180px;

    background: #22c55e;
}

.gallery-hero .container {
    position: relative;

    z-index: 2;
}

.gallery-hero-content {
    max-width: 760px;

    padding: 80px 0;
}

.gallery-eyebrow {
    display: inline-block;

    margin-bottom: 18px;

    padding: 8px 14px;

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

    border-radius: 50px;

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

    color: #a7f3d0;

    font-size: 10px;
    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: 1.5px;
}

.gallery-hero h1 {
    margin: 0 0 18px;

    color: white;

    font-size: clamp(48px, 7vw, 75px);

    line-height: 1;

    letter-spacing: -3px;
}

.gallery-hero h1 span {
    color: #6ee7b7;
}

.gallery-hero p {
    max-width: 600px;

    margin: 0;

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

    font-size: 14px;

    line-height: 1.8;
}

.gallery-breadcrumb {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 27px;

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

    font-size: 12px;
}

.gallery-breadcrumb a {
    color: #86efac;

    text-decoration: none;
}

.gallery-breadcrumb strong {
    color: white;
}

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

.gallery-section {
    padding: 100px 0;

    background: #f8fafc;
}

/* =========================================================
   HEADING
========================================================= */

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

    gap: 40px;

    margin-bottom: 30px;
}

.gallery-label {
    color: #16a34a;

    font-size: 10px;
    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: 1.5px;
}

.gallery-heading h2 {
    margin: 9px 0 8px;

    color: #0f172a;

    font-size: clamp(34px, 5vw, 48px);

    line-height: 1.1;

    letter-spacing: -1.5px;
}

.gallery-heading h2 strong {
    color: #16a34a;
}

.gallery-heading p {
    margin: 0;

    color: #64748b;

    font-size: 12px;
}

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

.gallery-search {
    width: 290px;

    display: flex;
    align-items: center;

    border: 1px solid #e2e8f0;

    border-radius: 12px;

    background: white;

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

.gallery-search:focus-within {
    border-color: #86efac;

    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}

.gallery-search input {
    width: 100%;

    padding: 13px 15px;

    border: 0;
    outline: 0;

    background: transparent;

    color: #0f172a;

    font-family: inherit;

    font-size: 12px;
}

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

.gallery-search span {
    padding-right: 15px;

    font-size: 13px;
}

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

.gallery-filter {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 35px;
}

.gallery-filter-btn {
    padding: 9px 15px;

    border: 1px solid #e2e8f0;

    border-radius: 50px;

    background: white;

    color: #64748b;

    font-family: inherit;

    font-size: 11px;
    font-weight: 750;

    cursor: pointer;

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

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

    border-color: #bbf7d0;

    color: #15803d;
}

.gallery-filter-btn.active {
    border-color: #15803d;

    background: #15803d;

    color: white;
}

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

.gallery-grid {
    display: grid;

    grid-template-columns: repeat(12, 1fr);

    grid-auto-rows: 230px;

    gap: 18px;
}

/* =========================================================
   ITEMS
========================================================= */

.gallery-item {
    grid-column: span 4;
}

.gallery-item:nth-child(1) {
    grid-column: span 5;
    grid-row: span 2;
}

.gallery-item:nth-child(2) {
    grid-column: span 4;
}

.gallery-item:nth-child(3) {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-item:nth-child(4) {
    grid-column: span 4;
}

.gallery-item:nth-child(5) {
    grid-column: span 4;
}

.gallery-item:nth-child(6) {
    grid-column: span 5;
}

.gallery-item:nth-child(7) {
    grid-column: span 4;
}

.gallery-item:nth-child(8) {
    grid-column: span 4;
}

.gallery-item:nth-child(9) {
    grid-column: span 4;
}

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

.gallery-card {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    border-radius: 18px;

    background: #dbeafe;

    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

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

    display: block;

    object-fit: cover;

    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

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

    display: flex;
    align-items: end;

    padding: 25px;

    background: linear-gradient(
        to top,
        rgba(2, 44, 34, 0.9),
        rgba(2, 44, 34, 0.15) 65%,
        transparent
    );

    opacity: 0;

    transition: opacity 0.35s ease;
}

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

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

    transform: translateY(15px);

    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-overlay-content > span {
    color: #86efac;

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

    text-transform: uppercase;

    letter-spacing: 1px;
}

.gallery-overlay-content h3 {
    max-width: 270px;

    margin: 6px 0 0;

    color: white;

    font-size: 18px;

    line-height: 1.3;
}

.gallery-view {
    position: absolute;

    right: 25px;
    bottom: 25px;

    width: 40px;
    height: 40px;

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

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

    border-radius: 50%;

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

    backdrop-filter: blur(10px);

    color: white;

    cursor: pointer;

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

.gallery-view:hover {
    transform: rotate(90deg);

    background: rgba(255, 255, 255, 0.22);
}

.gallery-view span {
    font-size: 24px;

    font-weight: 300;
}

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

.gallery-empty {
    display: none;

    padding: 80px 20px;

    text-align: center;
}

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

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

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

    margin: 0 auto 15px;

    border-radius: 18px;

    background: white;

    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);

    font-size: 24px;
}

.gallery-empty h3 {
    margin: 0 0 7px;

    color: #0f172a;

    font-size: 20px;
}

.gallery-empty p {
    margin: 0;

    color: #94a3b8;

    font-size: 12px;
}

/* =========================================================
   CTA
========================================================= */

.gallery-cta {
    position: relative;

    overflow: hidden;

    padding: 90px 0;

    background: #022c22;
}

.gallery-cta-pattern {
    position: absolute;
    inset: 0;

    opacity: 0.08;

    background-image: radial-gradient(circle, white 1px, transparent 1px);

    background-size: 30px 30px;
}

.gallery-cta .container {
    position: relative;
    z-index: 2;
}

.gallery-cta-content {
    max-width: 750px;

    margin: auto;

    text-align: center;
}

.gallery-cta-content > span {
    color: #6ee7b7;

    font-size: 10px;
    font-weight: 850;

    text-transform: uppercase;

    letter-spacing: 1.5px;
}

.gallery-cta-content h2 {
    margin: 10px 0 12px;

    color: white;

    font-size: clamp(30px, 5vw, 48px);

    line-height: 1.1;

    letter-spacing: -1.5px;
}

.gallery-cta-content p {
    max-width: 550px;

    margin: auto;

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

    font-size: 12px;

    line-height: 1.8;
}

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

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

    z-index: 9999;

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

    padding: 30px;

    visibility: hidden;

    opacity: 0;

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

.gallery-lightbox.show {
    visibility: visible;

    opacity: 1;
}

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

    background: rgba(2, 12, 9, 0.92);

    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;

    z-index: 2;

    width: min(100%, 1050px);

    max-height: 92vh;

    display: flex;
    flex-direction: column;
    align-items: center;

    transform: scale(0.94);

    transition: transform 0.35s ease;
}

.gallery-lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;

    display: block;

    object-fit: contain;

    border-radius: 12px;

    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;

    top: -48px;
    right: 0;

    width: 38px;
    height: 38px;

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

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

    border-radius: 50%;

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

    color: white;

    font-size: 27px;
    font-weight: 200;

    cursor: pointer;

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

.lightbox-close:hover {
    transform: rotate(90deg);

    background: rgba(255, 255, 255, 0.16);
}

.lightbox-caption {
    width: 100%;

    padding-top: 18px;
}

.lightbox-caption span {
    color: #6ee7b7;

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

    text-transform: uppercase;

    letter-spacing: 1.3px;
}

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

    color: white;

    font-size: 20px;
}

/* =========================================================
   BODY LOCK
========================================================= */

body.lightbox-open {
    overflow: hidden;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);

        grid-auto-rows: 220px;
    }

    .gallery-item,
    .gallery-item:nth-child(n) {
        grid-column: span 3;

        grid-row: span 1;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(3) {
        grid-column: span 3;

        grid-row: span 2;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 750px) {
    .gallery-section {
        padding: 75px 0;
    }

    .gallery-heading {
        display: block;
    }

    .gallery-search {
        width: 100%;

        margin-top: 25px;
    }

    .gallery-filter {
        overflow-x: auto;

        flex-wrap: nowrap;

        padding-bottom: 5px;

        scrollbar-width: none;
    }

    .gallery-filter::-webkit-scrollbar {
        display: none;
    }

    .gallery-filter-btn {
        flex-shrink: 0;
    }

    .gallery-grid {
        display: grid;

        grid-template-columns: repeat(2, 1fr);

        grid-auto-rows: 190px;

        gap: 12px;
    }

    .gallery-item,
    .gallery-item:nth-child(n),
    .gallery-item:nth-child(1),
    .gallery-item:nth-child(3) {
        grid-column: span 1;

        grid-row: span 1;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(6) {
        grid-column: span 2;
    }

    .gallery-overlay {
        padding: 15px;

        opacity: 1;

        background: linear-gradient(
            to top,
            rgba(2, 44, 34, 0.82),
            transparent 70%
        );
    }

    .gallery-overlay-content {
        transform: translateY(0);
    }

    .gallery-overlay-content h3 {
        max-width: 170px;

        font-size: 13px;
    }

    .gallery-view {
        right: 15px;
        bottom: 15px;

        width: 34px;
        height: 34px;
    }

    .gallery-view span {
        font-size: 20px;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 500px) {
    .gallery-hero {
        min-height: 470px;
    }

    .gallery-hero-content {
        padding: 70px 0;
    }

    .gallery-hero h1 {
        font-size: 47px;

        letter-spacing: -2px;
    }

    .gallery-grid {
        grid-auto-rows: 165px;
    }

    .gallery-card {
        border-radius: 13px;
    }

    .gallery-overlay-content > span {
        font-size: 7px;
    }

    .gallery-overlay-content h3 {
        font-size: 11px;
    }

    .lightbox-close {
        top: -45px;
    }
}
