/* ================================
   RESET & BASE
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "GFS Didot", serif;
    font-weight: 400;
    font-style: normal;
    background: #fff;
    line-height: 1.6;
}

/* ================================
   HEADINGS
================================ */
h1 {
    color: #c7a93a;
    font-family: "Italiana", sans-serif;
    font-weight: 400;
    font-size: 4.5rem;
    transition: color 0.3s ease;
}
h1:hover {
    color: #e98379;
}
a {
    text-decoration: none;
}

/* ================================
   NAVIGATION
================================ */
header {
    background: #fff;
    color: #8e7d2b;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}
nav a {
    text-decoration: none;
    color: #8e7d2b;
    font-family: "Italiana", sans-serif;
    font-size: 1rem;
}
nav a:hover {
    color: #e98379;
}

/* Dropdown */
.dropdown {
    position: relative;
}
.dropdown-content {
    display: none;
    position: absolute;
    background: #f4f2f2;
    opacity: 0.9;
    top: 100%;
    left: 0;
    min-width: 150px;
}
.dropdown-content a {
    display: block;
    padding: 0.5rem 1rem;
    color: #8e7d2b;
}
.dropdown:hover .dropdown-content {
    display: block;
}

/* ================================
   HAMBURGER MENU
================================ */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: auto;
    width: 25px;
    height: 20px;
    justify-content: space-between;
}
.hamburger span {
    background: #8e7d2b;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    transition: all 0.35s ease;
}
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        padding: 0 1rem;
    }
    nav ul.show {
        max-height: 1000px;
    }
    .hamburger {
        display: flex;
    }
}

/* ================================
   NEW MASONRY GALLERY (Fixes Stacking)
=============================== */
.gallery {
    column-count: 4;
    column-gap: 10px;
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
}

.gallery img {
    width: 100%;
    display: inline-block;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.gallery img.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive columns */
@media (max-width: 1200px) {
    .gallery {
        column-count: 3;
    }
}
@media (max-width: 800px) {
    .gallery {
        column-count: 2;
    }
}
@media (max-width: 500px) {
    .gallery {
        column-count: 1;
    }
}

/* ================================
   LIGHTBOX STYLES (Fixed)
================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lb-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    pointer-events: none; /* Allows clicks to pass through to the background */
}

.lb-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: auto; /* Re-enable clicks on image itself if needed */
}

/* Buttons */
.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 2100;
    transition: color 0.2s;
}

.lb-close {
    top: 20px;
    right: 20px;
    font-size: 2rem;
}
.lb-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.lb-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
    color: #e98379;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .lb-prev,
    .lb-next {
        font-size: 2rem;
    }
    .lb-close {
        top: 10px;
        right: 10px;
    }
}

/* ================================
   FOOTER
================================ */
footer {
    font-family: "Italiana", sans-serif;
    text-align: center;
    padding: 2rem;
    color: #c7a93a;
}

/* ================================
   FIXED LIGHTBOX BUTTONS
================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999; /* Ensure it is above EVERYTHING */
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lb-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: 90%;
}

.lb-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.3s;
}

.lb-btn:hover {
    background: #e98379; /* Matching your theme color */
}

.lb-close {
    top: -20px;
    right: -20px;
}

.lb-prev {
    left: 20px;
}

.lb-next {
    right: 20px;
}

/* Adjust for mobile so buttons don't overlap the image */
@media (max-width: 768px) {
    .lb-close {
        top: 10px;
        right: 10px;
    }
    .lb-prev {
        left: 10px;
    }
    .lb-next {
        right: 10px;
    }
}

.lb-prev,
.lb-next {
    font-family: "Italiana", serif;
}

/* Fix the Console Error and Swipe interference */
.lightbox {
    /* ... existing styles ... */
    touch-action: none !important;
    pointer-events: auto;
}

/* Remove aria-hidden logic from CSS if you had it,
   the JS will handle visibility */

#lb-img {
    /* Critical: This prevents Safari from trying to 'pick up'
       the image to save it, which kills the swipe gesture */
    pointer-events: none !important;
    -webkit-user-drag: none !important;
    user-select: none !important;
}

/* Make sure the buttons don't block the swipe area */
.lb-prev,
.lb-next {
    z-index: 2010;
}
