/* ---------- State of Democracy Observatory ---------- */
.obs-hero { background: var(--azul-profundo); }
.obs-hero .display { max-width: 16ch; }

/* Map stage */
.stage { background: var(--azul-profundo); color: #fff; padding: 0 0 72px; }
.stage__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.14); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: rgba(255,255,255,.82); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; display: inline-block; }
.legend .l-none { background: #1B3570; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.legend .l-data { background: var(--azul-medio); }
.legend .l-art { width: 10px; height: 10px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 0 3px rgba(176,141,60,.35); }

.country-search { position: relative; }
.country-search input {
  width: min(320px, 80vw); font: inherit; font-size: 15px; padding: 10px 14px 10px 40px; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 0; outline: 0;
}
.country-search input::placeholder { color: rgba(255,255,255,.6); }
.country-search input:focus { border-color: #fff; background: rgba(255,255,255,.12); }
.country-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: rgba(255,255,255,.7); }
.suggest { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: #fff; color: var(--tinta); list-style: none; margin: 4px 0 0; padding: 4px 0; max-height: 280px; overflow: auto; box-shadow: 0 12px 32px rgba(11,37,89,.25); }
.suggest li { padding: 8px 14px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--azul-suave); color: var(--azul-ycdi); }
.suggest small { color: var(--tinta-suave); }

.stage__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: stretch; }
.mapbox { position: relative; min-height: 520px; background: radial-gradient(ellipse at 50% 45%, rgba(34,84,197,.22), transparent 70%); border: 1px solid rgba(255,255,255,.1); overflow: hidden; }
.mapbox svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.mapbox svg:active { cursor: grabbing; }
.graticule { fill: none; stroke: rgba(255,255,255,.06); stroke-width: .5; }
.sphere { fill: rgba(255,255,255,.015); stroke: rgba(255,255,255,.12); stroke-width: .8; }
.country { fill: #1B3570; stroke: var(--azul-profundo); stroke-width: .35; transition: fill .2s; vector-effect: non-scaling-stroke; }
.country.has-data { fill: var(--azul-medio); }
.country:hover, .country.is-hover { fill: #6E9BEA; }
.country.is-active { fill: #fff; }
.dot { fill: var(--oro); stroke: rgba(176,141,60,.35); pointer-events: none; vector-effect: non-scaling-stroke; }
.dot-pulse { fill: none; stroke: var(--oro); pointer-events: none; animation: pulse 2.6s var(--ease) infinite; transform-box: fill-box; transform-origin: center; vector-effect: non-scaling-stroke; }
@keyframes pulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
@media (prefers-reduced-motion: reduce) { .dot-pulse { animation: none; opacity: 0; } }

.map-ctrl { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.map-ctrl button { width: 40px; height: 40px; background: rgba(11,37,89,.9); color: #fff; border: 1px solid rgba(255,255,255,.25); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.map-ctrl button:hover { background: var(--azul-ycdi); }
.map-hint { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: rgba(255,255,255,.6); letter-spacing: .02em; pointer-events: none; }

/* Tooltip */
.tip {
  position: fixed; z-index: 60; pointer-events: none; width: 280px;
  background: #fff; color: var(--tinta); box-shadow: 0 16px 40px rgba(11,37,89,.35);
  border-top: 4px solid var(--azul-ycdi); padding: 16px 18px; opacity: 0; transform: translateY(6px);
  transition: opacity .15s, transform .15s;
}
.tip.is-on { opacity: 1; transform: none; }
.tip h4 { margin: 0 0 4px; font-size: 18px; line-height: 1.25; font-weight: 700; }
.tip .tip__region { font-size: 12px; color: var(--tinta-suave); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.tip dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0 0; font-size: 13px; }
.tip dt { color: var(--tinta-suave); }
.tip dd { margin: 0; font-weight: 700; text-align: right; }
.tip .tip__cta { margin-top: 12px; font-size: 12px; color: var(--azul-medio); font-weight: 600; }

/* Side panel */
.panel { background: #fff; color: var(--tinta); display: flex; flex-direction: column; max-height: 720px; min-height: 520px; overflow: hidden; }
.panel__head { padding: 24px 24px 20px; border-bottom: var(--filete) solid var(--azul-medio); position: relative; }
.panel__head h3 { font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--azul-profundo); }
.panel__close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: 0; background: var(--superficie-alt); color: var(--tinta); display: grid; place-items: center; }
.panel__close svg { width: 18px; height: 18px; }
.panel__body { padding: 20px 24px 24px; overflow: auto; flex: 1; }
.panel__sec { padding: 18px 0; border-bottom: 1px solid var(--linea); }
.panel__sec:last-child { border-bottom: 0; }
.panel__sec h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--azul-medio); font-weight: 700; }
.panel__sec p { margin: 0; font-size: 15px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--superficie-alt); padding: 14px; }
.kpi b { display: block; font-size: 26px; font-weight: 800; color: var(--azul-ycdi); line-height: 1.1; }
.kpi span { display: block; font-size: 12px; color: var(--tinta-suave); margin-top: 4px; line-height: 1.35; }
.meter { height: 8px; background: var(--azul-suave); position: relative; margin: 10px 0 6px; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--azul-ycdi); transition: width .6s var(--ease); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--tinta-suave); }
.src { font-size: 11px; color: var(--tinta-suave); margin-top: 8px; line-height: 1.4; }
.mini-art { display: block; padding: 12px 0; border-bottom: 1px solid var(--linea); color: var(--tinta); }
.mini-art:last-child { border-bottom: 0; }
.mini-art:hover { text-decoration: none; }
.mini-art:hover strong { color: var(--azul-ycdi); }
.mini-art strong { display: block; font-size: 15px; line-height: 1.35; }
.mini-art span { font-size: 12px; color: var(--tinta-suave); }
.panel__empty { color: var(--tinta-suave); font-size: 15px; }
.panel__intro .kpis { margin-top: 20px; }
.panel ul.plain { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.panel ul.plain li { padding: 4px 0; }

@media (max-width: 1000px) {
  .stage__grid { grid-template-columns: 1fr; }
  .mapbox { min-height: 0; aspect-ratio: 16 / 10; }
  .panel { max-height: none; min-height: 0; }
}

/* Articles */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px 32px; }
.art { display: flex; flex-direction: column; color: var(--tinta); }
.art:hover { text-decoration: none; }
.art .ph { aspect-ratio: 16 / 10; margin-bottom: 20px; transition: transform .5s var(--ease); }
.art:hover .ph { transform: scale(1.015); }
.art__meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; color: var(--tinta-suave); margin-bottom: 10px; }
.art h3 { font-size: 22px; line-height: 1.3; font-weight: 700; margin-bottom: 10px; transition: color .2s; }
.art:hover h3 { color: var(--azul-ycdi); }
.art p { margin: 0 0 14px; color: var(--tinta-suave); font-size: 15px; }
.art__by { font-size: 13px; font-weight: 600; margin-top: auto; }
.art-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.art-empty { padding: 56px 32px; text-align: center; background: var(--superficie-alt); }

