/* Antiatajo — hoja única. Paleta y tipografía de /repos/ripio.cc/BRAND.md */
:root {
  --bg: #0c0c0c; --bg-alt: #111; --bg-card: #181818;
  --fg: #f0f0f0; --fg-muted: #ccc; --fg-dim: #8a8a8a;
  --accent: #d46a3a; --accent-hover: #b85a2e; --accent-dim: rgba(212,106,58,0.12);
  --ok: #5fb37a; --warn: #d4b43a; --bad: #d45a5a;
  --border: #1e1e1e; --border-light: #2a2a2a;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --max-w: 1200px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--fg);
  font-size: 1.05rem; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* Top bar */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12,12,12,0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); padding: 0 1.25rem;
}
.top-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 1rem; }
.top-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--fg); }
.top-brand img { height: 32px; width: auto; }
.top-brand span { font-family: var(--font-display); font-size: 0.95rem; }
.top-brand em { font-style: italic; color: var(--accent); }
.top-link { color: var(--fg-muted); text-decoration: none; font-size: 0.9rem; }
.top-link:hover { color: var(--accent); }

/* Layout */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }
section { padding: 3rem 0; }
.hero { background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%); padding: 4rem 0 3rem; }
.hero-cover { position: relative; min-height: 60vh; display: flex; align-items: flex-end; background: var(--bg-alt) center/cover no-repeat; }
.hero-cover::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.85) 100%); }
.hero-cover > .wrap { position: relative; width: 100%; padding-bottom: 3rem; }
.kicker { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); margin: 0 0 0.5rem; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h1 em, h2 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.lead { font-size: 1.15rem; color: var(--fg-muted); max-width: 42rem; }
.muted { color: var(--fg-muted); }
.dim { color: var(--fg-dim); font-size: 0.9rem; }
.prose p { color: var(--fg-muted); margin: 0 0 1rem; }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.card-body { padding: 1.25rem 1.4rem 1.5rem; }
a.card { color: inherit; text-decoration: none; transition: border-color .25s, transform .25s; display: block; }
a.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-cover { aspect-ratio: 16/9; background: var(--bg-alt) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); font-family: var(--font-display); font-style: italic; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.65rem; border-radius: 100px; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(212,106,58,0.25); }
.badge.gris { background: #1f1f1f; color: var(--fg-muted); border-color: var(--border-light); }
.badge.ok { background: rgba(95,179,122,0.12); color: var(--ok); border-color: rgba(95,179,122,0.3); }
.badge.bad { background: rgba(212,90,90,0.12); color: var(--bad); border-color: rgba(212,90,90,0.3); }
.facts { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.5rem 0; }
.fact { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; }
.fact small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-dim); }
.fact strong { font-size: 1.05rem; font-weight: 600; }

/* Itinerario */
.dias { display: grid; gap: 1rem; }
.dia { border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 1rem; }
.dia h3 { margin-bottom: 0.25rem; }
.dia .dim span + span::before { content: ' · '; }
.lista-llevar { columns: 2 16rem; padding-left: 1.2rem; color: var(--fg-muted); }
.puntos-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.puntos-lista li { display: flex; gap: 0.75rem; align-items: baseline; }
.puntos-lista .n { font-family: var(--font-display); color: var(--accent); font-size: 1.2rem; min-width: 1.5rem; }

/* Botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.6rem; border-radius: 100px; border: 1px solid transparent; background: var(--accent); color: #fff; font: 600 1rem var(--font); cursor: pointer; text-decoration: none; transition: background .25s, opacity .25s; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--border-light); color: var(--fg); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn.danger { background: transparent; border-color: rgba(212,90,90,0.4); color: var(--bad); }
.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
label { display: grid; gap: 0.35rem; align-content: start; font-size: 0.9rem; color: var(--fg-muted); }
input, select, textarea {
  width: 100%; padding: 0.75rem 0.9rem; border-radius: 6px; border: 1px solid var(--border-light);
  background: #111; color: var(--fg); font: 1rem var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 7rem; resize: vertical; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { width: auto; margin-top: 0.3rem; }
.alert { padding: 0.9rem 1.1rem; border-radius: 10px; border: 1px solid var(--border-light); background: var(--bg-card); }
.alert.error { border-color: rgba(212,90,90,0.45); color: #f1b3b3; }
.alert.ok { border-color: rgba(95,179,122,0.45); color: #bfe6cb; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }

/* Subida de fotos */
.drop { border: 2px dashed var(--border-light); border-radius: 10px; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: border-color .2s; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { display: none; }
.cola { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin-top: 1rem; }
.cola .item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #111 center/cover; }
.cola .item .st { position: absolute; inset: auto 0 0 0; font-size: 0.7rem; padding: 0.2rem 0.3rem; background: rgba(0,0,0,0.75); text-align: center; }
.cola .item.ok .st { color: var(--ok); }
.cola .item.err .st { color: var(--bad); }

/* Carrusel */
.carrusel { position: relative; }
.carrusel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.75rem; scrollbar-width: none; border-radius: 10px; }
.carrusel-track::-webkit-scrollbar { display: none; }
.carrusel-track figure { flex: 0 0 min(85%, 720px); margin: 0; scroll-snap-align: center; aspect-ratio: 4/3; background: #111; border-radius: 10px; overflow: hidden; cursor: zoom-in; position: relative; }
.carrusel-track img { width: 100%; height: 100%; object-fit: cover; }
.carrusel-track figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.5rem 0.8rem; font-size: 0.8rem; color: var(--fg-muted); background: linear-gradient(transparent, rgba(0,0,0,0.75)); }
.carrusel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-light); background: rgba(12,12,12,0.8); color: var(--fg); font-size: 1.3rem; cursor: pointer; }
.carrusel-nav.prev { left: 0.5rem; } .carrusel-nav.next { right: 0.5rem; }
@media (hover: none) { .carrusel-nav { display: none; } }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.95); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(24,24,24,0.8); border: 1px solid var(--border-light); color: var(--fg); width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox .cerrar { top: 1rem; right: 1rem; }
.lightbox .prev { left: 1rem; top: 50%; } .lightbox .next { right: 1rem; top: 50%; }

