/* Interactive maps on the guides (assets/mapas.js): catastro search (guia-numero-catastro.html) and flood zones
   (zona-inundable-*.html). The map library itself (MapLibre) loads only when a map comes near the screen. */

/* ---------- shared: gestures (desktop = click the map to zoom with the wheel; phone = tap to open full screen) */
.mx-wrap { position: relative; }
.mx-wrap.mx-on { box-shadow: 0 0 0 3px #FF6B4A; }
.mx-tip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(35, 41, 58, .45); color: #fff; font-weight: 700; font-size: 16px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3; text-align: center; padding: 0 16px; }
.mx-tip.show { opacity: 1; }
.mx-open { position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; font: inherit; }
.mx-open span { background: #23293A; color: #F5F3EE; font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.mx-close { display: none; position: absolute; top: 12px; right: 12px; z-index: 4; border: 0; background: #23293A; color: #F5F3EE; font: inherit; font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.mx-wrap.mx-full { position: fixed !important; inset: 0; z-index: 1000; border-radius: 0 !important; border: 0 !important; margin: 0 !important; }
.mx-wrap.mx-full .mb-map, .mx-wrap.mx-full .fz-map { height: 100% !important; }
.mx-wrap.mx-full .mx-open { display: none; }
.mx-wrap.mx-full .mx-close { display: block; }
.mx-wrap.mx-full .maplibregl-ctrl-top-right { top: 52px; }
.mx-wrap.mx-full + .mx-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; margin: 0; max-height: 52vh; overflow: auto; border-radius: 18px 18px 0 0; border-bottom: 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .2); }
.mapbox .mx-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: #5A6072; font-size: 15px; font-weight: 600; text-align: center; padding: 0 16px; }
.maplibregl-popup-content { border-radius: 12px; padding: 8px 12px; font-family: inherit; font-size: 14px; color: #23293A; }

/* ---------- catastro search */
.mapbox .mb-search { display: flex; gap: 8px; margin: 10px 0 12px; }
.mapbox .mb-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border: 2px solid #23293A; border-radius: 999px; font: inherit; font-size: 16px; background: #fff; color: #23293A; box-sizing: border-box; }
.mapbox .mb-search button { min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: #23293A; color: #F5F3EE; font: inherit; font-weight: 700; cursor: pointer; }
.mapbox .mb-status { font-size: 15px; color: #5A6072; margin: 0 0 10px; }
.mapbox .mb-wrap { border: 2px solid #23293A; border-radius: 18px; overflow: hidden; }
.mapbox .mb-map { height: 420px; background: #DAD5C9; }
.mapbox .mb-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2; background: rgba(35, 41, 58, .88); color: #F5F3EE; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.mapbox .mb-card { margin: 12px 0 6px; background: #fff; border: 2px solid #23293A; border-radius: 18px; padding: 14px 18px; }
.mapbox .mb-card .k { font-size: 13px; color: #5A6072; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mapbox .mb-card .num { font-size: 26px; font-weight: 800; color: #23293A; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.mapbox .mb-card .unit { background: #FFF4DA; border-radius: 12px; padding: 10px 12px; margin: 8px 0 10px; font-size: 15px; }
.mapbox .mb-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 4px; font-size: 15px; }
.mapbox .mb-card dt { color: #5A6072; font-weight: 600; }
.mapbox .mb-card dd { margin: 0; color: #23293A; }
.mapbox .pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; margin-right: 6px; color: #23293A; }
.mapbox .copy { border: 0; background: none; color: #23293A; font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0 0 0 8px; }
/* The report box at the end of each card: its own copy of the guides' CTA style, so it looks the same on the
   English pages (which use other CTA classes). */
.mapbox .cta { background: #23293A; color: #F5F3EE; border-radius: 20px; padding: 20px 22px; margin: 14px 0 2px; }
.mapbox .cta p { margin: 0 0 12px; color: #F5F3EE; }
.mapbox .cta strong { color: #F5F3EE; }
.mapbox .cta a.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: #FF6B4A; color: #23293A; font-weight: 700; text-decoration: none; margin: 4px 10px 4px 0; }
.mapbox .cta a.alt { color: #F5F3EE; font-weight: 600; text-decoration: underline; }

/* ---------- flood zones */
.mapbox .fz-wrap { border: 2px solid #23293A; border-radius: 18px; overflow: hidden; margin: 12px 0 0; }
.mapbox .fz-map { height: 460px; background: #E8E4DA; }
.mapbox .fz-back { position: absolute; top: 10px; left: 10px; z-index: 2; border: 0; background: #23293A; color: #F5F3EE; border-radius: 999px; padding: 9px 15px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.mapbox .fz-legend { position: absolute; left: 10px; bottom: 34px; z-index: 2; max-width: 260px; background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 8px 12px; font-size: 13px; line-height: 1.45; color: #23293A; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.mapbox .fz-legend summary { font-weight: 800; cursor: pointer; list-style: none; }
.mapbox .fz-legend summary::-webkit-details-marker { display: none; }
.mapbox .fz-legend summary::after { content: " ▾"; }
.mapbox .fz-legend:not([open]) summary::after { content: " ▸"; }
.mapbox .fz-legend .r { display: flex; gap: 6px; align-items: flex-start; margin-top: 3px; }
.mapbox .fz-legend .r b { white-space: nowrap; }
.mapbox .fz-legend .r span { color: #5A6072; }
.mapbox .fz-legend i { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 4px; margin-top: 2px; }
.mapbox .fz-legend i.dash { background: none; border: 2px dashed #5B3FA8; width: 10px; height: 10px; vertical-align: -1px; margin-right: 4px; }
.mapbox .fz-legend i.dot { width: 10px; height: 10px; border-radius: 50%; background: #1E6FD9; border: 2px solid #fff; box-shadow: 0 0 0 1px #1E6FD9; vertical-align: -1px; margin-right: 4px; }
.mapbox .fz-legend label { display: block; font-weight: 700; cursor: pointer; margin-top: 4px; }
.mapbox .fz-load { position: absolute; top: 12px; right: 56px; z-index: 2; background: rgba(35, 41, 58, .88); color: #F5F3EE; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; }
.mapbox .fz-info { margin: 12px 0 6px; background: #fff; border: 2px solid #23293A; border-radius: 18px; padding: 14px 18px; }
.mapbox .fz-empty { color: #5A6072; font-size: 15px; }
.mapbox .fz-info .hd { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mapbox .fz-info .hd h3 { margin: 0; font-size: 19px; color: #23293A; }
.mapbox .fz-info .hd small { color: #5A6072; font-size: 13px; }
.mapbox .fz-f { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #E3DED3; }
.mapbox .fz-f:first-of-type { border-top: 0; }
.mapbox .fz-f .pill { flex: none; font-size: 12px; padding: 4px 10px; min-width: 56px; text-align: center; margin: 2px 0 0; }
.mapbox .fz-f .t { font-weight: 700; color: #23293A; }
.mapbox .fz-f .b { font-size: 15px; line-height: 1.5; color: #2F3648; }
.mapbox .fz-f .b ul { margin: 4px 0 0; padding-left: 18px; }

@media (max-width: 640px) {
  .mapbox .mb-map { height: 340px; }
  .mapbox .mb-search { flex-direction: column; }
  .mapbox .mb-search button { width: 100%; }
  .mapbox .cta a.btn { box-sizing: border-box; width: 100%; margin-right: 0; justify-content: center; }
  .mapbox .mb-card dl { grid-template-columns: 1fr; gap: 0; }
  .mapbox .mb-card dd { margin-bottom: 8px; }
  .mapbox .mb-hint { white-space: normal; width: 80%; text-align: center; }
  .mapbox .fz-map { height: 400px; }
  .mapbox .fz-legend { max-width: 200px; }
  .mapbox .fz-legend .r span { display: none; }
}
