/* ... existing styles ... */

:root {
    --primary-bg: #000000;
    --secondary-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent: #ffffff;
    --font-serif: 'Cormorant Garamond', serif;
    --font-heading: 'Italiana', serif;
    --font-sans: 'Montserrat', sans-serif;
    --header-height: 55px;
    --footer-height: 35px;
    --gap-size: 6px;
}

/* ... existing body styles ... */

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

/* Header & Footer (Overlays) */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: var(--text-primary);
}

/* Typography */
.brand-link {
    text-decoration: none;
}

.brand-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    line-height: 1;
}

.brand-subtitle {
    font-family: var(--font-sans);
    font-weight: 300;
    font-style: normal;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-block;
    margin-left: 4px;
    vertical-align: baseline;
    opacity: 1;
    color: #ffffff;
}

.nav-link {
    font-family: var(--font-sans);
    font-style: normal;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #cccccc !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffffff !important;
    opacity: 1;
}

/* Horizontal Scroll Layout */
/* Horizontal Scroll Layout Refactored for Rows */
.horizontal-scroll-container {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    height: 100vh;
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    /* Centers valid content if empty, but mostly checks overflow */
    align-items: flex-start;
}


.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

.horizontal-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    align-items: center;
    gap: var(--gap-size);
    padding: 0 4vw;
    /* Add some horizontal padding */
}

.rows-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: max-content;
    /* Grows with content */
    padding-left: 20px;
    padding-right: 20px;
    gap: var(--gap-size);
}

.gallery-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1;
    /* Distribute height equally */
    gap: var(--gap-size);
    height: 32%;
    /* Fallback */
}