footer { border-top: 1px solid var(--border); padding: 2rem 1.25rem; text-align: center; color: #555; font-size: 0.85rem; margin-top: 3rem; }

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--fg-muted); padding: 0.7rem 1rem; font: 500 0.95rem var(--font); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--accent); }
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--fg-dim); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.mod-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.mod-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mod-item.aprobada { border-color: rgba(95,179,122,0.5); }
.mod-item.rechazada { opacity: 0.45; }
.mod-item .img { aspect-ratio: 1; background: #111 center/cover; cursor: zoom-in; }
.mod-item .meta { padding: 0.5rem 0.6rem; font-size: 0.78rem; color: var(--fg-muted); }
.mod-item .acciones { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0 0.6rem 0.6rem; }
.mod-item .acciones button { flex: 1; }

/* ---------- Página de versión ---------- */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 70px; }
.bloque { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.bloque + .bloque { padding-top: 0; }

/* Barra superior: transparente sobre el hero, sólida al bajar */
.top-flotante { position: fixed; left: 0; right: 0; background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background .3s, border-color .3s; }
.top-flotante.solida { background: rgba(12,12,12,0.88); border-bottom-color: var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* Hero a pantalla completa */
.hero-full {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  background: var(--hero, none) 40% center / cover no-repeat, var(--bg-alt);
}
.hero-full::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,8,8,0.88) 0%, rgba(8,8,8,0.55) 45%, rgba(8,8,8,0.05) 80%),
    linear-gradient(0deg, var(--bg) 0%, rgba(12,12,12,0) 30%);
}
.hero-texto { position: relative; width: 100%; padding-bottom: clamp(4rem, 12vh, 8rem); }
.hero-texto .kicker { font-size: 0.8rem; }
.titulo-hero { font-size: clamp(3.2rem, 10vw, 7rem); line-height: 0.95; letter-spacing: -0.02em; margin: 0 0 1.25rem; font-weight: 500; }
.titulo-hero em { display: block; }
.hero-bajada { font-family: var(--font-display); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--fg); max-width: 34rem; margin: 0 0 1.25rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; color: var(--fg-muted); font-size: 0.95rem; margin: 0 0 2rem; }
.hero-meta span:not(:last-child)::after { content: '·'; margin-left: 1.25rem; color: var(--accent); }
.hero-scroll { position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); color: var(--fg-muted); text-decoration: none; font-size: 1.3rem; animation: flota 2.4s ease-in-out infinite; }
@keyframes flota { 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .hero-scroll { animation: none; } html { scroll-behavior: auto; } }

/* Presentación */
.intro { display: grid; gap: 2.5rem; align-items: center; }
.intro.con-foto { grid-template-columns: 1.1fr 0.9fr; }
.cita { font-family: var(--font-display); font-size: clamp(1.45rem, 2.8vw, 2.1rem); line-height: 1.35; margin: 0 0 1.75rem; padding-left: 1.25rem; border-left: 3px solid var(--accent); color: var(--fg); }
.foto-intro { margin: 0; }
.foto-intro img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; }

/* Cifras */
.cifras { border-block: 1px solid var(--border); background: var(--bg-alt); padding: 2.25rem 0; }
.cifras-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.5rem; text-align: center; }
.cifras strong { display: block; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 500; line-height: 1.1; color: var(--fg); }
.cifras span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-dim); }

/* Dos columnas: incluye / qué llevar */
.dos-col { display: grid; gap: 1.25rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.lista-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; color: var(--fg-muted); }
.lista-check li { padding-left: 1.6rem; position: relative; }
.lista-check li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 0.7rem; height: 2px; background: var(--accent); }

