/* ============================================================
   03 — SHARED PAGE COMPONENTS
   ============================================================
   Purpose:  Reusable component classes used across 3+ pages.
             Eliminates ~1,000 lines of duplicated inline CSS
             from homepage, research, resources, hcs-guide,
             stories, poems, groups, ecd, sps, about.

   Depends:  01-core-tokens-base.css (tokens + base utilities)
   Enqueue:  functions.php → byr-shared-components
             after byr-tokens, before any page-specific CSS.

   Migration note:
     This file consolidates patterns that were independently
     defined inside <style> blocks in each page's PHP include.
     Pages should migrate to these classes over time.
     Existing page-specific selectors remain valid during
     the transition — no pages break when this file is added.

   TABLE OF CONTENTS:
   PART A — FONT IMPORTS
     1.  Instrument Serif (brand serif)

   PART B — CONTENT MODIFIERS
     2.  Content Width Variants
     3.  Eyebrow Line Variant
     4.  Serif Heading System

   PART C — PROSE SYSTEM
     5.  Prose Container (.byr-prose)

   PART D — DIVIDERS
     6.  Gradient Line Divider (.byr-divider)
     7.  Short Bar Divider (.byr-divider--bar)

   PART E — BUTTONS
     8.  Base Button Reset (.byr-btn)
     9.  Primary Button (.byr-btn--primary / .byr-primary)
     10. Outline Button (.byr-btn--outline / .byr-outline)
     11. Small Variant (.byr-btn--sm / .byr-btn-sm)
     12. Button Group (.byr-btn-group / .byr-cta-btns)

   PART F — CARDS
     13. Base Card (.byr-card)

   PART G — CALLOUTS & CROSSLINKS
     14. Callout (.byr-callout)
     15. Crosslink (.byr-crosslink)

   PART H — CTA SECTIONS
     16. Closing CTA Panel (.byr-closing-cta)
     17. Glass CTA Panel (.byr-cta-panel)

   PART I — LAYOUT PATTERNS
     18. Two-Column with TOC (.byr-two-col)
     19. TOC Sidebar (.byr-toc)
     20. Accordion (.byr-accordion)

   PART J — ANIMATION
     21. Fade-In (.byr-fade-in)

   PART K — LIGHT MODE OVERRIDES
     22. Component light-mode adjustments

   PART L — RESPONSIVE
     23. Tablet & mobile breakpoints
   ============================================================ */


/* ************************************************************
   PART A — FONT IMPORTS
   ************************************************************ */

/* ==========================================================
   1. INSTRUMENT SERIF — Brand Heading Font
   Used by homepage, about, and any page with editorial
   headings. Loaded once here instead of per-page @import.
========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');


/* ************************************************************
   PART B — CONTENT MODIFIERS
   ************************************************************ */

/* ==========================================================
   2. CONTENT WIDTH VARIANTS
   Extend .byr-content from core-tokens.
========================================================== */
.byr-content--narrow {
  max-width: 780px;
}

.byr-content--mid {
  max-width: 900px;
}

.byr-content--wide {
  max-width: 1280px;
}

/* ==========================================================
   3. EYEBROW LINE VARIANT
   Extends .byr-eyebrow from core-tokens.
   Adds a short horizontal line before the text.
   Used by: homepage, about, stories.
========================================================== */
.byr-eyebrow--lined {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.byr-eyebrow--lined::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ==========================================================
   4. SERIF HEADING SYSTEM
   Instrument Serif editorial headings.
   Used by: homepage, about, CTA panels.
========================================================== */
.byr-heading-serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  color: var(--color-heading);
}

.byr-heading-serif--hero {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.byr-heading-serif--section {
  font-size: clamp(2rem, 4vw, 3rem);
}

.byr-heading-serif--cta {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.2;
}

.byr-heading-serif em {
  font-style: italic;
  color: var(--color-accent-primary);
}

/* ==========================================================
   4b. GRADIENT HEADING WITH UNDERLINE
   Shimmer gradient text + animated partial underline.
   Used by: homepage, research, and any editorial page.
   Apply alongside .byr-heading-serif or standalone.
========================================================== */
.byr-gradient-heading {
  position: relative;
  display: inline-block;
  padding-bottom: 0.6rem;
  background: linear-gradient(
    125deg,
    #e2e8f0 0%,
    #67e8f9 18%,
    #22D3EE 32%,
    #38bdf8 48%,
    #60a5fa 62%,
    #7dd3fc 88%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: byrGradientShimmer 8s ease-in-out infinite;
}

.byr-gradient-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 70%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #22D3EE, #60a5fa 60%, transparent);
  opacity: 0.5;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.15);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease,
              box-shadow 0.4s ease;
}

