/* ================================
   May Memorial Library
   Main site stylesheet
   ================================ */

:root {
    --background: #fbfaf5;
    --green: #17372f;
    --green-light: #294f42;
    --text: #18352e;
    --border: #7d9088;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}


/* ================================
   Shared layout
   ================================ */

.site-container {
    width: min(94%, 1540px);
    margin: 0 auto;
}

/* ================================
   Announcement banner
   ================================ */

.announcement {
    width: min(94%, 1540px);
    margin: 0 auto 20px;
    padding: 16px 24px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;

    background: var(--green);
    color: var(--white);

    border-radius: 14px;

    text-align: center;
}

.announcement[hidden] {
    display: none;
}

.announcement-heading {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.announcement-message {
    font-size: 15px;
}

.announcement-link {
    display: inline-block;

    padding: 6px 13px;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;

    color: var(--white);
    text-decoration: none;
    font-size: 14px;
}

.announcement-link:hover,
.announcement-link:focus {
    background: var(--white);
    color: var(--green);
}

/* ================================
   Header
   ================================ */

.site-header {
    padding: 46px 0 30px;
}

.header-inner {
    display: grid;
    grid-template-columns: 180px 1fr 150px;
    align-items: center;
    gap: 30px;
}

.site-logo {
    width: 105px;
    height: auto;
}

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 55px;
}

.main-nav a {
    font-size: 17px;
    text-decoration: none;
    color: var(--text);
}

.main-nav a:hover,
.main-nav a:focus {
    text-decoration: underline;
}

.main-nav a.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.catalog-button,
.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--green-light);
    color: var(--white);

    border: none;
    border-radius: 999px;

    text-decoration: none;

    transition:
        transform 0.15s ease,
        background-color 0.15s ease;
}

.catalog-button {
    min-width: 115px;
    min-height: 48px;
    padding: 10px 24px;
    font-size: 17px;
    justify-self: end;
}

.catalog-button:hover,
.hero-button:hover {
    background: var(--green);
    transform: translateY(-1px);
}


/* ================================
   Hero
   ================================ */

.hero {
    padding: 52px 0 85px;
}

.hero-grid {
    display: grid;
    grid-template-columns:
        minmax(260px, 0.9fr)
        minmax(450px, 1.35fr)
        minmax(230px, 0.75fr);

    gap: 45px;
    align-items: start;
}

.hero-title-area {
    padding-top: 15px;
}

.hero-title {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(58px, 5.3vw, 82px);
    font-weight: 700;
    line-height: 0.94;

    color: var(--green);

    letter-spacing: -2px;
}

.hero-button {
    margin-top: 62px;
    margin-left: 95px;

    min-width: 118px;
    min-height: 64px;

    padding: 12px 23px;

    font-size: 16px;
    line-height: 1.15;
    text-align: center;
}

.hero-image-wrap {
    width: 100%;
}

.hero-image {
    width: 100%;
    aspect-ratio: 1.15 / 1;
    object-fit: cover;
}

.hours {
    padding-top: 0;
}

.hours-group {
    margin-bottom: 27px;
}

.hours-group:last-child {
    margin-bottom: 0;
}

.hours h2 {
    margin: 0 0 4px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.2;
    color: var(--green);
}

.hours p {
    margin: 0;
    font-size: 17px;
}


/* ================================
   Visit section
   ================================ */

.visit-section {
    padding: 0 0 140px;
}

.visit-grid {
    display: grid;
    grid-template-columns: minmax(430px, 0.95fr) minmax(520px, 1.05fr);
    gap: 120px;
    align-items: start;
}

.visit-photo {
    width: 100%;
    height: 815px;
    object-fit: cover;
}

.visit-card {
    min-height: 780px;

    border: 1px solid var(--border);
    border-radius: 28px;

    padding: 34px 40px 38px;
}

.visit-card h2 {
    margin: 0 0 30px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 52px;
    line-height: 1;
    color: var(--green);
}

.contact-block {
    margin-bottom: 24px;
}

.contact-block h3 {
    margin: 0 0 8px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.contact-block p {
    margin: 0;

    font-size: 16px;
    line-height: 1.35;
}

.contact-block a {
    text-decoration: none;
}

.contact-block a:hover {
    text-decoration: underline;
}

.map-wrap {
    margin-top: 52px;
    width: 100%;
    height: 325px;
    overflow: hidden;
}

.map-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}


/* ================================
   Footer
   ================================ */

.site-footer {
    padding: 30px 0 58px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 40px;
}

.footer-logo {
    width: 105px;
    margin-bottom: 45px;
}

.copyright {
    margin: 0;
    max-width: 300px;
    font-size: 14px;
    line-height: 1.4;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 70px;
}

.social-link {
    width: 26px;
    height: 26px;

    border-radius: 50%;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    font-size: 12px;
    font-weight: bold;

    text-decoration: none;

    background: var(--green);
    color: white;
}

/* ================================
   Featured Books
   ================================ */

.featured-books-section {
    padding: 10px 0 95px;
}

.featured-books-section[hidden] {
    display: none;
}

.featured-books-heading {
    margin: 0 0 34px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 46px;
    line-height: 1;
    color: var(--green);
}

.featured-books-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.featured-book-card {
    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.32);

    border: 1px solid var(--border);
    border-radius: 22px;
}

