/* 07 · Dónde estamos: el mapa ocupa todo el bloque y la ficha del despacho
   (foto de la fachada, dirección y accesos) flota encima, a la izquierda.
   El mapa es vectorial (MapLibre GL con datos de OpenFreeMap / OpenStreetMap);
   sus colores se definen en location-map.js. El marcador lleva el monograma de Patricia.
   Debajo hay siempre una imagen fija del mismo mapa (assets/mapa-despacho-*.webp): es lo que
   se ve mientras carga el interactivo y lo que queda si el navegador no puede mostrarlo. */
.location { background: var(--white); }
.location .section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 72px; align-items: end; }
.location .section-heading > p { margin-top: 0; }

.location-stage { position: relative; isolation: isolate; display: flex; min-height: 620px; padding: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(160deg, #e9eff6, #d3dde9); box-shadow: 0 30px 60px -36px #0b2e5266; }

/* Mapa */
/* --map-shift: mitad del borde derecho de la ficha, para centrar el despacho en el hueco libre. */
.location-map { --map-shift: 214px; position: absolute; inset: 0; z-index: 0; overflow: hidden; }
/* Imagen fija a escala 1:1 con el mapa interactivo y con el despacho en su centro. */
.location-map-static { position: absolute; left: calc(50% + var(--map-shift)); top: 50%; z-index: 0; width: 1800px; max-width: none; height: 1000px; translate: -50% -50%; }
.location-map-pin { position: absolute; left: calc(50% + var(--map-shift)); top: 50%; z-index: 3; translate: -50% calc(-100% + 4px); }
.location-map .location-map-canvas { position: absolute; inset: 0; z-index: 1; font-family: var(--sans); background: #e6edf5; opacity: 0; transition: opacity .8s ease; }
.location-map.is-ready .location-map-canvas { opacity: 1; }
/* Velo suave bajo la ficha para que el mapa no compita con ella. */
.location-map::after { content: ""; position: absolute; inset: 0 auto 0 0; z-index: 2; width: min(520px, 60%); background: linear-gradient(90deg, rgb(246 248 251 / .78), rgb(246 248 251 / 0)); pointer-events: none; }
/* Sobre la imagen fija, un acceso a Google Maps. Con el mapa interactivo cargado sobran
     tanto el acceso como el marcador fijo: la ficha ya enlaza y el mapa trae su marcador. */
.location-map-fallback { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--white); border-radius: 999px; box-shadow: 0 6px 16px #0b2e5233; color: var(--navy); font-size: .78rem; font-weight: 600; }
.location-map-fallback svg { width: 16px; height: 16px; color: var(--blue); }
@media (hover: hover) { .location-map-fallback:hover { background: var(--mist); } }
.location-map.is-ready :is(.location-map-fallback, .location-map-pin) { display: none; }

/* Controles y atribución del mapa con el estilo de la web. */
.location-map .maplibregl-map { font: inherit; }
.location-map .maplibregl-canvas { outline: none; }
.location-map .maplibregl-ctrl-top-right { top: 6px; right: 6px; }
.location-map .maplibregl-ctrl-group { overflow: hidden; background: var(--white); border-radius: 8px; box-shadow: 0 6px 16px #0b2e5229; }
.location-map .maplibregl-ctrl-group button { width: 38px; height: 38px; }
.location-map .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
@media (hover: hover) { .location-map .maplibregl-ctrl-group button:not(:disabled):hover { background: var(--mist); } }
.location-map .maplibregl-ctrl-attrib { background: rgb(255 255 255 / .86); font-size: .66rem; color: var(--muted); }
.location-map .maplibregl-ctrl-attrib a { color: var(--blue); }
.location-map .maplibregl-cooperative-gesture-screen { background: rgb(11 46 82 / .62); font-family: var(--sans); font-size: 1rem; font-weight: 500; }

/* Marcador: gota azul marino con el monograma, una onda suave y su etiqueta. */
.location-pin { width: 56px; height: 70px; cursor: default; }
.location-pin-mark { position: absolute; left: 4px; top: 0; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; background: var(--navy); border: 3px solid var(--white); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 12px 24px #0b2e5266; }
.location-pin-mark .logo-mark { width: 30px; height: 26px; color: var(--white); transform: rotate(45deg); }
.location-pin-pulse { position: absolute; left: 18px; bottom: 0; width: 20px; height: 8px; border-radius: 50%; background: #0b2e5240; }
.location-pin-pulse::after { content: ""; position: absolute; inset: -6px -10px; border: 2px solid #1f5a9666; border-radius: 50%; animation: location-pulse 2.4s ease-out infinite; }
@keyframes location-pulse { from { opacity: 1; transform: scale(.5); } to { opacity: 0; transform: scale(1.8); } }
.location-pin-label { position: absolute; left: 64px; top: 6px; padding: 8px 15px; background: var(--white); border-radius: 999px; box-shadow: 0 8px 20px #0b2e5233; color: var(--navy); font-family: var(--serif); font-size: .98rem; line-height: 1.2; white-space: nowrap; }

/* Ficha del despacho */
.location-card { position: relative; z-index: 2; display: flex; flex-direction: column; width: 400px; max-width: 100%; overflow: hidden; background: var(--white); border-radius: 10px; box-shadow: 0 30px 60px -20px #0b2e5259, 0 2px 8px #0b2e5214; }
.location-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(165deg, #dbe6f2, #bcd0e7); }
.location-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; transition: transform .6s var(--ease); }
/* La foto entera abre la ubicación en Google Maps. */
.location-photo-link { display: block; height: 100%; }
.location-photo-link::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(180deg, #0b2e5200, #0b2e5273); pointer-events: none; }
.location-photo-link:focus-visible { outline-offset: -6px; }
.location-photo-cta { position: absolute; right: 14px; bottom: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--white); border-radius: 999px; box-shadow: 0 6px 16px #0b2e5233; color: var(--navy); font-size: .78rem; font-weight: 600; transition: background .2s ease, transform .2s var(--ease); }
.location-photo-cta svg { width: 16px; height: 16px; color: var(--blue); }
@media (hover: hover) {
  .location-photo-link:hover img { transform: scale(1.04); }
  .location-photo-link:hover .location-photo-cta { background: var(--mist); transform: translateY(-2px); }
}
.location-photo figcaption { position: absolute; left: 14px; top: 14px; padding: 7px 13px; background: rgb(11 46 82 / .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 999px; color: var(--white); font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }

.location-info { display: flex; flex: 1 1 auto; flex-direction: column; padding: 26px 28px 24px; }
.location-info h3 { font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.location-facts { display: grid; gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.location-facts li { display: flex; gap: 14px; align-items: flex-start; font-size: .92rem; line-height: 1.6; color: var(--ink); }
.location-facts span { text-wrap: balance; }
.location-facts svg { width: 22px; height: 22px; margin-top: 2px; color: var(--blue); }
.location-facts a { color: var(--blue); font-weight: 600; text-decoration: underline; text-decoration-color: #9db9d8; text-underline-offset: 4px; }
.location-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-top: auto; padding-top: 22px; }

@media (max-width: 900px) {
  .location .section-heading { grid-template-columns: 1fr; }
  /* En una columna la ficha va primero y el mapa debajo, unidos en un mismo bloque. */
  .location-stage { flex-direction: column; min-height: 0; padding: 0; }
  .location-card { width: 100%; border-radius: 0; box-shadow: none; }
  .location-photo { aspect-ratio: 16 / 10; }
  .location-map { --map-shift: 0px; position: relative; inset: auto; order: 2; flex: none; height: 340px; border-top: 1px solid var(--line); }
  .location-map::after { display: none; }
}
@media (max-width: 600px) {
  .location-photo { aspect-ratio: 4 / 3; }
  .location-info { padding: 22px 20px; }
  .location-info h3 { font-size: 1.5rem; }
  .location-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .location-actions .button { width: 100%; }
  .location-actions .text-link { justify-content: center; }
  .location-map { height: 300px; }
  /* En pantallas estrechas la etiqueta del marcador no cabe junto a él. */
  .location-pin-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .location-pin-pulse::after { animation: none; opacity: 0; } }
@media print { .location-map { display: none; } .location-stage { min-height: 0; border: 0; box-shadow: none; } }
