/* ============================================
   LeadFluxA — Planner pages
   Public listing + detail. Uses the shared
   --primary / --gray tokens from public.css
   ============================================ */

.planner-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-700, #4B5563);
}

.planner-wrap h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    color: var(--dark, #1A1D23);
    font-size: 1.5rem;
    margin: 0 0 20px;
}

/* ---------- Detail: gallery + buy box ---------- */
.planner-top {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 36px;
    align-items: start;
    margin-bottom: 56px;
}

.planner-gallery { min-width: 0; }

.pg-main {
    background: var(--gray-100, #F8F9FC);
    border: 1px solid var(--gray-200, #EEF0F6);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.pg-main img {
    width: 100%;
    height: 100%;
    /* contain, not cover: listing artwork is rarely square, and cover was
       slicing the top and bottom off the product image inside the 1:1 frame. */
    object-fit: contain;
    display: block;
}

.pg-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.pg-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--gray-100, #F8F9FC);
    cursor: pointer;
    aspect-ratio: 1;
    transition: border-color .15s ease, transform .15s ease;
}
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-thumb:hover { transform: translateY(-2px); }
.pg-thumb.active { border-color: var(--primary, #F26522); }
.pg-thumb:focus-visible { outline: 3px solid var(--primary, #F26522); outline-offset: 2px; }

/* ---------- Buy box ---------- */
.planner-buy { position: sticky; top: 90px; }

.pb-card {
    background: var(--white, #fff);
    border: 1px solid var(--gray-200, #EEF0F6);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(26, 29, 35, .06);
}

.pb-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.pb-now {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark, #1A1D23);
    line-height: 1.1;
}
.pb-was { color: var(--gray-500, #8A94A6); text-decoration: line-through; font-size: 1rem; }
.pb-off {
    background: var(--primary-bg, #FFF5EE);
    color: var(--primary-dark, #D4500F);
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pb-sale-ends {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    font-size: .85rem;
    color: var(--gray-600, #6B7280);
}
.pb-sale-ends .material-icons { font-size: 16px; color: var(--primary, #F26522); }

.pb-actions { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 18px; }

.pb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pb-btn .material-icons { font-size: 18px; }
.pb-btn-primary {
    background: var(--primary, #F26522);
    color: #fff;
}
.pb-btn-primary:hover {
    background: var(--primary-dark, #D4500F);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(242, 101, 34, .28);
}
.pb-btn-secondary {
    background: var(--white, #fff);
    color: var(--gray-700, #4B5563);
    border-color: var(--gray-200, #EEF0F6);
}
.pb-btn-secondary:hover { border-color: var(--primary, #F26522); color: var(--primary, #F26522); }

.pb-trust {
    list-style: none;
    margin: 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--gray-200, #EEF0F6);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pb-trust li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    color: var(--gray-600, #6B7280);
}
.pb-trust .material-icons { font-size: 18px; color: var(--primary, #F26522); }

.pb-tags {
    list-style: none;
    margin: 18px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--gray-200, #EEF0F6);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pb-tags a {
    display: inline-block;
    background: var(--gray-100, #F8F9FC);
    color: var(--gray-600, #6B7280);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .75rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.pb-tags a:hover { background: var(--primary-bg, #FFF5EE); color: var(--primary-dark, #D4500F); }

/* ---------- Videos ---------- */
.planner-videos { margin-bottom: 56px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.pv-grid figure { margin: 0; }
.pv-grid video {
    width: 100%;
    border-radius: 14px;
    background: #000;
    display: block;
    border: 1px solid var(--gray-200, #EEF0F6);
}
.pv-grid figcaption {
    margin-top: 8px;
    font-size: .85rem;
    color: var(--gray-500, #8A94A6);
}

/* ============================================
   Verbatim description

   Rendered with th:text, so the admin's paste is escaped and unmodified.
   pre-wrap is what makes their line breaks and blank lines actually show;
   without it every newline collapses and the whole description runs
   together as one paragraph.
   ============================================ */
.planner-content-plain {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 1.02rem;
    line-height: 1.75;
}

/* ---------- Body content (admin-authored, sanitized) ---------- */
.planner-content {
    /* Left-aligned, not centred. A centred 900px block inside the 1140px wrap
       left its left edge inset from the gallery above, which read as a
       misalignment. ch keeps the reading measure sane at any font size. */
    max-width: 78ch;
    margin: 0 0 56px;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--gray-700, #4B5563);
}
.planner-content h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark, #1A1D23);
    margin: 40px 0 14px;
}
.planner-content h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark, #1A1D23);
    margin: 30px 0 10px;
}
.planner-content p { margin: 0 0 18px; }
.planner-content ul,
.planner-content ol { margin: 0 0 18px; padding-left: 22px; }
.planner-content li { margin-bottom: 8px; }
.planner-content a { color: var(--primary-dark, #D4500F); }
.planner-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0; }
.planner-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; }
.planner-content th,
.planner-content td { padding: 10px 14px; border: 1px solid var(--gray-200, #EEF0F6); text-align: left; }
.planner-content th { background: var(--gray-100, #F8F9FC); font-weight: 600; }
.planner-content hr { border: 0; border-top: 1px solid var(--gray-200, #EEF0F6); margin: 32px 0; }

/* ---------- Related ---------- */
.planner-related { margin-bottom: 56px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.pr-card {
    text-decoration: none;
    border: 1px solid var(--gray-200, #EEF0F6);
    border-radius: 14px;
    overflow: hidden;
    background: var(--white, #fff);
    transition: transform .15s ease, box-shadow .15s ease;
    display: block;
}
.pr-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(26, 29, 35, .09); }
.pr-thumb { aspect-ratio: 1 / 1; background: var(--gray-100, #F8F9FC); }
.pr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-body { padding: 14px 16px 18px; }
.pr-body h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--dark, #1A1D23);
    margin: 0 0 6px;
    line-height: 1.4;
}
.pr-price { font-size: .875rem; font-weight: 600; color: var(--primary-dark, #D4500F); }

/* ---------- Listing page ---------- */
.pl-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    font-size: .9rem;
    color: var(--gray-600, #6B7280);
}
.pl-filter strong {
    background: var(--primary-bg, #FFF5EE);
    color: var(--primary-dark, #D4500F);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .8rem;
}
.pl-filter a { color: var(--gray-500, #8A94A6); font-size: .85rem; }

.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 26px; }

.pl-card {
    text-decoration: none;
    border: 1px solid var(--gray-200, #EEF0F6);
    border-radius: 16px;
    overflow: hidden;
    background: var(--white, #fff);
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.pl-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(26, 29, 35, .1); }

.pl-thumb { position: relative; aspect-ratio: 1 / 1; background: var(--gray-100, #F8F9FC); }
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary, #F26522);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pl-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.pl-body h2 {
    font-size: 1.05rem;
    margin: 0 0 8px;
    line-height: 1.4;
}
.pl-body p {
    margin: 0 0 18px;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--gray-600, #6B7280);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pl-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pl-price strong { font-size: 1.05rem; color: var(--dark, #1A1D23); font-family: 'Plus Jakarta Sans', sans-serif; }
.pl-price s { font-size: .8rem; color: var(--gray-400, #B0B8C9); margin-left: 6px; }
.pl-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary, #F26522);
}
.pl-more .material-icons { font-size: 16px; }

.pl-empty {
    text-align: center;
    padding: 70px 24px;
    border: 2px dashed var(--gray-200, #EEF0F6);
    border-radius: 18px;
}
.pl-empty .material-icons { font-size: 44px; color: var(--gray-400, #B0B8C9); }
.pl-empty h2 { margin: 14px 0 6px; }
.pl-empty p { margin: 0 0 22px; color: var(--gray-500, #8A94A6); }

.pl-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 44px;
    font-size: .9rem;
    color: var(--gray-600, #6B7280);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .planner-top { grid-template-columns: 1fr; gap: 28px; }
    .planner-buy { position: static; }
}
@media (max-width: 560px) {
    .planner-wrap { padding: 28px 16px 60px; }
    .pb-now { font-size: 1.6rem; }
    .pl-grid { grid-template-columns: 1fr; }
    .planner-cta { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .pl-card, .pr-card, .pg-thumb, .pb-btn { transition: none; }
    .pl-card:hover, .pr-card:hover, .pg-thumb:hover, .pb-btn-primary:hover { transform: none; }
}

/* ============================================
   Header alignment + long-title handling

   blog.css sets .article-header .container to max-width:800px, but
   .planner-wrap below it is 1140px. That mismatch left dead gutters on
   both sides of the header and pushed the title into a narrow column.
   These rules are scoped to .planner-header so blog pages are unaffected.
   ============================================ */

.article-header.planner-header .container {
    max-width: 1140px;
}

/* Marketplace titles run long. Scale with the viewport instead of a fixed
   2.5rem, and cap the measure so it never exceeds a readable line length. */
.article-header.planner-header h1 {
    font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.35rem);
    line-height: 1.24;
    /* Was 22ch, which stranded the right half of the header empty. 46ch keeps
       the line length readable while actually using the container width. */
    max-width: 46ch;
    text-wrap: balance;
}

.article-header.planner-header p.desc {
    max-width: 68ch;
    font-size: 1.05rem;
}

/* Keep the breadcrumb on one line: the current page title is often 100+
   chars, which wrapped to two lines and collided with the header padding. */
.planner-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}
.planner-header .breadcrumb .bc-current {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.planner-header .breadcrumb .bc-sep {
    color: var(--gray-400, #B0B8C9);
    flex-shrink: 0;
}

/* Images that fail to load render as a broken-icon box with sprawling alt
   text. planner-gallery.js adds this class so they collapse cleanly. */
.media-broken {
    display: none !important;
}
.pg-thumb.media-broken,
.pr-card.media-broken {
    display: none !important;
}


@media (max-width: 900px) {
    .article-header.planner-header h1 { max-width: none; }
    .planner-content { max-width: none; }
    .planner-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .planner-cta h2 { max-width: none; }
    .planner-cta .pb-btn { width: 100%; }
}

/* ============================================
   Ad slots

   Sized to reserve space before the ad script resolves, so the page
   doesn't jump as units fill in (Cumulative Layout Shift).
   ============================================ */

.ad-slot {
    max-width: 1140px;
    margin: 36px auto;
    padding: 0 4px;
    text-align: center;
    /* Reserves height for a responsive unit before it loads. */
    min-height: 100px;
    overflow: hidden;
}

.ad-slot .adsbygoogle {
    display: block;
    width: 100%;
}

/* AdSense policy requires ads to be distinguishable from content.
   A quiet label is the simplest way to satisfy that. */
.ad-slot-label {
    display: block;
    font-size: .65rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--gray-400, #B0B8C9);
    margin-bottom: 6px;
    user-select: none;
}

/* Breathing room where an ad sits directly against a CTA block, so the
   two never read as one unit. */
.ad-slot[data-ad-label="after-gallery"],
.ad-slot[data-ad-label="in-content"] {
    margin-top: 48px;
    margin-bottom: 48px;
}

.ad-slot[data-ad-label="footer"] {
    margin-bottom: 56px;
}

/* Collapse the reserved space when a unit comes back unfilled, otherwise
   the page carries five 100px gaps of nothing. */
.ad-slot .adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}
.ad-slot:has(.adsbygoogle[data-ad-status="unfilled"]) {
    min-height: 0;
    margin: 0;
}
.ad-slot:has(.adsbygoogle[data-ad-status="unfilled"]) .ad-slot-label {
    display: none;
}

@media (max-width: 560px) {
    .ad-slot { margin: 28px auto; min-height: 90px; }
}

/* ============================================
   Placeholder ad boxes (app.adsense.placeholder=true)

   Deliberately obvious: dashed border, no imagery, so a placeholder can
   never be mistaken for a live ad in a screenshot or a review.
   ============================================ */
.ad-slot-placeholder .ad-placeholder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 120px;
    padding: 20px;
    border: 2px dashed var(--gray-300, #D8DDE8);
    border-radius: 12px;
    background: repeating-linear-gradient(
        45deg,
        var(--gray-100, #F8F9FC),
        var(--gray-100, #F8F9FC) 10px,
        #FFF 10px,
        #FFF 20px
    );
    color: var(--gray-500, #8A94A6);
    font-size: .85rem;
}
.ad-slot-placeholder .material-icons {
    font-size: 22px;
    color: var(--gray-400, #B0B8C9);
}
.ad-slot-placeholder strong { color: var(--gray-600, #6B7280); }
.ad-slot-placeholder small { font-size: .7rem; color: var(--gray-400, #B0B8C9); }

/* ============================================
   Checkout
   ============================================ */

.pb-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 16px;
    font-size: .78rem;
    color: var(--gray-500, #8A94A6);
}
.pb-secure .material-icons { font-size: 15px; color: #16A34A; }

/* width:100% ONLY inside the sidebar buy box. Applying it to every
   button.pb-btn made the CTA button eat the whole flex row and squash the
   copy beside it to one word per line. */
button.pb-btn { font-family: inherit; width: auto; }
.pb-actions button.pb-btn { width: 100%; }
.planner-cta button.pb-btn { flex-shrink: 0; }
button.pb-btn:disabled { opacity: .6; cursor: wait; }

.purchase-thanks[hidden] { display: none !important; }

.purchase-thanks {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    margin-bottom: 28px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
}
.purchase-thanks .material-icons { color: #16A34A; font-size: 24px; flex-shrink: 0; }
.purchase-thanks strong { display: block; color: #14532D; margin-bottom: 3px; font-size: .95rem; }
.purchase-thanks p { margin: 0; font-size: .875rem; color: #15803D; line-height: 1.55; }

/* ============================================
   Bottom CTA

   Two columns: persuasion on the left, the decision on the right.
   The previous version was a bare sentence and a button, which gave the
   reader nothing to act on at the point they're most likely to convert.
   ============================================ */

.planner-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;
    background: linear-gradient(135deg, #FFF7F0 0%, #FFEEDD 100%);
    border: 1px solid #FBD9BC;
    border-radius: 18px;
    padding: 34px 36px;
    margin-bottom: 56px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Soft accent bar so the block reads as a distinct offer, not another card. */
.planner-cta::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary, #F26522), #D4500F);
}

.cta-copy { min-width: 0; }

.cta-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(242, 101, 34, .12);
    color: var(--primary-dark, #D4500F);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 5px 11px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.cta-eyebrow .material-icons { font-size: 14px; }

.planner-cta h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.3rem, 1.05rem + .9vw, 1.65rem);
    font-weight: 800;
    color: var(--dark, #1A1D23);
    line-height: 1.25;
    margin: 0 0 8px;
}

.cta-sub {
    margin: 0 0 18px;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--gray-600, #6B7280);
    max-width: 54ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cta-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}
.cta-points li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--gray-700, #4B5563);
    font-weight: 500;
}
.cta-points .material-icons { font-size: 16px; color: #16A34A; }

/* ---------- Right column ---------- */
.cta-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 230px;
}

.cta-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.cta-now {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark, #1A1D23);
    line-height: 1;
}
.cta-was {
    font-size: .95rem;
    color: var(--gray-500, #8A94A6);
    text-decoration: line-through;
}
.cta-off {
    background: #16A34A;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 9px;
    border-radius: 20px;
}

.planner-cta .cta-btn {
    width: 100%;
    justify-content: center;
    padding: 15px 28px;
    font-size: 1rem;
    box-shadow: 0 6px 18px rgba(242, 101, 34, .26);
}

.cta-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: .75rem;
    color: var(--gray-500, #8A94A6);
}
.cta-note .material-icons { font-size: 14px; color: #16A34A; }

@media (max-width: 820px) {
    .planner-cta {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 26px 22px;
    }
    .cta-action { min-width: 0; }
    .cta-points { gap: 6px 16px; }
}
