/* ==========================================================================
   GALLERY PAGE STYLES
   ========================================================================== */
:root {
    --chocolate: #3B211E;
    --espresso: #241715;
    --blush: #F4C9CC;
    --dusty-rose: #D99A9F;
    --cream: #FFF8F2;
    --blush-light: #FDF1F1;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

body {
    background-color: var(--cream);
    font-family: var(--font-sans);
    color: var(--chocolate);
    overflow-x: hidden;
    margin: 0;
}

/* ==========================================================================
   OVERFLOW FIX
   ========================================================================== */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    position: relative;
}
section, .container, .container-fluid, .row {
    max-width: 100vw;
    overflow-x: hidden;
}
img {
    max-width: 100%;
    height: auto;
}

/* --- Intro Section --- */
.gallery-intro {
    padding: 8rem 1rem 3rem;
    background-color: var(--blush-light);
}
.intro-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    min-height: 100px;
    color: var(--chocolate);
    margin-bottom: 1rem;
}
.intro-title::after {
    content: '|';
    color: var(--dusty-rose);
    animation: blink 0.8s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* The new elegant Portfolio text */
.portfolio-subtitle {
    font-family: var(--font-sans);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    font-weight: 500;
    color: var(--dusty-rose);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards 2.5s; /* Fades in after the typewriter finishes */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GALLERY FILTER BUTTONS
   ========================================================================== */
.gallery-filter-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    background-color: var(--white);
    padding: 0.6rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--blush);
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--chocolate);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--blush-light);
}

.filter-btn.active {
    background-color: var(--chocolate);
    color: var(--cream);
}

@media (max-width: 575.98px) {
    .gallery-filter-wrapper {
        border-radius: 16px;
        flex-direction: column;
        width: 100%;
        padding: 1rem;
    }
    .filter-btn {
        width: 100%;
        border-radius: 8px;
        padding: 0.8rem;
        background-color: var(--blush-light);
    }
    .filter-btn.active {
        background-color: var(--chocolate);
    }
}

/* ==========================================================================
   PICTURE GRID
   ========================================================================== */
.photo-item {
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--blush);
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.img-wrapper:hover img {
    transform: scale(1.05);
}


/* ==========================================================================
   MOBILE SCROLL REVEAL ANIMATIONS
   ========================================================================== */
.reveal-row {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-row.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(36, 23, 21, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.lightbox-modal.active {
    display: flex;
}
.lightbox-content {
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
}
#lightboxImg {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}
#lightboxCaption {
    color: var(--blush);
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-top: 1rem;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--cream);
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}

/* ==========================================================================
   INSTAGRAM CTA SECTION
   ========================================================================== */
.instagram-cta {
    background-color: var(--white);
    border-top: 1px solid var(--blush);
}

.instagram-cta .btn-chocolate-outline {
    border: 1.5px solid var(--chocolate);
    color: var(--chocolate);
    transition: all 0.3s ease;
}

.instagram-cta .btn-chocolate-outline:hover {
    background-color: var(--chocolate);
    color: var(--cream);
    transform: translateY(-2px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.gallery-footer {
    background-color: var(--chocolate);
    color: var(--cream);
    padding: 2.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.footer-social-link {
    color: var(--blush);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.footer-social-link:hover {
    color: var(--white);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 575.98px) {
    .gallery-intro { padding: 5rem 1rem 3rem; }
    .intro-title { min-height: 90px; font-size: clamp(1.8rem, 7vw, 2.2rem); }
    .caption { font-size: 0.95rem; margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-row { transition: none !important; opacity: 1 !important; transform: none !important; }
    .intro-title::after { animation: none; content: ''; }
    .portfolio-subtitle { animation: none; opacity: 1; }
}
/* ==========================================================================
   ULTIMATE FIX: PREVENT HORIZONTAL SCROLLING SITE-WIDE
   ========================================================================== */

/* 1. Lock the body to the screen width */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
}

/* 2. Ensure all containers and rows wrap correctly and hide scrollbars */
.container, .container-fluid, .row, section {
    max-width: 100vw;
    flex-wrap: wrap !important;
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* 3. Hide the visual scrollbar on Chrome/Safari */
.container::-webkit-scrollbar, 
.container-fluid::-webkit-scrollbar, 
.row::-webkit-scrollbar, 
section::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 4. Ensure images never stretch the grid */
img {
    max-width: 100%;
    height: auto;
}