/*
 * Canonical event and gallery primitives.
 *
 * These rules own the structural components that the Next templates render.
 * Visual roles come exclusively from tokens.css; later component rules refine
 * the approved Penpot compositions without depending on fstcho_theme CSS.
 */

.theme-fstcho-next .fst-migrated-content {
  color: var(--fst-ink-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.theme-fstcho-next .fst-migrated-content :where(font, span[style], p[style], div[style]) {
  color: inherit !important;
  font: inherit !important;
  background: transparent !important;
}

.theme-fstcho-next .fst-migrated-content :where(h2, h3, h4) {
  margin-top: 1.8em;
  line-height: 1.18;
}

.theme-fstcho-next .fst-migrated-content :where(p, ul, ol, blockquote, table, figure) {
  margin-bottom: 1.4em;
}

.theme-fstcho-next .fst-migrated-content :where(img, video, iframe) {
  max-width: 100%;
  height: auto;
}

.theme-fstcho-next .fst-migrated-content iframe {
  width: 100%;
  min-height: 440px;
  border: 0;
  border-radius: var(--fst-radius);
}

.theme-fstcho-next .fst-migrated-content table {
  width: 100%;
  border-collapse: collapse;
}

.theme-fstcho-next .fst-migrated-content :is(th, td) {
  padding: 10px 12px;
  border: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-migrated-content blockquote {
  margin-inline: 0;
  padding: 12px 0 12px 22px;
  border-left: 3px solid var(--fst-accent);
}

.theme-fstcho-next .fst-catalog-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--fst-ink);
  font-family: var(--fst-font-sans);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1;
}

.theme-fstcho-next .fst-catalog-empty p {
  margin: 0;
  color: var(--fst-muted);
}

.theme-fstcho-next .fst-section-heading {
  margin-bottom: 22px;
}

.theme-fstcho-next .fst-section-heading > p {
  margin: 0 0 7px;
  color: var(--fst-accent-text);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.theme-fstcho-next .fst-section-heading h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 3.2rem);
  line-height: .98;
}

.theme-fstcho-next .fst-event-page {
  --fst-event-space: clamp(36px, 5vw, 66px);
}

.theme-fstcho-next .fst-event-page > .fst-event-lifecycle {
  margin-block: 0;
  padding-left: 0;
  list-style: none;
}

.theme-fstcho-next .fst-event-page > .fst-event-lifecycle li::before {
  position: absolute;
  content: "";
}

.theme-fstcho-next .fst-event-masthead__competitions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-fstcho-next .fst-event-masthead__competition {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-masthead__competition > span {
  color: var(--fst-accent-text);
  font-size: .64rem;
  font-weight: 800;
}

.theme-fstcho-next .fst-event-masthead__competition > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.theme-fstcho-next .fst-event-masthead__competition :where(strong, small) {
  margin: 0;
}

.theme-fstcho-next .fst-event-stage-stack {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-bottom: var(--fst-event-space);
}

.theme-fstcho-next .fst-content-surface .fst-event-page details.fst-event-stage {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--fst-line);
  border-radius: var(--fst-radius);
  background: var(--fst-surface);
  box-shadow: none;
  scroll-margin-top: 84px;
}

.theme-fstcho-next .fst-content-surface .fst-event-page details.fst-event-stage[data-state="current"] {
  border-color: color-mix(in srgb, var(--fst-accent) 52%, var(--fst-line));
  box-shadow: inset 4px 0 0 var(--fst-accent);
}

.theme-fstcho-next .fst-content-surface .fst-event-page details.fst-event-stage > summary {
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 20px;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
}

.theme-fstcho-next details.fst-disclosure > summary::after {
  justify-self: end;
  color: var(--fst-muted);
  content: "+";
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
}

.theme-fstcho-next details.fst-disclosure[open] > summary::after {
  content: "−";
}