section:hover .byr-gradient-heading::after {
  width: 92%;
  opacity: 0.85;
  box-shadow:
    0 0 12px rgba(34, 211, 238, 0.35),
    0 0 28px rgba(96, 165, 250, 0.12);
}

/* Centred underline variant (for CTA panels) */
.byr-gradient-heading--center::after {
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  background: linear-gradient(90deg, transparent, #22D3EE 30%, #60a5fa 70%, transparent);
  opacity: 0.45;
}

.byr-gradient-heading--center:hover::after,
.byr-cta-panel:hover .byr-gradient-heading--center::after {
  opacity: 0.8;
  box-shadow:
    0 0 14px rgba(34, 211, 238, 0.35),
    0 0 32px rgba(96, 165, 250, 0.12);
}

/* em inside gradient heading needs fill-color reset */
.byr-gradient-heading em {
  font-style: italic;
  -webkit-text-fill-color: var(--color-accent-primary);
}

@keyframes byrGradientShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}


/* ************************************************************
   PART C — PROSE SYSTEM
   ************************************************************ */

/* ==========================================================
   5. PROSE CONTAINER
   Sets up consistent body text styling for child elements.
   Apply to a wrapper around paragraphs, not individual <p>.
   Used by: every content page.
========================================================== */
.byr-prose p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin: 0 0 1.25rem 0;
  max-width: 65ch;
}

.byr-prose p:last-child {
  margin-bottom: 0;
}

.byr-prose strong {
  color: var(--color-accent-primary);
  font-weight: 700;
}

.byr-prose a {
  color: var(--color-accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.byr-prose a:hover {
  color: var(--color-accent-secondary);
}

.byr-prose a:focus-visible {
  outline: 3px solid var(--color-accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Lead paragraph variant — slightly larger, secondary colour */
.byr-prose .byr-lead,
.byr-prose-lead {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 54ch;
}


/* ************************************************************
   PART D — DIVIDERS
   ************************************************************ */

/* ==========================================================
   6. GRADIENT LINE DIVIDER
   Full-width gradient line that fades at edges.
   Used by: homepage, stories, templates.
   Apply to an empty <div> — the line is the ::after.
========================================================== */
.byr-divider {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.byr-divider::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-subtle) 20%,
    var(--color-border-subtle) 80%,
    transparent
  );
}

/* ==========================================================
   7. SHORT BAR DIVIDER
   56px gradient bar, left-aligned.
   Used by: research, resources, hcs-guide, templates.
========================================================== */
.byr-divider--bar {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent-primary), transparent);
  border: none;
  border-radius: 2px;
  margin: var(--space-xl) 0;
  opacity: 0.45;
}

/* Emerald variant for hcs-guide */
.byr-divider--bar-emerald {
  background: linear-gradient(90deg, var(--color-accent-secondary), transparent);
}


/* ************************************************************
   PART E — BUTTONS
   ************************************************************ */

/* ==========================================================
   8–10. BUTTON BASE STYLES
   ⚠ Defined in 07-buttons.css — not duplicated here.
   This file only provides contextual overrides (small variant,
   button groups, crosslink sizing) below.
========================================================== */

/* ==========================================================
   11. SMALL VARIANT
========================================================== */
.byr-btn--sm,
.byr-btn-sm {
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  min-height: 48px;
}

/* ==========================================================
   12. BUTTON GROUP
   Flex container for CTA button pairs.
   Used by: closing-cta sections site-wide.
========================================================== */
.byr-btn-group,
.byr-cta-btns {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}


/* ************************************************************
   PART F — CARDS
   ************************************************************ */

/* ==========================================================
   13. BASE CARD
   Elevated glass card with hover lift.
   Used by: homepage, research, resources, hcs-guide.
========================================================== */
.byr-card {
  position: relative;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.byr-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent-primary);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(34, 211, 238, 0.08);
}

/* Emerald hover variant */
.byr-card--emerald:hover {
  border-color: var(--color-accent-secondary);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(16, 185, 129, 0.08);
}

/* No-hover variant for static cards */
.byr-card--static {
  transition: none;
}

.byr-card--static:hover {
  transform: none;
  border-color: var(--color-border-subtle);
  box-shadow: none;
}


/* ************************************************************
   PART G — CALLOUTS & CROSSLINKS
   ************************************************************ */