.featured-book-cover {
    width: 100%;
    height: 340px;

    object-fit: contain;

    padding: 22px;

    background: rgba(255, 255, 255, 0.55);
}

.featured-book-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    flex: 1;

    padding: 24px;
}

.featured-book-title {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    line-height: 1.15;
    color: var(--green);
}

.featured-book-author {
    margin: 7px 0 15px;

    font-size: 15px;
    font-style: italic;
}

.featured-book-description {
    margin: 0 0 22px;

    font-size: 15px;
    line-height: 1.5;
}

.featured-book-link {
    margin-top: auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 17px;

    background: var(--green-light);
    color: var(--white);

    border-radius: 999px;

    text-decoration: none;
    font-size: 14px;
}

.featured-book-link:hover,
.featured-book-link:focus {
    background: var(--green);
}

/* ================================
   Newsletter
   ================================ */

.newsletter-section {
    padding: 10px 0 95px;
}

.newsletter-heading {
    margin: 0 0 36px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 46px;
    line-height: 1;
    color: var(--green);
}

.newsletter-list {
    display: grid;
    gap: 34px;
}

.newsletter-issue {
    max-width: 980px;

    padding: 30px 34px;

    border: 1px solid var(--border);
    border-radius: 22px;

    background: rgba(255, 255, 255, 0.3);
}

.newsletter-issue-header {
    margin-bottom: 16px;
}

.newsletter-issue-title {
    margin: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.15;
    color: var(--green);
}

.newsletter-date {
    margin: 8px 0 0;

    font-size: 14px;
    color: #52665f;
}

.newsletter-summary {
    margin: 0 0 24px;

    font-size: 16px;
    line-height: 1.5;

    font-style: italic;
}

.newsletter-body {
    font-size: 16px;
    line-height: 1.6;
}

.newsletter-body h1,
.newsletter-body h2,
.newsletter-body h3 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--green);
}

.newsletter-body h2 {
    margin: 26px 0 12px;
    font-size: 25px;
}

.newsletter-body h3 {
    margin: 22px 0 10px;
    font-size: 21px;
}

.newsletter-body p {
    margin: 0 0 16px;
}

.newsletter-body ul,
.newsletter-body ol {
    margin: 0 0 18px 24px;
}

.newsletter-body a {
    color: var(--green-light);
    text-decoration: underline;
}

.newsletter-body img {
    max-width: 100%;
    height: auto;

    margin: 20px 0;

    border-radius: 12px;
}

.newsletter-empty {
    font-size: 16px;
}

/* ================================
   Tablet
   ================================ */

@media (max-width: 1100px) {

    .header-inner {
        grid-template-columns: auto 1fr auto;
    }

    .main-nav {
        gap: 25px;
    }

    .hero-grid {
        grid-template-columns: 0.9fr 1.3fr;
    }

    .hours {
        grid-column: 1 / -1;

        display: flex;
        justify-content: center;
        gap: 70px;

        padding-top: 20px;
    }
   
    .featured-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .visit-grid {
        gap: 55px;
    }

    .visit-photo {
        height: 690px;
    }

    .visit-card {
        min-height: 690px;
    }
}


/* ================================
   Mobile
   ================================ */

@media (max-width: 800px) {

    .site-container {
        width: min(91%, 680px);
    }

    .site-header {
        padding-top: 25px;
    }

    .header-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .site-logo {
        width: 90px;
    }

    .main-nav {
        order: 3;

        width: 100%;

        margin-top: 25px;

        justify-content: flex-start;
        flex-wrap: wrap;

        gap: 14px 25px;
    }

    .main-nav a {
        font-size: 15px;
    }

    .catalog-button {
        min-width: 95px;
        min-height: 42px;
        font-size: 15px;
    }

    .hero {
        padding-top: 35px;
    }

    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 35px;
    }

    .hero-title {
        font-size: clamp(54px, 16vw, 76px);
    }

    .hero-button {
        margin: 30px 0 0;
    }

    .hero-image {
        aspect-ratio: auto;
    }

    .hours {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;

        width: 100%;
    }

    .hours h2 {
        font-size: 21px;
    }

    .hours p {
        font-size: 15px;
    }

       .featured-books-section {
        padding-bottom: 70px;
    }

    .featured-books-heading {
        font-size: 40px;
    }

    .featured-books-grid {
        grid-template-columns: 1fr;
    }

    .featured-book-cover {
        height: 300px;
    }

       .newsletter-section {
        padding-bottom: 70px;
    }

    .newsletter-heading {
        font-size: 40px;
    }

    .newsletter-issue {
        padding: 24px;
    }

    .newsletter-issue-title {
        font-size: 26px;
    }

    .visit-section {
        padding-bottom: 80px;
    }

    .visit-grid {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .visit-photo {
        height: auto;
        max-height: none;
    }

    .visit-card {
        width: 100%;
        min-height: 0;

        padding: 28px;

        border-radius: 22px;
    }

    .visit-card h2 {
        font-size: 44px;
    }

    .map-wrap {
        height: 290px;
    }

    .footer-inner {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-logo {
        margin-bottom: 25px;
    }

    .social-links {
        padding-bottom: 0;
    }
}


/* ================================
   Very small screens
   ================================ */

@media (max-width: 520px) {

    .hours {
        grid-template-columns: 1fr;
    }

    .hours-group {
        margin-bottom: 5px;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .visit-card h2 {
        font-size: 38px;
    }
}
