/* ================================================================
   BYR — FOOTER
   WPCode: CSS Snippet | Site Wide Header | Priority: 15
   ================================================================
   Hierarchy-driven layout. Tokens from BYR Foundations (Priority 5).
   No JS dependency. WCAG 2.1 AA compliant.
   ================================================================
   CLASS: .byr-site-footer  (avoids collision with .byr-footer
   button variant in Starlight v5 Button System)
   ================================================================ */


/* ── Wrapper ────────────────────────────────────────────────── */

.byr-site-footer {
  position: relative;
  display: block;
  background: var(--color-bg-primary, #020617);
  color: var(--color-text-secondary, #cbd5e1);
  overflow: hidden;
  border-top: none;
}

/* Chrome gradient rule — top edge */
.byr-site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--byr-chrome-c, rgba(34, 211, 238, 0.65)) 20%,
    var(--byr-chrome-a, rgba(255, 255, 255, 0.95)) 40%,
    var(--byr-chrome-d, rgba(16, 185, 129, 0.55)) 60%,
    var(--byr-chrome-c, rgba(34, 211, 238, 0.65)) 80%,
    transparent 100%
  );
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

/* Soft glow bloom beneath the chrome line */
.byr-site-footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 160px;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(34, 211, 238, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}


/* ── Body / content wrapper ─────────────────────────────────── */

.byr-site-footer .byr-site-footer__body {
  position: relative;
  z-index: 3;
  padding-block: clamp(3rem, 5vw, 4.5rem) clamp(1.25rem, 3vw, 2rem);
}


/* ── Main grid — Brand + 3 nav columns ─────────────────────── */

.byr-site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 0.9fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
  align-items: start;
}


/* ── Brand column ───────────────────────────────────────────── */

.byr-site-footer__logo {
  display: inline-block;
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-accent-primary, #22d3ee);
  text-decoration: none;
  margin-bottom: var(--space-xs);
  transition: color 200ms ease;
}

.byr-site-footer__logo:hover {
  color: var(--color-accent-secondary, #10b981);
}

.byr-site-footer__logo:focus-visible {
  outline: 2px solid var(--color-accent-primary, #22d3ee);
  outline-offset: 4px;
  border-radius: 3px;
}

.byr-site-footer__tagline {
  font-size: var(--text-sm, 0.875rem);
  line-height: var(--leading-relaxed, 1.7);
  color: var(--color-text-muted, #8a8a9a);
  max-width: 28ch;
  margin-bottom: var(--space-md);
}


/* ── Social row ─────────────────────────────────────────────── */

.byr-site-footer__social {
  display: flex;
  gap: var(--space-2xs);
  flex-wrap: wrap;
}

.byr-site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.35));
  color: var(--color-text-muted, #8a8a9a);
  text-decoration: none;
  background: transparent;
  transition:
    color        200ms ease,
    border-color 200ms ease,
    background   200ms ease,
    box-shadow   200ms ease;
  flex-shrink: 0;
}

.byr-site-footer__social-link:hover {
  color: var(--color-accent-primary, #22d3ee);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.1);
}

.byr-site-footer__social-link:focus-visible {
  outline: 2px solid var(--color-accent-primary, #22d3ee);
  outline-offset: 3px;
  border-radius: 8px;
}

.byr-site-footer__social-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}


/* ── Nav columns ────────────────────────────────────────────── */

.byr-site-footer__nav-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8a8a9a);
  margin-bottom: var(--space-sm);
  padding-left: 0.65rem;
  border-left: 2px solid var(--color-border-subtle, rgba(148, 163, 184, 0.35));
}

