/*
 * Paywall presentation. Pairs with nsam-paywall.js.
 *
 * The card covers the lower half of the screen and stays there, but the site
 * behind it keeps working: the reader can scroll, use the header and footer,
 * and click through to anything else. Only the rest of THIS story is out of
 * reach. Everything here is scoped to Outpost's paywall markup so it cannot
 * affect the rest of the site.
 */

/* Undo the modal's page lock. Inline styles need the override. */
body.nsam-has-paywall,
body:has(.outpost-paywall-popup[data-nsam-paywall]) {
    overflow: visible !important;
}

/* Outpost ships `.outpost-cta.outpost-paywall-popup { top:0; height:100vh;
   align-items:center }` and injects it at runtime, so it lands after this
   file and wins on source order at equal specificity. Hence the extra class
   and the !important flags: without them the card centres over the whole
   screen instead of sitting at the foot of it. */
.outpost-cta.outpost-paywall-popup[data-nsam-paywall] {
    align-items: flex-end !important;
    justify-content: center !important;
    background: none !important;
    backdrop-filter: none !important;
    z-index: 60;
    /* Clicks belong to the site behind; only the card itself takes them. */
    pointer-events: none !important;
}

.outpost-cta.outpost-paywall-popup[data-nsam-paywall] .nsam-paywall-inner {
    pointer-events: auto;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
    padding: 2rem 1.25rem 2.5rem;
    text-align: center;
    background: var(--color-paper, #fff);
    border-top: 3px solid var(--color-accent, #ee113e);
    box-shadow: 0 -18px 40px -12px rgba(0, 0, 0, 0.28);
}

@media (min-width: 768px) {
    .outpost-cta.outpost-paywall-popup[data-nsam-paywall] .nsam-paywall-inner {
        max-height: 55vh;
        padding: 2.5rem 2rem 3rem;
    }
}

.nsam-paywall-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading, Georgia, serif);
    font-weight: 800;
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--color-ink, #111);
}

.nsam-paywall-limit {
    margin: 0 0 0.75rem;
    font-style: italic;
    color: var(--color-ink-mute, #555);
}

.nsam-paywall-lede {
    margin: 0 auto 1.5rem;
    max-width: 46ch;
    color: var(--color-ink, #111);
}

.nsam-paywall-plans {
    display: grid;
    gap: 1rem;
    max-width: 46rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .nsam-paywall-plans {
        grid-template-columns: 1fr 1fr;
    }
}

.nsam-plan {
    padding: 1.5rem 1.25rem;
    background: var(--color-paper-2, #f7f7f5);
    border: 1px solid var(--color-rule, #e2e2df);
}

.nsam-plan-price {
    margin: 0 0 0.25rem;
    font-family: var(--font-heading, Georgia, serif);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-ink, #111);
}

.nsam-plan-price span {
    font-size: 1rem;
    font-weight: 600;
}

.nsam-plan-price--text {
    font-size: 1.25rem;
}

.nsam-plan-kind {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    color: var(--color-ink-mute, #555);
}

.nsam-plan-btn {
    display: inline-block;
    padding: 0.7rem 1.75rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    transition: opacity 0.15s ease;
}

.nsam-plan-btn:hover {
    opacity: 0.88;
}

.nsam-plan-btn--primary {
    background: var(--color-accent, #ee113e);
    color: #fff;
}

.nsam-plan-btn--dark {
    background: var(--color-ink, #111);
    color: #fff;
}

/* Dark scheme: ink flips to cream, which left white text on a cream button.
   Red with white text instead (Matt, 2026-07-27). */
.dark .nsam-plan-btn--dark {
    background: var(--color-accent, #ee113e);
    color: #fff;
}

.nsam-paywall-signin {
    margin: 1.5rem 0 0;
    font-size: 0.9375rem;
    color: var(--color-ink-mute, #555);
}

/* "Log in" reads as a link in both schemes. */
.nsam-paywall-signin a {
    font-weight: 700;
}

/* Membership wall: the first thing a logged-out reader meets. One ask, no
   prices, so it stays narrower and calmer than the subscription wall. */
.nsam-paywall-inner--membership {
    max-width: 34rem;
    margin: 0 auto;
}

.nsam-paywall-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.nsam-paywall-inner--membership .nsam-paywall-lede {
    margin-bottom: 1.75rem;
}

.nsam-paywall-cta {
    display: inline-block;
    padding: 0.85rem 2.25rem;
    font-size: 1rem;
}

/* The story stops being readable where the card takes over. */
.nsam-paywall-fade {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
    .nsam-plan-btn {
        transition: none;
    }
}
