/* =============================================================================
   3rdi-seg — the shared fab-style segmented tab control.
   One rounded track, N equal tabs, a gradient thumb sliding under the active
   tab. Same look as the /contact audience switcher (which keeps its own copy
   in contact.css as .aud-*). Driven by 3rdi-seg.js: the track carries
   --n (segment count, set in markup) and --i (active index, set by the JS).
   ========================================================================== */

.thirdi-seg {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--n, 2), 1fr);
  width: min(100%, 560px);
  padding: 5px;
  border: 1px solid var(--line-hi);
  border-radius: var(--pill);
  background: var(--panel);
  box-shadow: var(--soft-shadow), inset 0 1px 3px rgba(20, 28, 60, 0.05);
}

.thirdi-seg__thumb {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / var(--n, 2));
  border-radius: var(--pill);
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(73, 121, 239, 0.35);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 280ms cubic-bezier(0.3, 0.9, 0.3, 1);
}

.thirdi-seg__btn {
  appearance: none;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease;
}
.thirdi-seg__btn:hover { color: var(--text); }
.thirdi-seg__btn[aria-selected='true'] { color: #fff; }
.thirdi-seg__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(73, 121, 239, 0.3);
}

/* Panes: the element named by the track's data-seg-panes shows exactly one
   [data-seg-pane] child at a time (3rdi-seg.js toggles [hidden]). A soft
   rise-in on entry; none under reduced motion. */
[data-seg-pane] { animation: thirdi-seg-pane-in 320ms cubic-bezier(0.2, 0.75, 0.25, 1) both; }
[data-seg-pane][hidden] { display: none; }

@keyframes thirdi-seg-pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .thirdi-seg__btn { font-size: 14.5px; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .thirdi-seg__thumb { transition: none; }
  [data-seg-pane] { animation: none; }
}

/* Optional long/short label swap inside a seg button (used by the home #fork
   toggle: "Campuses & Companies" on desktop, "Organizations" on narrow). */
.thirdi-seg__short { display: none; }
@media (max-width: 560px) {
  .thirdi-seg__long { display: none; }
  .thirdi-seg__short { display: inline; }
}
