/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa; /* Light gray background */
    color: #343a40; /* Dark gray text */
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #343a40; /* Dark header background */
    color: #ffffff; /* White text */
    padding: 1em 1.5em;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 2em; /* Larger heading */
    font-weight: 300; /* Lighter font weight */
}

#category-nav {
    margin-top: 0.75em;
    word-wrap: break-word; /* Allow long category lists to wrap */
}

#category-nav a {
    margin: 0 0.5em 0.3em; /* Added bottom margin for wrapped links */
    text-decoration: none;
    color: #adb5bd; /* Lighter link color */
    font-size: 0.9em;
    transition: color 0.2s ease-in-out;
    display: inline-block; /* For better spacing of wrapped links */
}

#category-nav a:hover,
#category-nav a:focus {
    color: #ffffff; /* White hover/focus color */
    text-decoration: underline;
}

/* Main Content Area */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5em;
    width: 100%;
    box-sizing: border-box;
}

/* Slide Container Styles */
.slide-container {
    width: 90%; 
    max-width: 1000px; 
    height: 75vh; 
    margin-bottom: 1.5em;
    border: 1px solid #dee2e6; 
    border-radius: 8px; 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.075); 
    background-color: #ffffff; 
    overflow: hidden; 
    padding: 1em; 
    box-sizing: border-box;
    position: relative; /* Crucial: Establishes positioning context for the arrows */
}

/* Wrapper for the image and its info text */
.slide-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;   
    width: 100%;           
    height: 100%;          
}

#current-slide-image {
    display: block; 
    width: auto;    
    height: auto;   
    max-width: 100%;  
    /* If the <p id="current-slide-info"> tag IS in your HTML (as it is in the HTML above): */
    max-height: calc(100% - 22px - 0.75em); /* Accounts for info text space */
    /* If you COMPLETELY DELETED <p id="current-slide-info"> from HTML, use this instead: */
    /* max-height: 100%; */

    object-fit: scale-down; /* Scales large images down, shows small images at natural size */
    border-radius: 4px; 
}

/* Styles for slide arrows on the image */
.slide-arrow {
    position: absolute; 
    top: 50%;
    transform: translateY(-50%); 
    background-color: rgba(0, 0, 0, 0.25);
    color: white;
    border: none;
    font-size: 28px; 
    padding: 0; 
    width: 44px;  
    height: 44px; 
    line-height: 44px; 
    text-align: center; 
    cursor: pointer;
    border-radius: 50%; 
    z-index: 100; 
    opacity: 0.6;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    user-select: none; 
}

.slide-arrow:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.slide-arrow:disabled {
    background-color: rgba(50, 50, 50, 0.1);
    color: #999;
    cursor: not-allowed;
    opacity: 0.3;
}

.prev-arrow {
    left: 15px; 
}

.next-arrow {
    right: 15px; 
}

/* Styles for the slide info text (if the <p> tag is still in your HTML) */
#current-slide-info {
    text-align: center;
    color: #6c757d; 
    margin-top: 0.75em; 
    font-size: 0.95em;
    min-height: 22px; /* Reserves space, contributing to the calc() above */
    overflow: hidden;
    text-overflow: ellipsis; 
    white-space: nowrap; 
    width: 100%; 
}

/* Navigation Controls Styles (for the text buttons below the slide container) */
.navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5em;
}

.navigation-controls button {
    padding: 0.6em 1.2em;
    font-size: 1em;
    margin: 0 0.5em;
    cursor: pointer;
    background-color: #007bff; 
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navigation-controls button:hover:not(:disabled) {
    background-color: #0056b3; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.navigation-controls button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); 
}

.navigation-controls button:disabled {
    background-color: #e9ecef; 
    color: #6c757d; 
    cursor: not-allowed;
    box-shadow: none;
}

/* Footer Styles */
footer {
    background-color: #343a40; 
    color: #ffffff; 
    padding: 1em;
    text-align: center;
    font-size: 0.9em;
}

.footer-links {
    margin-top: 0.5em; 
}

.footer-links a,
.footer-links a:link,
.footer-links a:visited {
    color: #ffffff;         
    text-decoration: none; 
    margin: 0 0.5em;       
}

.footer-links a:hover,
.footer-links a:focus {
    color: #f0f0f0;        
    text-decoration: underline; 
}