/* src/styles/athletes.css */
/* Athlete cards (photo + caption) rise slightly when hovered. */
.ticker-list .athlete {
  transform: translateY(0);
  transition: transform 0.35s ease;
}
.ticker-list .athlete:hover {
  transform: translateY(-12px);
}
@media (prefers-reduced-motion: reduce) {
  .ticker-list .athlete { transition: none; }
}


/* src/styles/author-avatars.css */
/* src/scripts/author-avatars.js puts the author's staff photo inside the
   round .post-avatar badge; crop it to the face. */
.post-avatar.has-photo { overflow: hidden; background-color: var(--surface); }
.post-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }


/* src/styles/biomecanica.css */
/* Comparativa de Servicios: services not included in a plan are greyed out.
   Scoped under .plan-features so they outrank the shared white-text /
   yellow-tick rules for every list item. */
.plan-features li.feature-off { color: var(--text-subtle); }
.plan-features li.feature-off::before { background-color: rgb(100 100 100); }


/* src/styles/cookie-banner.css */
/* Cookie banner injected by src/scripts/cookie-consent.js. */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; display: flex; justify-content: center; opacity: 0; transform: translateY(16px); transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); pointer-events: none; }
.cookie-banner.is-visible { opacity: 1; transform: none; }
.cookie-banner[hidden] { display: none; }
.cookie-card { width: 100%; max-width: 760px; padding: 24px 28px; border: 1px solid rgb(224 224 32 / 0.35); border-radius: 20px; background-color: var(--surface); box-shadow: 0 20px 50px rgb(0 0 0 / 0.5); pointer-events: auto; }
.cookie-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: var(--text); }
.cookie-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.cookie-text a { color: var(--brand); text-decoration: underline; }
.cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.cookie-btn { height: 46px; padding: 0 24px; border: 0; font-size: 13px; cursor: pointer; }
.cookie-btn[hidden], .cookie-link[hidden] { display: none; }
.cookie-actions .btn-dark { background-color: var(--ink); color: var(--text); }
.cookie-link { margin-left: auto; padding: 0; border: 0; background: none; color: var(--text-muted); font-family: var(--font-heading); font-size: 14px; text-decoration: underline; cursor: pointer; }
.cookie-link:hover { color: var(--brand); }
.cookie-settings { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.cookie-settings[hidden] { display: none; }
.cookie-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background-color: rgb(255 255 255 / 0.04); }
.cookie-option label { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.cookie-option-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.cookie-option-text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.cookie-always { flex-shrink: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--brand); }
.cookie-toggle { position: relative; flex-shrink: 0; width: 46px; height: 26px; }
.cookie-toggle-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cookie-toggle-track { position: absolute; inset: 0; border-radius: 26px; background-color: rgb(255 255 255 / 0.18); transition: background-color 0.25s ease; }
.cookie-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background-color: var(--text); transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.cookie-toggle-input:checked + .cookie-toggle-track { background-color: var(--brand); }
.cookie-toggle-input:checked + .cookie-toggle-track::after { transform: translateX(20px); background-color: var(--surface); }
.cookie-toggle-input:focus-visible + .cookie-toggle-track { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 600px) {
  .cookie-card { padding: 20px; }
  .cookie-actions .cookie-btn { flex: 1; }
  .cookie-link { width: 100%; margin-left: 0; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner, .cookie-toggle-track, .cookie-toggle-track::after { transition: none; }
}


/* src/styles/form-thanks.css */
/* Thank-you box opened by src/scripts/form-thanks.js after the Endurance plan
   and Biomecánica questionnaire are sent: a 485×700 brand-yellow box with the
   T4LL artwork behind the form's success message. On small screens it scales
   down and keeps the same proportions. */
.form-thanks {
  width: min(485px, calc(100vw - 32px), calc((100vh - 32px) * 485 / 700));
  max-width: none;
  max-height: none;
  aspect-ratio: 485 / 700;
  /* The site reset zeroes every margin; auto margins are what centre a modal
     dialog in the viewport. */
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background-color: #e0e020;
  color: var(--surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
}
.form-thanks[open] { animation: form-thanks-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.form-thanks::backdrop { background-color: rgb(0 0 0 / 0.7); backdrop-filter: blur(3px); }

/* Artwork: the After Effects "WEB message" animation rebuilt as SVG. Same
   technique as the power chart on Home (src/styles/power-chart.css): the
   outlines draw in with stroke-dashoffset and the two letter rows slide with
   a CSS transform. Timings come from the AE file (24 fps): the rows slide for
   81 frames, the outlines draw from frame 7 to frame 43. */
.thanks-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.thanks-art .thanks-logo-dark { fill: var(--surface); }
.thanks-art .thanks-logo-light { fill: var(--text); fill-rule: evenodd; }
.thanks-art .thanks-outline {
  fill: none;
  stroke: rgb(96 96 96);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: thanks-draw 1.5s cubic-bezier(0.33, 0, 0.38, 1) 0.29s backwards;
}
.thanks-art .thanks-outline-accent { stroke: rgb(185 179 0); }
.thanks-art .thanks-slide { animation: 3.375s cubic-bezier(0.11, 0, 0, 1) backwards; }
.thanks-art .thanks-slide-top { transform: translate(-122.84px, -368.2px); animation-name: thanks-slide-top; }
.thanks-art .thanks-slide-bottom { transform: translate(-267.99px, 63.93px); animation-name: thanks-slide-bottom; }
@keyframes thanks-draw { from { stroke-dashoffset: 1; } }
@keyframes thanks-slide-top { from { transform: translate(-508.84px, -346.2px); } }
@keyframes thanks-slide-bottom { from { transform: translate(15.74px, 58.96px); } }

.form-thanks-message {
  position: absolute;
  top: 54%;
  left: 40px;
  right: 40px;
  margin: 0;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: clamp(20px, 5.4vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.form-thanks-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgb(38 38 38 / 0.12);
  color: var(--surface);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.form-thanks-close:hover { background-color: rgb(38 38 38 / 0.25); }
.form-thanks-close:focus-visible { outline: 2px solid var(--surface); outline-offset: 2px; }

@keyframes form-thanks-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .form-thanks[open], .thanks-art .thanks-outline, .thanks-art .thanks-slide { animation: none; }
}


/* src/styles/hero.css */
/* Page heroes that use a photo instead of a video (e.g. Nutrición): the image
   fills the whole hero at every width, centered and cropped like the videos. */
.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}


/* src/styles/plan-form.css */
/* The plan form script toggles `hidden`; flex/grid display rules on these
   elements would otherwise override the browser's built-in hidden style. */
.plan-layout [hidden] { display: none; }

/* After a successful request the form fades out, resets, and fades back in
   (keep the 0.4s in sync with FADE_MS in src/scripts/plan-form.js). */
.plan-layout { transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.plan-layout.is-resetting { opacity: 0; }

/* Country dropdown: same yellow chevron as the category selector, inset from the outline. */
.plan-form select.plan-country {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E0E020' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
  cursor: pointer;
}

/* Submission feedback injected by src/scripts/plan-form.js. It fades in and
   out over 0.4s (keep in sync with FADE_MS in the script). */
.plan-feedback {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
  background-color: rgb(255 255 255 / 0.06);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, background-color 0.3s ease;
}
.plan-feedback.is-visible { opacity: 1; }
.plan-feedback[data-state="success"] { color: var(--surface); background-color: var(--brand); font-weight: 700; }
.plan-feedback[data-state="error"] { color: #ffb4a8; background-color: rgb(255 80 60 / 0.12); }
.plan-submit:disabled { opacity: 0.6; cursor: wait; }

@media (prefers-reduced-motion: reduce) {
  .plan-layout, .plan-feedback { transition: none; }
}


/* src/styles/plan-wizard.css */
/* State styles for src/scripts/plan-wizard.js ("Customiza tu Plan" steps). */

/* Toggled elements must stay hidden despite flex/grid display rules. */
.plan-wizard [hidden] { display: none; }

/* Progress bar width is driven by the script. */
.wizard-progress-bar { width: var(--wizard-progress); transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.plan-wizard:not(.is-enhanced) .wizard-progress-bar { width: 100%; }

/* Without the script, all steps show; space them out. */
.plan-wizard:not(.is-enhanced) .wizard-step + .wizard-step { margin-top: 40px; }
.plan-wizard:not(.is-enhanced) .wizard-back,
.plan-wizard:not(.is-enhanced) .wizard-next { display: none; }

/* Each step fades in when it appears. */
.plan-wizard.is-enhanced .wizard-step:not([hidden]) { animation: wizard-step-in 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes wizard-step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dropdowns (country, category): same style as the category selector in the
   original plan form: yellow outline and a yellow chevron inset from the edge. */
.plan-wizard .wizard-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  border-color: rgb(224 224 32 / 0.5);
  font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E0E020' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
  cursor: pointer;
}
.plan-wizard .wizard-field select:focus { border-color: var(--brand); }

/* Selected answer card. */
.choice:has(input:checked) { border-color: var(--brand); background-color: rgb(224 224 32 / 0.1); }
.plan-wizard .plan-extra:has(input:checked) { border-color: var(--brand); }

/* Reset after a successful request (keep 0.4s in sync with FADE_MS). */
.plan-wizard { transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.plan-wizard.is-resetting { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .plan-wizard, .wizard-progress-bar { transition: none; }
  .plan-wizard.is-enhanced .wizard-step:not([hidden]) { animation: none; }
}


/* src/styles/power-chart.css */
/* Animated power chart on Home. The chart's shapes live inside an inline SVG
   (not editor nodes), so these rules ship as a stylesheet file rather than
   as editor classes, which the publisher prunes when no node carries them. */
.method-chart .chart-bg { fill: var(--ink); }
.method-chart .chart-grey { fill: rgb(91 91 91); }
.method-chart .chart-accent { fill: var(--brand); }
.method-chart .chart-axis { fill: none; stroke: rgb(91 91 91); stroke-width: 2.0032; stroke-miterlimit: 10; }
.method-chart .chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  stroke-dasharray: 2267;
  stroke-dashoffset: 2267;
  animation: chart-draw 5.2s ease-in-out infinite;
}
@keyframes chart-draw {
  0% { stroke-dashoffset: 2267; }
  83.33% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 2267; }
}
@media (prefers-reduced-motion: reduce) {
  .method-chart .chart-line { animation: none; stroke-dashoffset: 0; }
}


/* src/styles/reading-theme.css */
/* Light ("white screen") reading mode for blog posts, toggled by
   src/scripts/reading-theme.js. The article styles are built on the colour
   tokens, so the light mode re-points those tokens inside .article; the few
   rules that use brand yellow as text get a darker yellow for contrast. */
html.theme-light body { background-color: #fafafa; }

html.theme-light .article {
  --text: hsla(0, 0%, 7%, 1);
  --text-muted: hsla(0, 0%, 27%, 1);
  --text-subtle: hsla(0, 0%, 45%, 1);
  --text-10: hsla(0, 0%, 0%, 0.1);
  --text-20: hsla(0, 0%, 0%, 0.2);
  color: var(--text);
  background-color: #fafafa;
}

/* Over the white page the nav's dark gradient looks heavy: start it lighter. */
html.theme-light .site-nav {
  background-image: linear-gradient(rgba(26, 26, 26, 0.78) 0%, rgba(26, 26, 26, 0.06) 100%);
}

html.theme-light .article-hero { background-color: #ececec; }
@media (max-width: 809px) {
  html.theme-light .article-toc { background-color: #f0f0f0; }
}

html.theme-light .prose a,
html.theme-light .prose li a { color: var(--brand-d-3); }
html.theme-light .prose p a:hover,
html.theme-light .prose li a:hover { color: var(--text); }
html.theme-light .toc-list a:hover,
html.theme-light .article-back:hover { color: var(--brand-d-3); }
html.theme-light .post-body li::marker { color: var(--brand-d-2); }
html.theme-light .post-body blockquote { background-color: var(--brand-20); }

/* The call-to-action box sits on a dark photo: keep its text light. */
html.theme-light .article-cta {
  --text: hsla(0, 0%, 100%, 1);
  --text-muted: hsla(0, 0%, 74.9%, 1);
}

.article,
.article-hero,
.article-toc { transition: background-color 0.3s ease, color 0.3s ease; }

/* Toggle button injected into the byline row. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--text-20);
  border-radius: 100px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-button);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  .article, .article-hero, .article-toc, .theme-toggle { transition: none; }
}
