/* ==========================================================================
   Planet Sites — Version Switcher styles
   Self-contained: no dependency on any planet's design tokens, so the dock
   looks identical across sites. Pairs with switcher.js.
   ========================================================================== */

.pt-switcher {
  position: fixed;
  bottom: 1rem;
  z-index: 2147483000; /* above typical site chrome */
  display: flex;
  flex-direction: column;
  max-width: min(20rem, calc(100vw - 2rem));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.3;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.pt-switcher--right { right: 1rem; }
.pt-switcher--left { left: 1rem; }

/* Colour scheme keyed to the version. */
.pt-switcher--inaccessible {
  background: #3d1515;
  color: #ffd5d5;
  border: 1px solid #ff6b6b;
}
.pt-switcher--accessible {
  background: #0d3320;
  color: #c6f7e2;
  border: 1px solid #00b894;
}

/* --- Toggle (collapse/expand) ------------------------------------------- */
.pt-switcher__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.pt-switcher__toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.pt-switcher__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.pt-switcher__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.pt-switcher--inaccessible .pt-switcher__dot {
  background: #ff6b6b;
  box-shadow: 0 0 6px #ff6b6b;
}
.pt-switcher--accessible .pt-switcher__dot {
  background: #00b894;
  box-shadow: 0 0 6px #00b894;
}

.pt-switcher__label {
  flex: 1 1 auto;
}

/* --- Panel (the switch link) -------------------------------------------- */
.pt-switcher__panel {
  padding: 0 0.75rem 0.625rem;
}
.pt-switcher__link {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0.25rem 0;
}
.pt-switcher__link:hover {
  text-decoration: none;
}
.pt-switcher__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Collapsed state ----------------------------------------------------- */
/* Shrinks to just the coloured dot. The version label stays in the accessible
   tree (visually hidden, not removed) so the button keeps its name. */
.pt-switcher.is-collapsed {
  max-width: none;
  border-radius: 999px;
}
.pt-switcher.is-collapsed .pt-switcher__panel {
  display: none;
}
.pt-switcher.is-collapsed .pt-switcher__toggle {
  padding: 0.5rem;
}
.pt-switcher.is-collapsed .pt-switcher__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Visually-hidden helper for the toggle hint text. */
.pt-switcher .pt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .pt-switcher,
  .pt-switcher__toggle {
    transition: none;
  }
}
