/* landdata.es — consolidated stylesheet, served as a static public asset (bypasses the Astro/Vite
   scoped-style pipeline, which mangles paths on this Windows/non-C: setup). Global class names;
   each is distinctive so there are no collisions. "Slate + Terracotta" register, theme-aware. */

:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-alt: #eef1f5;
  --border: #d7dce2;
  --text: #14181d;
  --muted: #5a626c;
  --primary: #1f6a6f;
  --primary-deep: #0d3f43;
  --accent: #c0532b;
  --accent-hover: #9e4423;
  --good: #0f7a52;
  --warn: #b3801a;
  --bad: #c23b3b;
  --focus: #ffcf33;
  --maxw: 1000px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20,24,29,.05), 0 4px 16px rgba(20,24,29,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1317; --surface: #171c22; --surface-alt: #1e242b; --border: #2b333c;
    --text: #eaeef2; --muted: #9aa4b0; --primary: #4fb3b8; --primary-deep: #8fd6d9;
    --accent: #e0703f; --accent-hover: #ef8256; --focus: #ffd84d;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px; line-height: 1.55; color: var(--text); background: var(--bg);
  font-variant-numeric: tabular-nums;
}
main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); letter-spacing: -0.02em; margin: 0 0 .4em; line-height: 1.1; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 1.8em 0 .6em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
a { color: var(--primary); text-underline-offset: 2px; }
small { color: var(--muted); }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: slashed-zero tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
  padding: .65em 1.2em; border: 0; border-radius: var(--radius); cursor: pointer; font-size: 1rem; transition: background .15s; }
.btn:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3,1fr); } }

.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .num { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat .lbl { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.pill { display: inline-block; padding: .2em .6em; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill-bad  { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pill-neutral { background: var(--surface-alt); color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: .5em .6em; border-bottom: 1px solid var(--border); }
table.data th { font-weight: 600; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; width: 45%; }
.scroll-x { overflow-x: auto; }

/* header / footer (Base) */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { max-width: var(--maxw); margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 1.1rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-footer { max-width: var(--maxw); margin: 2rem auto 0; padding: 1.5rem 1.25rem 3rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }
.foot-links { margin: 0 0 1rem; }
.foot-links a { color: var(--muted); }
.attrib p { margin: .25em 0; }
.attrib .disc { margin-top: .8rem; }

/* home (index) */
.hero { text-align: center; padding: 2rem 0 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--accent); font-weight: 700; margin: 0 0 .8rem; }
.lede { font-size: 1.15rem; max-width: 42rem; margin: 1rem auto 1.8rem; color: var(--text); }
.search { display: flex; gap: .5rem; max-width: 34rem; margin: 0 auto; }
.search input { flex: 1; font-size: 1.05rem; padding: .75em 1em; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.search input:focus { border-color: var(--primary); outline: none; }
.search .btn { white-space: nowrap; }
.hint { font-size: .85rem; margin: .6rem 0 0; }
.examples { margin: 1.8rem auto 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; max-width: 44rem; }
.ex-chip { text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4em .9em; font-size: .88rem; color: var(--text); }
.ex-chip small { color: var(--muted); }
.ex-chip:hover { border-color: var(--primary); }
.ex-chip.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.why { margin-top: 2.5rem; }
.why h3 { margin-top: 0; }
.why p { margin: 0; font-size: .95rem; }
.sources-teaser { margin-top: 2rem; text-align: center; font-size: .92rem; }
@media (max-width: 560px) { .search { flex-direction: column; } }

/* report (Report component) */
.report { margin-top: 1rem; }
.rep-head { margin-bottom: 1.2rem; }
.rep-head h1 { margin: 0; }
.report .sub { margin: .4rem 0 0; font-size: .95rem; }
.hero-stat { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.hero-stat .stat { gap: .4rem; }
.hero-stat .num { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; color: var(--primary-deep); }
.hero-stat .lbl { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.5rem; min-width: 260px; }
.mini { display: flex; flex-direction: column; }
.mini .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mini .v { font-weight: 600; }
.radius-stats .num { font-size: 1.8rem; font-weight: 700; color: var(--primary-deep); }
.radius-stats .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.radius-stats hr { border: 0; border-top: 1px solid var(--border); margin: .9rem 0; }
.range { margin: .3rem 0 0; font-size: .9rem; }
.small { font-size: .85rem; }
.note { margin: .6rem 0 0; }
.method { margin-top: 1.2rem; }

/* informe (SSR) */
.search-top { display: flex; gap: .5rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.search-top input { flex: 1; min-width: 12rem; font-size: 1rem; padding: .6em .85em; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.search-top select { font-size: 1rem; padding: .6em; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.msg { margin: 1.5rem 0; }

/* cómo-funciona */
.steps { margin: 1.5rem 0 1rem; }
.steps .card { position: relative; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: .5rem; }
.steps h3 { margin: .2rem 0 .4rem; }
.steps p { margin: 0; font-size: .92rem; }
.carve { line-height: 1.6; }
.carve li { margin: .5rem 0; }
.cta { margin-top: 2rem; }

/* mini-map + sparkline: canonical rules mirror @landdata/core/report.css (keep UK + ES identical) */
.map-card { margin-bottom: 1rem; }
.mini-map { width: 100%; height: auto; max-height: 240px; display: block; background: var(--surface-alt); border-radius: var(--radius); }
.mini-map polygon { fill: color-mix(in srgb, var(--primary) 16%, transparent); stroke: var(--primary); stroke-width: 1.5; }
.mini-map .pt { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.live-map { width: 100%; height: 260px; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); }
.live-map .mini-map { height: 260px; max-height: none; }
.leaflet-container { font: inherit; background: var(--surface-alt); }

.trends { margin-top: 1rem; }
.spark-wrap { margin: .4rem 0 .5rem; }
.spark { width: 100%; height: auto; display: block; overflow: visible; }
.spark polyline { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .dot-now { fill: var(--accent); stroke: #fff; stroke-width: 1.2; }
.spark .dot-hi  { fill: var(--primary-deep); }
.spark .dot-lo  { fill: var(--muted); }
.axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.trend-line { margin: .2rem 0 0; font-size: .9rem; }
.trend-line .hi { color: var(--primary-deep); }
.trend-line .lo { color: var(--muted); }
.dem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.2rem; margin: .7rem 0 .4rem; }

/* ejemplos */
.crumb { font-size: .85rem; color: var(--muted); margin: .3rem 0 1rem; }
.intro { margin-bottom: 1.2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.intro p { margin: 0; flex: 1; min-width: 16rem; }
.more { margin-top: 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
