/* =========================================================
   GLOBAL STYLES
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    min-width: 320px;
    margin: 0;
    color: #1a1a1a;
    background-color: #f7f7f5;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

#wrapper {
    width: 100%;
    min-height: 100vh;
}

main {
    width: 100%;
}

img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Visible keyboard focus */
a:focus-visible,
summary:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

/* Prevent anchored sections from hiding beneath the header */
section[id] {
    scroll-margin-top: 6rem;
}

/* Keyboard-accessible skip link */
.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;

    color: #ffffff;
    background-color: #1a1a1a;
    border: 2px solid #ffffff;

    font-weight: 700;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* Screen-reader-only text that becomes visible when focused */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Prevent long words or URLs from forcing horizontal scrolling */
.full-review,
.full-bio,
.book-content,
.about-content {
    overflow-wrap: anywhere;
}


/* =========================================================
   HEADER AND NAVIGATION
   ========================================================= */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    width: 100%;
    padding: 1.5rem 4rem;

    background-color: #ffffff;
    border-bottom: 1px solid #d6d6d6;
}

.site-name {
    flex-shrink: 0;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#navigation ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

#navigation a {
    display: block;
    padding: 0.5rem 0;

    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    transition: color 0.2s ease;
}

#navigation a:hover,
#navigation a:focus-visible {
    color: #666666;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35em;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    position: relative;
    width: min(1180px, calc(100% - 6rem));
    margin: 0 auto;
    padding: 6rem 0 7rem;
}

.hero > h1 {
    position: relative;
    z-index: 2;
    width: min(900px, 82%);
    margin: 0 0 -3.25rem;
    padding: 1.1rem 2.25rem 1.1rem 0;
    background: linear-gradient(
        90deg,
        #f7f7f5 0%,
        #f7f7f5 76%,
        rgba(247, 247, 245, 0) 100%
    );
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.9rem, 4.6vw, 4.6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
    align-items: end;
    gap: 1rem;
}

.hero-content {
    position: relative;
    z-index: 3;
    min-width: 0;
    padding: 3.25rem 0 1rem;
}

.hero-content h2 {
    margin: 0 0 1rem;
    color: #5f5f5f;
    font-size: 1.15rem;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-content p {
    max-width: 560px;
    margin: 0 0 1.5rem;
    color: #4d4d4d;
    font-size: 1.05rem;
}

.hero-image {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 540px;
    margin-left: -1.5rem;
    overflow: hidden;
    background-color: #e5e5e3;
}

.hero-image img {
    width: 100%;
    height: 100%;
    min-height: 540px;
    object-fit: cover;
    object-position: center;
}


/* =========================================================
   BUTTONS AND ACTION LINKS
   ========================================================= */

.hero-actions,
.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.button,
.book-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0.9rem 1.5rem;

    border: 2px solid #1a1a1a;

    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.button-primary,
.book-actions a:first-child {
    color: #ffffff;
    background-color: #1a1a1a;
}

.button-secondary {
    color: #1a1a1a;
    background-color: transparent;
}

.button:hover,
.button:focus-visible,
.book-actions a:hover,
.book-actions a:focus-visible {
    transform: translateY(-2px);
}

.button-primary:hover,
.button-primary:focus-visible,
.book-actions a:first-child:hover,
.book-actions a:first-child:focus-visible {
    background-color: #3f3f3f;
    border-color: #3f3f3f;
}

.button-secondary:hover,
.button-secondary:focus-visible,
.book-actions a:not(:first-child):hover,
.book-actions a:not(:first-child):focus-visible {
    color: #ffffff;
    background-color: #1a1a1a;
}


/* =========================================================
   SHARED CONTENT SECTIONS
   ========================================================= */

.books-section,
.reviews-section,
.about-section,
.contact-section {
    width: min(1200px, calc(100% - 6rem));
    margin: 0 auto;
    padding: 6rem 0;
}

.reviews-section,
.about-section,
.contact-section {
    border-top: 1px solid #d6d6d6;
}

.books-section > h2,
.reviews-section > h2,
.about-content h2,
.contact-section h2 {
    margin: 0 0 3rem;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.025em;
}


/* =========================================================
   BOOKS
   ========================================================= */

.books-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 3rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;

    background-color: #ffffff;
    border: 1px solid #d6d6d6;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

/* Square image area that preserves the full portrait book cover */
.book-image {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 1 / 1;
    padding: clamp(1.25rem, 3vw, 2rem);

    background-color: #ededeb;
    border-bottom: 1px solid #d6d6d6;
}

.book-image img {
    width: 100%;
    height: 100%;
    max-width: 72%;
    max-height: 100%;

    object-fit: contain;
    object-position: center;

    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.18));
}

.book-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: 2.25rem;
}

.book-content h3 {
    margin: 0 0 1.25rem;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.1;
}

.book-content p {
    margin: 0 0 1.75rem;
    color: #4d4d4d;
}

.book-actions {
    margin-top: auto;
}


/* =========================================================
   REVIEWS
   ========================================================= */

.reviews-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 2rem;
}

.review-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 3rem;

    color: #ffffff;
    background-color: #202020;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.review-card h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.4;
}

.review-card blockquote {
    margin: 2rem 0 1.25rem;
    padding-left: 1.5rem;

    border-left: 3px solid #8c8c8c;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.55;
}

