/* =========================================================
   Running Night Upetecista 2026 — Resultados y diplomas
   Paleta: nogal + amarillo
   ========================================================= */

:root {
  --nogal-950: #24140d;
  --nogal-900: #2f1b11;
  --nogal-850: #372015;
  --nogal-800: #3e2517;
  --nogal-700: #52321f;
  --nogal-600: #6b452c;
  --nogal-500: #8a6144;
  --nogal-300: #c9ab92;
  --nogal-200: #dfcbb8;
  --nogal-100: #efe3d4;
  --nogal-50: #f7efe4;

  --cream: #fbf5e9;
  --cream-2: #f5ebd9;
  --cream-3: #fffdf8;
  --white: #ffffff;

  --yellow: #f7b500;
  --yellow-2: #ffca3a;
  --yellow-3: #ffe29a;
  --yellow-4: #fff4cf;
  --gold: #9a6200;
  --gold-2: #e0a800;

  --ink: #2a1a10;
  --muted: #7a6555;
  --muted-2: #8b7462;
  --line: rgba(82, 50, 31, 0.14);
  --line-strong: rgba(82, 50, 31, 0.24);

  --ok: #2f6b45;
  --warn: #9a4d10;

  --shadow-sm: 0 2px 10px -4px rgba(36, 20, 13, 0.22);
  --shadow: 0 22px 50px -32px rgba(36, 20, 13, 0.55);
  --shadow-lg: 0 40px 90px -40px rgba(36, 20, 13, 0.65);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;

  --font-body: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;

  --header-h: 72px;
  --container: 1240px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }

svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.logo-svg,
.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: none;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

h1, h2, h3, p, dl, dd, dt, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

strong, b { font-weight: 700; }

::selection { background: var(--yellow-3); color: var(--nogal-950); }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--yellow);
  color: var(--nogal-950);
  border-radius: 10px;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ============================= Header ============================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(36, 20, 13, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(247, 181, 0, 0.22);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.16rem;
  letter-spacing: 0.01em;
  color: #fff8e8;
  font-weight: 700;
}
.brand-text span {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--yellow-2);
  font-weight: 700;
  margin-top: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  color: #f1e5d5;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.site-nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  color: var(--nogal-950);
  background: var(--yellow);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
}
.site-nav .nav-cta:hover { background: var(--yellow-2); color: var(--nogal-950); }

.header-results {
  display: none;
  color: var(--nogal-950);
  background: var(--yellow);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ============================= Hero ============================= */

.hero {
  position: relative;
  overflow: hidden;
  color: #f6ecde;
  background:
    radial-gradient(120% 130% at 85% 0%, #5b3722 0%, transparent 55%),
    linear-gradient(150deg, var(--nogal-950) 0%, #3a2114 58%, #4a2b19 100%);
  isolation: isolate;
}

.hero-track {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(112deg, transparent 0 86px, rgba(255, 255, 255, 0.045) 86px 88px),
    repeating-linear-gradient(112deg, transparent 0 180px, rgba(247, 181, 0, 0.05) 180px 181px);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.15) 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.15) 70%, transparent);
}

.hero-glow {
  position: absolute;
  z-index: -1;
  width: 640px;
  height: 640px;
  right: -120px;
  top: -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 181, 0, 0.28) 0%, rgba(247, 181, 0, 0.06) 48%, transparent 70%);
  filter: blur(10px);
}

.hero-watermark {
  position: absolute;
  z-index: -1;
  right: -30px;
  bottom: -110px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(220px, 31vw, 470px);
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(247, 181, 0, 0.16);
  user-select: none;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  padding-top: clamp(54px, 7vw, 92px);
  padding-bottom: clamp(48px, 7vw, 82px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--yellow-2);
}
.eyebrow svg { width: 1.25em; height: 1.25em; stroke-width: 2; }

.eyebrow--dark { color: var(--gold); }
.eyebrow--dark svg { stroke: var(--gold); }

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(247, 181, 0, 0.14);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(247, 181, 0, 0.5);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(.55); opacity: 1; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.hero h1 {
  max-width: 980px;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5.6vw, 4.65rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  font-weight: 700;
  color: #fffaf0;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--yellow-2);
}
.hero h1 span {
  display: block;
  font-size: 0.68em;
  letter-spacing: -0.01em;
  color: #f0dfc6;
  font-style: italic;
  margin-top: 6px;
}

