/* Carousel styles. Generated from main.css by tools/split-discovery-css.php. */

.chaptertrail-landing > .chaptertrail-trending,
.chaptertrail-landing > .chaptertrail-columns,
.chaptertrail-landing > .chaptertrail-random,
.chaptertrail-trending,
.chaptertrail-columns,
.chaptertrail-random {
    width: 100%;
    margin: 0;
}

/* Discovery carousels — landing home + browse genre shelves */
.trending-carousel {
    --trend-card-width: 160px;
    --trend-card-gap: 12px;
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: start;
}

.trending-carousel__viewport {
    width: min(100%, var(--trending-visible-width, 100%));
    margin: 0 auto;
    overflow: hidden;
}

.trending-carousel .trending-rail {
    display: flex;
    gap: var(--trend-card-gap);
    align-items: stretch;
    transform: translateX(calc(var(--trending-offset, 0) * -1px));
    transition: transform 320ms ease;
    will-change: transform;
}

.trending-carousel[data-trending-autoplay="false"] .trending-carousel__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(45, 120, 96, 0.45) rgba(239, 230, 210, 0.55);
    -webkit-overflow-scrolling: touch;
}

.trending-carousel[data-trending-autoplay="false"] .trending-rail {
    transform: none;
    transition: none;
    will-change: auto;
    width: max-content;
    max-width: none;
    padding-bottom: 4px;
}

.trending-carousel[data-trending-autoplay="false"] .trend-card {
    scroll-snap-align: start;
}

.trending-carousel__arrow {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-top: 108px;
    border: 1px solid rgba(222, 216, 202, 0.9);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.82);
    color: var(--green);
    box-shadow: 0 10px 22px rgba(24, 32, 43, 0.1);
    cursor: pointer;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.trending-carousel__arrow:hover,
.trending-carousel__arrow:focus-visible {
    border-color: rgba(45, 120, 96, 0.38);
    background: #ffffff;
}

.trending-carousel__arrow:disabled {
    cursor: default;
    opacity: 0.35;
}

.trend-card {
    display: grid;
    gap: 8px;
    flex: 0 0 var(--trend-card-width);
    width: var(--trend-card-width);
    min-width: 0;
    max-width: var(--trend-card-width);
}

.trend-card a {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 2 / 3;
    max-height: 420px;
    overflow: hidden;
    border: 1px solid rgba(222, 216, 202, 0.85);
    border-radius: 8px;
    background: #16202b;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(24, 32, 43, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.trend-card a:hover,
.trend-card a:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(24, 32, 43, 0.18);
}

.trending-carousel--foil {
    --trend-foil-cover-opacity: 0.84;
}

.trending-carousel--foil .trend-card {
    position: relative;
}

.trending-carousel--foil .trend-card a {
    isolation: isolate;
    border-color: transparent;
    background-color: #1a1408;
    background-image: var(--chaptertrail-gold-foil, url('/apps/discovery/theme/assets/images/goldfoil.webp'));
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100vw 100vh;
    background-attachment: fixed;
    box-shadow:
        0 12px 28px rgba(24, 32, 43, 0.14),
        0 0 0 1px rgba(184, 134, 11, 0.22),
        0 8px 22px rgba(217, 154, 43, 0.16);
}

.trending-carousel--foil .trend-card img {
    z-index: 1;
    opacity: var(--trend-foil-cover-opacity);
}

.trending-carousel--foil .trend-card a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background-image: var(--chaptertrail-gold-foil, url('/apps/discovery/theme/assets/images/goldfoil.webp'));
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100vw 100vh;
    background-attachment: fixed;
    mix-blend-mode: overlay;
    opacity: 0.34;
    pointer-events: none;
}

.trending-carousel--foil .trend-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: 420px;
    z-index: 4;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(
        125deg,
        #8b6914 0%,
        #f4e4bc 14%,
        #ffd700 28%,
        #fff8dc 42%,
        #d4af37 56%,
        #fff3bf 70%,
        #c9a227 84%,
        #8b6914 100%
    );
    background-size: 220% 220%;
    animation: trend-card-foil-shimmer 7s ease-in-out infinite;
    pointer-events: none;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.trending-carousel--foil .trend-card a::after {
    inset: 2px;
    z-index: 3;
    border-radius: 6px;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.02) 28%,
        rgba(15, 23, 42, 0.52) 72%,
        rgba(15, 23, 42, 0.9) 100%
    );
}

