/*
 * Membership paywall — modal (parts/paywall-modal.php) + locked-content
 * skeleton (parts/paywall-skeleton.php). Loaded only when the page is locked
 * (inc/users/paywall.php). Everything is scoped under .ail-pw-* so Bootstrap's
 * own .modal styles never interfere.
 */

.ail-pw-overlay,
.ail-pw-skel {
    --pw-black: #141414;
    --pw-yellow: #F5B300;
    --pw-yellow-dark: #DE9E00;
    --pw-white: #FFFFFF;
    --pw-ink: #161616;
    --pw-muted: #6B6B6B;
    --pw-muted-2: #9A9A9A;
    --pw-line: #E7E5DF;
    --pw-calm-bg: #F1F0EC;
}

/* Scroll lock — set server side through body_class, no JS needed. */
html:has(body.ail-paywall-open),
body.ail-paywall-open {
    overflow: hidden;
}

/* ---------------------------------------------------------------- Overlay */

.ail-pw-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(20, 20, 20, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    font-family: 'Inter', sans-serif;
    line-height: 1.55;
    color: var(--pw-ink);
}

.ail-pw-dialog {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 940px;
    margin: auto;
    overflow: hidden;
    border-radius: 20px;
    background: var(--pw-white);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.5);
    animation: ail-pw-in .35s ease-out both;
}

.ail-pw-dialog:focus {
    outline: none;
}

@keyframes ail-pw-in {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ail-pw-dialog { animation: none; }
}

.ail-pw-dialog h2,
.ail-pw-dialog h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
}

.ail-pw-dialog p,
.ail-pw-dialog ul {
    margin: 0;
}

.ail-pw-dialog a {
    text-decoration: none;
}

/* ------------------------------------------------------ Left: why join */

.ail-pw-why {
    display: flex;
    flex-direction: column;
    padding: 30px 28px;
    background: var(--pw-black);
    color: var(--pw-white);
}

.ail-pw-eyebrow {
    align-self: flex-start;
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(245, 179, 0, 0.14);
    color: var(--pw-yellow);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ail-pw-why .ail-pw-heading {
    margin-bottom: 12px;
    font-size: clamp(21px, 2.6vw, 25px);
    font-weight: 800;
    line-height: 1.18;
    color: var(--pw-white);
}

.ail-pw-lead {
    margin-bottom: 22px !important;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.68);
}

.ail-pw-benefits {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    list-style: none;
}

.ail-pw-benefits li {
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.ail-pw-b-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
}

.ail-pw-b-icon svg {
    width: 16px;
    height: 16px;
    color: var(--pw-yellow);
}

.ail-pw-b-title {
    font-size: 14px;
    font-weight: 700;
}

.ail-pw-b-desc {
    margin-top: 1px;
    font-size: 12.8px;
    color: rgba(255, 255, 255, 0.58);
}

/* --------------------------------------------------------- Right: plans */

.ail-pw-plans {
    display: flex;
    flex-direction: column;
    padding: 30px 28px 22px;
}

.ail-pw-plans-title {
    margin-bottom: 4px !important;
    font-size: 19px;
    font-weight: 800;
    color: var(--pw-ink);
}

.ail-pw-plans-sub {
    margin-bottom: 20px !important;
    font-size: 13.5px;
    color: var(--pw-muted);
}

.ail-pw-plan {
    position: relative;
    margin-bottom: 12px;
    padding: 16px;
    border: 1.5px solid var(--pw-line);
    border-radius: 14px;
}

.ail-pw-plan.is-highlight {
    border-color: var(--pw-black);
    box-shadow: 0 0 0 1px var(--pw-black);
}

.ail-pw-plan-flag {
    position: absolute;
    top: -11px;
    right: 16px;
    padding: 4px 11px;
    border-radius: 20px;
    background: var(--pw-yellow);
    color: var(--pw-black);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ail-pw-plan-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.ail-pw-plan-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 800;
}

.ail-pw-plan-price {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 26px;
    font-weight: 800;
}

.ail-pw-plan-price small {
    font-size: 13px;
    font-weight: 600;
    color: var(--pw-muted-2);
}

.ail-pw-plan-note {
    margin-bottom: 14px;
    font-size: 12.8px;
    color: var(--pw-muted);
}

.ail-pw-plan-note b {
    color: var(--pw-ink);
}

.ail-pw-btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: 1.5px solid var(--pw-black);
    border-radius: 10px;
    background: var(--pw-white);
    color: var(--pw-ink) !important;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
    transition: background-color .2s, color .2s, border-color .2s;
}

.ail-pw-btn:hover,
.ail-pw-btn:focus-visible {
    background: var(--pw-black);
    color: var(--pw-white) !important;
}

.ail-pw-plan.is-highlight .ail-pw-btn {
    background: var(--pw-black);
    color: var(--pw-white) !important;
}

.ail-pw-plan.is-highlight .ail-pw-btn:hover,
.ail-pw-plan.is-highlight .ail-pw-btn:focus-visible {
    border-color: var(--pw-yellow);
    background: var(--pw-yellow);
    color: var(--pw-black) !important;
}

.ail-pw-value {
    margin: 4px 0 14px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--pw-calm-bg);
    font-size: 13px;
    font-weight: 600;
}

.ail-pw-assure {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 6px 0 16px;
    font-size: 12.3px;
    color: var(--pw-muted);
}

.ail-pw-assure span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ail-pw-assure svg {
    width: 13px;
    height: 13px;
    color: var(--pw-yellow-dark);
}

.ail-pw-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--pw-line);
    font-size: 13px;
    color: var(--pw-muted);
}

.ail-pw-foot a {
    color: var(--pw-muted);
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.ail-pw-foot a:hover {
    color: var(--pw-ink);
}

.ail-pw-dialog a:focus-visible {
    outline: 2px solid var(--pw-yellow-dark);
    outline-offset: 2px;
}

@media (max-width: 820px) {
    .ail-pw-dialog {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .ail-pw-overlay {
        padding: 12px;
    }

    .ail-pw-why,
    .ail-pw-plans {
        padding: 24px 20px;
    }

    /* Keep the sheet short on phones: titles only. */
    .ail-pw-b-desc {
        display: none;
    }
}

/* ------------------------------------------------- Locked-content skeleton */

.ail-pw-skel {
    filter: blur(4px);
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}

.ail-pw-skel-bar {
    height: 14px;
    margin-bottom: 12px;
    border-radius: 7px;
    background: #D9D7D0;
}

.ail-pw-skel-bar:nth-child(4n + 1) { width: 92%; }
.ail-pw-skel-bar:nth-child(4n + 2) { width: 84%; }
.ail-pw-skel-bar:nth-child(4n + 3) { width: 88%; }
.ail-pw-skel-bar:nth-child(4n)     { width: 70%; }

.ail-pw-skel-bar.is-title {
    width: 60%;
    height: 22px;
    background: #CFCDC5;
}

.ail-pw-skel-block {
    height: 90px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #E4E2DB;
}

.ail-pw-skel-block.is-tall {
    height: 320px;
}

.ail-pw-skel-card {
    padding: 22px;
    border: 1px solid var(--pw-line);
    border-radius: 14px;
    background: var(--pw-white);
}

.ail-pw-skel-card .ail-pw-skel-bar:first-child {
    width: 30%;
}

.ail-pw-skel-card.is-grid {
    height: 100%;
}
