/* Calendario de carreras (/ar/calendario) — tema "papel" del sitio (tokens copiados de web/css/app.css), "noche" con la luna. */
:root {
  --bg: #f2eee6; --bg-2: #ebe6db; --panel: #fbf9f4; --line: #ddd6c8; --line-2: #c9c0ae;
  --ink: #16140f; --ink-2: #57524a; --ink-3: #8c8579; --red: #e0202f; --red-ink: #c8101f;
  --hover: #e6e0d3; --warn: #9a5c00;
  --bar: #16140f; --bar-ink: #f2eee6; --bar-ink-2: #a9a294; --bar-line: #3a362e;
  --c-run: #13894a; --c-swim: #0a7fc4; --c-bike: #b06c00; --c-tri: #e0202f; --c-du: #7b4bb3; --c-aqua: #0c8f8a;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Barlow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #15161a; --bg-2: #1b1d22; --panel: #1f2127; --line: #2b2e36; --line-2: #3a3e48;
  --ink: #f1efe9; --ink-2: #b3b0a8; --ink-3: #7d7a73; --red: #ff3b4e; --red-ink: #ff6a78;
  --hover: #23262d; --warn: #e7a43a;
  --bar: #0f1013; --bar-ink: #f1efe9; --bar-ink-2: #b3b0a8; --bar-line: #3a3e48;
  --c-run: #1ea34e; --c-swim: #0b8fd9; --c-bike: #c47c05; --c-tri: #ff3b4e; --c-du: #a57ad9; --c-aqua: #1db5ae;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- barra superior */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 24px;
  background: var(--bar); color: var(--bar-ink); }
.brand { font-family: var(--cond); font-weight: 900; font-style: italic; font-size: 26px; letter-spacing: .02em; }
.brand-slash { color: var(--red); margin: 0 1px; }
.brand-data { color: var(--bar-ink-2); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px;
  color: var(--bar-ink-2); border-bottom: 2px solid transparent; }
.nav a.on, .nav a:hover { color: var(--bar-ink); border-bottom-color: var(--red); }
.theme-switch { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; padding: 0;
  background: none; border: 1px solid var(--bar-line); color: var(--bar-ink-2); }
.theme-switch:hover { color: var(--bar-ink); border-color: var(--bar-ink-2); }
.theme-switch svg { width: 15px; height: 15px; fill: currentColor; }
.theme-switch .ts-sun, html[data-theme="dark"] .theme-switch .ts-moon { display: none; }
html[data-theme="dark"] .theme-switch .ts-sun { display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------- cabecera */
.hero { padding: 34px 0 18px; }
.kicker { font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--red-ink); }
.h1 { font-family: var(--cond); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(38px, 6vw, 66px);
  line-height: .9; margin: 6px 0 0; letter-spacing: -.01em; }
.hero p { margin: 12px 0 0; color: var(--ink-2); max-width: 62ch; line-height: 1.45; }

/* ------------------------------------------------------------- filtros */
.filters { position: sticky; top: 56px; z-index: 20; background: var(--bg); padding: 12px 0 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; background: var(--panel); border: 1px solid var(--line-2);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.chip.on i { color: var(--bg); opacity: .7; }
.chip .dot { width: 9px; height: 9px; flex: none; }
.chip.zero:not(.on) { color: var(--ink-3); }
.sep { width: 1px; align-self: stretch; background: var(--line-2); margin: 0 6px; }
.search { flex: 1 1 220px; min-width: 180px; background: var(--panel); border: 1px solid var(--line-2); padding: 7px 11px; outline: none; font-size: 14px; }
.search:focus { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--red); width: 15px; height: 15px; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); margin-left: auto; }
.seg button { background: var(--panel); border: 0; border-left: 1px solid var(--line-2); padding: 6px 12px;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--red); color: #fff; }

