/* ========================================
   WORKOUTS — one WOD at a time, written like a whiteboard
   Reuses the .xp-page/.xp-hero shell from experiencia.css
   Per WOD: title and facts, the board, then weights and flow beside it,
   standards below. Every section title shares .wk-section-title.
======================================== */

.wk-page { padding-bottom: 112px; background: var(--black); }
.wk-page ::selection { background: var(--blue-light); color: var(--white); }
.wk-hero { padding-bottom: 40px; }

/* --- WOD tabs: type on a rule, no boxes --- */
.wk-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.wk-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px 18px 0;
  color: var(--gray-light);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease-out;
}
.wk-tab::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--blue-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
a.wk-tab:hover { color: var(--white); }
/* Keyboard focus rings the label only: a ring round the whole tab ran over the next one. */
a.wk-tab:focus-visible { outline: none; }
a.wk-tab:focus-visible .wk-tab-number { outline: var(--focus-visible-ring); outline-offset: 4px; border-radius: 4px; }
.wk-tab[aria-selected="true"] { color: var(--white); }
.wk-tab[aria-selected="true"]::after { transform: scaleX(1); }
.wk-tab-number {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.wk-tab[aria-selected="true"] .wk-tab-number { color: var(--blue-light); }
.wk-tab-name { font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.wk-tab-meta { color: var(--gray); font-size: 0.75rem; }
.wk-tab-locked { color: rgba(255, 255, 255, 0.32); }
.wk-tab-locked .wk-tab-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* --- Phones: the site's dropdown (Tom Select) in place of the tabs --- */
.wk-picker { display: none; }
.wk-picker .ts-wrapper.single { padding: 0; border: 0; background: transparent; box-shadow: none; }
.wk-picker .ts-wrapper .ts-control {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 10px 52px 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  color: var(--white);
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}
.wk-picker .ts-wrapper.dropdown-active .ts-control,
.wk-picker .ts-wrapper.focus:has(:focus-visible) .ts-control {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}
/* Tom Select turns an open single select white and shows a text cursor. */
.wk-picker .ts-wrapper.single.input-active .ts-control { background: rgba(255, 255, 255, 0.06); cursor: pointer; }
/* Six WODs fit on any phone: no scroll box inside the list. */
.wk-picker .ts-dropdown-content { max-height: none; }
.wk-picker-caret {
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--gray-light);
  font-size: 1.45rem;
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wk-picker .ts-wrapper.dropdown-active .wk-picker-caret { transform: translateY(-50%) rotate(180deg); }
.wk-choice { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.wk-choice-number {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.wk-choice-name { overflow: hidden; font-size: 0.875rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wk-picker .ts-control .wk-choice-number { color: var(--blue-light); }
.wk-picker .ts-dropdown {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: var(--dark);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: var(--gray-light);
}
.wk-picker .ts-dropdown .option { padding: 14px 18px; background: transparent; color: var(--gray-light); }
.wk-picker .ts-dropdown .option + .option { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.wk-picker .ts-dropdown .option.active { background: rgba(255, 255, 255, 0.06); color: var(--white); }
.wk-picker .ts-dropdown .option.selected { color: var(--white); }
.wk-picker .ts-dropdown .option.selected .wk-choice-number { color: var(--blue-light); }
.wk-picker .ts-dropdown .option[aria-disabled="true"] { opacity: 1; color: rgba(255, 255, 255, 0.32); cursor: default; }
.wk-picker .ts-dropdown .option[aria-disabled="true"] .wk-choice-name { font-weight: 500; }

/* --- WOD panel --- */
.wk-wod { scroll-margin-top: 80px; margin-top: 64px; }
.wk-wod[hidden] { display: none; }
/* Without JS every WOD is stacked; with tabs only one shows, so all share the first gap. */
.wk-wod + .wk-wod { margin-top: 120px; }
.wk-tabs-ready + .wk-panels .wk-wod { margin-top: 64px; }

/* --- Header: the name, then the facts an athlete needs, then the PDF --- */
.wk-wod-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px 40px;
  margin-bottom: 48px;
}
.wk-wod-title {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-wrap: balance;
}
.wk-wod-number { color: var(--blue-light); margin-right: 0.18em; }
.wk-facts { display: flex; flex-wrap: wrap; gap: 16px 48px; }
.wk-facts dt {
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}
.wk-facts dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wk-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.wk-download:focus-visible { outline: var(--focus-visible-ring); outline-offset: var(--focus-visible-offset); }

.wk-wod-body {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
  align-items: start;
  gap: 64px;
}

/* --- The board: only the work, centred like the organisers' sheet --- */
.wk-board {
  padding: 36px 32px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  background: var(--dark2);
  text-align: center;
}
.wk-board-format {
  padding-bottom: 24px;
  font-family: var(--font-display);
  font-size: 2.25rem;
  letter-spacing: 0.03em;
  line-height: 1;
}
.wk-board-note { margin: -12px 0 20px; color: var(--gray-light); font-size: 0.875rem; }
.wk-block {
  display: grid;
  gap: 16px;
  list-style: none;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
/* Interval or window heading over a block, and the rest or change between blocks. */
.wk-block-title {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.wk-block-title .wk-block-meta {
  display: block;
  margin-top: 4px;
  color: var(--blue-light);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.wk-block-title + .wk-block { padding-top: 16px; border-top: 0; }
.wk-block-rest + .wk-block { padding-top: 20px; border-top: 0; }
.wk-block-rest {
  margin-top: 6px;
  color: var(--gray-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wk-block-break {
  padding-bottom: 20px;
  color: var(--gray-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.wk-move { line-height: 1.15; }
.wk-move-line {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
}
.wk-qty { color: var(--blue-light); font-variant-numeric: tabular-nums; }
/* Who does it: a quiet note after the line, the way it is written on the board. */
.wk-tag {
  display: inline-block;
  margin-left: 8px;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 6px;
  white-space: nowrap;
}
.wk-scale { display: block; margin-top: 4px; color: var(--gray-light); font-size: 0.875rem; line-height: 1.4; }
.wk-scale-cat { color: var(--white); font-weight: 600; }
.wk-scale-cat::after { content: ':'; }

/* --- Sections beside and under the board share one title --- */
.wk-aside { display: grid; gap: 32px; }
.wk-section-title {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}
.wk-section-note { margin-top: 8px; color: var(--gray); font-size: 0.875rem; }

/* --- Pesos --- */
.wk-loads {
  width: 100%;
  margin-top: 12px;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.wk-loads th,
.wk-loads td { padding: 10px 8px; text-align: right; }
.wk-loads :is(th, td):first-child { padding-left: 0; text-align: left; }
.wk-loads :is(th, td):last-child { padding-right: 0; }
.wk-loads thead th {
  color: var(--gray-light);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  vertical-align: bottom;
}
.wk-loads thead td { width: 42%; }
.wk-loads tbody tr { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.wk-loads tbody th { font-weight: 600; line-height: 1.35; }
.wk-loads tbody td {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
/* Bebas has no lowercase: the unit goes back to Inter so kg never reads KG. */
.wk-unit {
  color: var(--gray-light);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
}

.wk-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Flow --- */
.wk-flow {
  display: grid;
  gap: 16px;
  max-width: 68ch;
  margin-top: 20px;
  list-style: none;
  counter-reset: flow;
}
.wk-flow li {
  position: relative;
  padding-left: 40px;
  color: var(--gray-light);
  line-height: 1.65;
  counter-increment: flow;
}
.wk-flow li::before {
  content: counter(flow);
  position: absolute;
  top: -1px;
  left: 0;
  color: var(--blue-light);
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.wk-flow strong,
.wk-standard strong { color: var(--white); }
.wk-note { margin-top: 16px; padding-left: 40px; color: var(--gray); font-size: 0.875rem; }

/* --- Standards: one disclosure per movement, named like the board --- */
.wk-standards { margin-top: 88px; }
.wk-standards .wk-section-title { margin-bottom: 8px; }
.wk-standard { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.wk-standard summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  list-style: none;
  cursor: pointer;
}
.wk-standard summary::-webkit-details-marker { display: none; }
.wk-standard-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  line-height: 1;
}
.wk-standard-icon {
  flex: none;
  color: var(--gray-light);
  font-size: 1.45rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease-out;
}
.wk-standard[open] .wk-standard-icon { transform: rotate(45deg); }
.wk-standard summary:hover .wk-standard-name { color: var(--blue-light); }
.wk-standard summary:hover .wk-standard-icon { color: var(--white); }
.wk-standard summary:focus-visible { outline: var(--focus-visible-ring); outline-offset: 2px; }
.wk-standard-scope {
  margin-left: 12px;
  color: var(--blue-light);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 4px;
}
.wk-standard ul {
  display: grid;
  gap: 8px;
  max-width: 72ch;
  padding: 0 0 24px 18px;
  list-style: disc;
  color: var(--gray-light);
  line-height: 1.6;
}
.wk-standard li::marker { color: var(--gray); }
.wk-standard-sub {
  margin-bottom: 8px;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wk-points li::marker { color: var(--blue-light); }

@media (prefers-reduced-motion: reduce) {
  .wk-picker-caret,
  .wk-picker .ts-wrapper .ts-control,
  .wk-tab::after,
  .wk-standard-icon { transition: none; }
}

@media (max-width: 1024px) {
  .wk-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 20px; border-bottom: 0; }
  .wk-tab { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .wk-tab::after { right: 0; }
  .wk-tab { padding-right: 12px; }
  .wk-wod-body { grid-template-columns: 1fr; gap: 56px; }
  .wk-board { max-width: 680px; }
}
@media (max-width: 600px) {
  .wk-picker-ready { display: block; }
  .wk-picker-ready + .wk-tabs { display: none; }
  .wk-tab { padding-bottom: 14px; }
  .wk-tab-number { font-size: 1.75rem; }
  .wk-tab-meta { display: none; }
  .wk-tab-soon {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .wk-wod { margin-top: 48px; }
  .wk-tabs-ready + .wk-panels .wk-wod { margin-top: 48px; }
  .wk-wod-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 36px; }
  .wk-facts { gap: 16px 32px; }
  .wk-download { justify-content: center; }
  .wk-board { padding: 28px 16px 8px; }
  .wk-tag { display: block; margin: 2px 0 0; vertical-align: 0; }
  .wk-loads thead td { width: 34%; }
  .wk-standard-scope { display: block; margin: 6px 0 0; }
}
