/* Global Reset & Typography */
html {
    scroll-behavior: smooth;
}

/* Modern Minimalist Scrollbar - Dynamic Gradient Style */
:root {
    --scrollbar-thumb-color: hsl(190, 30%, 75%);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-color);
    border: 2px solid transparent; /* Space for the 'outline' look */
    border-radius: 10px;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    filter: brightness(0.8);
}

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) rgba(0, 0, 0, 0.02);
}

img, video {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #fafafa;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Default: Only the main content fades in, keeping sidebar anchored */
main {
    animation: pageLoad 0.6s ease-out;
}

/* Special case: When coming from splash, the whole container fades in */
html.from-splash .container:not(.fade-in-from-splash) {
    opacity: 0; /* Hide immediately before JS runs */
}

.container.fade-in-from-splash {
    animation: pageLoad 1.2s ease-out forwards;
}

/* Prevent double animation if container is already fading in */
.container.fade-in-from-splash main {
    animation: none;
}

/* Desktop Layout */
@media (min-width: 900px) {
    .container {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 60px;
    }

    .sidebar {
        width: 250px;
        flex-shrink: 0;
        position: sticky;
        top: 40px;
        text-align: left;
    }

    main {
        flex-grow: 1;
        max-width: 800px;
        margin-top: 0;
        text-align: left;
    }
}

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 1001;
    line-height: 1;
    color: #000;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Layout */
@media (max-width: 899px) {
    .sidebar {
        margin-bottom: 0; /* Reduced from 40px to match menu gap */
        text-align: left;
        position: relative;
    }
    
    .container {
        padding: 20px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar nav,
    .sidebar .copyright {
        display: none;
    }

    .sidebar.menu-open nav,
    .sidebar.menu-open .copyright {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    /* Full Screen Overlay Menu */
    .sidebar.menu-open nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(250, 250, 250, 0.9); /* Semi-transparent #fafafa */
        backdrop-filter: blur(10px); /* Frosted glass effect */
        -webkit-backdrop-filter: blur(10px); /* Safari support */
        z-index: 1000; /* Below toggle button (1001) */
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Start from top */
        align-items: flex-start; /* Left align */
        padding-top: 60px; /* Space below the header/name */
        padding-left: 20px; /* Align with page content */
        margin: 0;
        border: none;
        box-sizing: border-box;
    }

    /* Ensure header stays above overlay */
    .sidebar header {
        position: relative;
        z-index: 1001;
    }

    .sidebar.menu-open nav ul {
        text-align: left;
        width: 100%;
    }

    .sidebar.menu-open nav ul li {
        margin-bottom: 20px; /* Slightly tighter vertical spacing */
    }

    .sidebar.menu-open nav ul li a {
        font-size: 14px; /* Reduced from 18px */
        letter-spacing: 2px; /* Match header spacing */
        color: #333;
        display: block; /* Ensure full width for easier tapping */
        line-height: 1.4; /* Handle wrapping gracefully */
    }

    .sidebar.menu-open nav ul li a.active {
        color: #000;
        font-weight: bold;
    }

    /* Hide submenus in overlay to keep it clean */
    .sidebar.menu-open .sub-menu {
        display: none; 
    }

    .sidebar.menu-open .copyright {
        position: fixed;
        bottom: 30px;
        left: 20px; /* Left align copyright too */
        width: auto;
        text-align: left;
        z-index: 1002;
        margin: 0;
    }
}

/* Typography Details */
header h1 {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    display: inline-block;
    position: relative;
}

header h1 a {
    text-decoration: none;
    color: #000;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    margin-bottom: 10px;
}

nav ul li a {
    text-decoration: none;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.2s;
    display: block; /* Ensures consistent box model */
    line-height: 1.5; /* Explicit line-height for all links */
    min-height: 21px; /* Matches the calculated height of the toggle */
}

nav ul li a:hover {
    color: #000;
}

nav ul li a.active {
    color: #000;
    font-weight: 500;
}

/* Toggle Indicator */
.nav-toggle {
    position: relative;
    display: block;
    line-height: 1.5;
    padding-right: 20px; /* Space for the icon */
    min-height: 21px; /* Explicitly match the base link height */
}

.nav-toggle::after {
    content: '−'; /* Unicode minus for open state */
    position: absolute;
    right: 0;
    top: 0;
    font-weight: normal;
    font-size: 14px;
    line-height: 1.5; /* Match the parent line-height exactly */
}

.nav-toggle.menu-closed::after {
    content: '+'; /* Plus for closed state */
}

/* Sidebar Sub-Menu */
.sub-menu {
    margin-top: 8px;
    margin-left: 4px;
    padding-left: 0;
    list-style: none;
    display: block;
    border-left: 1px solid #eee; /* The "track" */
    position: relative;
    overflow: visible;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.sub-menu::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: var(--scroll-progress, 0%);
    background-color: var(--scrollbar-thumb-color);
    transition: height 0.1s ease, background-color 0.2s;
    z-index: 10;
    margin-left: -1px;
}

.sub-menu.collapsed {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out; /* Removed margin-top transition to prevent jitter */
}

.sub-menu li {
    margin-bottom: 5px;
}

.sub-menu li a {
    font-size: 10px;
    color: #999;
    text-transform: none; /* Keep it simple */
    letter-spacing: 0.5px;
    font-weight: normal;
    display: block;
    padding-left: 12px; /* Indent */
    border-left: 1px solid transparent;
    margin-left: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.sub-menu li a:hover {
    color: #000;
}

.sub-menu li a.active {
    color: #000;
    font-weight: 500;
}

.project-section {
    scroll-margin-top: 40px; /* Reduced since sticky nav is gone */
    margin-bottom: 30px;
}

/* Content Styling */
h2 {
    font-size: 18px;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: left;
}

.section-content {
    max-width: 100%;
    text-align: left;
    margin-bottom: 30px;
}

.section-content p {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* Compact spacing for exhibitions and credits sections */
#exhibitions .section-content p,
#credits .section-content p {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.4;
}

/* Project Metadata Block */
.project-meta {
    margin-bottom: 20px; /* Reverted back to 20px as requested */
    margin-top: 0;
}

/* Add space before a new section header */
.project-section + .project-section .project-meta,
.content-text + .project-meta,
.project-image + .project-meta,
.project-video + .project-meta,
.media-grid + .project-meta {
    margin-top: 50px;
}

.project-meta h2 {
    margin-bottom: 10px;
    font-weight: bold; /* Make title stand out */
}

.project-year {
    font-weight: normal;
    color: #bbb;
    margin-left: 10px;
    font-size: 14px;
}

/* Compact spacing for lists (Exhibitions, Press, Credits, Acknowledgements) */
#credits .content-text p,
#press .content-text p,
#project-credits .content-text p,
#acknowledgements .content-text p,
.project-meta .meta-details p {
    margin-bottom: 5px;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.meta-details a {
    color: #666;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s;
}

.meta-details a:hover {
    color: #000;
}

.subtitle {
    color: #666;
    font-size: 13px;
    margin-bottom: 40px;
    font-style: normal;
    text-align: left;
    line-height: 1.35;
}

.project-image, .profile-image {
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
}

.image-caption {
    font-size: 11px;
    color: #666;
    margin-top: -30px !important;
    margin-bottom: 35px;
    line-height: 1.5;
    font-style: normal;
    letter-spacing: 0.2px;
    background-color: #f2f2f2;
    padding: 8px 12px;
    display: block; /* Full width of the container */
    border-left: 2px solid #ddd;
    position: relative;
    box-sizing: border-box;
}

.credits {
    font-size: 11px;
    color: #666;
    margin-top: 20px;
    margin-bottom: 10px;
    line-height: 1.5;
    font-style: italic;
}

.vertical-image + .image-caption {
    max-width: 50%;
}

.profile-image + .image-caption {
    max-width: 400px;
}

.vertical-image {
    max-width: 50%;
}

.profile-image {
    max-width: 400px;
}

.content-text {
    max-width: 100%;
    text-align: left;
    margin-bottom: 30px;
}

.content-text p {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.content-text p:last-child {
    margin-bottom: 0;
}

.contact-info {
    margin-top: 50px;
    font-weight: normal;
    text-align: left;
    font-size: 13px;
}

/* Landing Page Video */
.landing-content {
    max-width: 100%; /* Allow video to take available space */
}

.hero-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Case Study Layout */
.project-video {
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
}

/* Media Grid for Side-by-Side Images/Videos */
.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.media-grid .project-image,
.media-grid .project-video {
    margin-bottom: 0;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

/* Logo Grid for Laurels/Partners */
.logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center; /* Center align for laurels */
    align-items: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

.logo-item {
    max-height: 80px; /* Limit height so they don't dominate */
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: grayscale(100%); /* Optional: makes them look uniform */
    opacity: 0.8;
    transition: all 0.3s ease;
}

.logo-item:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Project Link Button */
.project-link-container {
    margin-bottom: 40px;
}

.project-link {
    display: inline-block;
    padding: 0 0 4px 0;
    background-color: transparent;
    color: #888;
    border: none;
    border-bottom: 1px solid #ccc;
    text-decoration: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: transparent;
    color: #000;
    border-bottom-color: #000;
}
.copyright {
    margin-top: 40px;
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Ensure it sits at the bottom of the sidebar if needed, or just below nav */
}

@media (max-width: 899px) {
    .copyright {
        margin-top: 20px;
        margin-bottom: 20px;
    }
}

/* Lightbox Styles */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

#lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#lightbox-overlay.active #lightbox-image {
    transform: scale(1);
}

#lightbox-caption {
    color: #ccc;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.5px;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 100;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    z-index: 10002;
}

#lightbox-close:hover {
    color: #ccc;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: 100;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: color 0.3s ease;
    z-index: 10001;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    color: #ccc;
}

#lightbox-prev {
    left: 20px;
}

#lightbox-next {
    right: 20px;
}

@media (max-width: 600px) {
    #lightbox-prev,
    #lightbox-next {
        font-size: 30px;
        padding: 10px;
    }
    #lightbox-prev { left: 10px; }
    #lightbox-next { right: 10px; }
}

