/* ================================================================
   BYR — FAQ PAGE (css/25-faq.css) — long-form, SPS-style
   ================================================================
   Scope: .faq-page body class (added by byr_faq_body_class filter)
   Page-specific accent: #00E71C (bright green)

   Structure:
     A. Scoped tokens
     A2. Fill-color reset (defeats Astra's gradient cascade bleed)
     B. Page wrapper + hero
     C. Callout
     D. Two-column layout
     E. Sticky TOC (SPS-style)
     F. Section titles
     G. Glass question cards
     H. In-card typography (paragraphs, links, code)
     I. Closing card
     J. Mobile breakpoint
     K. Light mode (.mode-light)
     L. Reduced motion
     M. Print
   ================================================================ */


/* ============================================================
   A. SCOPED TOKENS
   ============================================================ */
.faq-page {
    --faq-accent:          #00E71C;
    --faq-accent-darker:   #0A8F18;
    --faq-accent-soft:     rgba(0, 231, 28, 0.15);
    --faq-accent-softer:   rgba(0, 231, 28, 0.08);
    --faq-accent-border:   rgba(0, 231, 28, 0.40);
    --faq-accent-glow:     0 0 16px rgba(0, 231, 28, 0.35);
    --faq-accent-shadow:   0 0 0 1px rgba(0, 231, 28, 0.25), 0 6px 24px rgba(0, 231, 28, 0.10);
}


/* ============================================================
   A2. GLOBAL FILL-COLOR RESET
   ------------------------------------------------------------
   Astra's parent-theme cascade sets -webkit-text-fill-color:
   transparent on some descendants (you can see the same defence
   in inc/about-page.php). Without this reset, paragraph bodies
   and hover states paint invisibly.
   ============================================================ */
.faq-page #byr-faq-page,
.faq-page #byr-faq-page * {
    -webkit-text-fill-color: currentColor;
}
/* Re-assert transparency only where a gradient is intentionally
   clipped to the text itself. */
.faq-page .faq-hero-title,
.faq-page .faq-section-title {
    -webkit-text-fill-color: transparent !important;
}


/* ============================================================
   B. PAGE WRAPPER + HERO
   ============================================================ */
.byr-faq {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    color: var(--color-text-primary);
}

.faq-hero {
    padding: 4rem 0 2rem;
    max-width: 880px;
    margin-inline: auto;
    text-align: left;
}

.faq-hero-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: rgba(0, 231, 28, 0.70);
    margin: 0 0 1rem;
    line-height: 1.2;
}

.faq-hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0 0 1.5rem;
    background: linear-gradient(135deg, #00E71C, var(--color-accent-primary, #22D3EE));
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

.faq-hero-lead {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem;
    max-width: 70ch;
}

.faq-hero-note {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 70ch;
}


/* ============================================================
   C. GLASSMORPHIC CALLOUT
   ============================================================ */
.faq-hero-callout {
    max-width: 880px;
    margin: 2rem auto 3.5rem;
    padding: 1.25rem 1.5rem 1.25rem 1.75rem;
    background: var(--faq-accent-soft);
    border: 1px solid var(--faq-accent-border);
    border-left: 4px solid var(--faq-accent);
    border-radius: var(--radius-md, 14px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--faq-accent-shadow);
}
.faq-hero-callout p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}
.faq-hero-callout a {
    color: var(--faq-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    font-weight: 600;
}
.faq-hero-callout a:hover,
.faq-hero-callout a:focus-visible {
    text-decoration-thickness: 3px;
}
.faq-hero-callout a:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
    border-radius: 2px;
}


/* ============================================================
   D. TWO-COLUMN LAYOUT
   ============================================================ */
.byr-two-col.faq-two-col {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin-inline: auto;
    padding: 0 0 5rem;
    align-items: start;
}

.faq-main {
    min-width: 0;
}


/* ============================================================
   E. STICKY TOC (SPS-style, using .byr-toc base class)
   ============================================================ */
.byr-toc.faq-toc {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    align-self: start;
}

.faq-toc .byr-toc-inner {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--faq-accent-border);
    border-radius: var(--radius-md, 14px);
    padding: 1rem 0.5rem 1rem 0.75rem;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--faq-accent-border) transparent;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.faq-toc .byr-toc-inner::-webkit-scrollbar { width: 6px; }
.faq-toc .byr-toc-inner::-webkit-scrollbar-thumb {
    background: var(--faq-accent-border);
    border-radius: 3px;
}