.review-card blockquote p {
    margin: 0;
}

.reviewer {
    margin: 0 0 2rem;
    color: #cccccc;
    font-size: 0.95rem;
}

.review-card details {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #555555;
}

.review-card summary {
    width: fit-content;
    min-height: 24px;
    padding-block: 0.25rem;
    cursor: pointer;

    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.review-card summary:hover,
.review-card summary:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.35em;
}

.full-review {
    margin-top: 1.5rem;
    color: #d9d9d9;
    font-size: 0.95rem;
    line-height: 1.8;
}

.full-review p:first-child {
    margin-top: 0;
}

.full-review p:last-child {
    margin-bottom: 0;
}
.review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.review-actions .button {
    width: fit-content;
}

.review-actions .button-secondary {
    color: #ffffff;
    background-color: transparent;
    border-color: #ffffff;
}

.review-actions .button-secondary:hover,
.review-actions .button-secondary:focus-visible {
    color: #202020;
    background-color: #ffffff;
    border-color: #ffffff;
}


/* =========================================================
   ABOUT
   ========================================================= */

.about-section {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 5rem;
}

.author-image {
    min-width: 0;
}

.author-image img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background-color: #dddddd;
}

.about-content {
    min-width: 0;
}

.about-content p {
    max-width: 650px;
    margin: 0;

    color: #4d4d4d;
    font-size: 1.05rem;
}
.author-bio {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #d6d6d6;
}

.author-bio summary {
    width: fit-content;
    min-height: 24px;
    padding-block: 0.25rem;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.author-bio summary:hover,
.author-bio summary:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.3em;
}

.full-bio {
    margin-top: 1.5rem;
    color: #4d4d4d;
}

.full-bio p {
    margin: 0 0 1.25rem;
}

.full-bio p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   CONTACT
   ========================================================= */

.contact-section {
    text-align: center;
}

.contact-section p {
    max-width: 620px;
    margin: 0 auto 1.75rem;

    color: #555555;
    font-size: 1.05rem;
}

.contact-email {
    display: flex;
    justify-content: center;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    width: 100%;
    padding: 3rem 4rem;

    text-align: center;
    background-color: #ffffff;
    border-top: 1px solid #d6d6d6;
}

#footer-navigation ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;

    margin-bottom: 1.5rem;
}

#footer-navigation a {
    display: block;
    padding: 0.4rem 0;

    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#footer-navigation a:hover,
#footer-navigation a:focus-visible {
    color: #666666;
    text-decoration: underline;
    text-underline-offset: 0.35em;
}

.site-footer p {
    margin: 0;
    color: #707070;
    font-size: 0.875rem;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {
    .hero {
        width: min(1020px, calc(100% - 4rem));
    }

    .hero > h1 {
        width: min(780px, 82%);
        margin-bottom: -2.75rem;
        font-size: clamp(2.8rem, 5.7vw, 4.2rem);
    }

    .hero-layout {
        grid-template-columns: minmax(270px, 0.82fr) minmax(0, 1.18fr);
        gap: 1rem;
    }

    .hero-content {
        padding-top: 3rem;
    }

    .hero-image,
    .hero-image img {
        min-height: 500px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        width: min(100%, 720px);
        margin: 0 auto;
    }
}

@media (max-width: 800px) {
    .reviews-layout {
        grid-template-columns: 1fr;
    }

    .site-header {
        padding: 1.25rem 1.5rem;
    }

    .hero {
        width: min(700px, calc(100% - 3rem));
        padding: 5rem 0;
    }

    .hero > h1 {
        width: min(680px, 96%);
        margin-bottom: -2rem;
        padding: 1rem 1.5rem 1rem 0;
        font-size: clamp(2.8rem, 8vw, 4.25rem);
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .hero-image {
        order: 1;
        min-height: 430px;
        margin-left: 0;
    }

    .hero-image img {
        min-height: 430px;
    }

    .hero-content {
        order: 2;
        padding: 0;
    }

    .books-section,
    .reviews-section,
    .about-section,
    .contact-section {
        width: min(700px, calc(100% - 3rem));
    }

    .about-section {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .author-image {
        width: min(100%, 500px);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    #navigation {
        width: 100%;
    }

    #navigation ul {
        justify-content: flex-start;
        gap: 0.5rem 1rem;
    }

    #navigation a {
        font-size: 0.8rem;
    }

    .hero {
        width: calc(100% - 2.5rem);
        padding: 4rem 0;
    }

    .hero > h1 {
        width: 100%;
        margin-bottom: -1.25rem;
        padding: 0.875rem 1rem 0.875rem 0;
        font-size: clamp(2.4rem, 12vw, 3.65rem);
        line-height: 1.02;
    }

    .hero-layout {
        gap: 2rem;
    }

    .hero-image,
    .hero-image img {
        min-height: 340px;
    }

    .hero-content h2 {
        font-size: 1rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-actions,
    .book-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .book-actions a {
        width: 100%;
    }

    .book-image {
        padding: 1.25rem;
    }

    .book-image img {
        max-width: 78%;
    }

    .review-card {
        padding: 2rem 1.5rem;
    }

    .review-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .review-actions .button {
        width: 100%;
    }

    .site-footer {
        padding-inline: 1.5rem;
    }
}


/* =========================================================
   REDUCED MOTION ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}