.hero-sub {
  max-width: 640px;
  margin-top: 22px;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.62;
  color: rgba(247, 238, 225, 0.8);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 28px;
}
.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 233, 189, 0.2);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f5e8d7;
}
.hero-meta svg { color: var(--yellow-2); width: 1.1em; height: 1.1em; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn svg { width: 1.1em; height: 1.1em; stroke-width: 2; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--yellow);
  color: var(--nogal-950);
  box-shadow: 0 12px 28px -12px rgba(247, 181, 0, 0.75);
}
.btn-primary:hover { background: var(--yellow-2); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 233, 189, 0.34);
  color: #f7ecd9;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 233, 189, 0.6); }

.btn-outline-dark {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--nogal-800);
}
.btn-outline-dark:hover { background: var(--nogal-800); border-color: var(--nogal-800); color: var(--cream); }

.btn-sm { min-height: 40px; padding: 9px 15px; font-size: 0.82rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(34px, 5vw, 56px);
  border-top: 1px solid rgba(255, 233, 189, 0.18);
}
.hero-stats > div {
  padding: 20px 22px 0 0;
  border-right: 1px solid rgba(255, 233, 189, 0.14);
}
.hero-stats > div:last-child { border-right: 0; }
.hero-stats dt {
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255, 236, 200, 0.62);
  font-weight: 700;
}
.hero-stats dd {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 700;
  color: var(--yellow-2);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-stats dd small {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 236, 200, 0.62);
  letter-spacing: 0.02em;
}

/* ============================= Sections ============================= */

.section { padding: clamp(58px, 7vw, 92px) 0; }
.podium-section { background: var(--cream); }
.results-section {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(247, 181, 0, 0.08), transparent 60%),
    var(--cream-2);
  border-top: 1px solid rgba(82, 50, 31, 0.08);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 34px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--nogal-900);
}
.section-sub {
  max-width: 640px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.97rem;
}
.section-head--center .section-sub { margin-inline: auto; }
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

/* ============================= Podium ============================= */

