/*
Name: Priti Patel
Date: 2/26/26
File Name: styles.css
*/

/* ===== CSS RESET ===== */
/* Remove default browser spacing */
body, header, nav, main, footer, div, section, figure, figcaption,
h1, h2, h3, h4, p, ul, li, a, img, address {
    margin: 0;
    padding: 0;
    border: 0;
}

/* ===== GLOBAL STYLES ===== */
/* Apply border-box to all elements for consistent sizing */
* {
    box-sizing: border-box;
}

/* Base body styles */
body {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.6;
    color: #3A2C2A;  /* Rich brown text */
    background-color: #FFF9F0;  /* Cream background */
}

/* Heading styles */
h1, h2, h3, h4 {
    font-family: 'Merriweather', Georgia, serif;
    margin-bottom: 0.5em;
    color: #6B4E71;  /* Warm burgundy */
}

h1 {
    font-size: 1.8em;
}

h2 {
    font-size: 1.6em;
    border-bottom: 2px solid #E8C872;  /* Soft gold underline */
    padding-bottom: 0.25em;
}

h3 {
    font-size: 1.3em;
}

h4 {
    font-size: 1.1em;
}

/* Paragraph spacing */
p {
    margin-bottom: 1em;
}

/* Link styles */
a {
    color: #6B4E71;  /* Warm burgundy */
    text-decoration: none;
}

a:hover {
    color: #9CAF88;  /* Sage green on hover */
    text-decoration: underline;
}

/* Image styles */
img {
    max-width: 100%;
    display: block;
}

/* Utility class for rounded images */
.rounded-image {
    border-radius: 8px;
}

/* Highlight class for special text */
.highlight {
    color: #9CAF88;  /* Sage green */
    font-weight: bold;
    font-size: 1.2em;
}

/* ===== MOBILE FIRST STYLES (Base styles for all devices) ===== */

/* Hide desktop-only elements by default */
.desktop-view {
    display: none;
}

/* Show mobile-specific elements */
.mobile-only {
    display: block;
}

/* Header styles */
header {
    background-color: #6B4E71;  /* Warm burgundy */
    color: #FFF9F0;  /* Cream text */
    text-align: center;
    padding: 1em;
}

header h1 {
    color: #FFF9F0;  /* Cream text */
    margin-bottom: 0;
    border-bottom: none;
}

/* Desktop icon styling */
.desktop-icon {
    display: none;  /* Hidden on mobile */
}

/* Navigation styles - Mobile (vertical) */
nav {
    background-color: #E8C872;  /* Soft gold */
}

nav ul {
    list-style-type: none;
    text-align: center;
}

nav li {
    display: block;
    border-top: 1px solid #FFF9F0;  /* Cream separator */
}

nav li:first-child {
    border-top: none;
}

nav li a {
    display: block;
    color: #3A2C2A;  /* Rich brown text */
    text-align: center;
    padding: 0.75em 1em;
    font-weight: 600;
    text-decoration: none;
}

nav li a:hover {
    background-color: #9CAF88;  /* Sage green */
    color: #FFF9F0;  /* Cream text */
}

/* Main content area */
main {
    padding: 1.5em;
    background-color: #F8F4E9;  /* Off-white */
    min-height: 60vh;
}

/* Section spacing */
section {
    margin: 2em 0;
}

/* Welcome section on home page */
#welcome {
    text-align: center;
    margin-bottom: 2em;
}

/* Book grid layout - Mobile (single column) */
.book-grid, .team-grid {
    display: block;
}

/* Figure styling for book cards */
figure {
    position: relative;
    max-width: 250px;
    margin: 1.5em auto;
    border: 6px solid #6B4E71;  /* Warm burgundy border */
    border-radius: 8px;
    overflow: hidden;
}

figcaption {
    background-color: rgba(107, 78, 113, 0.85);  /* Burgundy with opacity */
    color: #FFF9F0;  /* Cream text */
    padding: 0.75em;
    text-align: center;
}

figcaption h3, figcaption h4, figcaption p {
    margin: 0.25em 0;
    color: #FFF9F0;  /* Cream text */
}

figcaption p a {
    color: #E8C872;  /* Soft gold */
    font-weight: bold;
}

figcaption p a:hover {
    color: #FFF9F0;
    text-decoration: underline;
}

/* Category list on home page */
.category-list {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin: 1.5em 0;
}

.category-list li {
    flex: 1 1 calc(50% - 0.75em);
}

.category-list a {
    display: block;
    background-color: #E8C872;  /* Soft gold */
    color: #3A2C2A;  /* Rich brown */
    padding: 0.75em;
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
}

.category-list a:hover {
    background-color: #9CAF88;  /* Sage green */
    color: #FFF9F0;  /* Cream */
    text-decoration: none;
}

/* Category filter on books page */
.category-filter {
    background-color: #FFF9F0;  /* Cream */
    padding: 1em;
    border-radius: 8px;
    margin: 1.5em 0;
}

.category-filter ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.5em;
}

.category-filter li a {
    display: block;
    background-color: #E8C872;
    color: #3A2C2A;
    padding: 0.4em 0.8em;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.category-filter li a:hover {
    background-color: #9CAF88;
    color: #FFF9F0;
    text-decoration: none;
}

/* Book detail page */
#book-detail-container {
    margin: 2em 0;
}