/* Mobile trigger button — hidden by default on desktop */
.faq-toc .byr-toc-btn {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--faq-accent-soft);
    border: 1px solid var(--faq-accent-border);
    border-radius: var(--radius-md, 14px);
    color: var(--color-text-primary);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
}
.faq-toc .byr-toc-btn .byr-toc-chevron {
    width: 14px;
    height: 14px;
    transition: transform 200ms ease;
}
.faq-toc.byr-toc-open .byr-toc-btn .byr-toc-chevron,
.faq-toc .byr-toc-btn[aria-expanded="true"] .byr-toc-chevron {
    transform: rotate(180deg);
}
.faq-toc .byr-toc-btn:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
}

/* TOC list */
.faq-toc .faq-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.faq-toc .faq-toc-list .faq-toc-group + .faq-toc-group {
    margin-top: 1rem;
}
.faq-toc .faq-toc-group-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 0.25rem 0.875rem 0.4rem;
}
.faq-toc .faq-toc-group > ol {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.25rem;
    border-left: 1px solid var(--faq-accent-softer);
    margin-left: 0.25rem;
}
.faq-toc a {
    display: block;
    padding: 0.4rem 0.875rem 0.4rem 0.875rem;
    margin-left: -1px;
    border-left: 3px solid transparent;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
    border-radius: 0 6px 6px 0;
}
.faq-toc a:hover {
    border-left-color: var(--faq-accent-border);
    color: var(--faq-accent);
    background: var(--faq-accent-softer);
}
.faq-toc a[aria-current="true"],
.faq-toc a[aria-current="location"] {
    border-left-color: var(--faq-accent);
    color: var(--faq-accent);
    background: var(--faq-accent-soft);
    font-weight: 600;
}
.faq-toc a:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
    border-radius: 2px;
}


/* ============================================================
   F. SECTION TITLES
   ============================================================ */
.faq-section + .faq-section {
    margin-top: 4rem;
}

.faq-section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0 0 0.75rem;
    background: linear-gradient(135deg, #00E71C, var(--color-accent-primary, #22D3EE));
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    scroll-margin-top: 7rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--faq-accent-border);
}

.faq-section-intro {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 1.5rem;
    max-width: 75ch;
}


/* ============================================================
   G. GLASS QUESTION CARDS
   ============================================================ */
.faq-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--faq-accent-border);
    border-left: 4px solid var(--faq-accent);
    border-radius: var(--radius-md, 14px);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 7rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.faq-card:hover {
    border-color: rgba(0, 231, 28, 0.6);
    box-shadow: var(--faq-accent-glow), 0 8px 28px rgba(0, 0, 0, 0.18);
}
.faq-card:target {
    border-color: var(--faq-accent);
    box-shadow: var(--faq-accent-glow), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.faq-card-question {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-heading);
    margin: 0 0 0.875rem;
    letter-spacing: -0.005em;
}


/* ============================================================
   H. IN-CARD TYPOGRAPHY
   ============================================================ */
.faq-card-answer p {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}
.faq-card-answer p:last-child {
    margin-bottom: 0;
}
.faq-card-answer a {
    color: var(--faq-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: text-decoration-thickness 150ms ease;
    word-break: break-word;
}
.faq-card-answer a:hover,
.faq-card-answer a:focus-visible {
    text-decoration-thickness: 2.5px;
}
.faq-card-answer a:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
    border-radius: 2px;
}
.faq-card-answer code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    background: var(--faq-accent-softer);
    border: 1px solid var(--faq-accent-border);
    border-radius: 4px;
    color: var(--faq-accent);
}


/* ============================================================
   I. CLOSING CARD
   ============================================================ */