/* Sources / method */
.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px; background: var(--linea); border: 2px solid var(--linea); }
.method > div { background: #fff; padding: 28px; }
.method h3 { font-size: 18px; margin-bottom: 8px; color: var(--azul-profundo); }
.method p { margin: 0 0 12px; font-size: 15px; color: var(--tinta-suave); }
.method a { font-size: 14px; font-weight: 600; }

/* Submit CTA */
.submit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
@media (max-width: 760px) { .submit { grid-template-columns: 1fr; } }

/* Article page */
.article-hero .display { font-size: clamp(36px, 5vw, 64px); max-width: 20ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; color: rgba(255,255,255,.85); font-size: 14px; }
.article-meta b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; margin-bottom: 2px; }
.prose { max-width: 70ch; margin: 0 auto; font-family: var(--font-serif); font-size: 19px; line-height: 1.75; color: var(--tinta); }
.prose h2 { font-family: var(--font-display); font-size: 28px; margin: 48px 0 16px; color: var(--azul-profundo); }
.prose h3 { font-family: var(--font-display); margin: 32px 0 12px; }
.prose p { margin: 0 0 22px; }
.prose a { color: var(--azul-medio); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--azul-ycdi); font-style: italic; font-size: 24px; line-height: 1.45; color: var(--azul-profundo); }
.prose blockquote:first-child { font-style: normal; font-size: 15px; font-family: var(--font-display); border-left-color: var(--oro); background: var(--superficie-alt); padding: 14px 18px; color: var(--tinta-suave); }
.prose blockquote p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }
.prose img { margin: 32px 0; }
.prose em:last-child { color: var(--tinta-suave); font-size: 16px; }
.article-foot { max-width: 70ch; margin: 56px auto 0; padding-top: 24px; border-top: var(--filete) solid var(--azul-medio); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* Coming soon notices */
.soon { margin-top: 20px; padding: 24px; background: var(--superficie-alt); border-left: 3px solid var(--azul-ycdi); }
.soon h4 { margin: 12px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--azul-profundo); letter-spacing: 0; text-transform: none; }
.soon p { margin: 0; font-size: 15px; color: var(--tinta-suave); }
.soon__badge { display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #fff; background: var(--azul-ycdi); padding: 4px 10px; }
.tip__soon { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--azul-medio); }
.legend[hidden] { display: none; }
.stage__bar:has(.legend[hidden]) { justify-content: flex-end; }
.method__sources { grid-column: 1 / -1; }
.method__sources > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 32px; }