.theme-fstcho-next .fst-event-stage__number {
  color: var(--fst-accent-text);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.theme-fstcho-next .fst-event-stage__identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.theme-fstcho-next .fst-event-stage__identity :where(strong, small) {
  margin: 0;
}

.theme-fstcho-next .fst-event-stage__identity strong {
  color: var(--fst-ink);
  font-size: clamp(.94rem, 1.4vw, 1.08rem);
}

.theme-fstcho-next .fst-event-stage__identity small {
  color: var(--fst-muted);
  font-size: .68rem;
  line-height: 1.4;
}

.theme-fstcho-next .fst-event-stage__body {
  min-width: 0;
  padding: clamp(14px, 2.5vw, 24px);
  border-top: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-stage__body > :first-child {
  margin-top: 0;
}

.theme-fstcho-next .fst-event-stage__body > :last-child {
  margin-bottom: 0;
}

.theme-fstcho-next .fst-event-stage__body :is(.fst-event-overview, .fst-event-dashboard, .fst-event-section, .fst-event-result, .fst-event-media) {
  margin-bottom: clamp(18px, 3vw, 30px);
}

.theme-fstcho-next .fst-event-stage__action {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.theme-fstcho-next .fst-event-stage__action div {
  display: grid;
  gap: 4px;
}

.theme-fstcho-next .fst-event-stage__action small {
  color: var(--fst-muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.theme-fstcho-next .fst-event-stage__action strong {
  color: var(--fst-ink);
  font-size: .94rem;
}

.theme-fstcho-next .fst-event-section,
.theme-fstcho-next .fst-event-overview,
.theme-fstcho-next .fst-event-dashboard,
.theme-fstcho-next .fst-event-live,
.theme-fstcho-next .fst-event-results,
.theme-fstcho-next .fst-event-roster,
.theme-fstcho-next .fst-event-media {
  min-width: 0;
  margin-bottom: var(--fst-event-space);
}

.theme-fstcho-next .fst-event-section--body {
  max-width: var(--fst-reading-width);
}

.theme-fstcho-next .fst-event-venue.fst-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr);
  min-height: 250px;
  padding: 0;
}

.theme-fstcho-next .fst-event-map {
  min-height: 250px;
  overflow: hidden;
  background: var(--fst-paper-deep);
}

.theme-fstcho-next .fst-event-map iframe {
  width: 100%;
  height: 100%;
  min-height: 250px;
  display: block;
  border: 0;
  pointer-events: none;
}

.theme-fstcho-next .fst-event-venue__details {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(22px, 4vw, 38px);
}

.theme-fstcho-next .fst-event-venue__details > :where(p, h2, address) {
  margin: 0;
}

.theme-fstcho-next .fst-event-venue__details > p,
.theme-fstcho-next .fst-event-venue__details > div span {
  color: var(--fst-muted);
  font-size: .64rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.theme-fstcho-next .fst-event-venue__details > div {
  display: grid;
  gap: 4px;
}

.theme-fstcho-next .fst-event-venue__details > div strong,
.theme-fstcho-next .fst-event-venue__details address {
  color: var(--fst-ink-soft);
  font-size: .82rem;
  line-height: 1.45;
}

.theme-fstcho-next .fst-event-venue__details > a {
  margin-top: 4px;
  font-size: .76rem;
  font-weight: 800;
}

.theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list,
.theme-fstcho-next .fst-event-masthead__facts.fst-meta-list {
  display: grid;
  margin-bottom: 0;
  padding-left: 0;
}

.theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list > div {
  min-width: 0;
  padding: 14px 18px;
  border-left: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.theme-fstcho-next .fst-event-dashboard__metrics dt {
  color: var(--fst-muted);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.theme-fstcho-next .fst-event-dashboard__metrics dd {
  margin: 5px 0 0;
  color: var(--fst-ink);
  font-family: var(--fst-font-sans);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-weight: 700;
}

.theme-fstcho-next .fst-event-dashboard__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  gap: clamp(20px, 3vw, 34px);
  margin-top: 18px;
}

.theme-fstcho-next .fst-event-dashboard__programme {
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-fstcho-next .fst-event-dashboard__programme li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-dashboard__programme time {
  display: grid;
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-dashboard__programme time strong {
  color: var(--fst-ink);
  font-size: .8rem;
}

.theme-fstcho-next .fst-event-dashboard__programme > li > span {
  color: var(--fst-ink);
  font-size: .82rem;
}

.theme-fstcho-next .fst-event-dashboard__programme a,
.theme-fstcho-next .fst-event-dashboard__actions a {
  font-size: .72rem;
  font-weight: 800;
}

.theme-fstcho-next .fst-event-dashboard__actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

.theme-fstcho-next .fst-event-dashboard__actions .btn {
  justify-content: space-between;
}

.theme-fstcho-next .fst-event-live__header,
.theme-fstcho-next .fst-event-live__distance > header,
.theme-fstcho-next .fst-event-results__heading,
.theme-fstcho-next .fst-event-roster__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.theme-fstcho-next .fst-event-live__header > div:last-child {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.theme-fstcho-next .fst-event-live__header small,
.theme-fstcho-next .fst-event-results__heading > span,
.theme-fstcho-next .fst-event-roster__heading > p {
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-live__distance + .fst-event-live__distance {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-live__distance > header {
  align-items: center;
  margin-bottom: 12px;
}

.theme-fstcho-next .fst-event-live__distance h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
}

.theme-fstcho-next .fst-event-live__distance time {
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-live__categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-fstcho-next .fst-event-result-track {
  margin-top: 22px;
  border-top: 2px solid var(--fst-ink);
}

.theme-fstcho-next .fst-event-result-track--regional {
  border-top-color: var(--fst-accent);
}

.theme-fstcho-next .fst-event-result-track > header {
  min-height: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
}

.theme-fstcho-next .fst-event-result-track > header span {
  color: var(--fst-accent-text);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.theme-fstcho-next .fst-event-result-track > header h4 {
  margin: 0;
  font-size: 1rem;
}

.theme-fstcho-next .fst-event-scoreboard {
  min-width: 0;
  padding: 12px 0;
}

.theme-fstcho-next .fst-event-scoreboard > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.theme-fstcho-next .fst-event-scoreboard > header :where(h5, span) {
  margin: 0;
  font-size: .7rem;
}

.theme-fstcho-next .fst-event-scoreboard > header span {
  color: var(--fst-muted);
}

.theme-fstcho-next .fst-event-roster__heading {
  margin-bottom: 20px;
}

.theme-fstcho-next .fst-event-roster__filter {
  margin-bottom: 12px;
}

.theme-fstcho-next .fst-event-roster__list,
.theme-fstcho-next .fst-event-document-stages {
  display: grid;
  gap: 8px;
}

.theme-fstcho-next .fst-event-team[hidden],
.theme-fstcho-next .fst-event-roster__empty[hidden] {
  display: none;
}

.theme-fstcho-next .fst-event-team > summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
}

.theme-fstcho-next .fst-event-team__number,
.theme-fstcho-next .fst-event-document-stage__number {
  color: var(--fst-accent-text);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.theme-fstcho-next .fst-event-team__identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.theme-fstcho-next .fst-event-team__identity strong {
  color: var(--fst-ink);
}

.theme-fstcho-next .fst-event-team__identity small,
.theme-fstcho-next .fst-event-team__count {
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-document-stage > summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
}

.theme-fstcho-next .fst-event-document-stage__count {
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-document-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 14px 16px 20px;
}

.theme-fstcho-next .fst-event-document-group {
  min-width: 0;
  border-top: 2px solid var(--fst-ink);
}

.theme-fstcho-next .fst-event-document-group--regional {
  border-top-color: var(--fst-accent);
}

.theme-fstcho-next .fst-event-document-group--shared {
  grid-column: 1 / -1;
  border-top-width: 1px;
  border-top-color: var(--fst-line);
}

.theme-fstcho-next .fst-event-document-group > header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}

.theme-fstcho-next .fst-event-document-group > header > span {
  color: var(--fst-accent-text);
  font-size: .64rem;
  font-weight: 800;
}

.theme-fstcho-next .fst-event-document-group > header h3,
.theme-fstcho-next .fst-event-document-group > header small {
  margin: 0;
}

.theme-fstcho-next .fst-event-document-group > header h3 {
  font-size: 1rem;
}

.theme-fstcho-next .fst-event-document-group > header small {
  color: var(--fst-muted);
  font-size: .65rem;
}

.theme-fstcho-next .fst-event-document-list {
  display: grid;
}

.theme-fstcho-next .fst-event-document-list > a {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--fst-line);
  text-decoration: none;
}

.theme-fstcho-next .fst-event-document-list > a > span:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.theme-fstcho-next .fst-event-document-list small {
  color: var(--fst-muted);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.theme-fstcho-next .fst-event-document-list strong {
  color: var(--fst-ink);
  font-size: .78rem;
  line-height: 1.35;
}

.theme-fstcho-next .fst-event-document-list > a:hover strong {
  color: var(--fst-accent-strong);
}

.theme-fstcho-next .fst-related-galleries {
  min-width: 0;
}

.theme-fstcho-next .fst-related-galleries > .fst-section-heading {
  margin-bottom: 24px;
}

.theme-fstcho-next .fst-event-photo-album + .fst-event-photo-album {
  margin-top: 36px;
}

.theme-fstcho-next .fst-event-media__summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 8px;
}

.theme-fstcho-next .fst-event-media__summary span {
  color: var(--fst-ink);
  font-family: var(--fst-font-sans);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 700;
}

.theme-fstcho-next .fst-event-media__summary p {
  margin: 0;
  color: var(--fst-muted);
}

.theme-fstcho-next .fst-event-media .fst-related-galleries {
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid var(--fst-line);
}

.theme-fstcho-next .fst-event-photo-album__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.theme-fstcho-next .fst-event-photo-album__header :where(h3, p) {
  margin: 0;
}

.theme-fstcho-next .fst-event-photo-album__header p {
  color: var(--fst-muted);
  font-size: .68rem;
}

.theme-fstcho-next .fst-event-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-fstcho-next .fst-event-photo {
  aspect-ratio: 16 / 9;
}

.theme-fstcho-next .fst-event-photo__cover-mark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  color: var(--fst-white);
  border-radius: var(--fst-radius-xs);
  background: var(--fst-accent);
  font-size: .58rem;
  font-weight: 800;
}

.theme-fstcho-next .fst-event-gallery-more {
  display: inline-grid;
  gap: 3px;
  margin-top: 16px;
  padding: 11px 16px;
  text-align: left;
}

.theme-fstcho-next .fst-event-gallery-more small {
  color: inherit;
}

/* Full-screen gallery viewer is one reusable dialog for galleries and events. */
.theme-fstcho-next .fst-gallery-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--fst-white);
  border: 0;
  background: rgb(11 15 17 / 96%);
}

.theme-fstcho-next .fst-gallery-viewer[open] {
  display: block;
}

.theme-fstcho-next .fst-gallery-viewer::backdrop {
  background: rgb(7 10 11 / 94%);
  backdrop-filter: blur(12px);
}

.theme-fstcho-next .fst-gallery-viewer__shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(circle at 50% 42%, rgb(255 255 255 / 8%), transparent 42%), #0b0f11;
}

.theme-fstcho-next .fst-gallery-viewer__header {
  z-index: 3;
  min-height: 72px;
  padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgb(255 255 255 / 11%);
}

.theme-fstcho-next .fst-gallery-viewer__header > div,
.theme-fstcho-next .fst-gallery-viewer__actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-fstcho-next .fst-gallery-viewer__header strong {
  overflow: hidden;
  color: var(--fst-white);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-fstcho-next .fst-gallery-viewer__header span {
  color: rgb(255 255 255 / 64%);
  font-size: .72rem;
}

.theme-fstcho-next .fst-gallery-viewer__cover {
  min-height: 42px;
  padding: 9px 16px;
  font-size: .72rem;
}

.theme-fstcho-next .fst-gallery-viewer__close,
.theme-fstcho-next .fst-gallery-viewer__nav {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.theme-fstcho-next .fst-gallery-viewer__close svg,
.theme-fstcho-next .fst-gallery-viewer__nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.theme-fstcho-next .fst-gallery-viewer__stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px clamp(16px, 3vw, 48px);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  touch-action: pan-y;
}

.theme-fstcho-next .fst-gallery-viewer__figure {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 12px;
}

.theme-fstcho-next .fst-gallery-viewer__image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.theme-fstcho-next .fst-gallery-viewer__image-wrap img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 22px 30px rgb(0 0 0 / 34%));
}

.theme-fstcho-next .fst-gallery-viewer.is-loading .fst-gallery-viewer__image-wrap img {
  opacity: .24;
}

.theme-fstcho-next .fst-gallery-viewer__loader {
  position: absolute;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: none;
  border: 3px solid rgb(255 255 255 / 25%);
  border-top-color: var(--fst-white);
  border-radius: 50%;
  animation: fst-next-gallery-spin .75s linear infinite;
}

.theme-fstcho-next .fst-gallery-viewer.is-loading .fst-gallery-viewer__loader {
  display: block;
}

.theme-fstcho-next .fst-gallery-viewer__figure figcaption {
  max-width: min(90%, 900px);
  min-height: 1.2em;
  overflow: hidden;
  color: rgb(255 255 255 / 72%);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-fstcho-next .fst-gallery-viewer__filmstrip {
  min-height: 84px;
  padding: 10px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid rgb(255 255 255 / 11%);
  scrollbar-width: none;
}

.theme-fstcho-next .fst-gallery-viewer__filmstrip::-webkit-scrollbar {
  display: none;
}

.theme-fstcho-next .fst-gallery-viewer__thumb {
  width: 72px;
  height: 52px;
  flex: 0 0 72px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--fst-radius-xs);
  background: rgb(255 255 255 / 8%);
  opacity: .5;
  cursor: pointer;
}

.theme-fstcho-next .fst-gallery-viewer__thumb.is-active {
  border-color: var(--fst-accent);
  opacity: 1;
}

.theme-fstcho-next .fst-gallery-viewer__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.fst-gallery-viewer-open,
.fst-gallery-viewer-open body {
  overflow: hidden;
}

@keyframes fst-next-gallery-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .theme-fstcho-next .fst-event-venue.fst-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  }
}

@media (max-width: 620px) {
  .theme-fstcho-next .fst-event-section--body {
    max-width: none;
  }

  .theme-fstcho-next .fst-event-masthead__competitions {
    grid-template-columns: 1fr;
  }

  .theme-fstcho-next .fst-content-surface .fst-event-page details.fst-event-stage > summary {
    grid-template-columns: 30px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 64px;
    padding: 10px 14px;
  }

  .theme-fstcho-next .fst-event-stage > summary .fst-status-marker {
    grid-column: 2;
  }

  .theme-fstcho-next .fst-event-stage > summary::after {
    grid-column: 3;
    grid-row: 1;
  }

  .theme-fstcho-next .fst-event-stage__body {
    padding: 12px;
  }

  .theme-fstcho-next .fst-event-stage__action {
    display: grid;
    align-items: stretch;
    padding: 14px;
  }

  .theme-fstcho-next .fst-event-venue.fst-panel {
    display: block;
  }

  .theme-fstcho-next .fst-event-dashboard__metrics.fst-meta-list > div {
    padding: 12px 10px;
  }

  .theme-fstcho-next .fst-event-dashboard__body {
    grid-template-columns: 1fr;
  }

  .theme-fstcho-next .fst-event-dashboard__programme li {
    grid-template-columns: 1fr auto;
  }

  .theme-fstcho-next .fst-event-dashboard__programme time {
    grid-column: 1 / -1;
  }

  .theme-fstcho-next .fst-event-live__header,
  .theme-fstcho-next .fst-event-live__distance > header,
  .theme-fstcho-next .fst-event-results__heading,
  .theme-fstcho-next .fst-event-roster__heading {
    display: grid;
    gap: 10px;
  }

  .theme-fstcho-next .fst-event-live__header > div:last-child {
    justify-items: start;
  }

  .theme-fstcho-next .fst-event-live__categories,
  .theme-fstcho-next .fst-event-document-groups,
  .theme-fstcho-next .fst-event-photo-grid {
    grid-template-columns: 1fr;
  }

  .theme-fstcho-next .fst-event-document-group--shared {
    grid-column: auto;
  }

  .theme-fstcho-next .fst-event-team > summary,
  .theme-fstcho-next .fst-event-document-stage > summary {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .theme-fstcho-next :is(.fst-event-team__count, .fst-event-document-stage__count) {
    grid-column: 2;
  }

  .theme-fstcho-next .fst-gallery-viewer__header {
    min-height: 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: max(12px, env(safe-area-inset-left));
  }

  .theme-fstcho-next .fst-gallery-viewer__header > div:first-child {
    min-width: 0;
    overflow: hidden;
  }

  .theme-fstcho-next .fst-gallery-viewer__actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .theme-fstcho-next .fst-gallery-viewer__cover-status {
    display: none;
  }

  .theme-fstcho-next .fst-gallery-viewer__cover {
    min-height: 38px;
    padding: 8px 11px;
    font-size: .66rem;
  }

  .theme-fstcho-next .fst-gallery-viewer__close,
  .theme-fstcho-next .fst-gallery-viewer__nav {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .theme-fstcho-next .fst-gallery-viewer__stage {
    position: relative;
    padding: 10px 8px;
    display: block;
  }

  .theme-fstcho-next .fst-gallery-viewer__nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    background: rgb(11 15 17 / 72%);
    transform: translateY(-50%);
  }

  .theme-fstcho-next .fst-gallery-viewer__nav--previous { left: 12px; }
  .theme-fstcho-next .fst-gallery-viewer__nav--next { right: 12px; }

  .theme-fstcho-next .fst-gallery-viewer__figure {
    height: 100%;
  }

  .theme-fstcho-next .fst-gallery-viewer__filmstrip {
    min-height: 70px;
    justify-content: flex-start;
  }

  .theme-fstcho-next .fst-gallery-viewer__thumb {
    width: 58px;
    height: 42px;
    flex-basis: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-fstcho-next .fst-event-photo img,
  .theme-fstcho-next .fst-gallery-viewer :is(img, button) {
    transition: none;
  }
}