.detail-figure {
    max-width: 300px;
    margin: 0 auto 2em;
}

.book-metadata {
    background-color: #FFF9F0;  /* Cream */
    padding: 1em;
    border-radius: 8px;
    margin: 1.5em 0;
    border-left: 4px solid #E8C872;  /* Soft gold accent */
}

.book-description {
    margin: 1.5em 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 1em;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* About page */
#about-story, #about-mission, #about-team {
    margin: 2em 0;
}

.team-grid {
    display: block;
}

.team-grid figure {
    max-width: 200px;
}

/* Contact page */
#contact-page {
    max-width: 800px;
    margin: 0 auto;
}

#contact-methods {
    margin: 2em 0;
}

.contact-section {
    background-color: #FFF9F0;  /* Cream */
    padding: 1.5em;
    border-radius: 8px;
    margin-bottom: 1.5em;
}

.phone-link {
    background-color: #6B4E71;  /* Burgundy */
    padding: 1em;
    margin: 1em 0;
    text-align: center;
    border-radius: 5px;
}

.phone-link a {
    color: #FFF9F0;  /* Cream */
    font-size: 1.2em;
    font-weight: bold;
    display: block;
    text-decoration: none;
}

.phone-link a:hover {
    color: #E8C872;  /* Soft gold */
}

.email-link {
    color: #6B4E71;
    font-weight: bold;
}

.email-link:hover {
    color: #9CAF88;
}

address {
    font-style: normal;
    margin-top: 1em;
}

.hours-list {
    list-style-type: none;
}

.hours-list li {
    padding: 0.25em 0;
    border-bottom: 1px dashed #E8C872;
}

.hours-list li:last-child {
    border-bottom: none;
}

.day {
    font-weight: bold;
    display: inline-block;
    width: 110px;
}

.responsive-map {
    border: 5px solid #6B4E71;  /* Burgundy border */
    border-radius: 8px;
    width: 100%;
    height: 300px;
    margin: 1.5em 0;
}

/* Footer styles */
footer {
    background-color: #6B4E71;  /* Burgundy */
    color: #FFF9F0;  /* Cream text */
    text-align: center;
    padding: 1.5em;
    clear: left;
}

footer a {
    color: #E8C872;  /* Soft gold */
}

footer a:hover {
    color: #FFF9F0;
    text-decoration: underline;
}

/* ===== TABLET VIEWPORT ===== */
@media screen and (min-width: 601px) {

    /* Show desktop icons on tablet/desktop */
    .desktop-icon {
        display: inline;
    }

    /* Tablet navigation - horizontal */
    nav li {
        display: inline-block;
        border-top: none;
        border-right: 1px solid #FFF9F0;
        font-size: 1.1em;
    }

    nav li:last-child {
        border-right: none;
    }

    nav li a {
        padding: 0.5em 1.5em;
    }

    /* Book grid - 2 columns on tablet */
    .book-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5em;
    }

    .book-grid figure {
        margin: 0;
        width: 100%;
    }

    /* Team grid - 2 columns on tablet */
    .team-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5em;
    }

    .team-grid figure {
        margin: 0;
        width: 100%;
    }

    /* Category list - more columns on tablet */
    .category-list li {
        flex: 1 1 calc(33.333% - 0.75em);
    }

    /* Book detail page - side by side layout */
    #book-detail-container {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 2em;
        align-items: start;
    }

    .detail-figure {
        margin: 0;
    }

    /* Contact page - side by side sections */
    #contact-methods {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5em;
    }

    .responsive-map {
        height: 350px;
    }
}

/* ===== DESKTOP VIEWPORT ===== */
@media screen and (min-width: 1025px) {

    /* Show desktop-only elements */
    .desktop-view {
        display: block;
    }

    /* Hide mobile-only elements */
    .mobile-only {
        display: none;
    }

    /* Center content with max-width for large screens */
    body {
        max-width: 1200px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    /* Header padding */
    header {
        padding: 1.5em;
    }

    header h1 {
        font-size: 2.2em;
    }

    /* Navigation with more spacing */
    nav li a {
        padding: 0.75em 2em;
    }

    nav li a:hover {
        background-color: #9CAF88;
    }

    /* Main content padding */
    main {
        padding: 2.5em;
    }

    /* Hero image styling */
    #hero {
        margin-bottom: 2em;
    }

    #hero img {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
    }

    /* Book grid - 4 columns on desktop */
    .book-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2em;
    }

    /* Team grid - 3 columns on desktop */
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Category list - horizontal on desktop */
    .category-list {
        flex-wrap: nowrap;
        justify-content: center;
    }

    .category-list li {
        flex: 0 1 auto;
    }

    .category-list a {
        padding: 0.75em 1.5em;
    }

    /* Category filter - centered */
    .category-filter ul {
        justify-content: center;
    }

    /* Map height */
    .responsive-map {
        height: 400px;
    }
}

/* ===== PRINT MEDIA QUERY ===== */
@media print {

    /* Hide navigation, hero, and phone links when printing */
    nav, #hero, .phone-link, .desktop-view, .mobile-only {
        display: none;
    }

    /* Black and white for printing */
    body {
        background-color: white;
        color: black;
        font-size: 12pt;
    }

    main {
        background-color: white;
        padding: 0.5in;
    }

    h1, h2, h3 {
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    img {
        max-width: 3in;
    }
}
