/* ============================================================
   Winsome Gallery Page — Premium Aesthetics & Modern Layout
   ============================================================ */

/* ── Hero / Intro Section ── */
.centered-heading-section .hero-title {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.centered-heading-section .hero-description {
    font-family: var(--font-body);
    font-size: 1.08rem;
    color: rgba(12, 16, 4, 0.72);
    line-height: 1.8;
    max-width: 680px;
    margin: 0 auto;
}

/* ── Portfolio Section ── */
.gallery-portfolio-section {
    padding: 3rem 6% 6rem;
    position: relative;
    z-index: 2;
}

.gallery-portfolio-section .section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.gallery-portfolio-section .section-header h2 {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 3.4rem;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 1rem;
}

.gallery-portfolio-section .section-header p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: rgba(12, 16, 4, 0.70);
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ── Glassmorphic Filters ── */
.filter-controls-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(80, 106, 28, 0.12);
    border-radius: 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(12, 16, 4, 0.04);
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(12, 16, 4, 0.65);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn span {
    position: relative;
    z-index: 2;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold) 100%);
    border-radius: 30px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

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

.filter-btn.active {
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(80, 106, 28, 0.25);
}

.filter-btn.active::before {
    opacity: 1;
    transform: scale(1);
}

/* ── Gallery Project Group (Section w/ Header + Grid) ── */
.gallery-project-group {
    margin-bottom: 4rem;
}

.gallery-project-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(80, 106, 28, 0.12);
}

.gallery-project-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-style: italic;
    color: var(--color-primary);
    margin: 0 0 0.2rem;
}

.gallery-project-location {
    font-size: 0.85rem;
    color: rgba(12, 16, 4, 0.55);
    margin: 0;
}

.gallery-project-link {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gold);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.gallery-project-link:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .gallery-project-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .gallery-project-name {
        font-size: 1.3rem;
    }
    .gallery-project-group {
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-project-name {
        font-size: 1.1rem;
    }
    .gallery-project-location {
        font-size: 0.75rem;
    }
    .gallery-project-link {
        font-size: 0.7rem;
    }
}

/* ── Aligned Portfolio Grid ── */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    width: 100%;
    margin: 0 auto;
    perspective: 1000px; /* enables 3D tilt effects */
}

/* Portfolio grid card configurations */
.bento-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(80, 106, 28, 0.15);
    box-shadow: 0 10px 40px rgba(12, 16, 4, 0.05);
    cursor: pointer;
    transform-style: preserve-3d;
    transform: translateZ(0);
    transition: 
        transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.6s ease, 
        visibility 0.6s ease;
    height: 420px; /* Uniform card height for perfect alignment */
}

/* Column/Row span utility classes (disabled to align grid evenly) */
.grid-col-8 { grid-column: span 1; }
.grid-col-4 { grid-column: span 1; }
.grid-row-2 { grid-row: span 1; }
.grid-row-1 { grid-row: span 1; }

.bento-card.filtered-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateZ(0);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    border: none;
    margin: 0;
    padding: 0;
}

.card-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1.02);
}

.card-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(12, 16, 4, 0) 25%,
        rgba(12, 16, 4, 0.4) 60%,
        rgba(12, 16, 4, 0.9) 100%
    );
    opacity: 0.85;
    transition: opacity 0.5s ease;
    z-index: 1;
}

/* Hover Zoom effect */
.bento-card:hover .card-image-container img {
    transform: scale(1.08);
}

.bento-card:hover {
    box-shadow: 
        0 30px 60px rgba(12, 16, 4, 0.2),
        0 0 0 2px var(--color-gold);
}

/* Card details (Bottom HUD) */
.card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    box-sizing: border-box;
    z-index: 2;
    transform: translateZ(30px); /* 3D layer pop out */
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-gold);
    margin-bottom: 0.6rem;
}

.card-info-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-excerpt {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 0;
}

.card-explore-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #ffffff;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.explore-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.bento-card:hover .explore-circle {
    background: var(--color-gold);
    border-color: var(--color-gold);
    transform: rotate(90deg);
}

/* Card details reveal on hover */
.bento-card:hover .card-excerpt {
    max-height: 80px;
    opacity: 1;
    margin-bottom: 0.5rem;
}

.bento-card:hover .card-explore-btn {
    opacity: 1;
    transform: translateY(0);
}



/* ── Immersive Fullscreen Lightbox ── */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 3, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Global Lightbox close btn */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    z-index: 100;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s ease;
}

.lightbox-close:hover {
    background: #ffffff;
    color: var(--color-text);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

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

/* Navigation arrows */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 95;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-nav-btn svg {
    width: 22px;
    height: 22px;
}

.lightbox-nav-btn:hover {
    background: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.45);
    color: #ffffff;
}

.lightbox-nav-btn.prev-btn { left: 40px; }
.lightbox-nav-btn.next-btn { right: calc(30% + 40px); } /* clear space for sidebar */

/* Split Content wrapper */
.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1540px;
    height: 85vh;
    display: flex;
    z-index: 90;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* Image Visual frame */
.lightbox-media-wrapper {
    flex: 1;
    width: 70%;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.lightbox-media-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.6s ease;
}

.lightbox-modal.active .lightbox-media-wrapper img {
    transform: scale(1);
    opacity: 1;
}

/* Immersive Spec sidebar panel */
.lightbox-sidebar {
    width: 30%;
    min-width: 380px;
    height: 100%;
    background: rgba(12, 16, 4, 0.65);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3.5rem;
    box-sizing: border-box;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.sidebar-header {
    margin-bottom: 2.2rem;
}

.project-category-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-gold);
    margin-bottom: 0.8rem;
}

