/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rojo:    #E8421E;
  --negro:   #0a0a0a;
  --gris1:   #111111;
  --gris2:   #1c1c1c;
  --gris3:   #2a2a2a;
  --texto:   #ffffff;
  --muted:   #888888;
  --borde:   #2a2a2a;
  --fuente-serif: 'Georgia', serif;
  --fuente-sans:  'Inter', 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--negro);
  color: var(--texto);
  font-family: var(--fuente-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Barrita Carrusel ─── */
.barrita-carrusel {
  margin-top: 64px;
  background: #000;
  overflow: hidden;
  position: sticky;
  top: 64px;
  z-index: 50;
  border-bottom: 1px solid #1c1c1c;
}

.barrita-viewport {
  overflow: hidden;
  width: 100%;
}

.barrita-track {
  display: flex;
}

.barrita-slide {
  flex: 0 0 50%;          /* Desktop: 2 visibles */
  height: clamp(64px, 10vh, 92px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  text-decoration: none;
  border-right: 1px solid #1c1c1c;
  position: relative;
}

.barrita-titulo {
  line-height: 1;
  text-transform: uppercase;
  font-size: clamp(20px, 2.6vw, 30px);
}

.barrita-frase {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: #cfcfcf;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: clamp(9px, 1vw, 11px);
  margin-top: 5px;
}

.barrita-cta { display: none; }

/* Dots de navegación — ocultos, solo autorrotación */
.barrita-dots { display: none; }
.barrita-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.barrita-dot.activo { background: #fff; width: 20px; border-radius: 4px; }

@media (max-width: 768px) {
  /* Móvil: 1 obra a la vez, apiladas, con FUNDIDO (sin deslizar) */
  .barrita-track {
    display: block;
    position: relative;
    height: clamp(110px, 26vw, 150px);
  }
  .barrita-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-right: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.9s ease-in-out;
  }
  .barrita-slide.activo {
    opacity: 1;
    pointer-events: auto;
  }
  .barrita-titulo { font-size: clamp(28px, 8vw, 40px); }
  .barrita-frase { font-size: clamp(10px, 2.6vw, 13px); margin-top: 8px; }
}

/* ─── Cartelera tipo Netflix (grid de pósters) ─── */
.cartelera-topbar {
  background: var(--negro);
  padding: 2rem;
}

.topbar-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rojo);
  margin-bottom: 1.25rem;
}

.cartelera-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* Móvil: 2 columnas */
  gap: 16px;
}

.tarjeta-obra-top {
  background: transparent;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease;
}
.tarjeta-obra-top:hover { transform: translateY(-4px); }

.tarjeta-img,
.tarjeta-img-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;          /* Póster vertical uniforme */
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 1px solid var(--borde);
  transition: border-color 0.25s;
}
.tarjeta-img-placeholder { background: var(--gris2); }
.tarjeta-obra-top:hover .tarjeta-img,
.tarjeta-obra-top:hover .tarjeta-img-placeholder { border-color: var(--rojo); }

