/* ==========================================================================
   Reading List Peru: editorial library and book collection
   ========================================================================== */

/* The page defines its local reading palette and maps it to shared component variables. */
.reading-list-page {
    --reading-list-ink: #171717;
    --reading-list-copy: #5d5d5d;
    --reading-list-muted: #757575;
    --reading-list-red: #f10100;
    --reading-list-red-deep: #b90201;
    --reading-list-line: #e8e8e4;
    --reading-list-soft: #f7f7f5;
    --reading-list-warm: #fffaf5;
    --reading-list-radius: 7px;
    --welcome-ink: var(--reading-list-ink);
    --welcome-copy: var(--reading-list-copy);
    --welcome-muted: var(--reading-list-muted);
    --welcome-red: var(--reading-list-red);
    --welcome-red-deep: var(--reading-list-red-deep);
    --welcome-line: var(--reading-list-line);
    --welcome-soft: var(--reading-list-soft);
    --welcome-warm: var(--reading-list-warm);
    --welcome-radius: var(--reading-list-radius);
}

/* The hero title keeps a compact book-cover-like measure. */
.reading-list-page .tour-category-hero-title {
    max-width: 10ch;
}

/* The long navigation starts with the first reading path and remains horizontally scrollable. */
.reading-list-nav .travel-guide-nav-list {
    justify-content: flex-start;
}

/* The breadcrumb gives the original source hierarchy a quiet editorial treatment. */
.reading-list-breadcrumb {
    border-bottom: 1px solid var(--reading-list-line);
    background-color: #ffffff;
}

/* Breadcrumb spacing stays compact below the sticky reading navigation. */
.reading-list-breadcrumb p {
    padding: 0.8rem 0;
    margin: 0;
    color: var(--reading-list-muted);
    font-size: 0.84rem;
}

/* Breadcrumb links use the deeper red reserved for editorial links. */
.reading-list-breadcrumb a {
    color: var(--reading-list-red-deep);
    font-weight: 800;
    text-underline-offset: 0.2em;
}

/* The introduction balances practical reading guidance with the supplied book collage. */
.reading-list-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7rem);
}

/* The introductory copy stays within a comfortable long-form measure. */
.reading-list-intro-copy {
    max-width: 76ch;
}

/* Added context follows the supplied opening without altering its wording. */
.reading-list-added-copy {
    max-width: 72ch;
    margin: 1.5rem 0 0;
    color: var(--reading-list-copy);
    font-size: 1.02rem;
    line-height: 1.78;
}

/* Three reading moments create a usable sequence without boxing the prose. */
.reading-list-use-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* Reading-moment columns use only top rules, never side accent borders. */
.reading-list-use-grid > div {
    padding-top: 1.2rem;
    border-top: 2px solid var(--reading-list-red);
}

/* Reading-moment headings use the established display face. */
.reading-list-use-grid h3 {
    margin: 0 0 0.65rem;
    color: var(--reading-list-ink);
    font-family: "Metromedium", "Roboto", sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.15;
}

