/* =============================================================================
   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 — vertical slider on short track ───────────────── */
/*
   Anatomy:
     .footer-theme-track   short vertical pill  (24 px × 44 px)
     .footer-theme-thumb   circle that slides up/down inside it

   "Vertical slider travelling a short horizontal length":
   The track is portrait-oriented so the thumb moves along the Y axis,
   giving a push-button / elevator feel distinct from a normal toggle.
   The total travel distance is ~20 px — brief and deliberate.
*/

.footer-theme-input {
  /* Hidden but still reachable by keyboard / screen-readers */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.footer-theme-track {
  position: relative;
  display: block;
  width: 24px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.28s ease, border-color 0.28s ease;
}

.footer-theme-track:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Thumb */
.footer-theme-thumb {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;

  /* Resting position (light mode): thumb at bottom */
  bottom: 3px;

  background: rgba(210, 225, 255, 0.75);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);

  transition:
    bottom 0.30s cubic-bezier(0.34, 1.56, 0.64, 1),  /* slight overshoot */
    background  0.28s ease,
    box-shadow  0.28s ease;
}

/* Dark-mode engaged: thumb travels to top, track glows faintly blue */
.footer-theme-input:checked + .footer-theme-track {
  background: rgba(0, 90, 200, 0.38);
  border-color: rgba(80, 160, 255, 0.35);
}

.footer-theme-input:checked + .footer-theme-track .footer-theme-thumb {
  bottom: calc(100% - 19px);          /* top of track */
  background: #4fa8ff;
  box-shadow: 0 0 8px rgba(80, 160, 255, 0.55);
}

/* Focus ring for keyboard users */
.footer-theme-input:focus-visible + .footer-theme-track {
  outline: 2px solid rgba(80, 160, 255, 0.7);
  outline-offset: 2px;
}


/* ── 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;
}
