/**
 * Fitxa de dades del municipi (inc/muni-ficha.php). Reutilitza les variables --hm-* de
 * css/localidades.css (sistema blau marí / atzur de les landings). Tot penja de .hf.
 */

body.hsm-location-landing .hf {
  --hf-wrap: 1120px;
  --hf-narrow: 720px;
  --hf-gutter: 32px;
  --hf-sec-y: 88px;
  --hf-r: 14px;
  --hf-r-lg: 20px;
  --hf-shadow: 0 4px 12px rgba(10, 30, 60, .08), 0 2px 4px rgba(10, 30, 60, .05);
  --hf-shadow-lg: 0 24px 60px rgba(10, 30, 60, .35), 0 4px 10px rgba(10, 30, 60, .18);
  --hf-cta: linear-gradient(135deg, var(--hm-azure, #2E9BFF), var(--hm-azure-dark, #1E6FD0));
  --hf-display: 'Aptos Display', 'Outfit', -apple-system, sans-serif;
  font-family: 'Aptos', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--hm-ink, #0F2A52);
  line-height: 1.6;
}
@media (max-width: 899px) {
  body.hsm-location-landing .hf { --hf-gutter: 16px; --hf-sec-y: 56px; }
}
body.hsm-location-landing .hf *, body.hsm-location-landing .hf *::before, body.hsm-location-landing .hf *::after { box-sizing: border-box; }
.hf-wrap { max-width: var(--hf-wrap); margin: 0 auto; padding: 0 var(--hf-gutter); }
.hf-narrow { max-width: calc(var(--hf-narrow) + 2 * var(--hf-gutter)); }
.hf-flush { padding: 0; margin: 0; }
.hf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hf-sec { padding: var(--hf-sec-y) 0; background: var(--hm-bg-white, #fff); }
.hf-alt { background: var(--hm-bg-light, #F4F8FD); }
body.hsm-location-landing .hf p { margin: 0 0 14px; color: var(--hm-ink-body, #3A5070); font-size: 16px; }
body.hsm-location-landing .hf .hf-h2 {
  font-family: var(--hf-display); font-weight: 700; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15;
  letter-spacing: -.01em; color: var(--hm-ink, #0F2A52); margin: 0 0 20px;
}
body.hsm-location-landing .hf .hf-h3 { font-family: var(--hf-display); font-size: 20px; margin: 0 0 12px; color: var(--hm-ink, #0F2A52); }
.hf-muted, body.hsm-location-landing .hf .hf-muted { color: var(--hm-ink-muted, #5C7394); font-size: 14px; }
.hf-cap, body.hsm-location-landing .hf .hf-cap { font-size: 13px; color: var(--hm-ink-muted, #5C7394); margin-top: 8px; }
body.hsm-location-landing .hf .hf-src { font-size: 12.5px; color: var(--hm-ink-muted, #5C7394); margin: 12px 0 0; }

/* ---------- Hero ---------- */
.hf-hero {
  /* sense overflow: hidden, que tallaria la llista d'adreces suggerides */
  position: relative; color: #fff;
  padding: 40px 0 72px;
  background:
    radial-gradient(70% 60% at 12% 10%, rgba(46, 155, 255, .20) 0%, rgba(46, 155, 255, 0) 60%),
    radial-gradient(60% 55% at 90% 15%, rgba(91, 178, 255, .12) 0%, rgba(91, 178, 255, 0) 65%),
    linear-gradient(160deg, var(--hm-navy-deep, #07152B) 0%, var(--hm-navy, #0A1E3C) 55%, var(--hm-navy-mid, #0F2A52) 100%);
}
.hf-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
}
.hf-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: start; }
.hf-crumbs { font-size: 13px; color: #A6BAD6; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.hf-crumbs a { color: #A6BAD6; text-decoration: none; }
.hf-crumbs a:hover { color: #fff; text-decoration: underline; }
.hf-crumb-sep { opacity: .6; }
body.hsm-location-landing .hf .hf-h1 {
  font-family: var(--hf-display); font-weight: 700; color: #fff; margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.1; letter-spacing: -.015em;
}
body.hsm-location-landing .hf .hf-h1 span { color: var(--hm-azure-bright, #5BB2FF); }
body.hsm-location-landing .hf .hf-hero-sub { color: #C7D7EE; font-size: 16.5px; max-width: 600px; margin: 0 0 28px; }
body.hsm-location-landing .hf .hf-hero-sub strong { color: #fff; }
.hf-big { font-family: var(--hf-display); font-weight: 700; font-size: clamp(64px, 10vw, 120px); line-height: .95; letter-spacing: -.03em; color: #fff; }
.hf-big-l { font-size: 22px; font-weight: 600; color: #fff; margin-top: 4px; }
body.hsm-location-landing .hf .hf-big-src { font-size: 13px; color: #A6BAD6; margin: 8px 0 26px; text-decoration: underline dotted rgba(166,186,214,.5); text-underline-offset: 3px; }
.hf-kpis { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; }
.hf-kpis div { min-width: 0; }
.hf-kpis dt { font-family: var(--hf-display); font-size: 28px; font-weight: 700; color: #fff; line-height: 1.1; }
.hf-kpis dd { margin: 2px 0 0; font-size: 13px; color: #A6BAD6; }

/* Targeta "Gratis" */
.hf-card {
  background: #fff; color: var(--hm-ink, #0F2A52); border-radius: var(--hf-r-lg);
  padding: 28px 28px 22px; box-shadow: var(--hf-shadow-lg);
}
.hf-card-badge { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid #D5E4F5; margin-bottom: 18px; }
.hf-card-badge img { width: 112px; height: auto; display: block; }
.hf-card-badge strong { display: block; font-family: var(--hf-display); font-size: 30px; line-height: 1; color: var(--hm-ink, #0F2A52); }
.hf-card-badge span { display: block; font-size: 12.5px; color: var(--hm-ink-muted, #5C7394); margin-top: 3px; }
body.hsm-location-landing .hf .hf-card-h { font-family: var(--hf-display); font-size: 21px; line-height: 1.25; margin: 0 0 8px; color: var(--hm-ink, #0F2A52); }
body.hsm-location-landing .hf .hf-card-p { font-size: 14px; margin: 0 0 16px; }
.hf-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13px; }
.hf-card-foot a { color: var(--hm-azure-dark, #1E6FD0); font-weight: 600; text-decoration: none; }
.hf-card-foot a:hover { text-decoration: underline; }
.hf-stars { color: var(--hm-ink-muted, #5C7394); }
.hf-stars span { color: #F5B342; letter-spacing: 1px; }

/* Formulari */
.hf-modes { display: flex; gap: 6px; margin-bottom: 10px; }
body.hsm-location-landing .hf .hf-mode {
  border: 1px solid #D5E4F5; background: #fff; color: var(--hm-ink-body, #3A5070);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; line-height: 1.2;
}
body.hsm-location-landing .hf .hf-mode.is-on { background: var(--hm-ink, #0F2A52); border-color: var(--hm-ink, #0F2A52); color: #fff; }
.hf-field { display: flex; flex-direction: column; gap: 10px; }
body.hsm-location-landing .hf .hf-field input {
  width: 100%; min-height: 50px; border: 1px solid #CBDAF0; border-radius: 10px; padding: 12px 14px;
  font-size: 16px; color: var(--hm-ink, #0F2A52); background: #fff;
}
body.hsm-location-landing .hf .hf-field input:focus { outline: 3px solid rgba(46,155,255,.35); border-color: var(--hm-azure, #2E9BFF); }

/* Autocompletat d'adreces (ficha.js) */
.hf-ac { position: relative; }
.hf-ac-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none; background: #fff;
  border: 1px solid #CBDAF0; border-radius: 10px; box-shadow: var(--hf-shadow-lg);
  max-height: 300px; overflow-y: auto; text-align: left;
}
.hf-ac-list[hidden] { display: none; }
.hf-ac-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.hf-ac-list li.is-active, .hf-ac-list li:hover { background: #EAF3FF; }
.hf-ac-main { font-size: 14.5px; font-weight: 600; color: var(--hm-ink, #0F2A52); }
.hf-ac-sub { font-size: 12.5px; color: var(--hm-ink-muted, #5C7394); }
.hf-ac-list li.hf-ac-none { cursor: default; color: var(--hm-ink-muted, #5C7394); font-size: 14px; }
.hf-ac-list li.hf-ac-none:hover { background: none; }
body.hsm-location-landing .hf .hf-btn {
  min-height: 50px; border: 0; border-radius: 10px; background: var(--hf-cta); color: #fff;
  font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 8px 22px rgba(46,155,255,.32);
  transition: transform 140ms, box-shadow 140ms;
}
body.hsm-location-landing .hf .hf-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(46,155,255,.42); }

/* ---------- Gràfics ---------- */
.hf-fig { margin: 24px 0 8px; }
.hf-fig figcaption { font-size: 13px; color: var(--hm-ink-muted, #5C7394); margin-top: 6px; }
.hf-chart { width: 100%; height: auto; display: block; overflow: visible; }
.hf-chart .hf-grid { stroke: #E3ECF8; stroke-width: 1; }
.hf-chart .hf-ax { fill: #7890B0; font-size: 12px; }
.hf-chart .hf-area { fill: rgba(30, 111, 208, .10); }
.hf-chart .hf-line { fill: none; stroke: var(--hm-azure-dark, #1E6FD0); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.hf-chart .hf-dot { fill: var(--hm-azure-dark, #1E6FD0); stroke: #fff; stroke-width: 2; }
.hf-chart .hf-val { fill: var(--hm-ink, #0F2A52); font-size: 14px; font-weight: 700; }
.hf-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; margin: 22px 0 4px; }
.hf-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.hf-bar-v { font-size: 12.5px; font-weight: 700; color: var(--hm-ink, #0F2A52); white-space: nowrap; }
.hf-bar-col { display: flex; align-items: flex-end; width: 100%; height: 140px; background: #EEF4FB; border-radius: 6px; overflow: hidden; }
.hf-bar-fill { display: block; width: 100%; background: linear-gradient(180deg, #5BB2FF, #1E6FD0); border-radius: 6px 6px 0 0; }
.hf-bar-l { font-size: 11.5px; color: #7890B0; white-space: nowrap; }
.hf-bars-fire .hf-bar-col { height: 70px; }
.hf-bars-fire .hf-bar-fill { background: linear-gradient(180deg, #F5B342, #E5484D); }
.hf-table { margin: 14px 0 0; }
.hf-table summary { cursor: pointer; color: var(--hm-azure-dark, #1E6FD0); font-weight: 600; font-size: 14px; }
.hf-table table { margin-top: 10px; border-collapse: collapse; font-size: 14px; min-width: 220px; }
.hf-table th, .hf-table td { padding: 5px 16px 5px 0; border-bottom: 1px solid #E3ECF8; text-align: left; }
.hf-table td + td, .hf-table th + th { text-align: right; }

/* ---------- Preu ---------- */
.hf-price-big { font-family: var(--hf-display); font-size: clamp(44px, 6vw, 64px); font-weight: 700; line-height: 1; color: var(--hm-ink, #0F2A52); }
.hf-price-big span { font-size: .45em; color: var(--hm-ink-muted, #5C7394); }
body.hsm-location-landing .hf .hf-price-l { margin: 8px 0 10px; }
.hf-price-split { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--hm-ink-body, #3A5070); }
.hf-price-split li { padding: 2px 0; }
.hf-bars-price .hf-bar-l { font-size: 11px; }

/* ---------- Riscos ---------- */
.hf-risks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.hf-risk { background: #fff; border: 1px solid #D5E4F5; border-radius: var(--hf-r); padding: 24px; box-shadow: var(--hf-shadow); display: flex; flex-direction: column; }
.hf-risk header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
body.hsm-location-landing .hf .hf-risk h3 { font-family: var(--hf-display); font-size: 21px; margin: 0; color: var(--hm-ink, #0F2A52); }
.hf-badge { flex: none; font-size: 12px; font-weight: 700; color: var(--hm-ink, #0F2A52); background: #EAF3FF; border: 1px solid rgba(46,155,255,.35); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
body.hsm-location-landing .hf .hf-risk p { font-size: 15px; }
.hf-list { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: var(--hm-ink-body, #3A5070); }
.hf-list li { margin: 2px 0; }
body.hsm-location-landing .hf .hf-note { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--hm-ink-muted, #5C7394); }
body.hsm-location-landing .hf .hf-note::before { content: 'ⓘ '; }

/* ---------- Banda CTA ---------- */
.hf-cta { padding: 72px 0; color: #fff; background: linear-gradient(160deg, var(--hm-navy, #0A1E3C) 0%, var(--hm-navy-mid, #0F2A52) 100%); }
.hf-cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; align-items: center; }
body.hsm-location-landing .hf .hf-cta-h { font-family: var(--hf-display); color: #fff; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; margin: 0 0 14px; }
body.hsm-location-landing .hf .hf-cta-h span { color: var(--hm-azure-bright, #5BB2FF); }
body.hsm-location-landing .hf.hf-cta p { color: #C7D7EE; }
.hf-checks { list-style: none; margin: 16px 0 0; padding: 0; }
.hf-checks li { position: relative; padding-left: 28px; margin: 8px 0; color: #fff; font-size: 15px; }
.hf-checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: rgba(46,155,255,.25); color: #5BB2FF; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hf-cta-form { background: #fff; border-radius: var(--hf-r-lg); padding: 24px; box-shadow: var(--hf-shadow-lg); }

/* ---------- Preguntes, propers, membres, fonts ---------- */
.hf-faq details { border-bottom: 1px solid #D5E4F5; padding: 16px 0; }
.hf-faq summary { cursor: pointer; font-weight: 700; font-size: 17px; color: var(--hm-ink, #0F2A52); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.hf-faq summary::-webkit-details-marker { display: none; }
.hf-faq summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--hm-azure-dark, #1E6FD0); }
.hf-faq details[open] summary::after { content: '−'; }
body.hsm-location-landing .hf .hf-faq p { margin: 10px 0 0; }
.hf-near { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hf-near a, .hf-near div { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: #fff; border: 1px solid #D5E4F5; border-radius: 12px; text-decoration: none; color: var(--hm-ink, #0F2A52); height: 100%; }
.hf-near a:hover { border-color: var(--hm-azure, #2E9BFF); box-shadow: var(--hf-shadow); }
.hf-near strong { font-size: 16px; }
.hf-near span { font-size: 13px; color: var(--hm-ink-muted, #5C7394); }
.hf-members { list-style: none; margin: 20px 0 0; padding: 0; columns: 3 220px; column-gap: 24px; font-size: 14.5px; }
.hf-members li { break-inside: avoid; padding: 4px 0; border-bottom: 1px dotted #D5E4F5; display: flex; }
.hf-members li span { margin-left: auto; color: var(--hm-ink-muted, #5C7394); font-size: 13px; padding-left: 8px; }
.hf-members a { color: var(--hm-azure-dark, #1E6FD0); text-decoration: none; display: flex; width: 100%; }
.hf-members a:hover { text-decoration: underline; }
.hf-sources { padding: 48px 0; }
.hf-sources ul { margin: 0 0 14px; padding-left: 18px; font-size: 14px; color: var(--hm-ink-body, #3A5070); }
body.hsm-location-landing .hf.hf-sources p { font-size: 13.5px; color: var(--hm-ink-muted, #5C7394); margin-bottom: 6px; }

/* ---------- Mòbil ---------- */
@media (max-width: 899px) {
  .hf-hero { padding: 24px 0 40px; }
  .hf-hero-grid, .hf-cta-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hf-card { padding: 22px 20px 18px; }
  .hf-risks { grid-template-columns: minmax(0, 1fr); }
  .hf-near { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hf-kpis { gap: 12px 28px; }
  .hf-kpis dt { font-size: 24px; }
  .hf-bars { gap: 4px; }
  .hf-bars-price .hf-bar-v { font-size: 10px; }
  .hf-bars-price .hf-bar-l { font-size: 9.5px; }
  .hf-bars-fire .hf-bar-l { font-size: 10px; }
}
@media (max-width: 480px) {
  .hf-near { grid-template-columns: minmax(0, 1fr); }
  .hf-bars-price .hf-bar-v { writing-mode: vertical-rl; transform: rotate(180deg); }
}
