/* ==========================================================================
   AZTECH METAL - EL MAPA DE UN RECINTO  (10-nov-2026)

   La banda "Dónde está" de las páginas de recinto: el mapa propio a la
   izquierda y, a la derecha, el nombre, la dirección, los recintos vecinos
   y el botón de ruta. Lo mueve mapa-recinto.js.

   Las reglas que tocan a MapLibre llevan `.mr` delante a propósito: su hoja
   de estilos llega DESPUÉS que esta (se pide cuando el mapa se acerca a la
   pantalla) y sin ese prefijo ganaría la suya.
   ========================================================================== */

.mr {
  max-width: 1280px;
  margin: clamp(2.8rem, 6vw, 4.5rem) auto 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
  scroll-margin-top: 8.5rem;   /* la cabecera y la cinta de "Última hora" son fijas: 110 px */
}

.mr-titulo { margin: 0 0 1.3rem; }   /* la letra es la de .ri-h2 (evento.css) */

.mr-cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 330px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--gx-panel, #101014);
}

/* ------------------------------------------------------------- El mapa */
.mr-mapa {
  position: relative;
  height: clamp(440px, 60vh, 580px);
  overflow: hidden;
  background: #0a0a0c;
}
/* Dos clases a propósito: MapLibre le pone `.maplibregl-map { position: relative }`
   al contenedor y, con una sola clase, su hoja (que llega después) ganaba: el
   lienzo se quedaba en 300 px de alto dentro de una caja de 620. */
.mr-mapa > .mr-lienzo { position: absolute; inset: 0; }

/* El respaldo: lo que se ve antes de que el mapa pinte y lo que se queda si
   no pinta (sin WebGL, sin red, sin el servicio de mosaicos). Una retícula
   tenue con el mismo giro que la vista del mapa, para que no sea una caja
   negra, y el enlace que sí funciona siempre. */
.mr-respaldo {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.7rem;
  padding: clamp(1.4rem, 5vw, 3rem);
  background:
    repeating-linear-gradient(66deg, transparent 0 46px, rgba(255, 255, 255, 0.035) 46px 47px),
    repeating-linear-gradient(156deg, transparent 0 46px, rgba(255, 255, 255, 0.035) 46px 47px),
    #0a0a0c;
}
.mr[data-estado="listo"] .mr-respaldo { display: none; }
.mr-respaldo-nombre {
  margin: 0;
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
}
.mr-aviso {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}
.mr[data-estado="cargando"] .mr-aviso:empty::before { content: "Cargando el mapa"; }
.mr-aviso:empty { min-height: 1.4em; }
.mr-respaldo a {
  display: inline-block;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--gx-red, #FF2A24);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.18s ease;
}

/* ------------------------------------------------------------ La ficha */
.mr-ficha {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 0;
}
.mr-lugar { padding: 1.5rem 1.3rem 1.3rem; }
.mr-nombre {
  margin: 0 0 0.7rem;
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 2.3rem;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: #fff;
}
.mr-dir {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.mr-cerca { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.mr-cerca-cab {
  margin: 0;
  padding: 0.75rem 1.3rem;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.mr-cerca ul { list-style: none; margin: 0; padding: 0; }
.mr-cerca li { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.mr-cerca a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.3rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.mr-cerca b {
  flex: none;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
}

.mr-botones { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.mr-ir {
  display: block;
  padding: 1.15rem 1.3rem;
  background: var(--gx-red, #FF2A24);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.mr-ver {
  display: block;
  padding: 0.85rem 1.3rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}
.mr a:focus-visible, .mr button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* -------------------------------------------------------- Los marcadores */
.mr-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}
.mr-pin-rotulo { white-space: nowrap; }

.mr-pin-recinto { z-index: 2; }
.mr-pin-recinto .mr-pin-rotulo {
  padding: 0.42rem 0.7rem 0.32rem;
  background: var(--gx-red, #FF2A24);
  color: #fff;
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}
.mr-pin-recinto .mr-pin-asta { width: 2px; height: 46px; background: var(--gx-red, #FF2A24); }
.mr-pin-recinto::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--gx-red, #FF2A24);
  box-sizing: border-box;
}

.mr-pin-vecino .mr-pin-rotulo {
  padding: 0.34rem 0.55rem 0.3rem;
  background: rgba(16, 16, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.mr-pin-vecino .mr-pin-asta { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.5); }
.mr-pin-vecino:focus-visible .mr-pin-rotulo { border-color: var(--gx-red, #FF2A24); color: #fff; }

/* ------------------------------------- Los controles de MapLibre, a la marca */
.mr .maplibregl-map { font-family: var(--font-data, 'Barlow', sans-serif); }
.mr .maplibregl-ctrl-group,
.mr .maplibregl-ctrl-group:not(:empty) {
  background: #101014;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  box-shadow: none;
}
.mr .maplibregl-ctrl-group button {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background-color: transparent;
}
.mr .maplibregl-ctrl-group button + button { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.mr .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1); }

.mr-centrar button {
  height: 40px;
  padding: 0 0.9rem;
  background: #101014;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

/* Los créditos: obligatorios y siempre a la vista. */
.mr .maplibregl-ctrl-attrib,
.mr .maplibregl-ctrl-attrib.maplibregl-compact {
  background: rgba(10, 10, 12, 0.86);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  line-height: 1.5;
}
.mr .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.85); }

/* El aviso de "usa Ctrl + la rueda" / "usa dos dedos". */
.mr .maplibregl-cooperative-gesture-screen {
  background: rgba(10, 10, 12, 0.74);
  font-family: var(--font-data, 'Barlow', sans-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mr .maplibregl-canvas:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* --------------------------------------------- Al pasar el ratón por encima
   Solo donde hay ratón: en celular el :hover se queda pegado después de tocar
   (el botón "Centrar" se quedaba rojo). */
@media (hover: hover) {
  .mr-respaldo a:hover { background: var(--gx-red, #FF2A24); }
  .mr-cerca a:hover { background: rgba(255, 42, 36, 0.08); color: #fff; }
  .mr-ir:hover { background: #fff; color: #0a0a0c; }
  .mr-ver:hover { color: #fff; }
  .mr-pin-vecino:hover .mr-pin-rotulo { border-color: var(--gx-red, #FF2A24); color: #fff; }
  .mr .maplibregl-ctrl-group button:not(:disabled):hover { background-color: rgba(255, 42, 36, 0.22); }
  .mr-centrar button:hover { background: rgba(255, 42, 36, 0.3); }
}
/* MapLibre trae su propio :hover gris claro para los botones; sin ratón, que no se quede. */
@media (hover: none) {
  .mr .maplibregl-ctrl-group button:not(:disabled):hover { background-color: transparent; }
}

/* ------------------------------------------------------------- Celular */
@media (max-width: 900px) {
  .mr-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .mr-mapa { height: 430px; }
  .mr-ficha { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
}
@media (max-width: 560px) {
  /* En pantallas angostas los créditos ocupan casi todo el ancho de abajo:
     los botones suben un renglón para no encimarse con ellos. */
  .mr .maplibregl-ctrl-bottom-left { bottom: 24px; }
  .mr-pin-recinto .mr-pin-rotulo { font-size: 1.2rem; }
  .mr-pin-recinto .mr-pin-asta { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .mr a, .mr button { transition: none; }
}