/* tira de meses */
.months { display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--line); background: var(--panel); }
.months button { flex: 1 0 58px; background: none; border: 0; border-left: 1px solid var(--line); padding: 6px 4px 7px; display: grid; gap: 2px; justify-items: center; }
.months button:first-child { border-left: 0; }
.months button:hover { background: var(--hover); }
.months b { font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.months span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.months .bars { display: flex; gap: 1px; height: 4px; width: 80%; }
.months .bars i { display: block; height: 100%; }
.months button.empty b { color: var(--ink-3); }
.months button.on { box-shadow: inset 0 -2px 0 var(--red); }

/* ------------------------------------------------------------- agenda */
.list { padding: 8px 0 80px; }
.month-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); scroll-margin-top: 200px; }
.month-h h2 { font-family: var(--cond); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; margin: 0; letter-spacing: .01em; }
.month-h span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ev { display: grid; grid-template-columns: 64px 4px minmax(0, 1fr) auto; gap: 0 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ev:hover { background: linear-gradient(90deg, transparent, var(--hover) 10%, var(--hover) 90%, transparent); }
.date { text-align: center; line-height: 1; }
.date .mo { display: block; font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--red-ink); margin-bottom: 2px; }
.date.est-d .mo { color: var(--ink-3); }
.date b { display: block; font-family: var(--cond); font-weight: 900; font-size: 32px; }
.date small { display: block; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.date.est b { font-size: 20px; color: var(--ink-3); }
.date.est-d b { color: var(--ink-3); }
.date.est-d em { display: block; margin-top: 4px; font-style: normal; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--ink-3); border: 1px dashed var(--line-2); padding: 1px 0; }
.ev.is-est .stripe { background: repeating-linear-gradient(180deg, var(--sc) 0 6px, transparent 6px 10px) !important; }
.ev.is-est .name { color: var(--ink-2); }
.stripe { align-self: stretch; }
.body { min-width: 0; display: grid; gap: 3px; }
.top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sport { font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.sub { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; color: var(--ink-3); }
.name { font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.meta .k { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.reg { font-size: 11.5px; color: var(--ink-3); border: 1px solid var(--line-2); padding: 0 5px; }
.note { font-size: 12.5px; color: var(--warn); }
.note.est { color: var(--ink-3); font-style: italic; }
.acts { display: flex; gap: 6px; }
.act { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; white-space: nowrap; }
.act:hover { border-color: var(--red); color: var(--red-ink); }
.act svg { width: 14px; height: 14px; }
.empty-msg { padding: 60px 0; text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------- vista mes */
.cal { padding: 18px 0 80px; }
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cal-head h2 { font-family: var(--cond); font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 30px; margin: 0; flex: 1; }
.cal-head button { background: var(--panel); border: 1px solid var(--line-2); width: 36px; height: 32px; font-size: 18px; }
.cal-head button:hover { border-color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.dow { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--bar-ink-2);
  background: var(--bar); padding: 6px 8px; border-right: 1px solid var(--bar-line); }
.cell { min-height: 108px; padding: 5px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); display: grid; align-content: start; gap: 3px; }
.cell.out { background: var(--bg-2); }
.cell.out .dn { color: var(--ink-3); }
.cell.wknd { background: color-mix(in srgb, var(--panel) 85%, var(--bg-2)); }
.cell.today .dn { color: #fff; background: var(--red); padding: 0 5px; }
.dn { justify-self: start; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.pill { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-left: 3px solid var(--c); background: var(--bg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill:hover { background: var(--hover); }
.pill.est { border-left-style: dashed; color: var(--ink-2); font-style: italic; background: transparent; }
.more { font-size: 11px; color: var(--ink-3); padding-left: 4px; background: none; border: 0; text-align: left; }
.more:hover { color: var(--red-ink); }
.cal-est { margin-top: 18px; }
.cal-est h3 { font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; margin: 0 0 6px; color: var(--ink-2); }

.foot { border-top: 1px solid var(--line); padding: 18px 0 40px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.foot a { border-bottom: 1px solid var(--line-2); }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; } .topbar .nav { display: none; } .theme-switch { margin-left: auto; }
  .wrap { padding: 0 16px; }
  .filters { position: static; }
  .seg { margin-left: 0; }
  .ev { grid-template-columns: 50px 3px minmax(0, 1fr); }
  .acts { grid-column: 3; margin-top: 6px; }
  .date b { font-size: 26px; }
  .cell { min-height: 64px; }
  .pill { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--c); }
}