.faq-closing {
    margin-top: 3rem;
    padding: 1.75rem 2rem;
    background: var(--faq-accent-softer);
    border: 1px solid var(--faq-accent-border);
    border-left: 4px solid var(--faq-accent);
    border-radius: var(--radius-md, 14px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}
.faq-closing p {
    margin: 0;
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: 1.0625rem;
}
.faq-closing-link {
    color: var(--faq-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.faq-closing-link:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 2px;
    border-radius: 2px;
}


/* ============================================================
   J. MOBILE BREAKPOINT
   ============================================================ */
@media (max-width: 900px) {
    .byr-two-col.faq-two-col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 3rem;
    }

    .byr-toc.faq-toc {
        position: static;
        max-height: none;
    }

    .faq-toc .byr-toc-btn {
        display: flex;
    }
    .faq-toc .byr-toc-inner {
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        max-height: none;
        overflow: visible;
    }
    .faq-toc .faq-toc-list {
        display: none;
        padding: 1rem 0.5rem;
        margin-top: 0.5rem;
        background: var(--glass-bg);
        border: 1px solid var(--faq-accent-border);
        border-radius: var(--radius-md, 14px);
    }
    .faq-toc.byr-toc-open .faq-toc-list {
        display: block;
    }

    .faq-hero {
        padding: 2.5rem 0 1rem;
    }

    .faq-card {
        padding: 1.25rem 1.25rem;
    }
    .faq-card-question {
        font-size: 1.0625rem;
    }
}


/* ============================================================
   K. LIGHT MODE (body.mode-light)
   ============================================================ */
body.mode-light .faq-hero-eyebrow {
    color: var(--faq-accent-darker);
}
body.mode-light .faq-hero-title,
body.mode-light .faq-section-title {
    background: linear-gradient(135deg, var(--faq-accent-darker), #0891B2);
    -webkit-background-clip: text;
            background-clip: text;
}
body.mode-light .faq-hero-callout {
    background: rgba(10, 143, 24, 0.08);
    border-color: rgba(10, 143, 24, 0.30);
}
body.mode-light .faq-hero-callout a,
body.mode-light .faq-card-answer a,
body.mode-light .faq-closing-link,
body.mode-light .faq-toc a:hover,
body.mode-light .faq-toc a[aria-current="true"],
body.mode-light .faq-toc a[aria-current="location"] {
    color: var(--faq-accent-darker);
}
body.mode-light .faq-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(10, 143, 24, 0.28);
    border-left-color: var(--faq-accent-darker);
}
body.mode-light .faq-card:hover {
    border-color: rgba(10, 143, 24, 0.5);
    box-shadow: 0 0 20px rgba(10, 143, 24, 0.18), 0 8px 28px rgba(0, 0, 0, 0.08);
}
body.mode-light .faq-card-question {
    color: var(--color-heading);
}
body.mode-light .faq-card-answer p {
    color: var(--color-text-primary);
}
body.mode-light .faq-card-answer code {
    color: var(--faq-accent-darker);
    background: rgba(10, 143, 24, 0.10);
    border-color: rgba(10, 143, 24, 0.25);
}
body.mode-light .faq-section-title {
    border-bottom-color: rgba(10, 143, 24, 0.35);
}
body.mode-light .faq-toc .byr-toc-inner {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(10, 143, 24, 0.28);
}
body.mode-light .faq-toc .byr-toc-btn {
    background: rgba(10, 143, 24, 0.10);
    border-color: rgba(10, 143, 24, 0.28);
}


/* ============================================================
   L. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .faq-page .faq-card,
    .faq-page .faq-toc a,
    .faq-page .byr-toc-chevron,
    .faq-page .faq-card-answer a {
        transition: none !important;
    }
    html:has(.faq-page) {
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   M. PRINT
   ============================================================ */
@media print {
    .faq-page .byr-toc.faq-toc,
    .faq-page .faq-hero-callout,
    .faq-page .faq-closing {
        display: none !important;
    }
    .faq-page .byr-two-col.faq-two-col {
        display: block;
        grid-template-columns: 1fr;
    }
    .faq-page .faq-card {
        break-inside: avoid;
        border: 1px solid #999 !important;
        border-left: 3px solid #000 !important;
        background: white !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    .faq-page .faq-card-question,
    .faq-page .faq-card-answer p {
        color: black !important;
    }
    body.faq-page {
        background: white !important;
        color: black !important;
    }
}

/* ============================================================
   LIGHT MODE — NEAR-WHITE GROUND, INDIGO BLOOM
   Uses the site-wide token system (see 01-core-tokens-base.css
   sections 19 + 14b). Regular-page indigo identity.
   ============================================================ */

.mode-light .byr-faq::before,
.mode-light .faq-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bloom-gradient), var(--paper-ground-white);
}

.mode-light .byr-faq, .mode-light .faq-page {
  --bloom-color:   rgba(30, 64, 138, 0.38);
  --bloom-size:    ellipse 110% 70% at 50% 0%;
  --accent-deep:   #1E3A8A;
  --accent-deeper: #1E2A5A;
  --accent-vivid:  #3B82F6;
}

/* Moving-gradient headings — inherits the site-wide shimmer. */
.mode-light .byr-faq h1, .mode-light .faq-page h1,
.mode-light .byr-faq h2, .mode-light .faq-page h2,
.mode-light .byr-faq .byr-gradient-heading, .mode-light .faq-page .byr-gradient-heading {
  background: linear-gradient(110deg,
    var(--accent-deeper) 0%,
    var(--accent-deep)   45%,
    var(--accent-vivid)  55%,
    var(--accent-deep)   100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: byr-heading-shimmer 8s ease-in-out infinite;
}