body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4; /* A light grey background for consistency */
    margin: 0;
    padding: 0;
}

.navbar {
    background-color: #333;
    padding: 10px 0;
    margin-bottom: 20px;
}

.navbar a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    display: inline-block;
}

.navbar a:hover {
    background-color: #575757;
}

h1 {
    margin-top: 30px;
    color: #333;
}



/* ... (Keep all your existing CSS rules for body, navbar, image-detail-container, overlay-nav-arrow, etc.) ... */
.gallery {
    padding: 20px;
    max-width: 1200px; /* Limit max width of the gallery */
    margin: 0 auto; /* Center the gallery */
}

.gallery a { /* Individual card */
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 8px;
    box-sizing: border-box;
    transition: transform 0.2s ease-in-out;
    margin-bottom: 20px; /* Space between cards */
    width: calc(33.33% - 40px); /* Default to ~3 columns, adjusted for padding/gaps */
    display: flex; /* Keep flex for internal card content */
    flex-direction: column;
    align-items: center; /* Center image and text */
    text-align: center;
}

.gallery a:hover {
    transform: translateY(-5px);
}

.gallery img {
    width: 100%; /* Image fills the card */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below image */
    margin-bottom: 10px; /* Space between image and text */
    border-radius: 5px;
    max-height: none;
    object-fit: contain; /* Keep for varying aspect ratios */
}

.gallery a p {
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.3;
}

.gallery a.bigger-card {
    width: calc(50% - 40px); /* Bigger cards take more space */
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gallery a {
        width: calc(50% - 30px); /* Two cards per row */
    }
    .gallery a.bigger-card {
        width: calc(50% - 30px); /* Same as regular for simplicity */
    }
    .gallery {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .gallery a, .gallery a.bigger-card {
        width: calc(100% - 20px); /* One card per row */
    }
    .gallery {
        padding: 10px;
    }
}


/* ... (Keep all remaining image-detail-container styles and media queries) ... */


.image-detail-container {
    position: relative;
    overflow: hidden;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-detail-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.image-detail-container p {
    color: #666;
    line-height: 1.6;
}

.image-detail-container p.artwork-details {
    font-size: 0.9em;
    font-style: italic;
}

.image-detail-container h2 {
    color: #333;
    margin-bottom: 10px;
}

.image-detail-container p {
    color: #666;
    line-height: 1.6;
}








/* ... (Keep all other overlay-nav-arrow, category-nav, etc. styles) ... */


/* Responsive adjustments for image detail page */

/* Add a media query for medium-to-large screens to manage the container width */
@media (max-width: 1200px) { /* When screen is 1200px or less */
    .image-detail-container {
        max-width: 90%; /* Let it take 90% of screen width, but keep padding */
        margin: 30px auto;
        padding: 15px;
    }
}

@media (max-width: 768px) { /* Your existing tablet/smaller laptop breakpoint */
    .gallery a, .gallery a.bigger-card {
        width: calc(50% - 30px);
        min-width: 250px;
    }
    .image-detail-container {
        max-width: 95%; /* Make it take more width on smaller screens */
        margin: 20px auto;
        padding: 15px;
    }
}

@media (max-width: 500px) { /* Your existing mobile breakpoint */
    .gallery a, .gallery a.bigger-card {
        width: calc(100% - 30px);
    }
    .image-detail-container {
        margin: 15px auto;
        padding: 10px;
    }
}


/* ... existing styles ... */

.image-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column; /* Stack category navs vertically */
    gap: 15px; /* Space between different category navigation blocks */
    align-items: center; /* Center category blocks */
}

.category-nav {
    display: flex;
    align-items: center;
    justify-content: center; /* Center links within each category row */
    flex-wrap: wrap; /* Allow links to wrap on small screens */
    gap: 15px; /* Space between nav links */
    background-color: #f9f9f9;
    padding: 10px 20px;
    border-radius: 5px;
    width: 100%; /* Take full width of parent container */
    max-width: 600px; /* Limit width for readability */
    box-sizing: border-box;
}

.category-nav span {
    color: #555;
    font-weight: bold;
}

.nav-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: #0056b3;
}

.nav-link.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-link.back-to-gallery {
    background-color: #6c757d;
}

.nav-link.back-to-gallery:hover {
    background-color: #5a6268;
}

/* Responsive adjustments for navigation */
@media (max-width: 600px) {
    .category-nav {
        flex-direction: column; /* Stack buttons vertically on small screens */
        gap: 10px;
    }
}

/* ... (Keep all existing CSS rules for body, navbar, gallery, image-detail-container, etc.) ... */

/* New styles for the overlay navigation arrows on image detail page */



.image-detail-container {
    position: relative;
    overflow: hidden;
    /* CHANGE THIS LINE: Increase max-width to allow wider landscape images */
    max-width: 1200px; /* Or 1200px if you want them to display at full 1200px when possible */
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-detail-container img {
    max-width: 100%; /* This is good; image will fill 100% of the container's width */
    height: auto;
    border-radius: 8px;
    margin-bottom: 0; /* Ensures no extra space below image */
    display: block;
    margin-left: auto; /* Explicitly center the image within its container if it's smaller than max-width */
    margin-right: auto;
}


.overlay-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3em; /* Make arrows larger */
    color: rgba(255, 255, 255, 0.7); /* White, slightly transparent */
    background-color: rgba(0, 0, 0, 0.3); /* Dark, transparent background */
    padding: 10px 15px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    user-select: none; /* Prevent text selection */
    border-radius: 5px;
    line-height: 1; /* Center vertically */
    z-index: 10; /* Ensure arrows are above the image */
    display: none; /* Hidden by default */
}

.overlay-nav-arrow.left-arrow {
    left: 10px;
}

.overlay-nav-arrow.right-arrow {
    right: 10px;
}

.overlay-nav-arrow:hover {
    background-color: rgba(0, 0, 0, 0.6); /* Darker on hover */
    color: white;
}

/* Show arrows only when hovering over the image detail container */
.image-detail-container:hover .overlay-nav-arrow {
    display: block;
}

/* Style for disabled arrows */
.overlay-nav-arrow.disabled {
    cursor: default;
    background-color: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

.overlay-nav-arrow.disabled:hover {
    background-color: rgba(0, 0, 0, 0.1); /* No change on hover if disabled */
    color: rgba(255, 255, 255, 0.3);
}

/* Hide the old text-based navigation below the image, as it's replaced by overlay */
.image-navigation {
    display: none;
}

/* Ensure the image doesn't have a bottom margin pushing other elements, as arrows are overlay */
.image-detail-container img {
    margin-bottom: 0;
}