/* Hero Billboard Component Styles - Flexible layout with book and text */

/* ===================================
   CONTAINER & BASE STYLES
   =================================== */
.hero-billboard-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
}

.hero-billboard {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 85vh;
    overflow: hidden;
    /* Reserve vertical panning for page scroll and hand horizontal gestures to the JS swipe handler
       (initializeCarouselSwipe). Without this, a touch-device horizontal swipe with any vertical drift
       is stolen by the browser for scrolling and fires touchcancel, so the swipe never registers. */
    touch-action: pan-y;
}

/* Ensure UI controls can receive clicks even with layered slides/backgrounds */
.hero-indicators,
.hero-nav-controls {
    pointer-events: auto;
    position: absolute;
    z-index: 50;
}

.hero-indicator,
.hero-nav-btn {
    pointer-events: auto;
}

/* ===================================
   SLIDE STRUCTURE
   =================================== */
/* Base slide styles */
.hero-billboard-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1000ms ease-in-out, visibility 1000ms ease-in-out;
    z-index: 1;
}

/* Incoming slide fades in on top */
.hero-billboard-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    animation: none !important; /* keep transition-driven crossfade */
}

/* Outgoing slide stays visible and fades out underneath */
.hero-billboard-slide.exiting {
    opacity: 0;
    visibility: visible;
    z-index: 1;
    animation: none !important;
}

/* Ensure background and content do not flash during crossfade */
.hero-billboard-background { will-change: opacity, transform; }
.hero-content-wrapper { will-change: opacity, transform; }

/* ===================================
   BACKGROUND STYLING
   =================================== */
.hero-billboard-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) saturate(1.3);
    transform: scale(1.08);
    z-index: 1;
    animation: heroZoomSlow 14s ease-in-out both; /* subtle Ken Burns */
}

/* Promotional image background - no blur, full quality */
.hero-billboard-background.promo-background {
    filter: none;
    transform: scale(1.02);
    background-size: cover;
    background-position: center center;
}

/* Overlay for text readability - REMOVED for brighter hero display */
.hero-billboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Overlay removed - no darkening */
    background: none;
    z-index: 2;
}

/* ===================================
   HERO CONTENT LAYOUT
   =================================== */
.hero-content-wrapper {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 4rem;
    gap: 3rem;
}

/* Book section */
.hero-book-section {
    flex-shrink: 0;
}

.hero-book-image {
    max-height: 50vh;
    max-width: 280px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: none;
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.4s ease;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(8px) perspective(1000px) rotateY(-5deg);
}

.hero-book-image:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

/* Text section */
.hero-text-section {
    flex: 1;
    max-width: 600px;
}

.hero-headline {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 0.75rem 0;
    line-height: 1.15;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(10px);
}

.hero-subheadline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(12px);
}

/* Animate child elements when slide becomes active (staggered) */
.hero-billboard-slide.active .hero-book-image {
    animation: fadeInUp 600ms ease-out 120ms both;
}

.hero-billboard-slide.active .hero-headline {
    animation: fadeInUp 550ms ease-out 180ms both;
}

.hero-billboard-slide.active .hero-subheadline {
    animation: fadeInUp 550ms ease-out 260ms both;
}

/* ===================================
   "NOW A SERIES" WATCH BADGE
   Signposts a book adapted into a Watch show, above the headline; tappable -> /watch/{slug}.
   Deliberately styled as a compact cinematic pill, NOT a .hero-cta-btn: it is cross-navigation
   to a separate product, not another format of this book. Uses Watch's cyan signature
   (#7FE3FF / #00B4FF), mirroring the book page's .book-view-series-banner. Always white-on-dark
   like the headline, so -- like .hero-headline / .hero-subheadline -- it needs no
   body.dark-mode override (the hero art is dark in both themes).
   =================================== */
.hero-series-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 100%;
    margin: 0 0 0.9rem 0;
    padding: 0.4rem 0.95rem 0.4rem 0.5rem;
    border-radius: 999px;
    background: rgba(9, 16, 30, 0.55);
    border: 1px solid rgba(127, 227, 255, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    /* Intro animation defaults (slides in just before the headline). */
    opacity: 0;
    transform: translateY(8px);
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, border-color 0.16s ease-out;
}

