/* =========================================================
   LiebresMX - Páginas individuales de carrera
   Archivo global para las páginas de detalle
   ========================================================= */

/* Base */
:root {
  --color-bg: #f3f4f6;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-body: #374151;
  --color-white: #ffffff;
  --color-soft: #f9fafb;
  --color-hero: #f8f5ef;
  --color-border: #e5e7eb;
  --shadow-soft: 0 12px 35px rgba(17, 24, 39, 0.06);
  --shadow-card: 0 10px 28px rgba(17, 24, 39, 0.06);
  --shadow-image: 0 22px 55px rgba(17, 24, 39, 0.18);
  --radius-lg: 34px;
  --radius-md: 28px;
  --radius-sm: 22px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--color-text);
  color: var(--color-white);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 1.4rem;
  font-weight: 900;
  text-decoration: none;
}

.logo::before {
  content: "🏃";
  font-size: 1.2rem;
}

.volver-calendario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text);
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.volver-calendario:hover {
  background: var(--color-text);
  color: var(--color-white);
}

/* Layout principal */
.detalle-carrera {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Hero */
.hero-carrera {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 42px;
  border-radius: var(--radius-lg);
  background: var(--color-hero);
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
}

.hero-info h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.descripcion-principal {
  margin-top: 24px;
  color: var(--color-body);
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-imagen img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 32px;
  box-shadow: var(--shadow-image);
}

/* Datos principales */
.datos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.dato-card {
  padding: 18px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-card);
}

.dato-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--color-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dato-card strong {
  color: var(--color-text);
  font-size: 1.02rem;
}

/* Botones */
.acciones-carrera {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-principal {
  background: var(--color-text);
  color: var(--color-white);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.18);
}

.btn-secundario {
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
}

/* Secciones de detalle */
.detalle-seccion {
  margin-top: 30px;
  padding: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.detalle-seccion h2 {
  margin: 0 0 18px;
  color: var(--color-text);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.info-lista {
  display: grid;
  gap: 10px;
  color: var(--color-body);
}

.info-lista p {
  margin: 0;
  line-height: 1.6;
}

/* Rutas */
.rutas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.ruta-card {
  padding: 18px;
  border-radius: 24px;
  background: var(--color-soft);
}

.ruta-card h3 {
  margin: 0 0 14px;
  color: var(--color-text);
}

.ruta-card img {
  width: 100%;
  border-radius: 20px;
}

/* Video */
.video-carrera {
  overflow: hidden;
}

.video-responsive {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-text);
}

.video-responsive iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Nota LiebresMX */
.nota-liebres {
  margin-top: 30px;
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: #e5e7eb;
  line-height: 1.7;
}

.nota-liebres p {
  margin: 0;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-carrera {
    grid-template-columns: 1fr;
    padding: 26px;
  }

  .datos-grid {
    grid-template-columns: 1fr;
  }

  .acciones-carrera {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 14px;
    align-items: flex-start;
  }

  .logo {
    font-size: 1.15rem;
  }

  .volver-calendario {
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .detalle-carrera {
    padding: 20px 14px 64px;
  }

  .hero-carrera,
  .detalle-seccion {
    border-radius: 24px;
  }

  .hero-carrera,
  .detalle-seccion,
  .nota-liebres {
    padding: 22px;
  }
}

.btn-compartir {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.btn-compartir.copiado {
  background: #16a34a;
  color: #fff;
}
