/* ==========================================
   🖼️ GALLERY SPECIFIC STYLES
   Ensures seamless scaling across phones, tablets, laptops, and desktops.
============================================= */

.gallery-body {
    overflow-x: hidden;
}

/* --- Gallery Header & Filter Nav --- */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: transparent;
    position: relative;
    z-index: 50;
}

.hamburger-trigger {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1a2c33;
    cursor: pointer;
    transition: transform 0.2s;
}

.hamburger-trigger:hover {
    transform: scale(1.1);
}

.gallery-logo {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: #1a2c33;
    text-decoration: none;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 5%;
    position: relative;
    z-index: 50;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #555;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: #1a2c33;
}

.filter-btn.active {
    border: 1px solid #87572d;
    color: #87572d;
    font-weight: bold;
}

/* --- The Morphing Background Title --- */
.dynamic-center-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    font-size: 15vw;
    font-family: 'Georgia', serif;
    color: #87572d;
    opacity: 0.05;
    white-space: nowrap;
    z-index: -1;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s;
}

.dynamic-center-title.morphing {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

/* --- Tight Fit Masonry Gallery --- */
.masonry-container {
    column-count: 4;
    /* Default for Desktop/Laptop */
    column-gap: 8px;
    /* TIGHT FIT */
    padding: 0 5%;
    padding-bottom: 100px;
    position: relative;
    z-index: 10;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 8px;
    /* TIGHT FIT */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;

    /* Hover Transition Foundation */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s;

    /* Pop-in animation initial state */
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
}

/* Hover Floating Effect */
.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item.pop-in {
    opacity: 1;
    transform: translateY(0);
}

/* --- Side Hamburger Menu --- */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.side-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background: #fcfbf9;
    z-index: 1000;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.side-menu.open {
    right: 0;
}

.close-menu-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1a2c33;
    cursor: pointer;
}

.side-menu-logo {
    text-align: center;
    margin-bottom: 3rem;
    color: #1a2c33;
    border-bottom: 1px solid #eae2d2;
    padding-bottom: 1rem;
}

.side-menu-logo h2 {
    font-family: 'Georgia', serif;
    font-size: 2rem;
}

.side-menu-logo p {
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.side-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.side-nav-links a {
    text-decoration: none;
    color: #555;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.side-nav-links a:hover,
.side-nav-links a.active {
    color: #87572d;
    font-weight: bold;
}

.side-book-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    background: #1a2c33;
    color: #fff !important;
    text-align: center;
    border-radius: 4px;
}

/* --- Lightbox Overlay --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 44, 51, 0.95);
    /* Deep espresso/charcoal theme */
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* --- Device Compatibility (Tablet & Mobile) --- */
@media (max-width: 1000px) {
    .masonry-container {
        column-count: 3;
    }

    /* Tablet */
    .dynamic-center-title {
        font-size: 20vw;
    }
}

@media (max-width: 768px) {
    .masonry-container {
        column-count: 2;
        column-gap: 5px;
        padding: 0 5px;
    }

    /* Phones */
    .gallery-item {
        margin-bottom: 5px;
    }

    .dynamic-center-title {
        font-size: 25vw;
    }

    .lightbox-close {
        top: 1rem;
        right: 1.5rem;
        font-size: 2rem;
    }
}