/* Ruta */
.ruta { display: grid; gap: 2.5rem; margin-top: 2rem; }
.ruta.con-mapa { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
.mapa { margin: 0; position: sticky; top: 80px; }
.mapa img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.mapa figcaption { margin-top: 0.6rem; }
.dias { display: grid; gap: 2.5rem; }
.dia { border-left: 2px solid var(--border-light); padding: 0 0 0 1.5rem; position: relative; }
.dia::before { content: ''; position: absolute; left: -7px; top: 0.3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.dia h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-bottom: 0.4rem; }
.datos { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--fg-muted); font-size: 0.92rem; margin: 0 0 0.6rem; }
.datos b { color: var(--fg); font-weight: 600; }
.pernocte { color: var(--fg-muted); font-size: 0.92rem; }
.antiatajos { margin-top: 1rem; display: grid; gap: 0.7rem; }
.antiatajos .kicker { margin: 0; }
.antiatajo { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1.1rem; }
.antiatajo.reco { border-color: rgba(212,106,58,0.5); background: linear-gradient(135deg, var(--accent-dim), var(--bg-card) 60%); }
.antiatajo-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.antiatajo p { margin: 0.2rem 0 0; }

/* Franja de foto */
.franja { position: relative; min-height: 55vh; display: flex; align-items: center; background: var(--franja) center / cover no-repeat; }
.franja::before { content: ''; position: absolute; inset: 0; background: rgba(8,8,8,0.45); }
.franja .wrap { position: relative; width: 100%; }
.franja p { font-family: var(--font-display); font-style: italic; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.1; margin: 0; max-width: 16ch; text-shadow: 0 2px 24px rgba(0,0,0,0.5); }

/* Puntos de control */
.puntos { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.puntos li { display: flex; gap: 0.9rem; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; }
.puntos .n { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--accent); }
.puntos p { margin: 0.2rem 0 0; }
.puntos-dia + .puntos-dia { margin-top: 2rem; }
.puntos-dia .puntos { margin-top: 0.75rem; }
.puntos li.alternativo { border-style: dashed; border-color: rgba(212,106,58,0.5); }
.puntos .alt { color: var(--fg-muted); font-size: 0.85rem; }

/* Inscripción y fotos */
.panel-insc { padding: clamp(1.5rem, 4vw, 2.5rem); border-color: var(--border-light); }
.panel-fotos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-fotos h3, .panel-fotos p { margin: 0 0 0.25rem; }

@media (max-width: 820px) {
  .intro.con-foto, .ruta.con-mapa { grid-template-columns: 1fr; }
  .mapa { position: static; }
  .foto-intro img { aspect-ratio: 4/3; }
  .hero-full::before { background: linear-gradient(0deg, var(--bg) 0%, rgba(8,8,8,0.7) 45%, rgba(8,8,8,0.25) 100%); }
}

/* Página de control (validación de puntos) */
.control-lista { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.control-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; color: var(--fg);
  font: inherit; cursor: pointer; transition: border-color .2s; }
.control-item:hover { border-color: var(--accent); }
.control-item.alternativo { border-style: dashed; }
.control-item small { display: block; color: var(--fg-muted); font-size: 0.8rem; margin-top: 0.15rem; }
.control-item .badge { white-space: nowrap; }
.indicacion { border-color: rgba(212,106,58,0.45); }
.indicacion-texto { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.35; margin: 0; }

/* Admin: grilla de control */
.control-grid th { white-space: nowrap; font-size: 0.68rem; }
.control-grid th.alt { border-bottom: 1px dashed var(--accent); }
.control-grid td { text-align: center; }
.control-grid td:first-child { text-align: left; white-space: nowrap; }
.control-grid td.vacia { background: rgba(255,255,255,0.015); }
.celda { width: 64px; height: 64px; border-radius: 6px; border: 2px solid var(--border-light); background: #111 center/cover; cursor: pointer; position: relative; padding: 0; }
.celda span { position: absolute; right: 2px; bottom: 2px; font: 600 0.75rem var(--font); background: rgba(0,0,0,0.75); color: #fff; border-radius: 4px; padding: 0 0.3rem; }
.celda.pendiente { border-color: var(--warn); }
.celda.valida { border-color: var(--ok); }
.celda.invalida { border-color: var(--bad); }

.pasos-control { color: var(--fg-muted); padding-left: 1.2rem; display: grid; gap: 0.4rem; max-width: 46rem; }
.pasos-control strong { color: var(--fg); }
.puntos .foto-ind { color: var(--fg-muted); font-size: 0.88rem; }

em.acento { font-style: italic; color: var(--accent); }
label small { font-size: 0.78rem; }

/* Ruta: hitos y tabla de combinaciones */
.hitos { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--fg-muted); }
.hitos li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.5rem; }
.hitos .km { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
table.opciones { margin: 1rem 0 0.5rem; font-size: 0.92rem; }
table.opciones caption { text-align: left; margin-bottom: 0.4rem; }
table.opciones td:nth-child(2), table.opciones td:nth-child(3), table.opciones th:nth-child(2), table.opciones th:nth-child(3) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.opciones tr.reco td { color: var(--fg); background: var(--accent-dim); }
