/**
 * Beyond Volatility — Offers / Referrals v6.0 "Structured Swiss"
 * ================================================================
 * Skin for the [my_referrals] shortcode output (BOTH variants: the full
 * cards auto-appended to blog posts and the compact="1" claim cards on
 * /save-money/), plus the offers-page hero byline/actions.
 *
 * Depends on swiss-core.css tokens. All colors via --sw-* so light + dark
 * theme automatically. Scoped under body.bv-swiss so it can load globally
 * without touching the legacy look anywhere else.
 *
 * IMPORTANT: css/referrals.css is late-enqueued by the shortcode and prints
 * in the FOOTER (after this sheet), so every override here deliberately
 * carries higher specificity via the `body.bv-swiss .bv-referral-container`
 * prefix — a cascade-order tie would lose.
 *
 * Cards are ALWAYS visible: nothing here (or in referrals.css) sets an
 * initial opacity/transform; the old scroll-reveal hide lived only in the
 * deleted v4 template CSS (scoped to .bv-refer-page, which no longer
 * exists). js/referrals-page.js hooks kept working: [data-bv-share],
 * .bv-share-label, [data-bv-copy] / .bv-claim-code-act / .is-copied.
 *
 * TOC
 *   1. Offers page hero — byline + actions
 *   2. Shortcode container + header (full variant)
 *   3. Category headers
 *   4. Cards — shared re-skin (full + compact)
 *   5. Compact claim cards (/save-money/)
 *   6. Promo-code chip (tap to copy)
 *   7. Claim CTA (stretched link)
 *   8. Disclosure
 *   9. Responsive & motion
 */

/* ============================================================
   1. OFFERS PAGE HERO — BYLINE + ACTIONS
   ============================================================ */
body.bv-swiss .bv-sw-offers-byline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sw-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sw-graphite);
    margin: 0 0 22px;
}
body.bv-swiss .bv-sw-offers-avatar {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid var(--sw-line);
    filter: grayscale(1);
}
body.bv-swiss .bv-sw-offers-monogram {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--sw-ink);
    font-family: var(--sw-display);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--sw-ink);
}
body.bv-swiss .bv-sw-offers-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

/* ============================================================
   2. SHORTCODE CONTAINER + HEADER (full variant)
   ============================================================ */
body.bv-swiss .bv-referral-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 3rem auto;
    font-family: var(--sw-body);
}
/* On the offers page the section supplies its own rhythm. */
body.bv-swiss .bv-sw .bv-referral-container { margin: clamp(24px, 4vh, 40px) auto 0; }

body.bv-swiss .bv-referral-container .bv-referral-header {
    text-align: left;
    margin-bottom: clamp(28px, 4vh, 44px);
}
body.bv-swiss .bv-referral-container .bv-terminal-tag {
    font-family: var(--sw-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sw-accent);
    opacity: 1;
    margin-bottom: 14px;
}
body.bv-swiss .bv-referral-container .bv-referral-header h2 {
    font-family: var(--sw-display);
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--sw-ink);
    margin: 0 0 12px;
}
body.bv-swiss .bv-referral-container .bv-referral-header p {
    font-family: var(--sw-body);
    font-weight: 300;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--sw-graphite);
    max-width: 62ch;
    margin: 0 0 0.6rem;
}
body.bv-swiss .bv-referral-container .bv-affiliate-disclosure {
    color: var(--sw-graphite) !important; /* wins over the inline style attr */
}
body.bv-swiss .bv-referral-container .bv-affiliate-disclosure strong { color: var(--sw-ink); font-weight: 500; }

/* ============================================================
   3. CATEGORY HEADERS
   ============================================================ */
body.bv-swiss .bv-referral-container .bv-referral-category { margin-bottom: clamp(32px, 5vh, 52px); }
body.bv-swiss .bv-referral-container .bv-category-header-terminal {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--sw-ink);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
/* Status dot: accent only — overrides the per-category inline color + glow. */
body.bv-swiss .bv-referral-container .bv-cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%; /* the one permitted circle: a status point */
    background-color: var(--sw-accent) !important;
    box-shadow: none;
    flex-shrink: 0;
}
body.bv-swiss .bv-referral-container .bv-referral-category-title {
    font-family: var(--sw-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sw-ink);
    margin: 0;
}

/* ============================================================
   4. CARDS — SHARED RE-SKIN (full + compact)
   ============================================================ */
body.bv-swiss .bv-referral-container .bv-referral-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 16px;
}
body.bv-swiss .bv-referral-container .bv-referral-card-v2 {
    opacity: 1;            /* visibility safety: never hidden without JS */
    transform: none;
    background: var(--sw-canvas);
    border: 1px solid var(--sw-line);
    border-radius: 0;
    box-shadow: none;
    padding: 22px 24px;
    text-decoration: none;
    position: relative;
    overflow: visible;
    transition: transform 0.3s var(--sw-ease), box-shadow 0.3s var(--sw-ease), border-color 0.3s var(--sw-ease);
}
body.bv-swiss .bv-referral-container .bv-referral-card-v2::before { display: none; } /* kill legacy shimmer bar */
body.bv-swiss .bv-referral-container .bv-referral-card-v2:hover,
body.bv-swiss .bv-referral-container .bv-referral-card-v2:focus-within {
    background: var(--sw-canvas);
    transform: translateY(-4px);
    box-shadow: var(--sw-lift-shadow);
    border-color: var(--sw-graphite);
}