/* ==========================================================
   14. CALLOUT
   Left-border information box.
   Used by: research, resources, hcs-guide, poems, sps, terms.
========================================================== */
.byr-callout {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--color-accent-primary);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin: 1.75rem 0;
}

.byr-callout p {
  color: var(--color-text-secondary);
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.byr-callout strong {
  color: var(--color-accent-primary);
}

/* Urgent variant (red border) */
.byr-callout--urgent {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.18);
}

.byr-callout--urgent strong {
  color: #f87171;
}

/* Emerald variant */
.byr-callout--emerald {
  border-left-color: var(--color-accent-secondary);
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.18);
}

.byr-callout--emerald strong {
  color: var(--color-accent-secondary);
}

/* ==========================================================
   15. CROSSLINK
   Cross-page navigation banner with CTA button.
   Used by: research, resources, hcs-guide.
========================================================== */
.byr-crosslink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.byr-crosslink p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.byr-crosslink .byr-primary,
.byr-crosslink .byr-btn--primary {
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  min-height: 48px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Emerald variant */
.byr-crosslink--emerald {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.22);
}


/* ************************************************************
   PART H — CTA SECTIONS
   ************************************************************ */

/* ==========================================================
   16. CLOSING CTA PANEL
   Centered closing section with heading, body, buttons.
   Used by: research, resources, hcs-guide, stories, ecd.
========================================================== */
.byr-closing-cta {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-top: var(--space-lg);
}

.byr-closing-cta h2 {
  text-align: center;
}

.byr-closing-cta p {
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto 1.75rem;
  text-align: center;
}

/* ==========================================================
   17. GLASS CTA PANEL
   Centred glass panel with chrome top-edge highlight.
   Used by: homepage.
========================================================== */
.byr-cta-panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  backdrop-filter: blur(var(--glass-blur-lg));
  -webkit-backdrop-filter: blur(var(--glass-blur-lg));
  overflow: hidden;
}

/* Chrome top-edge highlight */
.byr-cta-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--byr-chrome-c) 30%,
    var(--byr-chrome-a) 50%,
    var(--byr-chrome-d) 70%,
    transparent
  );
  opacity: 0.5;
}

.byr-cta-panel__body {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 48ch;
  margin: 0 auto var(--space-lg);
}

.byr-cta-panel__note {
  margin-top: 1.25rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.byr-cta-panel__note span {
  color: var(--color-accent-secondary);
}


/* ************************************************************
   PART I — LAYOUT PATTERNS
   ************************************************************ */

/* ==========================================================
   18. TWO-COLUMN WITH TOC
   Sidebar + main content grid layout.
   Used by: research, resources, hcs-guide, sps.
========================================================== */
.byr-two-col {
  position: relative;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem) 4rem;
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-areas: "toc main";
  gap: 3.5rem;
  align-items: start;
}

.byr-two-col-main {
  grid-area: main;
  padding-top: clamp(1.5rem, 3vw, 3rem);
}

.byr-two-col-main h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  color: var(--color-heading);
  margin: 0 0 1.1rem 0;
  line-height: var(--leading-tight);
}

.byr-two-col-main h3 {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--color-heading);
  margin: 2.25rem 0 0.9rem 0;
  line-height: var(--leading-snug);
}

/* Section scroll offset for sticky header */
.byr-two-col .byr-section-anchor[id] {
  scroll-margin-top: 6.5rem;
}

.admin-bar .byr-two-col .byr-section-anchor[id] {
  scroll-margin-top: calc(6.5rem + 32px);
}

/* ==========================================================
   19. TOC SIDEBAR
   Sticky sidebar table of contents.
   Used by: research, resources, hcs-guide.
========================================================== */
.byr-toc {
  grid-area: toc;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  z-index: var(--z-controls);
}

.admin-bar .byr-toc {
  top: calc(5.5rem + 32px);
}

.byr-toc-inner {
  padding: 1.25rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--color-accent-primary);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur-md));
  -webkit-backdrop-filter: blur(var(--glass-blur-md));
}

/* Emerald border variant for hcs-guide */
.byr-toc-inner--emerald {
  border-left-color: var(--color-accent-secondary);
}

.byr-toc-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.9rem 0;
}

.byr-toc-btn {
  display: none;
}

.byr-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.byr-toc a {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color 0.2s,
              background 0.2s,
              border-color 0.2s,
              padding-left 0.2s;
}