.hero-series-kicker:hover {
    transform: translateY(-1px);
    border-color: rgba(127, 227, 255, 0.6);
    box-shadow: 0 10px 26px rgba(0, 180, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #fff;
}

.hero-series-kicker:visited { color: #fff; }

.hero-series-kicker-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(127, 227, 255, 0.16);
    border: 1px solid rgba(127, 227, 255, 0.3);
    color: #7FE3FF;
    font-size: 0.95rem;
}

.hero-series-kicker-icon i { margin-left: 1px; } /* optically center the play triangle */

.hero-series-kicker-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0; /* lets a long title ellipsize instead of overflowing the pill */
    text-align: left; /* keep copy left-aligned even under .hero-layout-center */
}

.hero-series-kicker-eyebrow {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7FE3FF;
}

.hero-series-kicker-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-billboard-slide.active .hero-series-kicker {
    animation: fadeInUp 550ms ease-out 140ms both;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Optional: animate CTA group slightly later */
.hero-billboard-slide.active .hero-cta-group {
    animation: fadeInUp 500ms ease-out 340ms both;
}

/* ===================================
   LAYOUT MODES
   =================================== */
/* Left layout - book on left, text on right (default) */
.hero-layout-left .hero-content-wrapper {
    flex-direction: row;
}

.hero-layout-left .hero-text-section {
    text-align: left;
}

.hero-layout-left .hero-cta-group {
    justify-content: flex-start;
}

/* Right layout - book on right, text on left */
.hero-layout-right .hero-content-wrapper {
    flex-direction: row-reverse;
}

.hero-layout-right .hero-text-section {
    text-align: left;
}

.hero-layout-right .hero-cta-group {
    justify-content: flex-start;
}

.hero-layout-right .hero-billboard-overlay {
    /* No overlay gradient */
    background: none;
}

/* Center layout - book and text centered */
.hero-layout-center .hero-content-wrapper {
    flex-direction: column;
    text-align: center;
}

.hero-layout-center .hero-text-section {
    text-align: center;
}

.hero-layout-center .hero-cta-group {
    justify-content: center;
}

.hero-layout-center .hero-billboard-overlay {
    /* No overlay gradient */
    background: none;
}

/* ===================================
   CTA BUTTONS - Site Theme Style
   =================================== */
.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff !important; /* Force white text */
}

/* Ensure visited links don't change color */
.hero-cta-btn:visited {
    color: #fff !important;
}

