/* =============================================
   What's New Modern Block — Frontend Styles
   ============================================= */

.lwp-wnm {
    --wnm-gap: 24px;
    --wnm-radius: 16px;
    --wnm-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 80px 24px;
}

/* ===== Section Header ===== */
.lwp-wnm-header {
    text-align: center;
    margin-bottom: 48px;
}

.lwp-wnm-tag {
    display: inline-block;
    font-family: var(--lwp-font-sans, 'Inter', -apple-system, sans-serif);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lwp-accent-light, var(--lwp-accent, #7c5cbf));
    margin-bottom: 12px;
    opacity: 0.85;
}

.lwp-wnm-title {
    font-family: var(--lwp-font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--lwp-text-primary, #e8eaf0);
    margin-bottom: 20px;
}

.lwp-wnm-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--lwp-accent, #7c5cbf), transparent);
    margin: 0 auto;
    opacity: 0.6;
}

/* ===== Slider Container ===== */
.lwp-wnm-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.lwp-wnm-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Respect reduced-motion preference: disable slide transition */
@media (prefers-reduced-motion: reduce) {
    .lwp-wnm-track {
        transition: none;
    }

    .lwp-wnm-arrow:hover {
        transform: none;
    }
}

/* ===== Featured Book Card ===== */
.lwp-wnm-slide {
    flex-shrink: 0;
    width: 100%;
}

.lwp-wnm-card {
    display: flex;
    background: var(--lwp-surface, rgba(20, 30, 50, 0.6));
    border-radius: var(--wnm-radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    min-height: 380px;
}

.lwp-wnm-card-img {
    width: 280px;
    min-height: 380px;
    object-fit: cover;
    flex-shrink: 0;
}

.lwp-wnm-card-content {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.lwp-wnm-series {
    font-family: var(--lwp-font-sans, 'Inter', -apple-system, sans-serif);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lwp-accent-light, var(--lwp-accent, #7c5cbf));
    margin-bottom: 12px;
}

.lwp-wnm-book-title {
    font-family: var(--lwp-font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--lwp-text-primary, #e8eaf0);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lwp-wnm-desc {
    color: var(--lwp-text-secondary, #9aa5b8);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* WYSIWYG content brings its own <p> tags and renders inside a block-level
   container; reset inner paragraph margins to keep the block compact.
   Description is shown in full (no line-clamp) in every layout. */
.lwp-wnm-desc > p { margin: 0; }

.lwp-wnm-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--lwp-border, rgba(124, 92, 191, 0.2));
    flex-wrap: wrap;
}

.lwp-wnm-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lwp-wnm-meta-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lwp-wnm-rating {
    color: #f5c542;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.lwp-wnm-pub-info {
    font-size: 0.82rem;
    color: var(--lwp-text-muted, #6b7a94);
}

/* WYSIWYG field — inner paragraphs must not push the meta row apart */
.lwp-wnm-pub-info > p { margin: 0; }

/* CTA buttons use the shared .lwp-btn system (css/lwp-modern-buttons.css) —
   rendered as lwp-btn lwp-btn--solid lwp-btn--xl, same size as hero CTAs. */

.lwp-wnm-more-info {
    font-family: var(--lwp-font-sans, 'Inter', -apple-system, sans-serif);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--lwp-text-secondary, #9aa5b8);
    text-decoration: none;
    transition: var(--wnm-transition);
}

.lwp-wnm-more-info:hover {
    color: var(--lwp-text-primary, #e8eaf0);
}

/* ===== Slider Controls ===== */
.lwp-wnm-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 8px;
}

.lwp-wnm-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--lwp-surface, rgba(20, 30, 50, 0.8));
    border: 1px solid var(--lwp-border, rgba(124, 92, 191, 0.2));
    color: var(--lwp-text-primary, #e8eaf0);
    font-size: 1.4rem;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wnm-transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lwp-wnm-arrow:hover {
    background: var(--lwp-accent, #7c5cbf);
    border-color: var(--lwp-accent, #7c5cbf);
    transform: scale(1.05);
}

/* ===== Pagination Dots ===== */
.lwp-wnm-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.lwp-wnm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lwp-border, rgba(124, 92, 191, 0.2));
    border: none;
    cursor: pointer;
    transition: var(--wnm-transition);
    padding: 0;
}

.lwp-wnm-dot.active,
.lwp-wnm-dot:hover {
    background: var(--lwp-accent-light, var(--lwp-accent, #a382de));
    transform: scale(1.3);
}

/* ===== Single Card Mode (no slider chrome) ===== */
.lwp-wnm--single .lwp-wnm-track {
    transition: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .lwp-wnm {
        padding: 60px 16px;
    }

    .lwp-wnm-card {
        flex-direction: column;
    }

    .lwp-wnm-card-img {
        width: 100%;
        min-height: 250px;
        max-height: 300px;
    }

    .lwp-wnm-card-content {
        padding: 28px 24px;
    }

    /* CTA mobile sizing is handled by the shared .lwp-btn--xl media query. */

    .lwp-wnm-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .lwp-wnm-header {
        margin-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .lwp-wnm {
        padding: 48px 12px;
    }

    .lwp-wnm-card-img {
        min-height: 200px;
        max-height: 250px;
    }

    .lwp-wnm-card-content {
        padding: 24px 20px;
    }

    .lwp-wnm-book-title {
        font-size: 1.4rem;
    }

    /* Hide arrows on very small screens — swipe is primary */
    .lwp-wnm-arrows {
        display: none;
    }

    .lwp-wnm-dot {
        width: 12px;
        height: 12px;
    }
}

/* =============================================
   Hero Layout (.lwp-wnm--hero)
   De-chromed slider: full-height cover panel +
   hero-scale typography on the page background.
   Identical markup to the card layout — CSS only.
   ============================================= */
.lwp-wnm--hero .lwp-wnm-slider {
    max-width: 1200px;
}

.lwp-wnm--hero .lwp-wnm-card {
    background: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 520px;
}

.lwp-wnm--hero .lwp-wnm-card-img {
    width: 40%;
    min-width: 320px;
    min-height: 520px;
    border-radius: 12px;
}

.lwp-wnm--hero .lwp-wnm-card-content {
    padding: 48px 44px;
}

.lwp-wnm--hero .lwp-wnm-book-title {
    font-size: clamp(2.6rem, 6vw, 4rem);
}

.lwp-wnm--hero .lwp-wnm-desc {
    max-width: 600px;
}

/* =============================================
   Hero variation: Compact (.lwp-wnm--hero-compact)
   Same fields & concept — smaller cover, tighter
   vertical rhythm, slightly smaller typography.
   ============================================= */
.lwp-wnm--hero-compact .lwp-wnm-slider {
    max-width: 1000px;
}

.lwp-wnm--hero-compact .lwp-wnm-card {
    background: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 440px;
}

.lwp-wnm--hero-compact .lwp-wnm-card-img {
    width: 300px;
    min-width: 240px;
    min-height: 440px;
    border-radius: 10px;
}

.lwp-wnm--hero-compact .lwp-wnm-card-content {
    padding: 32px 32px;
}

.lwp-wnm--hero-compact .lwp-wnm-book-title {
    font-size: clamp(2rem, 4vw, 2.6rem);
}

.lwp-wnm--hero-compact .lwp-wnm-desc {
    max-width: 520px;
}

/* =============================================
   Hero variation: Split (.lwp-wnm--hero-split)
   Same fields & concept — cover moved to the
   right side of the panel (mirrored alignment).
   ============================================= */
.lwp-wnm--hero-split .lwp-wnm-slider {
    max-width: 1200px;
}

.lwp-wnm--hero-split .lwp-wnm-card {
    background: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 520px;
    flex-direction: row-reverse;
}

.lwp-wnm--hero-split .lwp-wnm-card-img {
    width: 42%;
    min-width: 320px;
    min-height: 520px;
    border-radius: 12px;
}

.lwp-wnm--hero-split .lwp-wnm-card-content {
    padding: 48px 44px;
}

.lwp-wnm--hero-split .lwp-wnm-book-title {
    font-size: clamp(2.6rem, 6vw, 4rem);
}

.lwp-wnm--hero-split .lwp-wnm-desc {
    max-width: 600px;
}


/* =============================================
   Hero variations — mobile reset
   Collapse every hero variant back to the base
   stacked card on small screens (image becomes a
   capped-width banner above the text, no fixed
   heights, no mirrored row).
   ============================================= */
@media (max-width: 768px) {
    .lwp-wnm--hero-compact .lwp-wnm-card,
    .lwp-wnm--hero-split .lwp-wnm-card {
        min-height: 0;
    }

    .lwp-wnm--hero-split .lwp-wnm-card {
        flex-direction: column;
    }

    .lwp-wnm--hero-compact .lwp-wnm-card-img,
    .lwp-wnm--hero-split .lwp-wnm-card-img {
        width: 100%;
        min-height: 250px;
        max-height: 300px;
    }
}

/* Hero layout — responsive */
@media (max-width: 768px) {
    .lwp-wnm--hero .lwp-wnm-card {
        min-height: 0;
    }

    /* Cover becomes a top banner. The height caps must be restated here
       instead of relying on the base rules: the desktop min-height: 520px
       has higher specificity than the .lwp-wnm-card-img mobile caps, and
       min-height beats max-height when they conflict — without this reset
       the hero cover stayed >=520px tall on phones. */
    .lwp-wnm--hero .lwp-wnm-card-img {
        width: 100%;
        min-width: 0;
        min-height: 250px;
        max-height: 300px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .lwp-wnm--hero .lwp-wnm-book-title {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
    }
}