.podium-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.podium-group {
  background: var(--cream-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 2.4vw, 26px);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.podium-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.podium-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--nogal-900);
}
.podium-group-title .gender-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow-3);
  color: var(--nogal-800);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
}
.podium-group-title .gender-mark[data-gender="Hombres"] {
  background: var(--nogal-100);
}
.podium-group-count {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.podium-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.podium-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--nogal-200);
}
.podium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(185, 123, 0, 0.35);
}
.podium-card--1 { background: linear-gradient(180deg, #fff6d8, #fffdf8 68%); border-color: rgba(224, 168, 0, 0.5); }
.podium-card--1::before { background: linear-gradient(90deg, #b97b00, #f7b500, #ffe29a); }
.podium-card--2::before { background: linear-gradient(90deg, #8d8d8d, #c9c9c9); }
.podium-card--3::before { background: linear-gradient(90deg, #8a4f22, #c07a3e); }

.podium-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--nogal-950);
  background: var(--nogal-100);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(36, 20, 13, 0.18);
}
.podium-card--1 .podium-medal { background: linear-gradient(145deg, #ffe9a3, #f7b500 55%, #c98a00); }
.podium-card--2 .podium-medal { background: linear-gradient(145deg, #f2f2f2, #c9c9c9 55%, #9c9c9c); }
.podium-card--3 .podium-medal { background: linear-gradient(145deg, #e6b483, #b87333 55%, #8a4f22); }

.podium-name {
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--nogal-900);
  overflow-wrap: anywhere;
}
.podium-city {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
}
.podium-city svg { width: 0.95em; height: 0.95em; }
.podium-time {
  margin-top: auto;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--nogal-800);
}
.podium-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.podium-link svg { width: 1em; height: 1em; transition: transform .18s ease; }
.podium-link:hover svg { transform: translateX(3px); }

/* ============================= Filters ============================= */

.filters {
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) minmax(225px, 1.15fr) minmax(150px, 0.85fr) minmax(165px, 0.85fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  background: var(--cream-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field > label,
.field > .label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap svg {
  position: absolute;
  left: 13px;
  width: 1.05em;
  height: 1.05em;
  color: var(--muted-2);
  pointer-events: none;
}
.input-wrap input,
.select-wrap select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input-wrap input {
  padding: 0 14px 0 38px;
  appearance: none;
}
.input-wrap input::placeholder { color: var(--muted-2); }
.input-wrap input:hover,
.select-wrap select:hover { border-color: var(--nogal-300); }
.input-wrap input:focus,
.select-wrap select:focus {
  outline: none;
  background: #fff;
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(247, 181, 0, 0.2);
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  appearance: none;
  padding: 0 34px 0 13px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  height: 48px;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}
.segmented button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.segmented button span {
  display: none;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(82, 50, 31, 0.1);
}
.segmented button[aria-pressed="true"] {
  background: var(--nogal-800);
  color: var(--yellow-2);
  box-shadow: 0 4px 10px -4px rgba(36, 20, 13, 0.5);
}
.segmented button[aria-pressed="true"] span { background: rgba(247, 181, 0, 0.18); color: var(--yellow-2); }

.field--switch { align-items: flex-start; justify-content: flex-end; height: 48px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding-bottom: 8px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  width: 44px;
  height: 25px;
  flex: none;
  border-radius: 999px;
  background: var(--nogal-200);
  transition: background .2s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(36, 20, 13, 0.3);
  transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--yellow); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--yellow); outline-offset: 3px; }
.switch-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nogal-800);
  line-height: 1.15;
}
.switch-text small {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ============================= Results ============================= */

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 16px;
}
.result-count {
  font-size: 0.9rem;
  color: var(--muted);
}
.result-count strong { color: var(--nogal-900); font-size: 1rem; }
.result-count .filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--yellow-3);
  color: var(--nogal-900);
  font-size: 0.72rem;
  font-weight: 800;
}
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream-3);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 2px;
  border: 0;
  background: none;
  color: var(--nogal-700);
  font-size: 0.8rem;
  font-weight: 800;
}
.text-btn svg { width: 0.95em; height: 0.95em; }
.text-btn:hover { color: var(--gold); }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.runner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 15px;
  background: var(--cream-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: cardIn .42s ease both;
}
.runner-card:hover {
  transform: translateY(-3px);
  border-color: rgba(185, 123, 0, 0.32);
  box-shadow: var(--shadow);
}
.runner-card.is-podium {
  border-color: rgba(224, 168, 0, 0.45);
  background: linear-gradient(180deg, #fffaf0, var(--cream-3) 55%);
}
.runner-card.is-podium::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--gold), var(--yellow), var(--yellow-3));
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--nogal-100);
  color: var(--nogal-800);
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.rank svg { width: 0.95em; height: 0.95em; stroke-width: 2; }
.rank--1 { background: linear-gradient(135deg, #ffe29a, #f7b500); color: var(--nogal-950); }
.rank--2 { background: linear-gradient(135deg, #f3f3f3, #c7c7c7); color: #3b3b3b; }
.rank--3 { background: linear-gradient(135deg, #eac199, #b87333); color: #2f1b11; }

.chip-gender {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--yellow-4);
  color: var(--gold);
  border: 1px solid rgba(247, 181, 0, 0.28);
}
.chip-gender[data-gender="Hombres"] {
  background: var(--nogal-50);
  color: var(--nogal-700);
  border-color: var(--line);
}

.bib {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bib b { color: var(--nogal-800); font-size: 0.82rem; }

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  margin-top: 11px;
  align-items: start;
}

.runner-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.18;
  letter-spacing: -0.012em;
  font-weight: 700;
  color: var(--nogal-900);
  overflow-wrap: anywhere;
}
.runner-city {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}
.runner-city svg { width: 0.95em; height: 0.95em; color: var(--gold); }

.card-time {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.card-time .time-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.card-time strong {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--nogal-900);
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.diff-badge--lap {
  background: #fdf0e3;
  border-color: rgba(154, 77, 16, 0.25);
  color: var(--warn);
}

.mini-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  margin-top: 10px;
  font-size: 0.74rem;
}
.mini-stats dt {
  color: var(--muted-2);
  font-weight: 600;
  white-space: nowrap;
}
.mini-stats dd {
  color: var(--nogal-800);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.diploma-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 11 / 8.5;
  padding: 0;
  border: 1px solid rgba(185, 123, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 5px 14px -8px rgba(36, 20, 13, 0.45);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.diploma-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.diploma-thumb:hover { transform: scale(1.025); border-color: var(--gold); box-shadow: 0 10px 20px -10px rgba(36, 20, 13, 0.55); }
.diploma-thumb:hover img { transform: scale(1.06); }
.diploma-thumb::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(36, 20, 13, 0.7));
  pointer-events: none;
}
.diploma-thumb-label {
  position: absolute;
  z-index: 1;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 4px;
  color: #fff7e6;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}
.diploma-thumb-label svg { width: 0.9em; height: 0.9em; stroke-width: 2.2; }

.diploma-thumb.is-missing {
  display: grid;
  place-items: center;
  background: var(--cream);
  border-style: dashed;
}
.diploma-thumb.is-missing::before {
  content: "Diploma no disponible";
  padding: 6px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
}
.diploma-thumb.is-missing::after,
.diploma-thumb.is-missing .diploma-thumb-label { display: none; }

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--line-strong);
  font-size: 0.71rem;
  color: var(--muted);
}
.card-foot span { display: inline-flex; align-items: baseline; gap: 4px; }
.card-foot b {
  color: var(--nogal-800);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 54px 20px;
  background: var(--cream-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.empty-state[hidden] { display: none; }
.results-grid[hidden] { display: none; }
.text-btn:disabled { opacity: 0.4; cursor: default; }
.empty-state code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--cream-2);
  font-size: 0.9em;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--yellow-4);
  color: var(--gold);
  margin-bottom: 14px;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--nogal-900);
}
.empty-state p { max-width: 460px; margin: 6px 0 18px; color: var(--muted); font-size: 0.92rem; }

.results-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}
.results-note svg { width: 1.1em; height: 1.1em; margin-top: 2px; color: var(--gold); }
.results-note em { color: var(--nogal-700); }

/* ============================= Modal ============================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 12, 7, 0.78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .22s ease both;
}

.modal-dialog {
  position: relative;
  width: min(1110px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--cream);
  border: 1px solid rgba(255, 226, 154, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn .28s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(36, 20, 13, 0.55);
  color: #fff9ec;
  backdrop-filter: blur(5px);
  transition: background .18s ease, transform .18s ease;
}
.modal-close:hover { background: var(--yellow); color: var(--nogal-950); transform: rotate(90deg); }
.modal-close svg { width: 18px; height: 18px; stroke-width: 2.2; }

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.8fr);
  min-height: 0;
}

.modal-visual {
  padding: 18px;
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(247, 181, 0, 0.12), transparent 70%),
    var(--nogal-900);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-width: 0;
}

.modal-image-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 45px -18px rgba(0, 0, 0, 0.7);
}
.modal-image-wrap a {
  position: relative;
  display: block;
  cursor: zoom-in;
}
.modal-image-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 8.5;
  object-fit: contain;
  background: #fff;
  transition: opacity .18s ease;
}
.modal-image-wrap img.is-loading { opacity: 0.35; }
.zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(36, 20, 13, 0.72);
  color: #fff7e6;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
.modal-image-wrap a:hover .zoom-hint,
.modal-image-wrap a:focus-visible .zoom-hint { opacity: 1; transform: translateY(0); }

.modal-visual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.modal-visual-actions .btn-outline-dark {
  border-color: rgba(255, 233, 189, 0.35);
  color: #f7ecd9;
}
.modal-visual-actions .btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 233, 189, 0.6);
  color: #fff;
}

.modal-info {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  background: var(--cream);
  min-width: 0;
}
.modal-info .eyebrow { margin-bottom: 10px; font-size: 0.68rem; }
.modal-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--nogal-900);
  padding-right: 34px;
  overflow-wrap: anywhere;
}
.modal-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}
.modal-subtitle svg { width: 1em; height: 1em; color: var(--gold); }

.modal-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--nogal-900);
  color: var(--yellow-2);
}
.modal-time span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 236, 200, 0.62);
}
.modal-time strong {
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.modal-positions {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.modal-positions > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.modal-positions dt { font-size: 0.78rem; color: var(--muted); }
.modal-positions dd {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--nogal-900);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.modal-positions dd span { color: var(--muted-2); font-weight: 600; font-size: 0.78rem; }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.modal-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  font-size: 0.68rem;
  color: var(--muted);
}
.modal-meta b { color: var(--nogal-800); font-size: 0.72rem; }

.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted-2);
}
.modal-note svg { width: 1em; height: 1em; margin-top: 2px; flex: none; }
.modal-note strong { color: var(--muted); }

.modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}
.modal-nav[hidden] { display: none; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--nogal-800);
  font-size: 0.76rem;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav-btn:hover:not(:disabled) { background: var(--nogal-800); border-color: var(--nogal-800); color: var(--yellow-2); }
.nav-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.nav-btn svg { width: 0.95em; height: 0.95em; }
.nav-index { font-size: 0.7rem; font-weight: 700; color: var(--muted-2); white-space: nowrap; }

/* ============================= Footer ============================= */

.site-footer {
  background: var(--nogal-950);
  color: #eadcc8;
  border-top: 4px solid var(--yellow);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  padding: 52px 0 38px;
}
.brand--footer .brand-text strong { color: #fff8e8; }
.footer-brand p {
  margin-top: 16px;
  max-width: 340px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: rgba(234, 220, 200, 0.68);
}
.footer-col h3 {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow-2);
  margin-bottom: 14px;
}
.footer-col a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  font-size: 0.82rem;
  color: rgba(234, 220, 200, 0.82);
  transition: color .18s ease;
}
.footer-col a:hover { color: var(--yellow-2); }
.footer-col a svg { width: 1em; height: 1em; color: var(--yellow); }
.footer-col p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(234, 220, 200, 0.65);
  margin-bottom: 9px;
}
.footer-col p strong { color: #f4e9d7; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 233, 189, 0.14);
  font-size: 0.72rem;
  color: rgba(234, 220, 200, 0.5);
}
.footer-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: rgba(234, 220, 200, 0.75);
}
.footer-bottom a:hover { color: var(--yellow-2); }
.footer-bottom svg { width: 1em; height: 1em; transform: rotate(-90deg); }

