body {
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    color: #333;
    background: #fff;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    justify-content: center; /* Center content */
    align-items: center; /* Center vertically too */
    height: 100vh;
    position: relative;
    /* Calculate the true center by accounting for header width + padding */
    /* Header is 300px width + 50px left padding + 50px right padding = 400px total */
    margin-left: -200px; /* Half of header total width to center on screen */
    width: calc(100% + 400px); /* Expand to account for header total width */
}

header {
    width: 300px;
    min-height: 100vh;
    padding: 30px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 10; /* Ensure header stays above content */
    position: relative; /* Ensure z-index works */
}

header h1 {
    font-size: 30px;
    margin-left: 10px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

footer {
    width: 100%;
    text-align: center;
    padding: 30px 0 1px;
    font-size: 12px;
    color: #aaa;
    position: fixed;
    bottom: 0;
    left: 0;
    background: #fff;
}

nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 10px;
}

nav a,
#years-container a {
    display: block;
    font-size: 24px;
    text-decoration: none;
    color: #555;
    margin-left: 0;
    margin-top: 0;
}

#years-container {
    display: flex;
    flex-direction: column;
}

.hamburger {
    display: none;
}

#content-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 90%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: auto;
    z-index: 5;
}

#nav-menu a {
    margin: 0px;
    font-size: 22px;
    line-height: 1.5;
}

/* Default Gallery Styles - Single Artwork Display */
.gallery-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 70px 0 60px;
    position: relative;
}

.artwork-item {
    display: none; /* Hide all artworks by default */
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.artwork-item.active {
    display: block; /* Show only the active artwork */
}

.artwork-item img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

/* Side nav prev/next labels */
.gallery-side-nav {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding-right: 4px;
    position: relative;
    z-index: 30;
}

.gallery-side-nav span {
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    letter-spacing: 0.5px;
    font-family: 'Georgia', serif;
}

.gallery-side-nav span:hover {
    color: #333;
}

/* Thumbnail strip */
.gallery-thumbnails {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 50px;
    padding-bottom: 4px;
    max-width: 800px;
    scrollbar-width: none;
    position: relative;
    z-index: 25;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.gallery-thumbnails .thumb {
    width: 52px;
    height: 40px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.gallery-thumbnails .thumb:hover {
    opacity: 0.7;
}

.gallery-thumbnails .thumb.active {
    opacity: 1;
    outline-offset: 1px;
}

/* Navigation arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.95);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

/* Gallery counter */
.gallery-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.artwork-item img {
    width: 100%;
    height: auto;
}


/* Mobile Styles */
@media (max-width: 1300px), (max-device-width: 1300px) {
    body {
        flex-direction: column; /* Change to column for mobile */
    }
    
    main {
        margin-left: 0; /* Reset the margin on mobile */
        width: 100%; /* Reset the width on mobile */
        height: auto;
    }
    
    #content-box {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        max-width: 100%;
        padding: 10px;
        margin-top: 70px; /* Add space below the header */
    }
    
    header {
        width: 100%;
        min-height: auto;
        position: fixed; /* Make header fixed */
        top: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: center; /* Center the title */
        padding: 15px 20px;
        background: #fff;
    }

    header h1 {
        margin: 0;
        font-size: 24px;
        line-height: 1;
        text-align: center;
    }

    .hamburger {
        display: block;
        font-size: 24px;
        cursor: pointer;
        position: absolute;
        right: 20px;
        top: 50%; /* Center vertically */
        transform: translateY(-50%); /* Ensure perfect vertical centering */
        line-height: 1;
    }

    #nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        width: 100%;
        flex-direction: column;
        padding: 10px 0;
        z-index: 100;
    }

    #nav-menu.show {
        display: flex;
    }
    
    #nav-menu a,
    #years-container a {
        font-size: 18px;
        padding: 8px 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    #years-container {
        width: 100%;
    }

    /* Mobile Gallery - Vertical scrollable gallery */
    .gallery-container {
        display: flex;
        flex-direction: column;
        gap: 40px;
        padding: 20px 0;
        position: static;
    }

    .artwork-item {
        display: block !important; /* Show all artworks on mobile */
        max-width: 100%;
        padding: 0 10px;
    }

    .artwork-item.active {
        display: block; /* Override the active class for mobile */
    }

    .artwork-item img {
        max-height: none; /* Allow full height on mobile */
        width: 100%;
        height: auto;
    }

    /* Hide navigation arrows on mobile */
    .gallery-nav {
        display: none;
    }

    .gallery-side-nav {
        display: none;
    }

    .gallery-thumbnails {
        display: none;
    }

    /* Hide gallery counter on mobile */
    .gallery-counter {
        display: none;
    }
}