/* ══════════════════════════════════════
   HOME PAGE — editorial, elegant, spacious
══════════════════════════════════════ */

/* ── Header: hidden until scroll ── */
.home-header {
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 1000 !important;
}
.home-header-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@supports (padding-top: env(safe-area-inset-top)) {
  .home-header { padding-top: env(safe-area-inset-top); }
  .home-header-visible { padding-top: env(safe-area-inset-top); }
}

/* ── Page shell ── */
.home-main {
  /* uses .container from base.css for max-width + centering */
}

/* ══ HERO ══ */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 52px); /* subtract topbar height */
  padding: 60px 0 60px;
  border-bottom: 1px solid var(--rule);
}

.home-hero-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-hero-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--text);
  margin: 0 0 20px;
  white-space: nowrap;
}

.home-hero-tagline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
  line-height: 1.15;
}

.home-hero-verb {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  opacity: 0.5;
}

.home-hero-rotating-wrap {
  overflow: hidden;
  height: clamp(32px, 3.5vw, 48px);
  display: flex;
  align-items: center;
}

.home-hero-rotating {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  letter-spacing: -0.02em;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.home-hero-rotating.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}
.home-hero-rotating.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.home-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.home-hero-stat {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Map */
.home-hero-right {
  position: relative;
}

.home-hero-map-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid var(--rule);
  box-shadow: 0 12px 48px rgba(26,23,20,0.10);
  height: 460px;
}

#homeMap {
  width: 100%;
  height: 100%;
}

.home-map-pill {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--rule);
  z-index: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.15s;
}
.home-map-pill:hover { background: #fff; text-decoration: none; color: var(--text); }

/* ══ SECTIONS BASE ══ */
.home-section {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}
.home-section:last-child { border-bottom: none; padding-bottom: 100px; }

.home-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.home-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}

.home-section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.home-section-more:hover { text-decoration: underline; }

.home-section-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 36px;
  line-height: 1.5;
  max-width: 480px;
}

/* ══ RUTAS ══ */
.home-rutas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.home-ruta-card {
  border-radius: 16px;
  border: 1.5px solid var(--rule);
  background: var(--card);
  padding: 22px 20px 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.home-ruta-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(45,74,138,0.10);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--text);
}
.home-ruta-icon { width: 36px; height: 36px; object-fit: contain; }
.home-ruta-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.home-ruta-city {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.home-ruta-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.home-ruta-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.home-ruta-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }
.home-ruta-count { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* skeleton */
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.home-ruta-skel {
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--faint) 25%, #e8e4dc 50%, var(--faint) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
}
.home-rank-skel {
  height: 64px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--faint) 25%, #e8e4dc 50%, var(--faint) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ══ RANKINGS ══ */
.home-rankings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
}

.home-rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--rule);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.12s, transform 0.12s;
}
.home-rank-row:hover {
  border-color: var(--accent);
  background: var(--faint);
  transform: translateX(3px);
  text-decoration: none;
  color: var(--text);
}
.home-rank-crown { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.home-rank-info { flex: 1; min-width: 0; }
.home-rank-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-rank-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.home-rank-score {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ══ MOBILE ══ */
@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px 0 40px;
    gap: 28px;
  }
  .home-hero-map-wrap { height: 280px; border-radius: 14px; }
  .home-hero-brand { font-size: 36px; white-space: normal; }
  .home-rutas-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .home-section { padding: 48px 0 40px; }
}

@media (max-width: 560px) {
  .home-hero-brand { font-size: 30px; }
  .home-hero-map-wrap { height: 220px; }
  .home-rutas-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-ruta-skel { height: 110px; }
  .home-ruta-card { padding: 16px 14px 14px; }
  .home-ruta-name { font-size: 13px; }
}

/* ── Home map: monochrome navy markers ── */
.home-map-marker {
  background: #1a1714 !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.home-map-marker .tba-marker-inner img {
  filter: brightness(0) invert(1) !important;
  opacity: 0.9;
}