.byr-toc a:hover,
.byr-toc a[aria-current="true"] {
  color: var(--color-accent-primary);
  background: rgba(34, 211, 238, 0.08);
  border-left-color: var(--color-accent-primary);
  padding-left: 0.9rem;
}

.byr-toc a[aria-current="true"] {
  font-weight: 600;
}

.byr-toc a:focus-visible {
  outline: 3px solid var(--color-accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Emerald hover variant */
.byr-toc--emerald a:hover,
.byr-toc--emerald a[aria-current="true"] {
  color: var(--color-accent-secondary);
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--color-accent-secondary);
}

.byr-toc--emerald a:focus-visible {
  outline-color: var(--color-accent-secondary);
}

.byr-toc-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

/* ==========================================================
   20. ACCORDION
   Expandable details/summary sections.
   Used by: research, hcs-guide, ecd, poems.
========================================================== */
.byr-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.byr-accordion details {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.byr-accordion details:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2),
              0 0 20px rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
}

.byr-accordion details[open] {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.06);
}

.byr-accordion summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-heading);
  user-select: none;
  transition: color 0.2s;
}

.byr-accordion summary::-webkit-details-marker {
  display: none;
}

.byr-accordion summary:hover {
  color: var(--color-accent-primary);
}

.byr-accordion summary:focus-visible {
  outline: 3px solid var(--color-accent-primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.byr-acc-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 1.6rem;
  text-align: center;
}

.byr-acc-label {
  flex: 1;
}

.byr-acc-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.25s ease,
              color 0.2s;
}

.byr-accordion details[open] .byr-acc-chevron {
  transform: rotate(180deg);
  color: var(--color-accent-primary);
}

.byr-acc-body {
  padding: 0.25rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.byr-acc-body p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0.8rem 0 0;
}

.byr-acc-body p:first-child {
  margin-top: 0.65rem;
}

/* Emerald variant for hcs-guide */
.byr-accordion--emerald details[open] {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.06);
}

.byr-accordion--emerald summary:hover {
  color: var(--color-accent-secondary);
}

.byr-accordion--emerald summary:focus-visible {
  outline-color: var(--color-accent-secondary);
}

.byr-accordion--emerald details[open] .byr-acc-chevron {
  color: var(--color-accent-secondary);
}


/* ************************************************************
   PART J — ANIMATION
   ************************************************************ */

/* ==========================================================
   21. FADE-IN — Scroll-Reveal Animation
   Elements start hidden and slide up when .byr-visible
   is added by IntersectionObserver JS.
   Used by: research, resources, hcs-guide, about, groups,
   homepage, stories.
========================================================== */
.byr-fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease,
              transform 0.65s ease;
}

.byr-fade-in.byr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* CSS-only staggered variant (for homepage-style sections) */
.byr-fade-in--stagger {
  opacity: 0;
  transform: translateY(20px);
  animation: byrFadeIn 600ms ease both;
}

.byr-fade-in--stagger:nth-child(1) { animation-delay: 100ms; }
.byr-fade-in--stagger:nth-child(2) { animation-delay: 200ms; }
.byr-fade-in--stagger:nth-child(3) { animation-delay: 300ms; }
.byr-fade-in--stagger:nth-child(4) { animation-delay: 400ms; }
.byr-fade-in--stagger:nth-child(5) { animation-delay: 500ms; }
.byr-fade-in--stagger:nth-child(6) { animation-delay: 600ms; }

@keyframes byrFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ************************************************************
   PART K — LIGHT MODE OVERRIDES
   ************************************************************ */

/* ==========================================================
   22. COMPONENT LIGHT-MODE ADJUSTMENTS
========================================================== */

/* Cards */
.mode-light .byr-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.mode-light .byr-card:hover {
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(8, 145, 178, 0.10);
}

/* Buttons — light mode handled by 07-buttons.css */