.tarjeta-info {
  padding: 0.6rem 0.1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tarjeta-foro {
  font-size: 0.6rem;
  color: var(--rojo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tarjeta-titulo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tarjeta-horario {
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.2rem;
}
.tarjeta-ver { display: none; }

@media (min-width: 600px) {
  .cartelera-track { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .cartelera-track { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1200px) {
  .cartelera-track { grid-template-columns: repeat(6, 1fr); }
}

/* ─── Nav ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--negro);
  border-bottom: 1px solid var(--borde);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav-logo .wordmark {
  font-family: var(--fuente-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.nav-logo .sub {
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  color: var(--rojo);
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  color: #ccc;
  transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

.nav-cta {
  background: var(--rojo);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* ─── Hero ─── */
.hero {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 3rem 5rem 4rem;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--rojo);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--fuente-serif);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1rem;
  color: #aaa;
  max-width: 420px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--rojo);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.8rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-block;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.8rem 1.8rem;
  border: 1px solid #444;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}
.btn-secondary:hover { border-color: #fff; }

.hero-image {
  background: var(--gris2);
  position: relative;
  overflow: hidden;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  filter: grayscale(20%);
}
.hero-image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─── Secciones generales ─── */
section { padding: 6rem 2rem; }

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--borde);
  padding-bottom: 1.5rem;
}

.section-title {
  font-family: var(--fuente-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-link {
  font-size: 0.8rem;
  color: var(--rojo);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.section-link:hover { opacity: 0.7; }

/* ─── Cartelera destacada ─── */
#cartelera { background: var(--gris1); }

.obras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--borde);
}

.obra-card {
  background: var(--negro);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.2s;
}
.obra-card:hover { background: var(--gris2); }

.obra-titulo {
  font-family: var(--fuente-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.obra-foro {
  font-size: 0.8rem;
  color: var(--rojo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.obra-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.5rem;
}
.obra-meta span { display: flex; align-items: center; gap: 0.4rem; }

.obra-precio {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.5rem;
}

.obra-card--link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.obra-img {
  margin: -2rem -2rem 1.5rem;
  overflow: hidden;
  max-height: 220px;
}
.obra-img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.4s ease;
}
.obra-card:hover .obra-img img { transform: scale(1.03); }

.obra-btn {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rojo);
  border-top: 1px solid var(--borde);
  padding-top: 1rem;
  transition: color 0.2s;
  cursor: pointer;
}
.obra-btn:hover { color: #fff; }
.obra-btn a { color: inherit; text-decoration: none; }

/* ─── Mapa ─── */
#mapa { background: var(--negro); padding-bottom: 0; }

.mapa-desc {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.mapa-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border: 1px solid var(--borde);
  height: 560px;
}

.mapa-sidebar {
  background: var(--gris1);
  border-right: 1px solid var(--borde);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mapa-filtros {
  padding: 1rem;
  border-bottom: 1px solid var(--borde);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filtro-btn {
  font-size: 0.7rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--borde);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filtro-btn:hover,
.filtro-btn.activo { background: var(--rojo); border-color: var(--rojo); color: #fff; }

.mapa-lista { flex: 1; overflow-y: auto; }

.mapa-item {
  padding: 1rem;
  border-bottom: 1px solid var(--borde);
  cursor: pointer;
  transition: background 0.15s;
}
.mapa-item:hover,
.mapa-item.seleccionado { background: var(--gris2); }

.mapa-item-nombre {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.mapa-item-colonia {
  font-size: 0.75rem;
  color: var(--muted);
}
.mapa-item-estado {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.estado-activo { background: #1a3a1a; color: #5cba5c; }
.estado-actividad_por_confirmar { background: #3a2e0a; color: #c9a22a; }
.estado-en_pausa { background: #2a1a1a; color: #c05050; }
.estado-historico { background: #1a1a2a; color: #7070bb; }

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ─── Leaflet popup custom ─── */
.leaflet-popup-content-wrapper {
  background: var(--gris1) !important;
  border: 1px solid var(--borde) !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6) !important;
  color: #fff !important;
}
.leaflet-popup-tip { background: var(--gris1) !important; }
.popup-nombre { font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.popup-colonia { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.popup-tipo { font-size: 0.75rem; color: var(--rojo); text-transform: uppercase; letter-spacing: 0.07em; }

/* ─── Foros directorio ─── */
#foros { background: var(--gris1); }

.foros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--borde);
}

.foro-card {
  background: var(--negro);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.2s;
  cursor: pointer;
}
.foro-card:hover { background: var(--gris2); }

.foro-nombre {
  font-family: var(--fuente-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.foro-colonia {
  font-size: 0.8rem;
  color: var(--muted);
}
.foro-alcaldia {
  font-size: 0.75rem;
  color: #555;
}
.foro-ver {
  margin-top: 1.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #444;
  transition: color 0.2s;
}
.foro-card:hover .foro-ver { color: var(--rojo); }

/* ─── Registro ─── */
#registro { background: var(--negro); }

.registro-inner {
  max-width: 680px;
}

.registro-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.registro-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Footer ─── */
footer {
  background: var(--gris1);
  border-top: 1px solid var(--borde);
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.footer-nota {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.8;
  border-left: 2px solid var(--borde);
  padding-left: 1.2rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: #333;
  margin-top: 2rem;
  text-align: right;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-image { display: none; }
  .hero-text { padding: 4rem 1.5rem; }
  .mapa-layout { grid-template-columns: 1fr; height: auto; }
  .mapa-sidebar { height: 240px; }
  #map { height: 340px; }
  .nav-links { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-copy { text-align: left; margin-top: 1rem; }
}
