/* JAMES GODBER - MASTER STYLESHEET */

/* 1. MASTER LAYOUT */
html, body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    display: flex; 
    flex-direction: row; /* Desktop side-by-side */
    overflow: hidden;
}

/* 2. SIDEBAR - THE "SPRING" LAYOUT */
.sidebar {
    width: 280px;
    height: 100vh;
    padding: 60px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* This pushes top and bottom groups apart */
    border-right: 1px solid #222;
    box-sizing: border-box;
    flex-shrink: 0; 
    background: #000;
    z-index: 100;
    position: fixed; /* Keeps sidebar locked on desktop */
}

.sidebar h1 {
    font-weight: 200;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 1.2rem;
    margin: 0 0 40px 0;
    cursor: pointer;
}

/* Nav Groups */
.main-nav, .secondary-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
    transition: 0.3s;
}

.main-nav a:hover, .active-link { opacity: 1; }

/* Secondary Links (Stories, About, Contact) */
.secondary-nav {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #222;
}

.secondary-nav a {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    text-decoration: none;
    transition: 0.3s;
}

.secondary-nav a:hover { color: #fff; }

/* Social Links - Subtle #555 Grey */
.social-links {
    margin: 20px 0;
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555; /* Very subtle */
    text-decoration: none;
    transition: 0.3s;
}

.social-links a:hover { color: #aaa; }

.descriptor {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* SIDEBAR CONTROLS */
.controls { display: flex; gap: 5px; margin-top: 20px; }
.controls button {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 15px;
    font-size: 9px;
    cursor: pointer;
}
.controls button:hover { border-color: #fff; }

/* 3. THE STAGE (Home Page Slideshow) */
.stage {
    position: fixed;     /* Locks it to the screen */
    top: 0;
    left: 280px;         /* Keeps space for your 280px sidebar */
    right: 0;
    bottom: 0;
    background-color: #000;
    display: flex;       /* Centers the image automatically */
    align-items: center; 
    justify-content: center;
    overflow: hidden;
    padding: 60px;       /* This is your black 'matted' border */
    box-sizing: border-box;
}

.slide {
    position: absolute;  
    max-width: 100%;     /* Image won't exceed the stage width */
    max-height: 100%;    /* Image won't exceed the stage height */
    width: auto;         /* Maintains original aspect ratio */
    height: auto;        /* Maintains original aspect ratio */
    object-fit: contain; /* Shows the whole photo, no cropping */
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    visibility: hidden;
    user-select: none;
    -webkit-user-drag: none;
}

.slide.active { 
    opacity: 1 !important; 
    visibility: visible;
    z-index: 5;
}

/* 4. GALLERY & GRID WRAPPER */
.grid-wrapper {
    flex: 1;
    margin-left: 280px; /* Offset for fixed sidebar */
    height: 100vh;
    overflow-y: auto; 
    padding: 40px;
    box-sizing: border-box;
    background-color: #000;
}

.photo-grid {
    column-count: 3; 
    column-gap: 20px;
    width: 100%;
}

.grid-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    position: relative;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.9;
    user-select: none;
    -webkit-user-drag: none;
}

.grid-item:hover img { transform: scale(1.05); opacity: 1; }

/* 5. LIGHTBOX (Gallery Popup) */
#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95); 
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

/* 6. CONTACT FORM & MAIN CONTENT */
main {
    flex: 1;
    margin-left: 280px;
    padding: 60px 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

form {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: -25px;
}

input, textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    padding: 10px 0;
    font-family: inherit;
    font-size: 15px;
    width: 100%;
}

input:focus, textarea:focus { outline: none; border-bottom-color: #fff; }

button[type="submit"] {
    width: fit-content;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 12px 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

button[type="submit"]:hover { background: #fff; color: #000; }

/* 7. MOBILE RECOVERY & ROTATION */
@media (max-width: 768px) {
    body { flex-direction: column; overflow-y: auto; }
    
    .sidebar { 
        position: relative; /* Unlocks from the side on mobile */
        width: 100%; 
        height: auto; 
        border-right: none; 
        border-bottom: 1px solid #222; 
        padding: 40px 20px;
        justify-content: center; /* Centers items on mobile */
        text-align: center;
    }
    
    .sidebar-top, .sidebar-bottom { width: 100%; }

    .main-nav, .secondary-nav, .social-links { 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 15px;
    }

    .secondary-nav { border-top: none; margin-top: 15px; }

    .stage, .grid-wrapper, main { 
        margin-left: 0; /* Removes the desktop sidebar offset */
        width: 100%;
    }

    .stage { height: 60vh; }
    
    .photo-grid {
        display: block !important;
        column-count: 2 !important; 
        column-gap: 10px;
    }

    .grid-item { margin-bottom: 10px; }
    .controls { justify-content: center; padding-bottom: 20px; }
}

/* THE CINEMA MODE (Rotation) */
@media screen and (orientation: landscape) and (max-device-width: 932px) {
    .stage { height: 100vh; }
    .slide { 
        max-height: 95% !important; 
        max-width: 95% !important; 
    }
    .sidebar { display: none !important; }
}