/* Gradient heading */
.mode-light .byr-gradient-heading {
  background: linear-gradient(
    125deg,
    #1e293b 0%,
    #0e7490 22%,
    #0891B2 38%,
    #0284c7 55%,
    #1d4ed8 72%,
    #0369a1 90%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
}

.mode-light .byr-gradient-heading::after {
  background: linear-gradient(90deg, #0891B2, #0284c7 60%, transparent);
}

.mode-light .byr-gradient-heading--center::after {
  background: linear-gradient(90deg, transparent, #0891B2 30%, #0284c7 70%, transparent);
}

.mode-light .byr-gradient-heading em {
  -webkit-text-fill-color: #0891B2;
}

/* Accordion hover — shadow in light mode */
.mode-light .byr-accordion details:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08),
              0 0 0 1px rgba(8, 145, 178, 0.10);
  border-color: rgba(8, 145, 178, 0.20);
}

/* CTA Panel */
.mode-light .byr-cta-panel {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.mode-light .byr-cta-panel .byr-heading-serif em {
  color: #0891B2;
}

/* Closing CTA */
.mode-light .byr-closing-cta {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Crosslink */
.mode-light .byr-crosslink {
  background: rgba(8, 145, 178, 0.04);
  border-color: rgba(8, 145, 178, 0.15);
}

/* Callout */
.mode-light .byr-callout {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}


/* ************************************************************
   PART L — RESPONSIVE
   ************************************************************ */

/* ==========================================================
   23. TABLET & MOBILE BREAKPOINTS
========================================================== */

/* ── Tablet (≤860px): TOC collapses to sticky dropdown ── */
@media (max-width: 860px) {
  .byr-two-col {
    display: block;
    padding-bottom: 3rem;
  }

  .byr-toc {
    position: sticky;
    top: 4rem;
    max-height: none;
    margin-bottom: 0;
    z-index: var(--z-controls);
  }

  .admin-bar .byr-toc {
    top: calc(4rem + 46px);
  }

  .byr-toc-inner {
    background: var(--color-bg-elevated);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: none;
    backdrop-filter: blur(var(--glass-blur-lg));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }

  .byr-toc-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-heading);
    min-height: 48px;
  }

  .byr-toc-btn:focus-visible {
    outline: 3px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  .byr-toc ol {
    display: none;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border-subtle);
  }

  .byr-toc.byr-toc-open ol {
    display: flex;
  }

  .byr-toc a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.6rem;
  }

  .byr-toc.byr-toc-open .byr-toc-chevron {
    transform: rotate(180deg);
  }

  .byr-two-col-main {
    padding-top: 2rem;
  }

  .byr-two-col .byr-section-anchor[id] {
    scroll-margin-top: 10rem;
  }

  .admin-bar .byr-two-col .byr-section-anchor[id] {
    scroll-margin-top: calc(10rem + 46px);
  }
}

/* Desktop: hide TOC toggle button */
@media (min-width: 861px) {
  .byr-toc-btn {
    pointer-events: none;
  }

  .byr-toc-chevron {
    display: none;
  }
}

/* ── Phone (≤480px): tighter spacing ── */
@media (max-width: 480px) {
  .byr-two-col {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 2.5rem;
  }

  .byr-callout {
    padding: 1rem 1.1rem;
  }

  .byr-crosslink {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.1rem;
    gap: 1rem;
  }

  .byr-crosslink .byr-primary,
  .byr-crosslink .byr-btn--primary {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .byr-closing-cta {
    padding: 2rem 1rem;
  }

  .byr-divider--bar {
    margin: 2rem 0;
  }

  .byr-acc-body {
    padding: 0.25rem 0.9rem 1rem;
  }

  .byr-btn-group,
  .byr-cta-btns {
    flex-direction: column;
    align-items: center;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .byr-fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .byr-fade-in--stagger {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .byr-card:hover {
    transform: none;
  }

  /* Button reduced motion handled by 07-buttons.css */

  .byr-accordion details {
    transition: none;
  }

  .byr-accordion details:hover {
    transform: none;
  }

  .byr-acc-chevron {
    transition: none;
  }

  .byr-accordion details[open] .byr-acc-chevron {
    transform: none;
    opacity: 0.5;
  }

  .byr-toc.byr-toc-open .byr-toc-chevron {
    transform: none;
    opacity: 0.5;
  }

  .byr-toc a {
    transition: none;
  }

  .byr-gradient-heading {
    animation: none;
    background-size: 100% 100%;
  }

  .byr-gradient-heading::after {
    transition: none;
  }
}

/* ── Forced Colors (Windows High Contrast) ── */
@media (forced-colors: active) {
  .byr-card,
  .byr-callout,
  .byr-crosslink,
  .byr-closing-cta,
  .byr-cta-panel,
  .byr-toc-inner {
    border: 2px solid CanvasText;
  }

  /* Button forced colors handled by 07-buttons.css */

  .byr-divider::after,
  .byr-divider--bar {
    background: CanvasText;
  }

  .byr-eyebrow--lined::before {
    background: CanvasText;
  }

  .byr-gradient-heading {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: CanvasText;
  }

  .byr-gradient-heading::after {
    background: CanvasText;
  }
}
