/* =============================================================================
   footer.css  (replaces old footer rules + toggle.css entirely)
   =============================================================================

   Layout:  fixed pill bar centred at the bottom of the viewport.
   Three equal flex columns:  logo  |  nav arrows  |  theme slider.
   The bar slides off-screen downward when the user scrolls down fast
   and snaps back on any upward scroll (class toggled by JS in the partial).
   ============================================================================= */


/* ── Bar shell ──────────────────────────────────────────────────────────── */

.footer-bar {
  position: fixed;
  bottom: max(0.875rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(0);

  display: flex;
  align-items: stretch;          /* sections fill the bar height */

  width: min(400px, 94vw);
  height: 56px;

  backdrop-filter: blur(1px) saturate(72%);
  -webkit-backdrop-filter: blur(1px) saturate(72%);
  background-color: rgba(17, 25, 40, 0.19);
  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.125);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.37),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  z-index: 9000;
  overflow: hidden;               /* pill clips children cleanly */

  /* Kinetic transition — snappy enough to feel tied to scroll momentum */
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.24s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Hidden state: bar slides just past the viewport bottom */
.footer-bar--hidden {
  transform: translateX(-50%) translateY(calc(100% + 1.25rem));
  opacity: 0.15;
}


/* ── Equal-width thirds ─────────────────────────────────────────────────── */

.footer-section {
  flex: 1 1 0;                   /* each third identical width */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

/* Hairline dividers between sections */
.footer-section + .footer-section {
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}


/* ── 1 / 3  Logo section ────────────────────────────────────────────────── */

.footer-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding: 0;
  background: none;
  border: none;
}

/* Let the existing .home-image sizing rule handle width/height;
   just make sure it doesn't add extra space. */
.footer-section--logo .home-image {
  /* display: block;
  max-height: 32px;
  width: auto; */
}


/* ── 2 / 3  Navigation arrows ───────────────────────────────────────────── */

.footer-section--nav {
  gap: 0.25rem;
}

.footer-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  /* Arrows inherit this colour via currentColor on the SVG stroke */
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.16s ease, background 0.16s ease;
}

.footer-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.footer-nav-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

/* Disabled state wired from the history-navigation Stimulus controller */
.footer-nav-btn[disabled],
.footer-nav-btn.is-inactive {
  color: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.footer-nav-icon {
  width: 20px;
  height: 20px;
  display: block;
  /* stroke="currentColor" set in the SVG markup — nothing more needed */
}


/* ── 3 / 3  Theme toggle — sun / moon icon button ──────────────────────── */
/*
   A plain round button (matching the nav arrows) that shows a recognisable
   sun or moon glyph. The icon reflects the action, not just the state:
     · light mode → moon  ("switch to dark")
     · dark mode  → sun   ("switch to light")
   Paired with an aria-label / title that updates in the Stimulus controller,
   so the meaning is unambiguous to sighted and assistive-tech users alike.
*/

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  color: rgba(255, 255, 255, 0.55);   /* icon colour via currentColor */
  transition: color 0.16s ease, background 0.16s ease;
}

.theme-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.theme-toggle:active {
  background: rgba(255, 255, 255, 0.16);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(80, 160, 255, 0.7);
  outline-offset: 2px;
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Light mode (default): show the moon → tap to go dark */
.theme-toggle__icon--sun  { display: none; }
.theme-toggle__icon--moon { display: block; }

/* Dark mode engaged: show the sun → tap to go light */
:root.dark .theme-toggle__icon--moon { display: none; }
:root.dark .theme-toggle__icon--sun  { display: block; }


/* ── Silence old conflicting rules ─────────────────────────────────────── */
/* These selectors no longer exist in the markup. The declarations below
   act as safety guards in case old CSS is still loaded in the same bundle. */

.home-button,
.footer,
.toggle-container,
.toggle-wrap,
.toggle-input,
.toggle-track,
.toggle-thumb,
.thumb-core,
.thumb-inner,
.thumb-scan,
.thumb-particles,
.thumb-particle,
.toggle-data,
.data-text,
.status-indicator,
.energy-rings,
.energy-ring,
.interface-lines,
.interface-line,
.toggle-reflection,
.toggle-label,
.holo-glow,
.track-lines,
.track-line {
  display: none !important;
}