/* Explore — primary accent */
.byr-site-footer__nav-group--primary .byr-site-footer__nav-label {
  border-left-color: var(--color-accent-primary, #22d3ee);
  color: var(--color-text-secondary, #c7c7d8);
}

/* About — secondary accent */
.byr-site-footer__nav-group--secondary .byr-site-footer__nav-label {
  border-left-color: var(--color-accent-secondary, #10b981);
  color: var(--color-text-muted, #8a8a9a);
}

/* Policies — muted */
.byr-site-footer__nav-group--legal .byr-site-footer__nav-label {
  border-left-color: rgba(148, 163, 184, 0.2);
  color: var(--color-text-muted, #8a8a9a);
}

.byr-site-footer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.byr-site-footer__nav-link {
  display: inline-block;
  font-size: var(--text-sm, 0.875rem);
  line-height: var(--leading-snug, 1.3);
  color: var(--color-text-secondary, #c7c7d8);
  text-decoration: none;
  padding: 0.15rem 0;
  transition: color 180ms ease;
}

.byr-site-footer__nav-link:hover {
  color: var(--color-accent-primary, #22d3ee);
}

.byr-site-footer__nav-link:focus-visible {
  outline: 2px solid var(--color-accent-primary, #22d3ee);
  outline-offset: 3px;
  border-radius: 2px;
}

/* About column — emerald hover */
.byr-site-footer__nav-group--secondary .byr-site-footer__nav-link:hover {
  color: var(--color-accent-secondary, #10b981);
}

/* Legal links — smaller, muted */
.byr-site-footer__nav-link--legal {
  font-size: var(--text-sm);
  color: var(--color-text-muted, #8a8a9a);
}

.byr-site-footer__nav-link--legal:hover {
  color: var(--color-text-secondary, #c7c7d8);
}


/* ── Recent-posts strip ─────────────────────────────────────── */

.byr-site-footer__posts {
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.15));
  padding-top: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.byr-site-footer__posts-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8a8a9a);
  margin-bottom: 0.85rem;
}

.byr-site-footer__posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.byr-site-footer__post-link {
  display: block;
  font-size: var(--text-sm, 0.875rem);
  line-height: var(--leading-snug, 1.3);
  color: var(--color-text-secondary, #c7c7d8);
  text-decoration: none;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.15));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition:
    color        180ms ease,
    border-color 180ms ease,
    background   180ms ease,
    box-shadow   180ms ease;
}

.byr-site-footer__post-link:hover {
  color: var(--color-accent-secondary, #10b981);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.06);
}

.byr-site-footer__post-link:focus-visible {
  outline: 2px solid var(--color-accent-primary, #22d3ee);
  outline-offset: 3px;
  border-radius: 8px;
}


/* ── Bottom bar ─────────────────────────────────────────────── */

.byr-site-footer__bottom {
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.15));
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.byr-site-footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-text-muted, #8a8a9a);
  line-height: var(--leading-normal, 1.5);
}


/* ── Light-mode overrides ───────────────────────────────────── */

.mode-light .byr-site-footer {
  background: var(--color-bg-primary, #f8f8fc);
  border-top: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.12));
}

.mode-light .byr-site-footer::before {
  opacity: 0.35;
}

.mode-light .byr-site-footer::after {
  opacity: 0.4;
}

.mode-light .byr-site-footer__social-link:hover {
  background: rgba(34, 211, 238, 0.06);
}

.mode-light .byr-site-footer__post-link {
  background: rgba(0, 0, 0, 0.015);
}

.mode-light .byr-site-footer__post-link:hover {
  background: rgba(16, 185, 129, 0.05);
}


/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 960px) {
  .byr-site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem var(--space-lg);
  }

  .byr-site-footer__brand {
    grid-column: 1 / -1;
  }

  .byr-site-footer__tagline {
    max-width: 38ch;
  }

  .byr-site-footer__posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 560px) {
  .byr-site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .byr-site-footer__brand {
    grid-column: auto;
  }

  .byr-site-footer__tagline {
    max-width: none;
  }

  .byr-site-footer__posts-grid {
    grid-template-columns: 1fr;
  }

  .byr-site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}


/* ── Print ──────────────────────────────────────────────────── */

@media print {
  .byr-site-footer {
    background: #fff !important;
    color: #000 !important;
  }

  .byr-site-footer::before,
  .byr-site-footer::after {
    display: none;
  }

  .byr-site-footer__social {
    display: none;
  }
}