/* Full-variant card internals (blog posts) */
body.bv-swiss .bv-referral-container .bv-ref-name {
    font-family: var(--sw-display);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: -0.015em;
    color: var(--sw-ink);
    margin: 0 0 10px;
}
body.bv-swiss .bv-referral-container .bv-ref-desc {
    font-family: var(--sw-body);
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--sw-graphite);
    margin: 0 0 1.6rem;
}
body.bv-swiss .bv-referral-container .bv-ref-cta {
    font-family: var(--sw-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sw-accent) !important; /* wins over the inline per-category color */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   5. COMPACT CLAIM CARDS (/save-money/)
   ============================================================ */
body.bv-swiss .bv-referral-container .bv-referral-card-v2.bv-claim {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    min-height: 0;
    padding: 20px 20px 18px;
}
body.bv-swiss .bv-referral-container .bv-claim-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
body.bv-swiss .bv-referral-container .bv-claim-name {
    font-family: var(--sw-display);
    font-weight: 500;
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--sw-ink);
}
body.bv-swiss .bv-referral-container .bv-claim-badge {
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--sw-mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sw-accent);
    padding: 4px 10px;
    border: 1px solid var(--sw-line);
    background: var(--sw-canvas);
}
body.bv-swiss .bv-referral-container .bv-claim-what {
    margin: 0;
    font-family: var(--sw-body);
    font-weight: 300;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--sw-graphite);
}
body.bv-swiss .bv-referral-container .bv-claim-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 2px;
}
body.bv-swiss .bv-referral-container .bv-claim-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--sw-body);
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--sw-graphite);
}
body.bv-swiss .bv-referral-container .bv-claim-step svg { color: var(--sw-accent); flex-shrink: 0; }

/* ============================================================
   6. PROMO-CODE CHIP — TAP TO COPY
   ============================================================ */
/* Sits ABOVE the card's stretched CTA link (z-index 2 vs 1) so tapping the
   code copies without navigating. js/referrals-page.js swaps the .bv-claim-
   code-act contents and toggles .is-copied. */
body.bv-swiss .bv-referral-container .bv-claim-code {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-family: var(--sw-mono);
    font-size: 0.7rem;
    line-height: 1;
    padding: 6px 10px;
    border: 1px solid var(--sw-line);
    border-radius: 0;
    background: var(--sw-surface);
    color: var(--sw-graphite);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s var(--sw-ease);
}
body.bv-swiss .bv-referral-container .bv-claim-code:hover { border-color: var(--sw-ink); }
body.bv-swiss .bv-referral-container .bv-claim-code:focus-visible {
    outline: 2px solid var(--sw-accent);
    outline-offset: 2px;
}
body.bv-swiss .bv-referral-container .bv-claim-code-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}
body.bv-swiss .bv-referral-container .bv-claim-code-val {
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--sw-ink);
}
body.bv-swiss .bv-referral-container .bv-claim-code-act {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--sw-accent);
}
body.bv-swiss .bv-referral-container .bv-claim-code-act svg { flex-shrink: 0; }
body.bv-swiss .bv-referral-container .bv-claim-code.is-copied {
    border-color: var(--sw-accent);
    color: var(--sw-accent);
}
body.bv-swiss .bv-referral-container .bv-claim-code.is-copied .bv-claim-code-val { color: var(--sw-accent); }

/* ============================================================
   7. CLAIM CTA — STRETCHED LINK
   ============================================================ */
body.bv-swiss .bv-referral-container .bv-claim-go {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-family: var(--sw-display);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sw-ink);
    background: transparent;
    border: 1px solid var(--sw-ink);
    border-radius: 0;
    transition: background-color 0.2s var(--sw-ease), color 0.2s var(--sw-ease);
}
body.bv-swiss .bv-referral-container .bv-claim-go::after { /* whole card = one tap target */
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
body.bv-swiss .bv-referral-container .bv-claim:hover .bv-claim-go,
body.bv-swiss .bv-referral-container .bv-claim-go:focus-visible {
    background: var(--sw-ink);
    color: var(--sw-canvas);
}
body.bv-swiss .bv-referral-container .bv-claim-go svg { flex-shrink: 0; }

/* ============================================================
   8. DISCLOSURE
   ============================================================ */
body.bv-swiss .bv-referral-container .bv-ref-compact-disclosure {
    max-width: 640px;
    margin: 2.5rem 0 0;
    border-top: 1px solid var(--sw-line);
    padding-top: 14px;
    text-align: left;
    font-family: var(--sw-body);
    font-weight: 300;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--sw-graphite);
}

/* ============================================================
   9. RESPONSIVE & MOTION
   ============================================================ */
@media (max-width: 640px) {
    body.bv-swiss .bv-sw-offers-actions { flex-direction: column; align-items: stretch; }
    body.bv-swiss .bv-sw-offers-actions .bv-sw-btn { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    body.bv-swiss .bv-referral-container .bv-referral-card-v2,
    body.bv-swiss .bv-referral-container .bv-claim-code,
    body.bv-swiss .bv-referral-container .bv-claim-go { transition: none; }
    body.bv-swiss .bv-referral-container .bv-referral-card-v2:hover,
    body.bv-swiss .bv-referral-container .bv-referral-card-v2:focus-within {
        transform: none;
        box-shadow: none;
    }
}
