/* HOMEPAGE */

/* Hero: title, image slider and newsletter / giveaway card */
.home-hero { background: linear-gradient(180deg, #fff 0%, var(--sg-bg) 100%); border-bottom: 1px solid var(--sg-border); padding: 2rem 0 3rem 0; }
.home-title { margin: 0 0 1.5rem 0; text-align: left; line-height: 1.15; }
.home-title-name { display: block; font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); font-weight: 700; }
.home-title-sub { display: block; margin-top: .4rem; font-family: var(--sg-font-body); font-size: clamp(.8rem, .7rem + .35vw, 1rem); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sg-accent-dark); }

.image-gallery { list-style: none; padding: 0; margin: 0; }
/* Every slide gets the same shape so the hero never changes height between slides.
   Images with a different ratio are cropped to fit (object-fit: cover). Reserved space also stops layout shift while they load. */
.image-gallery > li { position: relative; aspect-ratio: 1140 / 550; overflow: hidden; background: #ece6dc; }
.image-gallery > li > a { display: block; height: 100%; }
.image-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Before lightSlider starts, show only the first slide so the page does not jump. */
.image-gallery:not(.lightSlider) > li:not(:first-child) { display: none; }
.gallery-cnt .lSSlideOuter { border-radius: var(--sg-radius); overflow: hidden; box-shadow: var(--sg-shadow); }
.gallery-cnt .image-gallery:not(.lightSlider) > li:first-child { border-radius: var(--sg-radius); overflow: hidden; box-shadow: var(--sg-shadow); }
/* Pager dots sit on the white card below the slides, so they need real contrast. */
.gallery-cnt .lSSlideOuter .lSPager.lSpg { margin: 12px 0 14px 0 !important; }
.gallery-cnt .lSSlideOuter .lSPager.lSpg > li { padding: 0 6px; }
.gallery-cnt .lSSlideOuter .lSPager.lSpg > li a { width: 12px; height: 12px; background-color: #c9c2b8; border: 0; box-shadow: inset 0 0 0 1px rgba(42, 39, 51, .12); }
.gallery-cnt .lSSlideOuter .lSPager.lSpg > li:hover a { background-color: #8f877b; }
.gallery-cnt .lSSlideOuter .lSPager.lSpg > li.active a { background-color: var(--sg-accent); box-shadow: none; }
.image-gallery > li .release-date { position: absolute; bottom: 14px; right: 20px; padding: .35rem .7rem; border-radius: var(--sg-radius-sm); background: rgba(20, 18, 26, .55); color: white; font-size: .9rem; text-align: center; }
.image-gallery > li .release-date.top-right { bottom: auto; top: 14px; right: 20px; }
.image-gallery > li .release-date.bottom-left { bottom: 14px; top: auto; right: auto; left: 20px; }
.image-gallery > li .release-date.top-left { bottom: auto; top: 14px; right: auto; left: 20px; }

.home-email-register .congrats { display: none; }
.home-email-register .email-signup { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.email-signup .free-book-details img.free-book { height: 120px; width: auto; margin-bottom: 11px; }
.email-signup .free-book-details p { font-weight: normal; }
.email-signup .free-book-details .free-book-details-image { display: inline-block; }

/* Giveaway card (replaces the newsletter card while a giveaway runs) */
.home-email-register.giveaway-winner .congrats { display: block; background: white; margin: 0 0 .75rem 0; padding: .75rem 1rem; text-align: center; border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-sm); }
.home-email-register.giveaway-winner .congrats h3 { margin-top: 0; font-weight: 700; }
.homepage-giveaway { height: 100%; padding: 1.5rem; }
.homepage-giveaway h3 { font-size: 1.4rem; }
.homepage-giveaway img { width: 100%; height: auto; border-radius: var(--sg-radius-sm); }
.homepage-giveaway .giveaway-content-block { align-items: center; }
.homepage-giveaway .giveaway-countdown .btn { width: 100%; }
.homepage-giveaway .giveaway-countdown .card { margin: 0; }

/* Book sections */
.book-section { padding: 3rem 0 0 0; }
.book-section:last-of-type { padding-bottom: 1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); }
.section-head h2 a { color: var(--sg-ink); text-decoration: none; }
.section-head h2 a:hover { color: var(--sg-accent-dark); }
.section-link { font-size: .95rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.book-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
.book-grid-centered { grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); justify-content: center; }
@media (min-width: 576px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; } }
@media (min-width: 1200px) { .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.book-card { text-align: center; min-width: 0; }
.book-cover { position: relative; display: block; border-radius: 6px; box-shadow: 0 2px 4px rgba(42, 39, 51, .12), 0 10px 24px rgba(42, 39, 51, .16); transition: transform .25s ease, box-shadow .25s ease; }
.book-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #ece6dc; }
.book-cover:hover { transform: translateY(-6px); box-shadow: 0 4px 8px rgba(42, 39, 51, .14), 0 18px 36px rgba(42, 39, 51, .24); }
.book-card h3 { margin: 1rem 0 .25rem 0; font-family: var(--sg-font-body); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card h3 a { color: var(--sg-ink); text-decoration: none; }
.book-card h3 a:hover { color: var(--sg-accent-dark); text-decoration: underline; }
.book-meta { font-size: .85rem; color: var(--sg-muted); }
.book-cover .usa-today-stamp { position: absolute; bottom: -12px; left: -14px; width: 64px; height: 64px; background: url( '/media/misc/usa-today-best-seller-logo-stamp.png' ) no-repeat; background-size: 64px; transform: rotate(-20deg); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }

/* Single upcoming book */
.feature-book { display: grid; grid-template-columns: 1fr; gap: 1.5rem; background: var(--sg-surface); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); padding: 1.5rem; }
@media (min-width: 768px) { .feature-book { grid-template-columns: minmax(180px, 280px) 1fr; gap: 2.5rem; padding: 2rem; align-items: center; } }
.feature-cover { display: block; max-width: 240px; margin: 0 auto; border-radius: 6px; box-shadow: 0 4px 8px rgba(42, 39, 51, .14), 0 16px 36px rgba(42, 39, 51, .22); }
.feature-cover img { display: block; width: 100%; height: auto; border-radius: 6px; }
.feature-body .kicker { display: inline-block; margin-bottom: .75rem; padding: .25rem .75rem; border-radius: 999px; background: var(--sg-accent-soft); color: var(--sg-accent-dark); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.feature-body h3 { margin: 0 0 .25rem 0; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
.feature-body h3 a { color: var(--sg-ink); text-decoration: none; }
.feature-body h4 { margin: 0 0 1rem 0; font-size: 1.2rem; color: var(--sg-muted); font-weight: 500; }
.feature-body .scheduled-date { margin: .5rem 0 1rem 0; color: var(--sg-muted); }
.feature-body .scheduled-date .bi { color: var(--sg-accent); margin-right: .25rem; }
.feature-body .upcoming-timer { margin: 0 0 1.5rem 0; }
.feature-body .feature-description { max-width: 70ch; }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.feature-actions .btn-az-buy-now { display: block; width: 180px; }
.feature-actions .btn-az-buy-now img { display: block; width: 100%; height: auto; }

@media (max-width: 767.98px) {
    .home-hero { padding: 1.25rem 0 2rem 0; }
    .home-title { margin-bottom: 1rem; text-align: center; }
    .home-email-register .email-signup { height: auto; }
    .homepage-giveaway { height: auto; }
    .book-section { padding-top: 2.25rem; }
    .section-head { align-items: center; }
    .feature-book { text-align: center; }
    .feature-actions { justify-content: center; }
    .feature-body .feature-description { text-align: left; }
}

/* RECENT BOOKS: a spotlight for the newest book, then a row that scrolls sideways. Scoped to .recent-books; the upcoming-book sections keep the plain grid. */
.recent-books .rb-spotlight { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); align-items: center; gap: 3rem; padding: 2.75rem 3.25rem; border-radius: calc(var(--sg-radius) + 6px); color: #fff; background: #2a2733; box-shadow: var(--sg-shadow); }
.recent-books .rb-spotlight-bg { position: absolute; inset: -80px; z-index: -2; background-size: cover; background-position: center; filter: blur(50px) saturate(1.4); transform: scale(1.15); }
.recent-books .rb-spotlight::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(20, 17, 28, .62) 0%, rgba(20, 17, 28, .78) 55%, rgba(20, 17, 28, .86) 100%); }

.recent-books .rb-spotlight-cover { position: relative; display: block; justify-self: center; width: 100%; max-width: 300px; perspective: 1000px; }
.recent-books .rb-spotlight-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #3b3548; box-shadow: 0 4px 10px rgba(0, 0, 0, .35), 0 30px 60px rgba(0, 0, 0, .55); transform: rotateY(-9deg) rotateX(2deg); transform-origin: 70% 50%; transition: transform .5s ease, box-shadow .5s ease; }
.recent-books .rb-spotlight-cover:hover img { transform: rotateY(0) rotateX(0) translateY(-5px); }
.recent-books .rb-spotlight-cover .usa-today-stamp { position: absolute; bottom: -20px; left: -22px; width: 88px; height: 88px; background: url( '/media/misc/usa-today-best-seller-logo-stamp.png' ) no-repeat; background-size: 88px; transform: rotate(-20deg); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .4)); }