.trending-carousel--foil .trend-card a:hover,
.trending-carousel--foil .trend-card a:focus-visible {
    box-shadow:
        0 18px 36px rgba(24, 32, 43, 0.2),
        0 0 0 1px rgba(217, 154, 43, 0.42),
        0 10px 28px rgba(217, 154, 43, 0.28);
}

.trending-carousel--foil .trend-card__rank {
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(145deg, #fff8dc 0%, #ffd700 42%, #c9a227 100%);
    color: #5c3d0f;
    box-shadow:
        0 2px 8px rgba(92, 61, 15, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.trending-carousel--foil .trend-card a > span,
.trending-carousel--foil .trend-card a > .trend-card__foot {
    z-index: 5;
}

@supports not (background-attachment: fixed) {
    .trending-carousel--foil .trend-card a,
    .trending-carousel--foil .trend-card a::before {
        background-attachment: scroll;
        background-size: cover;
    }

    .trending-carousel--foil .trend-card img {
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {
.trending-carousel--foil .trend-card::after {
        animation: none;
        background-size: 100% 100%;
    }
}

.trend-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.92;
}

.trend-card a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 38%, rgba(15, 23, 42, 0.92) 100%);
    pointer-events: none;
}

.trend-card a > span,
.trend-card a > .trend-card__foot {
    position: relative;
    z-index: 1;
}

.trend-card__foot {
    display: grid;
    gap: 4px;
    align-self: end;
    margin-top: auto;
    padding: 12px;
}

.trend-card__rating {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2px;
}

.trend-card__rating .fiction-star-display {
    gap: 1px;
}

.trend-card__rating .fiction-star-display__star--full,
.trend-card__rating .fiction-star-display__side--left {
    color: #6eb5ff;
}

.trend-card__rating .fiction-star-display__star--empty,
.trend-card__rating .fiction-star-display__side--right {
    color: rgba(255, 255, 255, 0.28);
}

.trend-card__rank {
    align-self: start;
    margin: 12px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.88);
    color: var(--wine);
    font-weight: 900;
}

.trend-card .landing-fiction-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.trend-card .landing-fiction-meta .fiction-tags--compact {
    width: 100%;
    min-width: 0;
}

.trend-card .fiction-tags.fiction-tags--compact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.trend-card__foot strong {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    line-height: 1.08;
    color: #ffffff;
}

.trend-card__foot small {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 750;
}

.trend-card a > strong,
.trend-card a > small {
    position: relative;
    z-index: 1;
}

.trend-card strong {
    align-self: end;
    margin: auto 12px 4px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    line-height: 1.05;
}

.trend-card small {
    margin: 0 12px 16px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 750;
}

.trend-card .landing-fiction-rating,
.trend-card .fiction-star-display {
    display: inline-flex;
    align-items: center;
}

.trend-card .fiction-star-display__star,
.trend-card .fiction-star-display__side {
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0;
    background: transparent;
    display: inline-block;
    place-items: initial;
}

.fiction-tags--compact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
}

.fiction-tags--compact span {
    display: inline-block;
    max-width: 100%;
    padding: 2px 6px;
    border: 1px solid rgba(23, 32, 38, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: #2c3940;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.trend-card .fiction-tags--compact span {
    padding: 2px 5px;
    font-size: 0.58rem;
    font-weight: 700;
}

.chaptertrail-trending,
.browse-genre-shelf {
    display: grid;
    gap: 16px;
    width: 100%;
    margin: 0;
}

.chaptertrail-trending {
    padding: 0 0 18px;
}

.browse-genre-shelves {
    display: grid;
    gap: 28px;
}

.browse-genre-shelf .chaptertrail-section-heading h2 {
    font-size: 1.65rem;
}

.chaptertrail-trending .eyebrow {
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    margin-bottom: 6px;
}

@media (max-width: 1040px) {
.trend-card a {
        min-height: 280px;
        max-height: none;
    }
}

@media (max-width: 760px) {
.chaptertrail-trending {
        padding-bottom: 12px;
    }

.trend-card a {
        min-height: 240px;
        max-height: none;
    }
}