/* ============================= Toast ============================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--nogal-900);
  color: var(--yellow-2);
  border: 1px solid rgba(247, 181, 0, 0.4);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  animation: toastIn .25s ease both;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================= Responsive ============================= */

@media (max-width: 1120px) {
  .filters { grid-template-columns: minmax(220px, 1.4fr) minmax(230px, 1.1fr) minmax(160px, 0.8fr) minmax(180px, 0.9fr); }
  .field--switch { grid-column: 1 / -1; height: auto; align-items: flex-start; }
  .switch { padding-bottom: 0; }
}

@media (max-width: 1020px) {
  .podium-groups { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-visual { padding: 16px; }
  .modal-info { padding-top: 26px; }
  .modal-nav { margin-top: 18px; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .header-results { display: inline-flex; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div { padding: 18px 18px 12px 0; }
  .hero-stats > div:nth-child(2) { border-right: 0; }
  .hero-stats > div:nth-child(3),
  .hero-stats > div:nth-child(4) { border-top: 1px solid rgba(255, 233, 189, 0.12); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head--center { align-items: center; }
  .section-actions { width: 100%; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--search { grid-column: 1 / -1; }
  .field--switch { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .container { width: calc(100% - 32px); }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text strong { font-size: 1.02rem; }
  .brand-text span { font-size: 0.57rem; letter-spacing: 0.16em; }
  .header-results { padding: 8px 12px; font-size: 0.76rem; }

  .hero-inner { padding-top: 44px; padding-bottom: 48px; }
  .hero-sub { font-size: 0.96rem; }
  .hero-meta { gap: 8px; }
  .hero-meta li { font-size: 0.75rem; padding: 7px 10px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-stats dd { font-size: 2rem; }
  .hero-watermark { right: -60px; bottom: -40px; font-size: 200px; opacity: 0.65; }

  .section { padding: 50px 0; }
  .section-head { gap: 16px; margin-bottom: 20px; }
  .section-actions .btn { flex: 1 1 auto; }
  .podium-cards {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 78%);
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .podium-card { scroll-snap-align: start; }
  .podium-group { padding: 18px 16px; }

  .filters { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
  .field--search, .field--switch { grid-column: auto; }
  .segmented button span { display: inline-flex; }
  .results-grid { grid-template-columns: 1fr; gap: 14px; }
  .card-body { grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; }
  .runner-card { padding: 16px 15px 14px; }
  .runner-name { font-size: 1.12rem; }
  .card-time strong { font-size: 1.42rem; }
  .card-foot { gap: 3px 11px; font-size: 0.68rem; }
  .results-toolbar { margin-top: 20px; }
  .toolbar-actions { width: 100%; justify-content: space-between; }

  .modal { padding: 0; }
  .modal-dialog { width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0; border: 0; }
  .modal-visual { padding: 12px; }
  .modal-info { padding: 22px 18px 24px; }
  .modal-close { top: 10px; right: 10px; }
  .modal-info h2 { padding-right: 30px; }
  .modal-time strong { font-size: 1.75rem; }
  .modal-visual-actions .btn { flex: 1 1 auto; }

  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding: 40px 0 30px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .toast { left: 16px; right: 16px; bottom: 16px; transform: none; text-align: center; animation: none; }
}

@media (max-width: 380px) {
  .card-body { grid-template-columns: 1fr; }
  .diploma-thumb { width: 62%; }
  .card-foot { font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .hero, .site-footer, .filters, .section-actions,
  .results-toolbar, .results-note, .modal, .toast { display: none !important; }
  body { background: #fff; }
  .section { padding: 0; }
  .results-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .runner-card { break-inside: avoid; box-shadow: none; }
  .diploma-thumb { width: 90px; }
}