.lightbox-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.lightbox-sidebar .title-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
    border-radius: 2px;
}

.sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1.2rem;
}

.spec-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

.spec-value {
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 500;
    color: #ffffff;
}

.spec-concept p {
    font-family: var(--font-body);
    font-size: 0.91rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    text-align: justify;
}

/* ══════════════════════════════════════
   Responsive Breakpoints
   ══════════════════════════════════════ */
@media (max-width: 1400px) {
    .bento-grid {
        gap: 20px;
    }
    .bento-card {
        height: 380px;
    }
}

@media (max-width: 1200px) {
    .bento-grid {
        gap: 16px;
    }
    .bento-card {
        height: 350px;
    }
    
    .card-info-overlay {
        padding: 1.8rem;
    }

    .card-info-overlay h3 {
        font-size: 1.4rem;
    }
    
    .lightbox-nav-btn.next-btn {
        right: calc(35% + 20px);
    }
    
    .lightbox-sidebar {
        width: 35%;
        min-width: 320px;
        padding: 2.2rem;
    }
    
    .lightbox-sidebar h3 {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card {
        height: 360px;
    }
    
    .lightbox-content {
        flex-direction: column;
        height: 90vh;
    }
    
    .lightbox-media-wrapper {
        width: 100%;
        height: 60%;
        flex: none;
    }
    
    .lightbox-sidebar {
        width: 100%;
        height: 40%;
        overflow-y: auto;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 2rem;
    }
    
    .lightbox-nav-btn.next-btn {
        right: 20px;
    }
    .lightbox-nav-btn.prev-btn {
        left: 20px;
    }
    
    .lightbox-nav-btn {
        width: 48px;
        height: 48px;
        top: 30%; /* align within media wrapper */
    }
}

@media (max-width: 768px) {
    .centered-heading-section {
        min-height: 40vh;
        padding: 0 4%;
        margin-top: 2vh;
    }

    .gallery-portfolio-section {
        padding: 2rem 4% 3rem;
    }

    .centered-heading-section .hero-title {
        font-size: clamp(2rem, 6vw, 2.6rem);
    }

    .centered-heading-section .hero-description {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    .gallery-portfolio-section .section-header h2 {
        font-size: 2.2rem;
    }

    .gallery-portfolio-section .section-header p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .filter-buttons {
        flex-wrap: wrap;
        border-radius: 20px;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.75rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bento-card {
        height: 300px;
    }

    .card-excerpt {
        max-height: none;
        opacity: 1;
        margin-bottom: 0.3rem;
        font-size: 0.82rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-explore-btn {
        opacity: 1;
        transform: translateY(0);
        margin-top: 0;
    }

    .card-info-overlay h3 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }

    .card-tag {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }

    .lightbox-content {
        width: 95%;
        border-radius: 20px;
    }

    .lightbox-sidebar {
        padding: 1.5rem;
    }

    .lightbox-sidebar h3 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    .sidebar-body {
        gap: 1.2rem;
    }

    .spec-item {
        padding-bottom: 0.8rem;
    }
}

@media (max-width: 480px) {
    .centered-heading-section {
        min-height: 35vh;
        padding: 0 4%;
    }

    .gallery-portfolio-section {
        padding: 1.5rem 4% 2rem;
    }

    .centered-heading-section .hero-description {
        font-size: 0.85rem;
    }

    .gallery-portfolio-section .section-header h2 {
        font-size: 1.8rem;
    }

    .ww-carousel-container {
        padding: 1.5rem 0 3rem;
    }
    .card-info-overlay {
        padding: 1rem;
    }
    .card-info-overlay h3 {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    .card-tag {
        font-size: 0.6rem;
        margin-bottom: 0.2rem;
    }
    .card-excerpt {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        margin-bottom: 0.2rem;
    }
    .card-explore-btn {
        font-size: 0.65rem;
        gap: 4px;
    }
    .explore-circle {
        width: 20px;
        height: 20px;
    }
    .explore-circle svg {
        width: 10px;
        height: 10px;
    }
    .bento-card {
        height: 250px;
    }
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }
    .filter-buttons {
        gap: 6px;
        padding: 6px;
    }
    .lightbox-content {
        border-radius: 16px;
        height: 88vh;
    }
    .lightbox-sidebar {
        padding: 1.2rem;
    }
    .lightbox-sidebar h3 {
        font-size: 1.3rem;
    }
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
    }
    .lightbox-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    .lightbox-nav-btn.next-btn {
        right: 8px;
    }
    .lightbox-nav-btn.prev-btn {
        left: 8px;
    }
    .lightbox-close {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
    }
    .bento-grid {
        gap: 12px;
    }
}

@media (max-width: 360px) {
    .gallery-portfolio-section {
        padding: 1rem 3% 1.5rem;
    }

    .gallery-portfolio-section .section-header h2 {
        font-size: 1.4rem;
    }

    .bento-card {
        height: 220px;
        border-radius: 16px;
    }

    .card-info-overlay {
        padding: 0.75rem;
    }

    .card-info-overlay h3 {
        font-size: 0.85rem;
    }

    .card-tag {
        font-size: 0.55rem;
    }

    .card-excerpt {
        display: none;
    }

    .card-explore-btn {
        font-size: 0.6rem;
        gap: 3px;
    }

    .filter-btn {
        padding: 5px 10px;
        font-size: 0.65rem;
        letter-spacing: 0.3px;
    }

    .filter-buttons {
        gap: 4px;
        padding: 4px;
        border-radius: 14px;
    }

    .bento-grid {
        gap: 10px;
    }
}
