/* --- Global Resets & Typography --- */
body {
    font-family: 'Consolas', monospace; 
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.5;
}

h1, h2, h3 {
    text-transform: uppercase;
    font-weight: 400;
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #000;
    text-decoration: underline;
}

/* --- 1. Main Layout (Sidebar + Content) --- */
.portfolio-container {
    display: grid;
    grid-template-columns: 280px 1fr; 
    min-height: 100vh;
}

/* --- 2. Sidebar Styling --- */
.sidebar {
    padding: 40px;
    background-color: #fff;
    position: fixed; 
    width: 200px; 
    height: 100vh;
    overflow-y: auto;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 0px; 
    padding-bottom: 10px;
    line-height: 1.2; 
    display: block;
}

/* --- Navigation Styling --- */
.active-page {
    font-weight: bold !important;
    color: #000 !important;
    text-decoration: none !important; 
    border-bottom: none !important;
}

.active-page:hover {
    text-decoration: none !important;
    cursor: default;
}

.nav-section-title {
    display: block;
    margin-bottom: 5px;
    color: #333; 
    cursor: pointer; 
    text-decoration: none;
}

.nav-section-title:hover {
    text-decoration: underline; 
}

.nav-links-stack {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    margin-left: 0; 
}

.nav-links-stack li {
    margin-left: 0 !important; 
    margin-bottom: 5px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.nav-list li {
    margin-left: 15px; 
    margin-bottom: 5px;
}

.nav-list li a {
    color: #555;
    font-size: 0.95rem;
}

.nav-spacer {
    margin-top: 15px;
    margin-bottom: 15px;
}

.nav-separator {
    padding-top: 20px; 
    border-top: 1px solid #ddd; 
    margin-top: 30px; 
}

.private-link {
    display: block;
    margin-top: 10px;
}

/* --- 3. Content Areas --- */
.content-gallery {
    grid-column: 2 / 3;
    padding: 40px;
}

.content-text {
    grid-column: 2 / 3;
    padding: 60px 40px;
    max-width: 800px; 
}

.content-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #444;
}

/* --- 4. DEFAULT GRID (The "Row" Layout for Sketches) --- */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; 
    justify-content: flex-start;
    align-items: flex-start;
}

.grid-item {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    transition: outline 0.1s ease;
    outline: 1px solid transparent;
}

.grid-item img {
    height: 300px; /* FIXED HEIGHT for rows */
    width: auto;
    max-width: 100%;
    display: block;
}

.grid-item:hover {
    outline: 1px solid #999;
    z-index: 2;
}

/* --- 5. EMINENCE OVERRIDE (Full Width Stack) --- */
#eminence-container {
    display: grid; 
    grid-template-columns: 1fr !important; 
    gap: 40px; 
}

#eminence-container .grid-item {
    width: 100%;
    height: auto; 
    display: block;
}

#eminence-container .grid-item img {
    /* OVERRIDE the default 300px height */
    width: 100% !important; 
    height: auto !important; 
    max-width: 100%;
}

/* --- 6. Image Viewer Styles --- */
#image-viewer {
    display: none; 
    position: fixed;
    top: 0;
    left: 280px; 
    width: calc(100% - 280px); 
    height: 100%; 
    background-color: #fff; 
    z-index: 1000; 
    align-items: center;
    justify-content: center;
    cursor: pointer; 
    overflow: hidden !important; 
}

#viewer-content {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: 100%;
    display: flex; 
    align-items: center;
    justify-content: center;
}

#viewer-image {
    width: 100%; 
    height: 100%; 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    border: 1px solid #d3d3d3; 
    box-shadow: none; 
}

#viewer-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10001;
}

#viewer-close:hover { color: red; }

/* --- 7. SPA & Transitions --- */
main {
    grid-column: 2 / 3;
    width: 100%;
}

.content-gallery, .content-text {
    grid-column: auto !important; 
}

@view-transition {
    navigation: auto;
}

/* --- 8. MOBILE & TABLET RESPONSIVENESS --- */
@media (max-width: 900px) {
    .portfolio-container { display: block; }

    .sidebar {
        position: fixed; top: 0; left: 0; width: 100%; height: 60px; 
        padding: 0 20px; border-bottom: 1px solid #ddd; z-index: 10000;
        display: flex; align-items: center; justify-content: space-between; 
        box-sizing: border-box; overflow: visible !important; 
    }

    .nav-separator { display: none !important; }
    .logo { margin: 0; padding: 0; font-size: 1.1rem; line-height: 60px; }

    .mobile-menu-toggle {
        display: block !important; background: none; border: none; font-size: 1.5rem;
        cursor: pointer; padding: 0; color: #333; margin-left: auto; 
    }

    .navigation {
        display: none; position: absolute; top: 60px; left: 0; width: 100%;
        background: #fff; border-bottom: 1px solid #ddd; padding: 20px;
        box-sizing: border-box; box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        max-height: 80vh; overflow-y: auto;
    }
    .navigation.nav-open { display: block; }
    
    .content-gallery, .content-text {
        grid-column: auto; padding: 80px 20px 40px 20px; 
    }

    #view-private, #view-art-direction {
        padding-top: 60px; box-sizing: border-box; height: 100vh; 
    }

    #image-viewer {
        left: 0; width: 100%; top: 0; z-index: 20000; 
    }
    
    /* Mobile Spacing Fixes */
    .gallery-grid {
        gap: 5px !important; 
        justify-content: center; /* Center items on mobile */
    }
    
    /* On mobile, ensure eminence is still stacked but fits width */
    #eminence-container .grid-item img { width: 100%; height: auto; }
    
    /* On mobile, regular images fill width */
    .grid-item img { height: auto; width: 100%; }
    
    #viewer-close {
        top: 20px; right: 20px; font-size: 3rem; z-index: 20001 !important;
        color: black; background: rgba(255, 255, 255, 0.5);
        width: 50px; height: 50px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
    }
}
/* About Image */
.about-image {
    float: left; width: 300px; max-width: 45%; height: auto;
    margin-right: 30px; margin-bottom: 20px; border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
@media (max-width: 768px) {
    .about-image {
        float: none; display: block; margin: 0 auto 25px auto;
        width: 80%; max-width: 400px;
    }
}

/* Hide toggle on desktop */
.mobile-menu-toggle { display: none; }