.recent-books .rb-spotlight-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.recent-books .rb-tag { display: inline-block; padding: .28rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.recent-books .rb-tag a { color: inherit; text-decoration: none; }
.recent-books .rb-tag a:hover { text-decoration: underline; }
.recent-books .rb-tag-hot { background: var(--sg-accent); border-color: var(--sg-accent); }
.recent-books .rb-spotlight-title { margin: 0 0 .3rem 0; font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.08; letter-spacing: -.015em; }
.recent-books .rb-spotlight-title a { color: #fff; text-decoration: none; }
.recent-books .rb-spotlight-title a:hover { color: #ffd9b5; }
.recent-books .rb-spotlight-subtitle { margin: 0 0 .6rem 0; font-family: var(--sg-font-heading); font-size: 1.3rem; font-style: italic; color: #ffd9b5; }
.recent-books .rb-spotlight-date { margin: 0 0 1rem 0; font-size: .92rem; font-weight: 600; letter-spacing: .02em; color: rgba(255, 255, 255, .75); }
.recent-books .rb-spotlight-teaser { max-width: 40rem; margin: 0 0 1.5rem 0; font-size: 1.1rem; line-height: 1.55; color: rgba(255, 255, 255, .92); }
.recent-books .rb-spotlight-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.recent-books .rb-buy { display: inline-flex; align-items: center; gap: .5rem; }
.recent-books .rb-audio { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; font-weight: 600; }
.recent-books .rb-audible { background: #f8991c; border: 2px solid #f8991c; color: #1a1a1a; box-shadow: 0 10px 24px rgba(248, 153, 28, .3); }
.recent-books .rb-audible:hover, .recent-books .rb-audible:focus { background: #e08a12; border-color: #e08a12; color: #1a1a1a; }
.recent-books .rb-audio-amazon { border: 2px solid var(--sg-accent); color: #fff; background: rgba(196, 88, 0, .25); }
.recent-books .rb-audio-amazon:hover, .recent-books .rb-audio-amazon:focus { background: var(--sg-accent); border-color: var(--sg-accent); color: #fff; }
.recent-books .rb-more { display: inline-flex; align-items: center; gap: .5rem; border: 2px solid rgba(255, 255, 255, .55); border-radius: 999px; color: #fff; font-weight: 600; background: transparent; }
.recent-books .rb-more:hover { background: #fff; border-color: #fff; color: var(--sg-ink); }
.recent-books .rb-more .bi { transition: transform .2s ease; }
.recent-books .rb-more:hover .bi { transform: translateX(4px); }

/* The sideways row */
.recent-books .rb-row-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem 0; }
.recent-books .rb-row-head h3 { margin: 0; font-size: 1.35rem; }
.recent-books .rb-arrows { display: flex; gap: .5rem; }
.recent-books .rb-arrow { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; color: var(--sg-ink); font-size: 1.1rem; box-shadow: var(--sg-shadow-sm); transition: background-color .15s, color .15s, transform .15s, opacity .15s; }
.recent-books .rb-arrow:hover:not(:disabled) { background: var(--sg-accent); color: #fff; transform: translateY(-2px); }
.recent-books .rb-arrow:disabled { opacity: .35; cursor: default; }

.recent-books .rb-scroller { position: relative; margin-inline: calc(var(--sg-gutter) * -1); }
.recent-books .rb-scroller::before, .recent-books .rb-scroller::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 2; width: var(--sg-gutter); pointer-events: none; }
.recent-books .rb-scroller::before { left: 0; background: linear-gradient(90deg, var(--sg-bg), rgba(250, 247, 242, 0)); }
.recent-books .rb-scroller::after { right: 0; background: linear-gradient(270deg, var(--sg-bg), rgba(250, 247, 242, 0)); }
.recent-books .rb-track { display: flex; gap: 1.5rem; margin: 0; padding: 1.1rem var(--sg-gutter) 1.5rem var(--sg-gutter); list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--sg-gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
.recent-books .rb-track::-webkit-scrollbar { display: none; }
.recent-books .rb-track:focus-visible { outline: 2px solid var(--sg-accent); outline-offset: -2px; }

.recent-books .rb-card { flex: 0 0 clamp(150px, 15.2vw, 205px); scroll-snap-align: start; min-width: 0; text-align: center; }
.recent-books .rb-cover { position: relative; display: block; overflow: hidden; border-radius: 6px; box-shadow: 0 2px 4px rgba(42, 39, 51, .12), 0 10px 24px rgba(42, 39, 51, .16); transition: transform .25s ease, box-shadow .25s ease; }
.recent-books .rb-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; background: #ece6dc; transition: transform .4s ease; }
.recent-books .rb-cover:hover { transform: translateY(-6px); box-shadow: 0 4px 8px rgba(42, 39, 51, .14), 0 18px 36px rgba(42, 39, 51, .26); }
.recent-books .rb-cover:hover img { transform: scale(1.04); }
.recent-books .rb-peek { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .5rem .7rem .5rem; background: linear-gradient(180deg, rgba(20, 17, 28, 0), rgba(20, 17, 28, .85)); color: #fff; font-size: .85rem; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.recent-books .rb-cover:hover .rb-peek, .recent-books .rb-cover:focus-visible .rb-peek { opacity: 1; transform: none; }
.recent-books .rb-cover .usa-today-stamp { position: absolute; bottom: 6px; right: 6px; left: auto; width: 52px; height: 52px; background: url( '/media/misc/usa-today-best-seller-logo-stamp.png' ) no-repeat; background-size: 52px; transform: rotate(-20deg); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.recent-books .rb-card h4 { margin: 1rem 0 .25rem 0; font-family: var(--sg-font-body); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-books .rb-card h4 a { color: var(--sg-ink); text-decoration: none; }
.recent-books .rb-card h4 a:hover { color: var(--sg-accent-dark); text-decoration: underline; }

/* The last tile in the row and the button under it: this is only the newest books, so point at the full catalog. */
.recent-books .rb-all-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; aspect-ratio: 2 / 3; padding: 1rem; text-align: center; color: #fff; text-decoration: none; background: radial-gradient(120% 90% at 100% 0%, rgba(196, 88, 0, .8) 0%, rgba(196, 88, 0, 0) 60%), linear-gradient(160deg, #2a2733 0%, #5a3b5d 100%); }
.recent-books .rb-all-number { font-family: var(--sg-font-heading); font-size: 3.6rem; font-weight: 700; line-height: 1; font-variant-numeric: lining-nums; }
.recent-books .rb-all-label { font-size: .95rem; font-weight: 600; line-height: 1.3; color: rgba(255, 255, 255, .85); }
.recent-books .rb-all-go { display: inline-flex; align-items: center; gap: .4rem; margin-top: .4rem; padding: .35rem .9rem; border-radius: 999px; background: #fff; color: var(--sg-ink); font-size: .85rem; font-weight: 700; }
.recent-books .rb-all-go .bi { transition: transform .2s ease; }
.recent-books .rb-all-cover:hover .rb-all-go .bi { transform: translateX(4px); }
.recent-books .rb-all-cta { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-top: .5rem; text-align: center; }
.recent-books .rb-all-cta p { margin: 0; color: var(--sg-muted); font-size: 1rem; }
.recent-books .rb-all-cta .btn { display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 2.25rem; border-radius: 999px; font-weight: 600; }
.recent-books .rb-all-cta .btn .bi { transition: transform .2s ease; }
.recent-books .rb-all-cta .btn:hover .bi { transform: translateX(4px); }

@media (max-width: 991.98px) {
    .recent-books .rb-spotlight { gap: 2rem; padding: 2.25rem 2rem; }
}

@media (max-width: 767.98px) {
    .recent-books .rb-spotlight { grid-template-columns: 1fr; gap: 1.75rem; padding: 1.75rem 1.25rem 1.75rem 1.25rem; text-align: center; }
    .recent-books .rb-spotlight-cover { max-width: 220px; }
    .recent-books .rb-spotlight-cover img { transform: none; }
    .recent-books .rb-spotlight-tags, .recent-books .rb-spotlight-actions { justify-content: center; }
    .recent-books .rb-spotlight-teaser { margin-inline: auto; text-align: left; }
    .recent-books .rb-spotlight-actions .btn { flex: 1 1 100%; justify-content: center; }
    .recent-books .rb-arrows { display: none; }
    .recent-books .rb-card { flex-basis: 150px; }
    .recent-books .rb-peek { display: none; }
    .recent-books .rb-all-cta .btn { width: 100%; justify-content: center; padding-inline: 1rem; }
}
