/* ============================================================
   Phils 5K — Tab Components
   ------------------------------------------------------------
   Two patterns:
     .ph-year-tabs    → Year-Strip Tabs   (Photos / Results pages)
     .ph-segmented    → Segmented Control (Runner Info)
   Both wrap in:
     .ph-tabs-shell   → Horizontal-scroll container with edge
                        fades and ◀ ▶ arrow controls.
   ============================================================ */

/* ── SCROLL SHELL ──────────────────────────────────────── */
.ph-tabs-shell {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}
.ph-tabs-shell__bar {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 194, 0, 0.5) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.ph-tabs-shell__bar::-webkit-scrollbar       { height: 6px; }
.ph-tabs-shell__bar::-webkit-scrollbar-track { background: transparent; }
.ph-tabs-shell__bar::-webkit-scrollbar-thumb {
  background: rgba(245, 194, 0, 0.45);
  border-radius: 3px;
}
.ph-tabs-shell__bar::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 194, 0, 0.75);
}

/* Edge fade gradients */
.ph-tabs-shell::before,
.ph-tabs-shell::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 44px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s;
}
.ph-tabs-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--ph-fade-bg, #fff) 0%, transparent 100%);
  opacity: var(--ph-fade-left, 0);
}
.ph-tabs-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--ph-fade-bg, #fff) 0%, transparent 100%);
  opacity: var(--ph-fade-right, 1);
}

/* Scroll arrow buttons (injected by JS) */
.ph-tabs-shell__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid rgba(27, 61, 143, 0.18);
  color: #1B3D8F;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(20, 14, 8, 0.18);
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
}
.ph-tabs-shell__arrow.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.ph-tabs-shell__arrow:hover {
  background: #1B3D8F;
  color: #F5C200;
  border-color: #1B3D8F;
  transform: translateY(-50%) scale(1.06);
}
.ph-tabs-shell__arrow--left  { left: 4px; }
.ph-tabs-shell__arrow--right { right: 4px; }
.ph-tabs-shell__arrow svg { width: 20px; height: 20px; }

/* ── YEAR-STRIP TABS ───────────────────────────────────── */
.ph-year-tabs {
  display: flex;
  gap: 0;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFF8E7 100%);
  border: 1.5px solid rgba(245, 194, 0, 0.30);
  border-radius: 16px;
  overflow: hidden;
  min-width: max-content;
}
.ph-year-tabs__btn {
  background: transparent;
  border: none;
  flex: 0 0 124px;
  padding: 18px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  border-right: 1px solid rgba(245, 194, 0, 0.20);
  transition: background 0.2s;
}
.ph-year-tabs__btn:last-child {
  border-right: none;
}
.ph-year-tabs__btn:hover {
  background: rgba(245, 194, 0, 0.10);
}
.ph-year-tabs__year {
  font-family: 'Fredoka', cursive;
  font-size: 28px;
  font-weight: 700;
  color: #1B3D8F;
  line-height: 1;
}
.ph-year-tabs__caption {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #706758;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}
.ph-year-tabs__btn[aria-selected="true"] {
  background: #1B3D8F;
}
.ph-year-tabs__btn[aria-selected="true"] .ph-year-tabs__year    { color: #F5C200; }
.ph-year-tabs__btn[aria-selected="true"] .ph-year-tabs__caption { color: rgba(245, 194, 0, 0.92); }

/* Focus ring for keyboard users */
.ph-year-tabs__btn:focus-visible,
.ph-segmented__btn:focus-visible {
  outline: 3px solid rgba(245, 194, 0, 0.55);
  outline-offset: -3px;
}

/* ── SEGMENTED CONTROL ─────────────────────────────────── */
.ph-segmented {
  display: inline-flex;
  background: #FFF8E7;
  border: 1px solid rgba(245, 194, 0, 0.30);
  border-radius: 9999px;
  padding: 5px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(20, 14, 8, 0.06);
  min-width: max-content;
}
.ph-segmented__btn {
  background: transparent;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #706758;
  padding: 12px 26px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}
.ph-segmented__btn:hover:not([aria-selected="true"]) {
  color: #1B3D8F;
}
.ph-segmented__btn[aria-selected="true"] {
  background: #F5C200;
  color: #1B3D8F;
  box-shadow: 0 2px 10px rgba(245, 194, 0, 0.45);
}