/* Reading-moment explanations remain compact and easy to scan. */
.reading-list-use-grid p {
    margin: 0;
    color: var(--reading-list-copy);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* The supplied cover collage becomes a warm editorial plate rather than a generic card. */
.reading-list-intro-media {
    overflow: hidden;
    margin: 0;
    border-radius: var(--reading-list-radius);
    background-color: var(--reading-list-soft);
}

/* The collage fills its plate while preserving its original cover artwork. */
.reading-list-intro-media img {
    display: block;
    width: 100%;
    min-height: 430px;
    object-fit: cover;
}

/* The collage caption supplies useful context in a quiet reading style. */
.reading-list-intro-media figcaption {
    padding: 1rem 1.25rem 1.2rem;
    color: var(--reading-list-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* Collection headings remain centered above each distinct reading path. */
.reading-list-collection .welcome-section-heading {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
}

/* Nature references receive the page's single immersive dark chapter. */
.reading-list-collection.is-dark {
    background-color: var(--reading-list-ink);
}

/* Dark chapter headings and explanatory copy use warm white for contrast. */
.reading-list-collection.is-dark .welcome-section-heading h2 {
    color: #ffffff;
}

/* Dark chapter descriptions remain readable without losing hierarchy. */
.reading-list-collection.is-dark .welcome-section-heading p {
    color: rgba(255, 255, 255, 0.78);
}

/* The final cultural collection uses the design system's warm editorial surface. */
.reading-list-collection.is-warm {
    background-color: var(--reading-list-warm);
}

/* Book collections adapt from three columns to a generous responsive reading grid. */
.reading-list-book-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    margin-top: clamp(3rem, 6vw, 5rem);
}

/* Four cultural references use four columns only on the widest viewport. */
.reading-list-book-grid-culture {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Each reusable book card treats the cover as the primary content. */
.reading-list-book-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border-radius: var(--reading-list-radius);
    background-color: #ffffff;
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.06);
    transition: box-shadow 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Cards lift modestly when their link receives pointer or keyboard attention. */
.reading-list-book-card:hover,
.reading-list-book-card:focus-within {
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.12);
    transform: translateY(-4px);
}

/* Cover links provide a consistent shelf-like visual stage. */
.reading-list-book-cover {
    display: flex;
    min-height: 390px;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    background-color: #eeeeeb;
}

/* Covers remain fully visible while respecting their supplied aspect ratio. */
.reading-list-book-cover img {
    display: block;
    width: 100%;
    height: 360px;
    object-fit: contain;
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* A restrained scale change gives the collection one coherent interactive motion. */
.reading-list-book-card:hover .reading-list-book-cover img,
.reading-list-book-card:focus-within .reading-list-book-cover img {
    transform: scale(1.025);
}

/* Card copy uses a flexible column so actions align across varied original titles. */
.reading-list-book-copy {
    display: flex;
    min-height: 300px;
    flex: 1;
    flex-direction: column;
    padding: 1.5rem;
}

/* Original book titles preserve their wording and receive a clear editorial hierarchy. */
.reading-list-book-copy h3 {
    margin: 0;
    color: var(--reading-list-ink);
    font-family: "Metromedium", "Roboto", sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 500;
    line-height: 1.15;
    text-wrap: balance;
}

/* Title links inherit the heading color and expose an obvious keyboard focus state. */
.reading-list-book-copy h3 a {
    color: inherit;
    text-decoration: none;
}

/* Explanatory text fills the source's missing context at a readable measure. */
.reading-list-book-description {
    margin: 1rem 0 0;
    color: var(--reading-list-copy);
    font-size: 0.96rem;
    line-height: 1.7;
}

/* External book actions align at the base of every card. */
.reading-list-book-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    align-self: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    margin-top: auto;
    border-radius: var(--reading-list-radius);
    background-color: var(--reading-list-red-deep);
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, transform 180ms ease;
}

/* Book actions deepen on hover and remain white for accessible contrast. */
.reading-list-book-action:hover,
.reading-list-book-action:focus-visible {
    background-color: #940100;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* All interactive reading-list links share a visible branded focus ring. */
.reading-list-page :is(a, button):focus-visible {
    outline: 3px solid rgba(241, 1, 0, 0.3);
    outline-offset: 3px;
}

/* Browser selection adopts the same red-and-white reading palette. */
.reading-list-page ::selection {
    background-color: var(--reading-list-red);
    color: #ffffff;
}

/* Large tablets move all collections to two stable columns. */
@media (max-width: 1199.98px) {
    .reading-list-intro-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Introductory media becomes a broad landscape pause below the copy. */
    .reading-list-intro-media img {
        min-height: 360px;
    }

    /* Every collection uses the same two-column tablet rhythm. */
    .reading-list-book-grid,
    .reading-list-book-grid-culture {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Compact tablets simplify the reading sequence into one column. */
@media (max-width: 767.98px) {
    .reading-list-use-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Cards stack in source order for focused mobile reading. */
    .reading-list-book-grid,
    .reading-list-book-grid-culture {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Book cards retain a comfortable maximum width on small screens. */
    .reading-list-book-card {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
    }

    /* Mobile cover stages reduce height without cropping the supplied artwork. */
    .reading-list-book-cover {
        min-height: 350px;
    }

    /* Mobile cover art remains large enough to read at a glance. */
    .reading-list-book-cover img {
        height: 330px;
    }

    /* Mobile card copy height follows its content rather than matching the grid. */
    .reading-list-book-copy {
        min-height: 0;
    }
}

/* Reduced-motion readers receive immediate card and cover state changes. */
@media (prefers-reduced-motion: reduce) {
    .reading-list-book-card,
    .reading-list-book-cover img,
    .reading-list-book-action {
        transition: none;
    }
}
