/* ============================================================
   Stock Portfolio One — Public Pricing page
   Reuses the "After Dark" palette from landing.css (loaded on
   the same page). These rules add the plan-card grid + toggle.
   ============================================================ */

/* ── Page layout ── */
.pricing-wrap {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3.5rem) 4rem;
}

.pricing-head { text-align: center; margin-bottom: 2rem; }

.pricing-head .eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.pricing-head h1 {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.6rem;
}

.pricing-head p {
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    color: var(--text-dim);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ── Monthly / Yearly toggle ── */
.pricing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 1.6rem auto 0;
    padding: 0.32rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.pricing-toggle button {
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.pricing-toggle button.active {
    color: #1d1611;
    background: linear-gradient(145deg, var(--gold-bright), var(--gold));
}

.pricing-toggle .save-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green);
    margin-left: 0.1rem;
}

/* ── Card grid ── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1rem, 2.5vw, 1.6rem);
    margin-top: 2.2rem;
    align-items: stretch;
}

.plan-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.6rem 1.5rem 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}

.plan-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.plan-card.featured {
    border-color: var(--gold);
    box-shadow: 0 24px 60px rgba(205, 155, 90, 0.25), var(--shadow);
}

.plan-card .featured-ribbon {
    position: absolute;
    top: -0.6rem;
    right: 1.2rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d1611;
    background: linear-gradient(145deg, var(--gold-bright), var(--gold));
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
}

.plan-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.plan-card .desc {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.5;
    min-height: 2.6em;
    margin: 0 0 1.2rem;
}

.plan-card .price {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: 1.3rem;
}

.plan-card .price .amt {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.plan-card .price .cadence {
    font-size: 0.84rem;
    color: var(--text-faint);
}

.plan-card .price .billed-annually {
    font-size: 0.72rem;
    color: var(--text-faint);
    opacity: 0.8;
}

.plan-card .price .free {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--green);
}

/* each interval's amount lives in a data attribute; JS swaps which is visible */
.plan-card .price .amt[data-interval="yearly"] { display: none; }
.plan-card.has-yearly .price .amt[data-interval="yearly"] { display: inline; }
.plan-card.has-yearly .price .amt[data-interval="monthly"] { display: none; }
.plan-card.has-yearly.is-yearly .price .amt[data-interval="yearly"] { display: inline; }
.plan-card.has-yearly.is-yearly .price .amt[data-interval="monthly"] { display: none; }
.plan-card.has-yearly:not(.is-yearly) .price .amt[data-interval="yearly"] { display: none; }
.plan-card.has-yearly:not(.is-yearly) .price .amt[data-interval="monthly"] { display: inline; }

.plan-card .cta {
    margin-top: auto;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    border: none;
    color: #1d1611;
    background: linear-gradient(145deg, var(--gold-bright), var(--gold));
    box-shadow: 0 6px 20px rgba(205, 155, 90, 0.35);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}

.plan-card .cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(205, 155, 90, 0.5);
    filter: brightness(1.04);
    color: #1d1611;
}

.plan-card .cta.btn-ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
}

.plan-card .cta.btn-ghost:hover {
    border-color: var(--gold);
    background: rgba(205, 155, 90, 0.08);
    transform: none;
    box-shadow: none;
}

/* CTA target also swaps with the interval; only one link is live at a time */
.plan-card .cta[data-interval="yearly"] { display: none; }
.plan-card.has-yearly.is-yearly .cta[data-interval="yearly"] { display: block; }
.plan-card.has-yearly.is-yearly .cta[data-interval="monthly"] { display: none; }
.plan-card.has-yearly:not(.is-yearly) .cta[data-interval="yearly"] { display: none; }
.plan-card.has-yearly:not(.is-yearly) .cta[data-interval="monthly"] { display: block; }
.plan-card:not(.has-yearly) .cta[data-interval="monthly"] { display: block; }

/* ── Feature-comparison columns (PlansFeatures admin content) ── */
/* Two explicit rows (cards, then feature boxes); each .plan-column is a row-subgrid
   mapped onto them, so every feature box stretches to match the tallest one — same
   row-stretch behavior the price cards already get from the outer grid. */
.pricing-grid.has-features {
    grid-template-rows: auto auto;
}

.plan-column {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    row-gap: 1.2rem;
    min-width: 0;
}

.plan-column .plan-features {
    height: 100%;
}

/* >3 plans (desktop): stop shrinking/wrapping columns — scroll horizontally instead.
   Disabled on mobile below, where the cards stack vertically. */
.pricing-grid.many-plans {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 280px;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.plan-features {
    background: linear-gradient(180deg, var(--raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.55;
}

.plan-features > :first-child { margin-top: 0; }
.plan-features > :last-child { margin-bottom: 0; }

.plan-features h3, .plan-features h4 {
    color: var(--text);
    font-size: 0.95rem;
    margin: 0 0 0.6rem;
}

.plan-features ul, .plan-features ol {
    padding-left: 1.1rem;
    margin: 0 0 0.8rem;
}

.plan-features li { margin-bottom: 0.45rem; }

.plan-features img { max-width: 100%; border-radius: 0.4rem; }

/* ── Full-width content block below the comparison columns ── */
.pricing-footer-content {
    max-width: 1180px;
    margin: 2.5rem auto 0;
    padding: 0 clamp(1.25rem, 4vw, 3.5rem);
    color: var(--text);
    line-height: 1.6;
}

.pricing-footer-content img { max-width: 100%; border-radius: 0.6rem; }

/* ── Error banner ── */
.pricing-error {
    max-width: 620px;
    margin: 1.4rem auto 0;
    text-align: center;
    font-size: 0.86rem;
    color: var(--gold-bright);
    background: rgba(205, 155, 90, 0.08);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
}

/* ── Footer links (mirror landing page) ── */
.pricing-foot {
    text-align: center;
    padding-top: 2.5rem;
    font-size: 0.8rem;
    color: var(--text-faint);
}

.pricing-foot a {
    color: var(--text-dim);
    text-decoration: none;
    margin: 0 0.3rem;
}

.pricing-foot a:hover { color: var(--gold-link); }

/* ── Responsive ── */
@media (max-width: 575px) {
    .pricing-grid { grid-template-columns: 1fr; }
    /* Mobile: never horizontal-scroll — stack the plans vertically instead. */
    .pricing-grid.many-plans {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        overflow-x: visible;
    }
    .pricing-toggle { width: 100%; justify-content: center; }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .plan-card, .plan-card .cta { transition: none !important; }
    .plan-card:hover { transform: none; }
}