/* ═══════════════════════════════════════════════════════════════
                     PAYWALL OVERLAY
   Matches reader aesthetic: Cormorant Garamond headings,
   Inter body, gold accent (--reader-chapter-accent / --gold)
   ═══════════════════════════════════════════════════════════════ */

/* ── Gated chapter blur ── */
.chapter-block.gated {
    position: relative;
    max-height: 400px;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.chapter-block.gated .chapter-body {
    filter: blur(6px);
    opacity: 0.5;
    transition: filter 0.3s ease;
}

.chapter-block.gated .chapter-actions,
.chapter-block.gated .chapter-nav {
    display: none;
}

/* Hide all gated chapters after the first one */
.chapter-block.gated ~ .chapter-block.gated {
    display: none;
}

/* ── The paywall wall ── */
.paywall-overlay {
    position: relative;
    margin: -6rem auto 3rem;
    padding: 3rem 2rem 2.5rem;
    max-width: var(--reader-max-width, 680px);
    text-align: center;
    z-index: 100;
}

.paywall-overlay::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--reader-bg) 100%
    );
    pointer-events: none;
}

.paywall-card {
    background: var(--reader-surface);
    border: 1px solid var(--reader-border);
    border-radius: 20px;
    padding: 2.75rem 2.25rem 2.25rem;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Subtle gold accent line at top */
.paywall-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-muted));
    border-radius: 0 0 3px 3px;
}

.paywall-lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(201, 162, 39, 0.12),
        rgba(201, 162, 39, 0.04));
    border: 1px solid rgba(201, 162, 39, 0.2);
    color: var(--reader-chapter-accent);
    font-size: 1.25rem;
}

.paywall-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--reader-text);
    margin: 0 0 0.6rem;
    line-height: 1.25;
}

.paywall-subtitle {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--reader-text-muted);
    line-height: 1.6;
    max-width: 380px;
    margin: 0 auto 1.5rem;
}

/* ── What you get ── */
.paywall-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.paywall-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    background: var(--reader-bg);
    border: 1px solid var(--reader-border);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--reader-text-muted);
}

.paywall-feature i {
    color: var(--reader-chapter-accent);
    font-size: 0.7rem;
}

/* ── CTA Button ── */
.paywall-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.25rem;
    border-radius: 28px;
    border: none;
    background: linear-gradient(135deg, #c9a227, #b8941f);
    color: white;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 12px rgba(201, 162, 39, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.paywall-cta:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 20px rgba(201, 162, 39, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #d4ac2b, #c9a227);
}

.paywall-cta:active {
    transform: translateY(0);
}

.paywall-price {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.7rem;
    color: var(--reader-text-muted);
    margin-top: 0.85rem;
}

.paywall-price-amount {
    font-weight: 700;
    color: var(--reader-text);
}

.paywall-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.6rem;
    color: var(--reader-text-muted);
    opacity: 0.7;
}

.paywall-trust i {
    font-size: 0.55rem;
}

/* ── Hide gated TOC items styling ── */
.toc-item.locked {
    opacity: 0.5;
    position: relative;
}

.toc-item.locked::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.55rem;
    color: var(--reader-text-muted);
    margin-left: 0.5rem;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .paywall-card {
        padding: 2rem 1.5rem 1.75rem;
    }

    .paywall-title {
        font-size: 1.4rem;
    }

    .paywall-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }

    .paywall-features {
        gap: 0.35rem;
    }
}

/* ── Dark theme adjustments ── */
[data-theme="dark"] .paywall-card {
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        0 1px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .paywall-lock-icon {
    background: linear-gradient(135deg,
        rgba(201, 162, 39, 0.18),
        rgba(201, 162, 39, 0.06));
}

/* ── Sepia theme adjustments ── */
[data-theme="sepia"] .paywall-cta {
    background: linear-gradient(135deg, #8b7355, #7a6548);
    box-shadow:
        0 2px 12px rgba(139, 115, 85, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="sepia"] .paywall-cta:hover {
    background: linear-gradient(135deg, #96795a, #8b7355);
    box-shadow:
        0 4px 20px rgba(139, 115, 85, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.12);
}