/* Primary button - unQbd Blue (Start Free / Read Now) */
.hero-cta-primary {
    background: linear-gradient(135deg, #00B4FF 0%, #0174B1 100%);
    color: #fff !important;
}

.hero-cta-primary:hover {
    background: linear-gradient(135deg, #00A6EC 0%, #016196 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 255, 0.40);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-primary:visited {
    color: #fff !important;
}

/* Secondary button - Slate (Preview) */
.hero-cta-secondary {
    background: linear-gradient(135deg, #2E3A4A 0%, #1B2330 100%);
    color: #fff !important;
}

.hero-cta-secondary:hover {
    background: linear-gradient(135deg, #26303E 0%, #141A24 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 29, 45, 0.35);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-secondary:visited {
    color: #fff !important;
}

/* Audio button - audiobook Indigo (Listen Now). Matches the Discover audiobooks rail
   (#673ab7) and this component's own dark-mode Listen Now, so audiobook reads as a cool
   color everywhere. Keeps it clearly distinct from the adjacent read-along Ember button
   (both were warm and looked like one pair before) and from the blue Read Now beside it. */
.hero-cta-audio {
    background: linear-gradient(135deg, #673AB7 0%, #512DA8 100%);
    color: #fff !important;
}

.hero-cta-audio:hover {
    background: linear-gradient(135deg, #5E35B1 0%, #4527A0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(103, 58, 183, 0.40);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-audio:visited {
    color: #fff !important;
}

/* Read-along button - Ember orange (matches the BookCard read-along badge). The darker end of the
   read-along Ember keeps the forced white button text legible -- a flat #FFAA00 amber is too light
   under white text at button scale. */
.hero-cta-readalong {
    background: linear-gradient(135deg, #F59300 0%, #E07B00 100%);
    color: #fff !important;
}

.hero-cta-readalong:hover {
    background: linear-gradient(135deg, #E07B00 0%, #C96A00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 123, 0, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-readalong:visited {
    color: #fff !important;
}

/* The inline read-along mark inherits the button's white text and does not shrink. */
.hero-cta-ra-icon {
    color: inherit;
    flex: 0 0 auto;
}

.hero-cta-btn i {
    font-size: 1.1rem;
    color: inherit;
}

/* ===================================
   NAVIGATION INDICATORS - Progress Bar Style
   =================================== */
.hero-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 50;
}

.hero-indicator {
    position: relative;
    width: 2.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.hero-indicator.active {
    background: rgba(255, 255, 255, 0.25);
    width: 3.5rem;
}

/* Progress bar animation inside active indicator */
.hero-indicator-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--highlight-color, #f59e0b) 0%, #fbbf24 100%);
    transform-origin: left;
    /* Animation duration set via inline style from component to stay in sync with AutoplayIntervalMs */
    animation: progressBar linear forwards;
    border-radius: 2px;
}

@keyframes progressBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* First in the keyboard tab order; visible for both rotation states.
   Never in the top band: on /discover the hero starts at the top of the page, under the fixed
   top nav, whose full-width header box takes every click and tap there and hides the focus ring.
   Above the phone layout the slide content is centered in the whole hero, nav band included, so
   the free space just under the nav is the free space at the bottom minus the nav's height, and
   a button placed there sat on covers and headlines at 900 to 1200px wide. The bottom-right
   corner, in the slide-dot row, stays clear of the slide content, arrows and dots (phones: see
   the 768px block). */
.hero-rotation-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 60;
}

.hero-rotation-btn i {
    font-size: 1.2rem;
}

.hero-rotation-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #16212e;
}

/* Icon only on phones, tablets up to the nav's 900px breakpoint, and short screens (a phone in
   landscape, a short laptop window). There the slide content fills nearly the whole hero, and the
   labelled pill reached the last call-to-action button, the headline or the cover (measured at
   769 to 1400px wide, 601 to 1024px tall). The aria-label still names the action. */
@media (max-width: 900px), (max-height: 650px) {
    .hero-rotation-btn {
        right: 1rem;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-rotation-btn span {
        display: none;
    }
}

/* ===================================
   NAVIGATION CONTROLS - Modern centered approach
   =================================== */
.hero-nav-controls {
    /* Remove old container - buttons are now positioned individually */
    display: contents;
}

.hero-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    /* Subtle shadow for depth */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-nav-prev {
    left: 2rem;
}

.hero-nav-next {
    right: 2rem;
}

.hero-nav-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hero-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

/* Hide on initial load, fade in after content loads */
.hero-nav-btn {
    opacity: 0;
    animation: fadeInNavBtn 0.4s ease-out 0.8s forwards;
}

@keyframes fadeInNavBtn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   EMPTY STATE
   =================================== */
.hero-billboard-empty {
    min-height: 50vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-billboard-empty .hero-billboard-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
}

.hero-empty-state {
    text-align: center;
    max-width: 600px;
}

.hero-empty-state p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-empty-state .hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===================================
   SKELETON LOADING
   =================================== */
.hero-billboard-skeleton {
    opacity: 0;
    animation: fadeInHero 0.5s ease-out forwards;
}

.hero-billboard-skeleton .hero-billboard-background {
    background: linear-gradient(90deg, #f0f3f5 25%, #e2e8ec 50%, #f0f3f5 75%);
    background-size: 200% 100%;
    filter: none;
    animation: shimmerHero 1.5s ease-in-out infinite;
}

/* Fade in animation for hero billboard content */
.hero-billboard-slide.active {
    animation: fadeInHero 0.6s ease-out forwards;
}

@keyframes fadeInHero {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmerHero {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Staggered entrance animation */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Subtle background zoom for active slide */
@keyframes heroZoomSlow {
    0% { transform: scale(1.06); }
    100% { transform: scale(1.10); }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-billboard-slide { transition: none; }
    .hero-billboard-slide.active, .hero-billboard-skeleton { animation: none; }
    .hero-billboard-background { animation: none; }
    .hero-billboard-slide.active .hero-book-image,
    .hero-billboard-slide.active .hero-series-kicker,
    .hero-billboard-slide.active .hero-headline,
    .hero-billboard-slide.active .hero-subheadline,
    .hero-billboard-slide.active .hero-cta-group { animation: none; opacity: 1; transform: none; }
}

/* ===================================
   DARK MODE STYLES
   =================================== */
body.dark-mode .hero-indicator.active {
    background: #f59e0b;
}

body.dark-mode .hero-cta-primary {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: #fff !important;
}

body.dark-mode .hero-cta-primary:hover {
    background: linear-gradient(135deg, #1ea850 0%, #0e9f6e 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    color: #fff !important;
}

body.dark-mode .hero-cta-primary:visited {
    color: #fff !important;
}

body.dark-mode .hero-cta-audio {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff !important;
}

body.dark-mode .hero-cta-audio:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    color: #fff !important;
}

body.dark-mode .hero-cta-audio:visited {
    color: #fff !important;
}

body.dark-mode .hero-cta-readalong {
    background: linear-gradient(135deg, #FF9F1C 0%, #F07800 100%);
    color: #fff !important;
}

body.dark-mode .hero-cta-readalong:hover {
    background: linear-gradient(135deg, #F07800 0%, #D96A00 100%);
    box-shadow: 0 6px 20px rgba(255, 159, 28, 0.4);
    color: #fff !important;
}

body.dark-mode .hero-cta-readalong:visited {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary:hover {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary:visited {
    color: #fff !important;
}

/* ===================================
   DARK MODE ADJUSTMENTS
   =================================== */
body.dark-mode .hero-billboard-overlay {
    /* Add back a subtle overlay in dark mode for text readability */
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.05) 100%);
}

body.dark-mode .hero-layout-center .hero-billboard-overlay {
    background: radial-gradient(circle at center,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.18) 55%,
        rgba(0, 0, 0, 0.05) 100%) !important;
}

body.dark-mode .hero-layout-right .hero-billboard-overlay {
    background: linear-gradient(270deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.05) 100%) !important;
}

body.dark-mode .hero-billboard-background {
    filter: blur(30px) saturate(1.15) brightness(0.82);
}

body.dark-mode .hero-billboard-background.promo-background {
    filter: brightness(0.9) contrast(1.05);
}

body.dark-mode .hero-nav-btn {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.50);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.dark-mode .hero-nav-btn:hover {
    background: rgba(0, 0, 0, 0.50);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

body.dark-mode .hero-indicator {
    background: rgba(255, 255, 255, 0.25);
}

body.dark-mode .hero-indicator:hover {
    background: rgba(255, 255, 255, 0.40);
}

body.dark-mode .hero-indicator.active {
    background: rgba(255, 255, 255, 0.20);
}

body.dark-mode .hero-indicator-progress {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

body.dark-mode .hero-rotation-btn {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===================================
   RESPONSIVE STYLES - TABLET
   =================================== */
@media (max-width: 992px) {
    .hero-billboard {
        min-height: 60vh;
    }

    .hero-content-wrapper {
        padding: 2rem;
        gap: 2rem;
    }

    .hero-book-image {
        max-height: 40vh;
        max-width: 220px;
    }

    .hero-headline {
        font-size: 2.2rem;
    }

    /* Slightly smaller nav buttons on tablet */
    .hero-nav-btn {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.2rem;
    }

    .hero-nav-prev {
        left: 1.5rem;
    }

    .hero-nav-next {
        right: 1.5rem;
    }
}

/* ===================================
   RESPONSIVE STYLES - MOBILE
   Force centered layout on mobile
   =================================== */
@media (max-width: 768px) {
.hero-billboard {
    /* Optimize for mobile viewport - account for nav bar */
    min-height: calc(100vh - 70px);
    max-height: none;
}

    /* Use percentage width on mobile for reliable centering in MAUI WebView */
    .hero-billboard-container {
        width: 100%;
        margin-left: 0;
    }

    /* Force centered layout on mobile regardless of HeroLayoutMode */
    .hero-billboard-slide .hero-content-wrapper {
        flex-direction: column !important;
        text-align: center;
        padding: 2rem 1.5rem;
        padding-top: 100px; /* Reduced - new nav is edge-to-edge so needs less clearance */
        padding-bottom: 9rem; /* Clear nav buttons + indicators */
        gap: 1.5rem;
    }

    .hero-billboard-slide .hero-text-section {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .hero-billboard-slide .hero-cta-group {
        justify-content: center !important;
        flex-direction: column !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .hero-billboard-slide .hero-billboard-overlay {
        /* No overlay gradient on mobile */
        background: none !important;
    }

    .hero-book-image {
        max-height: 35vh;
        max-width: 180px;
        transform: none;
    }

    .hero-book-image:hover {
        transform: scale(1.02);
    }

    .hero-headline {
        font-size: 1.6rem;
    }

    .hero-subheadline {
        font-size: 1rem;
    }

    .hero-cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.85rem 2rem;
    }

    .hero-indicators {
        bottom: 4rem;
    }

    /* Rotation button on mobile - top right, just below the fixed nav (the phone layout pads the
       slide content down past it). --topnav-controls-top follows the nav's breakpoints and the
       app's safe-area inset (80px, the tallest bar without an inset, if navigation.css is ever
       missing); 0.5rem leaves room for the 5px focus ring. Landscape: see the next block. */
    .hero-rotation-btn {
        top: calc(var(--topnav-controls-top, 80px) + 0.5rem);
        bottom: auto;
    }

    /* Mobile nav buttons - larger tap targets, positioned in thumb zones */
    .hero-nav-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1.15rem;
        /* Position lower for easier thumb reach */
        top: auto;
        bottom: 7rem;
        transform: none;
        /* Slight inset from edges */
        background: rgba(255, 255, 255, 0.18);
    }

    .hero-nav-prev {
        left: 1rem;
    }

    .hero-nav-next {
        right: 1rem;
    }

    .hero-nav-btn:hover {
        transform: scale(1.08);
    }

    .hero-nav-btn:active {
        transform: scale(0.96);
    }
}

/* A small phone in landscape (768px or narrower; wider ones get the bottom-right icon above).
   The hero is only about 250 to 350px tall, so just under the nav the rotation button met the
   Next arrow (right: 1rem, 3rem wide, bottom: 7rem). Step left of the arrow column instead. The
   bottom of the hero is no option here: the fixed bottom nav, taller with the Android navigation
   inset, reaches into it. */
@media (max-width: 768px) and (max-height: 420px) {
    .hero-rotation-btn {
        right: 4.5rem;
    }
}

/* ===================================
   RESPONSIVE STYLES - SMALL MOBILE
   =================================== */
@media (max-width: 480px) {
    .hero-billboard {
        min-height: 90vh;
    }

    .hero-billboard-slide .hero-content-wrapper {
        padding: 1.5rem 1rem;
        padding-top: 95px; /* Adjusted for edge-to-edge nav */
        padding-bottom: 8rem; /* Clear nav buttons + indicators */
    }

    .hero-book-image {
        max-height: 30vh;
        max-width: 150px;
    }

    .hero-headline {
        font-size: 1.4rem;
    }

    .hero-subheadline {
        font-size: 0.9rem;
    }

    .hero-cta-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .hero-indicators {
        bottom: 3.5rem;
        gap: 0.4rem;
    }

    .hero-indicator {
        width: 1.8rem;
    }

    .hero-indicator.active {
        width: 2.5rem;
    }

    /* Small mobile - maintain positioning consistency */
    .hero-nav-btn {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.05rem;
        bottom: 6.5rem;
    }

    .hero-nav-prev {
        left: 0.75rem;
    }

    .hero-nav-next {
        right: 0.75rem;
    }
}

/* ===================================
   ULTRA-WIDE SCREENS
   =================================== */
@media (min-width: 1800px) {
    .hero-billboard {
        max-height: 90vh;
    }

    .hero-content-wrapper {
        max-width: 1600px;
    }

    .hero-book-image {
        max-height: 55vh;
        max-width: 320px;
    }

    .hero-headline {
        font-size: 3.2rem;
    }

    .hero-cta-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
}
