/* General Page Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f1ea;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

h1 {
    margin: 0 0 15px 0;
    font-size: 2.2rem;
}

/* Navigation Bar - Sticky and Responsive */
#year-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* Allows buttons to wrap on small screens */
    position: sticky;
    top: 0;
    z-index: 100;
    background: #2c3e50;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#year-nav a {
    color: #f1c40f;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid #f1c40f;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Bookshelf Container */
#bookshelf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.shelf-year {
    scroll-margin-top: 80px; /* Safety gap for the sticky nav */
    margin-bottom: 50px;
}

.shelf-year h2 {
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 8px;
    color: #2c3e50;
}

/* THE RESPONSIVE GRID */
.book-list {
    display: flex;
    flex-wrap: wrap;         /* This is crucial for responsiveness */
    gap: 20px;               /* Space between books */
    justify-content: center; /* Centers books on mobile */
    padding: 20px 0;
}

.book-item {
    flex: 0 1 150px;         /* Books stay around 150px wide */
    transition: transform 0.3s ease;
}

.book-item img {
    width: 100%;             /* Image fills the 150px container */
    height: auto;            /* Keeps proportions correct */
    border-radius: 3px 6px 6px 3px;
    box-shadow: 4px 6px 10px rgba(0,0,0,0.3);
}

.book-item:hover {
    transform: translateY(-8px);
}

/* Favourite Highlight */
.book-item.favourite img {
    outline: 4px solid #f1c40f; 
    outline-offset: -4px;
}

/* MOBILE SPECIFIC RULES */
@media (max-width: 600px) {
    h1 {
        font-size: 1.6rem;
    }
    
    #bookshelf-container {
        padding: 10px;
    }

    .book-item {
        flex: 0 1 120px;     /* Smaller covers for mobile screens */
    }

    .book-list {
        gap: 12px;           /* Tighter gap on mobile */
    }
}