.gallery-cell {
    height: 100%;
    width: auto;
    /* Let image define width */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.gallery-cell img {
    height: 100%;
    width: auto;
    /* Maintain aspect ratio */
    object-fit: contain;
    /* Ensure full image is seen, though height constraint should make it fill exactly */
    display: block;
    transition: transform 1s ease;
}

.gallery-cell:hover img {
    transform: scale(1.03);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.gallery-cell:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    color: #fff;
    font-family: var(--font-sans);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.overlay-name {
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.overlay-location {
    font-size: 0.9rem;
    font-weight: 400;
    color: #e0e0e0;
    font-family: var(--font-serif);
    font-style: italic;
    margin-bottom: 4px;
}

.overlay-desc {
    font-size: 0.8rem;
    font-weight: 300;
    color: #ccc;
    line-height: 1.2;
    margin-top: 4px;
    max-width: 250px;
    /* Optional constraint but allows wrapping */
    margin-left: auto;
    /* Push to right */
}

/* --- DETAILS FILMSTRIP STYLES --- */
.details-filmstrip-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    /* scroll-behavior: smooth; REMOVED for clean snapping */
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
}

.details-filmstrip-container::-webkit-scrollbar {
    display: none;
}

.details-slide {
    height: 100%;
    /* Full height */
    /* Max width to view neighbors? */
    /* Or auto width based on image ratio */
    flex: 0 0 auto;
    padding: 0;
    /* Tiny gap between slides */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    /* Fade out neighbors */
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: scale(0.99);
    will-change: opacity, transform;
    position: relative;
    /* For caption positioning */
    scroll-snap-align: center;
}

/* ... existing styles for .details-slide.active and .details-img ... */

.details-caption {
    position: absolute;
    top: calc(var(--header-height) + 20px);
    /* Top aligned below header */
    right: 40px;
    /* Right aligned */
    left: auto;
    bottom: auto;

    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    text-align: right;
    /* Explicit Right Align */

    max-width: 60vw;
    background: transparent;
    padding: 15px;
    border-radius: 4px;

    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.details-slide.active .details-caption {
    opacity: 1;
    /* Show when active */
    pointer-events: auto;
}

.details-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    /* Slightly larger in details */
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.details-location {
    font-family: var(--font-serif);
    font-style: italic;
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.details-desc {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ddd;
    margin-left: auto;
    /* Push text blocks right if they wrap oddly */
}

.details-slide.active {
    opacity: 1;
    transform: scale(1);
}

.details-img {
    height: 100%;
    /* Cover full height */
    width: auto;
    /* Maintain aspect ratio */
    max-height: 100vh;
    object-fit: contain;
    /* Or cover? Ref image looks like cover/fill but contained vertically */
    /* If we want full bleed height */
    display: block;
}

/* Footer Controls */
/* Footer Controls */
.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.control-btn.home-btn {
    width: auto;
    padding: 0 14px;
    border-radius: 20px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #fff;
    opacity: 1;
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-icon svg {
    display: block;
}

.btn-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding-top: 1px;
    /* Optical alignment */
}

.nav-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 8px;
}

.control-btn.disabled {
    opacity: 0.2;
    pointer-events: none;
    border-color: transparent;
    background: transparent;
}

/* Social Buttons */
.social-btn {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
}

.social-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.cinematic-input {
    background-color: transparent !important;
    border: none;
    border-bottom: 1px solid #444;
    border-radius: 0;
    color: #fff !important;
    padding-left: 0;
    padding-right: 0;
}

.cinematic-input:focus {
    background-color: transparent !important;
    border-color: #fff;
    box-shadow: none;
    color: #fff !important;
}


/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

    /* 1. Global & Header/Footer Adjustments */
    :root {
        --header-height: 50px;
        --footer-height: 45px;
    }

    .site-header {
        padding: 0 10px;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .brand-subtitle {
        font-size: 1.1rem;
    }

    /* Footer: Stack or Tighten */
    .site-footer {
        padding: 0 10px;
        justify-content: center;
    }

    .site-footer .d-flex {
        /* On very smal screens, we might need to hide social or stack?
           For now, flex with gap adjustment */
        gap: 10px !important;
    }

    .footer-controls {
        gap: 8px !important;
    }

    .btn-label {
        display: none;
        /* Hide GALLERY text on mobile to save space */
    }

    /* 2. Home Page: Vertical Experience */
    .horizontal-scroll-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding-top: calc(var(--header-height) + 10px);
        padding-bottom: 80px;
        /* Space for footer */
        align-items: center;
    }

    .horizontal-grid {
        display: none;
        /* Hide if used differently, but here we use rows-wrapper */
    }

    .rows-wrapper {
        width: 100%;
        height: auto;
        padding: 0 10px;
        gap: 15px;
    }

    /* Unset the row flex behavior to allow stacking if desired, 
       OR keep rows but make them tall enough to be seen individually */
    .gallery-row {
        flex-direction: column;
        flex: none;
        height: auto;
        /* Vertical stack */
        margin-bottom: 0;
        /* Gap handlded by cell */

        /* Ensure scrolling within row if many items */
        overflow: visible;
        padding-bottom: 0;
    }

    .gallery-row::-webkit-scrollbar {
        display: none;
    }

    .gallery-cell {
        width: 100%;
        height: auto;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .gallery-cell img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* 3. Details Page: Portrait Optimization */
    .details-filmstrip-container {
        /* Maintain horizontal snap */
        height: 100vh;
        /* Ensure we account for mobile browser UI */
        height: 100dvh;
    }

    .details-slide {
        width: 100vw;
        position: relative;
    }

    .details-img {
        /* Allow image to fit width, height auto */
        width: 100%;
        height: auto;
        max-height: 70vh;
        /* Leave room for caption at bottom */
        object-fit: contain;
        transform: translateY(-10%);
        /* Shift up slightly */
    }

    .details-caption {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
        padding: 40px 20px 60px 20px;
        /* Extra padding bottom for footer/safe area */
        text-align: center;
        transform: translateY(0);
        opacity: 1;
        /* Always visible or use fade */
        pointer-events: auto;

        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .details-title {
        font-size: 1.5rem;
        margin-bottom: 2px;
    }

    .details-location {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .details-desc {
        margin: 0 auto;
        font-size: 0.85rem;
        max-width: 90%;
        line-height: 1.4;
    }
}

/* Glassmorphism Dropdown */
.dropdown-menu {
    background: rgba(0, 0, 0, 0.65) !important;
    /* Semi-transparent black */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInDropdown 0.3s ease forwards;
    margin-top: 10px;
    /* Spacing from nav item */
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0.02em;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    /* Lighter glass for hover */
    color: #fff !important;
    transform: translateX(4px);
    backdrop-filter: blur(5px);
    /* Nested glass effect */
}

.dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}