/* Horta Sud — full d'estils compartit */
:root {
  --paper: #f3f4ef;
  --paper-2: #e8ebe3;
  --card: #fbfbf8;
  --ink: #1b2420;
  --ink-2: #4b5650;
  --ink-3: #6e7872;
  --line: #cdd3c7;
  --sequia: #1c6770;
  --sequia-soft: #d6e7e7;
  --terra: #8f5f22;
  --terra-soft: #efe2cc;
  --alerta: #a3372a;
  --alerta-soft: #f3dcd6;
  --ok: #3f6b2f;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121714; --paper-2: #1a211d; --card: #18201c;
    --ink: #e5e9e2; --ink-2: #b0b9b2; --ink-3: #8a948d; --line: #2f3a34;
    --sequia: #6db8bf; --sequia-soft: #183236; --terra: #d7a35e; --terra-soft: #33281a;
    --alerta: #e4806c; --alerta-soft: #3a1f1a; --ok: #9cc58a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121714; --paper-2: #1a211d; --card: #18201c;
  --ink: #e5e9e2; --ink-2: #b0b9b2; --ink-3: #8a948d; --line: #2f3a34;
  --sequia: #6db8bf; --sequia-soft: #183236; --terra: #d7a35e; --terra-soft: #33281a;
  --alerta: #e4806c; --alerta-soft: #3a1f1a; --ok: #9cc58a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sequia); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--sequia); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 800; font-stretch: 78%; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 750; font-stretch: 80%; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 88%; }
h4 { font-size: 1.02rem; font-weight: 700; font-stretch: 92%; }
p { margin: 0; }
.prose > * + * { margin-top: 0.9em; }
.prose { max-width: var(--measure); }
.lede { font-size: clamp(1.12rem, 1.8vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.eyebrow {
  font-family: var(--display); font-stretch: 100%; font-weight: 600;
  font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.mono { font-family: var(--mono); font-size: 0.86em; }
.num { font-variant-numeric: tabular-nums; }
/* Partida names echo the brown italic toponyms of the ICGC topographic map */
.toponim { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--terra); }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; margin-bottom: clamp(24px, 4vw, 40px); max-width: 64ch; }
.stack { display: grid; gap: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1000;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 1.35rem; line-height: 1; letter-spacing: 0.01em; }
.brand-sub { display: block; font-family: var(--display); font-weight: 500; font-stretch: 100%; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  font-family: var(--display); font-weight: 600; font-stretch: 92%; font-size: 0.95rem;
  color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius);
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--sequia); box-shadow: inset 0 -2px 0 var(--sequia); border-radius: 0; }
.nav-toggle {
  display: none; font-family: var(--display); font-weight: 600; font-size: 0.95rem;
  background: none; border: 1px solid var(--line); color: var(--ink); padding: 7px 12px; border-radius: var(--radius); cursor: pointer;
}
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 14px; flex-direction: column; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: none; }
}

/* ---------- Page intro ---------- */
.page-intro { padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); }
.page-intro .wrap { display: grid; gap: 16px; }

/* ---------- Figures & credits ---------- */
figure { margin: 0; }
figcaption, .credit { font-family: var(--display); font-stretch: 100%; font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); margin-top: 8px; }
.credit { margin-top: 0; }
.ph { background: var(--paper-2); border-radius: var(--radius); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Fitxa (register-style data rows) ---------- */
.fitxa { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; border-top: 1px solid var(--line); font-size: 0.95rem; }
.fitxa dt, .fitxa dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fitxa dt { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); padding-right: 16px; padding-top: 11px; }
.fitxa dd { font-variant-numeric: tabular-nums; }

/* ---------- Chips / tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; font-stretch: 95%;
  font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px;
  background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
}
.tag.epa { background: var(--terra-soft); color: var(--terra); }
.tag.bpu { background: var(--sequia-soft); color: var(--sequia); }
.tag.alert { background: var(--alerta-soft); color: var(--alerta); }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-weight: 650; font-stretch: 92%; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 12px; white-space: nowrap; }
tr.total td { font-weight: 700; border-bottom: 2px solid var(--ink); }

/* ---------- Callouts ---------- */
.posicio {
  border-left: 3px solid var(--sequia); padding: 4px 0 4px 20px; max-width: var(--measure);
}
.posicio .eyebrow { color: var(--sequia); display: block; margin-bottom: 6px; }
.font {
  font-family: var(--display); font-stretch: 100%; font-size: 0.82rem; color: var(--ink-3); line-height: 1.5;
  border-top: 1px solid var(--line); padding-top: 12px; max-width: 80ch;
}
.font strong { color: var(--ink-2); font-weight: 600; }
.avis { background: var(--paper-2); padding: 14px 18px; border-radius: var(--radius); font-size: 0.95rem; max-width: var(--measure); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 650; font-stretch: 92%; font-size: 1rem;
  padding: 10px 16px; border-radius: var(--radius); text-decoration: none; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--sequia); border-color: var(--sequia); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--sequia); color: #fff; }
.more { font-family: var(--display); font-weight: 650; font-stretch: 92%; text-decoration: none; }
.more::after { content: " →"; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.timeline .who { font-family: var(--display); font-size: 0.8rem; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Maps ---------- */
.map { height: clamp(380px, 62vh, 620px); border: 1px solid var(--line); border-radius: var(--radius); background: #f2f1ec; z-index: 0; }
.leaflet-container { font-family: var(--display); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.leaflet-popup-content { margin: 12px 14px; font-size: 0.9rem; line-height: 1.4; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--card) 85%, transparent) !important; color: var(--ink-3); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-bar a { background: var(--card); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--paper-2); }
.map-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.map-switch button { font-family: var(--display); font-weight: 600; font-size: 0.86rem; border: 0; background: transparent; color: var(--ink-2); padding: 7px 12px; cursor: pointer; }
.map-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pin {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.3);
}
.pin.sq { border-radius: 2px; transform: rotate(45deg); width: 14px; height: 14px; }
.map-label { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #1b2420; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--display); font-size: 0.85rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.sw.line { width: 22px; height: 0; border-radius: 0; border: 0; border-top: 3px solid; box-shadow: none; }
.sw.poly { border-radius: 2px; width: 14px; height: 12px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--ink); margin-top: 0; padding-block: 40px 56px; background: var(--paper-2); }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; font-size: 0.93rem; }
.site-footer h4 { margin-bottom: 8px; }
.site-footer p { color: var(--ink-2); }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-btn { font-family: var(--display); font-size: 0.8rem; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: var(--radius); padding: 3px 8px; cursor: pointer; }
.copy-btn:hover { color: var(--ink); border-color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Inici ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-img { max-height: 460px; overflow: hidden; background: var(--paper-2); }
.hero-img img { width: 100%; height: clamp(220px, 36vw, 460px); object-fit: cover; object-position: center 58%; }
.hero-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding-block: clamp(28px, 4vw, 48px) 12px; align-items: end; }
.hero-text { display: grid; gap: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.hero-credit { padding-bottom: 20px; }
.keyfigs { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.keyfigs > div { display: grid; grid-template-columns: 6.8rem 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.keyfigs dt { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 1.9rem; line-height: 1; color: var(--sequia); }
.keyfigs dd { margin: 0; font-size: 0.92rem; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 860px) { .hero-body { grid-template-columns: 1fr; } }

.partida-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 24px; }
.pcard { display: grid; gap: 8px; text-decoration: none; color: var(--ink); align-content: start; }
.pcard .ph { aspect-ratio: 3 / 2; }
.pcard img { transition: transform .4s ease; }
.pcard:hover img { transform: scale(1.03); }
.pcard h3 { font-size: 1.5rem; margin-top: 6px; }
.pcard p { font-size: 0.97rem; color: var(--ink-2); line-height: 1.5; }
.pmeta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.03em; }

.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.now { display: grid; gap: 12px; align-content: start; }
.now .ph { aspect-ratio: 16 / 9; background: var(--card); border: 1px solid var(--line); }
.now .ph img { object-fit: contain; background: #fff; }
.now p { color: var(--ink-2); }
.now-stat { display: grid; align-content: center; gap: 16px; padding: 24px; }
.now-stat .big { font-family: var(--display); font-weight: 800; font-stretch: 72%; font-size: 4.2rem; line-height: 0.9; color: var(--ink); margin-right: 10px; }
.now-stat > div:first-child { display: flex; align-items: flex-end; gap: 6px; font-family: var(--display); color: var(--ink-2); font-size: 1rem; max-width: 30ch; }
.bars { display: flex; height: 14px; gap: 2px; }
.bars i { display: block; border-radius: 1px; }
.b-tram { background: var(--terra); } .b-aut { background: var(--alerta); } .b-serv { background: var(--ink-2); }

.feature { background: var(--paper-2); }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.feature-img { background: transparent; }
.feature-img img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 800px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Partides ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 1.15rem; }
.jump a { text-decoration: none; }
.jump a:hover { text-decoration: underline; }
.map-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.partida { scroll-margin-top: 72px; }
.partida-grid2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.partida-grid2 > .stack { max-width: var(--measure); }
.big-top { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; }
.partida h3 { margin-top: 10px; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.facts li { padding-left: 16px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--terra); border-radius: 1px; }
.gallery { display: grid; gap: 10px; }
.g2 { grid-template-columns: 1fr 1fr; }
.gallery .ph { aspect-ratio: 4 / 3; }
.gallery .span2 { grid-column: span 2; }
.gallery .ph.span2 { aspect-ratio: 16 / 10; }
.partida figure.ph + figcaption, .partida > .wrap > figure.ph img { border-radius: var(--radius); }
@media (max-width: 860px) { .partida-grid2 { grid-template-columns: 1fr; } }

/* ---------- Patrimoni ---------- */
.filters { display: grid; gap: 12px; }
.fgroup { display: grid; grid-template-columns: 5.5rem 1fr; gap: 10px; align-items: start; }
.fgroup .eyebrow { padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--display); font-weight: 600; font-stretch: 95%; font-size: 0.9rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 560px) { .fgroup { grid-template-columns: 1fr; gap: 6px; } .fgroup .eyebrow { padding-top: 0; } }
.count { font-family: var(--display); font-weight: 600; color: var(--ink-2); }
.atlas { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.atlas .map { height: clamp(420px, 70vh, 680px); }
.detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(70vh + 60px); overflow-y: auto; position: sticky; top: 80px; }
.detail:focus { outline: none; }
.d-photo { aspect-ratio: 16 / 10; border-radius: 0; }
.d-body { padding: 18px 20px 22px; display: grid; gap: 12px; font-size: 0.97rem; }
.d-body h3 { font-size: 1.6rem; font-stretch: 80%; }
.d-code { color: var(--ink-3); }
.d-body .toponim { font-size: 1.05rem; }
.d-body .fitxa { font-size: 0.9rem; }
.d-orto .ph { aspect-ratio: 290 / 264; max-width: 260px; }
@media (max-width: 960px) { .atlas { grid-template-columns: 1fr; } .detail { position: static; max-height: none; } }
.pin { transition: transform .15s ease; }
.is-sel .pin { transform: scale(1.5); box-shadow: 0 0 0 2px #1b2420, 0 2px 8px rgba(0,0,0,.4); }
.is-sel .pin.sq { transform: rotate(45deg) scale(1.5); }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; }
.scard { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 4px; align-content: start; color: var(--ink); }
.scard .ph { aspect-ratio: 4 / 3; margin-bottom: 6px; }
.scard strong { font-family: var(--display); font-stretch: 88%; font-size: 1.12rem; line-height: 1.15; }
.scard .mono { color: var(--ink-3); font-size: 0.74rem; }
.scard .toponim { font-size: 0.95rem; }
.scard-meta { font-size: 0.86rem; color: var(--ink-2); line-height: 1.35; }
.scard .tags { margin-top: 4px; }
.scard:hover strong { color: var(--sequia); }
.scard:focus-visible { outline: 2px solid var(--sequia); outline-offset: 4px; }
.scard[aria-current="true"] .ph { box-shadow: 0 0 0 3px var(--ink); }
.qp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.qp-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
.qp-gallery .ph { aspect-ratio: 4 / 3; }
@media (max-width: 900px) { .qp-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .qp-gallery { grid-template-columns: 1fr; } }
.gloss { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 32px; }
.gloss > div { display: grid; gap: 8px; align-content: start; }
.gloss dd { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* ---------- Torreblanca ---------- */
.tb-intro { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr) !important; gap: clamp(24px, 5vw, 64px) !important; align-items: end; }
.tb-fitxa { font-size: 0.92rem; }
@media (max-width: 860px) { .tb-intro { grid-template-columns: 1fr !important; } }
.tb-map img, .tb-fases img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tb-fases { max-width: 900px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(24px, 5vw, 56px); align-items: start; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.steps li::marker { font-family: var(--display); font-weight: 700; color: var(--sequia); }
table.cmp td:first-child { font-weight: 600; width: 22%; }
table.cmp td { width: 39%; }
table { min-width: 560px; }

/* ---------- Energia ---------- */
.estat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.estat-row > div { display: grid; gap: 4px; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); font-family: var(--display); color: var(--ink-2); font-size: 0.92rem; line-height: 1.3; }
.estat-row .big { font-weight: 800; font-stretch: 72%; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { accent-color: var(--sequia); }
#ptable td { font-size: 0.92rem; }

/* ---------- Associació ---------- */
.as-intro { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) !important; gap: clamp(24px, 5vw, 56px) !important; align-items: end; }
.as-photo { background: transparent; }
.as-photo img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 860px) { .as-intro { grid-template-columns: 1fr !important; } }
.aims { margin: 0; padding: 0; list-style: none; counter-reset: a; border-top: 2px solid var(--ink); }
.aims li { counter-increment: a; display: grid; grid-template-columns: 2.4rem 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.aims li::before { content: counter(a); font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 1.4rem; color: var(--sequia); line-height: 1.1; }
.memoria { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 14px; }
.memoria .ph { aspect-ratio: 4 / 3; }
.memoria .m-wide { grid-column: span 2; }
.memoria .m-wide .ph { aspect-ratio: 16 / 9; }
@media (max-width: 860px) { .memoria { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .memoria { grid-template-columns: 1fr; } .memoria .m-wide { grid-column: auto; } }
.intro-img { margin-top: 18px; }
.intro-img .ph { aspect-ratio: 16 / 7; }
.intro-img img { object-position: center 55%; }
.aims-img { aspect-ratio: 16 / 9; margin-top: 8px; }
.brand-logo { height: 50px; width: auto; flex: none; }
@media (max-width: 480px) { .brand-logo { height: 42px; } }

/* ---------- Limonium ---------- */
.lim-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.lim-map { height: clamp(360px, 58vh, 540px); }
@media (max-width: 900px) { .lim-grid { grid-template-columns: 1fr; } }

/* Etiquetes de partida al mapa: cursiva com els topònims */
.partida-lbl span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 15px; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff, 0 0 6px #fff; }
.toggle-row { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--display); font-size: 0.85rem; color: var(--ink-2); }

/* ---------- Intermodal ---------- */
.im-plan { overflow-x: auto; }
.im-plan img { width: 100%; min-width: 760px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Aire i boira ---------- */
:root { --smoke: #6b3f22; --c-wind: #008c9e; --c-city: #c43b2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --smoke: #f0b27a; --c-wind: #14a3b4; --c-city: #e8654f; } }
:root[data-theme="dark"] { --smoke: #f0b27a; --c-wind: #14a3b4; --c-city: #e8654f; }
.air-stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 2px solid var(--ink); }
.air-stats > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.air-stats dt { font-family: var(--display); font-weight: 800; font-stretch: 72%; font-size: 2.5rem; line-height: 1; color: var(--ink); }
.air-stats dd { margin: 0; font-family: var(--display); font-size: 0.92rem; color: var(--ink-2); line-height: 1.35; }
.sim-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sim-ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sim-ctrl .btn { padding: 7px 12px; font-size: 0.9rem; }
.sim-ctrl select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.sim-wrap { position: relative; }
.sim-map { height: clamp(440px, 72vh, 700px); }
.sim-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 450; }
.sim-hud { position: absolute; top: 12px; right: 12px; z-index: 800; width: min(270px, calc(100% - 70px)); background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; font-family: var(--display); box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.hud-time { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-stretch: 85%; font-size: 1.1rem; }
.hud-time span:last-child { font-family: var(--mono); font-size: 1rem; color: var(--ink-2); }
.hud-wind { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.hud-wind > div { display: grid; font-size: 0.85rem; color: var(--ink-2); line-height: 1.3; }
.hud-wind strong { font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-bars { display: grid; gap: 8px; font-size: 0.8rem; color: var(--ink-2); }
.hud-bars > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.hud-bars b { font-variant-numeric: tabular-nums; color: var(--ink); }
.hud-bars i { grid-column: 1 / -1; display: block; height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.hud-bars em { display: block; height: 100%; width: 0; background: var(--smoke); border-radius: 3px; transition: width .3s; }
@media (max-width: 640px) { .sim-hud { position: static; width: auto; margin-top: 10px; box-shadow: none; } .sim-map { height: 420px; } }
.place-lbl span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: 13px; color: #1b2420; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 2px; border: 1px solid rgba(0,0,0,.15); }
.roses { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; max-width: 900px; }
.rose { display: grid; gap: 8px; justify-items: center; }
.rose figcaption { display: grid; text-align: center; font-family: var(--display); }
.rose figcaption strong { font-size: 1.15rem; font-stretch: 88%; color: var(--ink); }
.rose figcaption span { font-size: 0.85rem; color: var(--ink-3); }
.rose svg { width: 100%; max-width: 340px; height: auto; overflow: visible; }
.rose-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.rose-tick { font-family: var(--mono); font-size: 9px; fill: var(--ink-3); }
.rose-card { font-family: var(--display); font-weight: 700; font-size: 12px; fill: var(--ink-2); text-anchor: middle; }
.petal { fill: var(--c-wind); stroke: var(--paper); stroke-width: 2; }
.petal.hot { fill: var(--c-city); }
.petal:hover { opacity: .8; }
.rose-hub { fill: var(--paper); stroke: var(--line); }
.rose-calm { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); text-anchor: middle; }
.rose-note { font-family: var(--display); font-size: 0.9rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rose-note b { color: var(--ink); }
.rose-hot-key { width: 12px; height: 12px; border-radius: 2px; background: var(--c-city); display: inline-block; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.q blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; line-height: 1.5; color: var(--ink); border-left: 3px solid var(--line); padding-left: 16px; }
.q figcaption { padding-left: 19px; }
/* Seveso */
.sv-hero img { width: 100%; height: auto; border-radius: var(--radius); filter: grayscale(1) contrast(1.05); }
.sv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.sv-side { display: grid; gap: 20px; }
.sv-side img { width: 100%; max-width: 400px; height: auto; border-radius: var(--radius); filter: grayscale(1); }
.sv-dates { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; border-top: 2px solid var(--ink); }
.sv-dates li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding: 10px 0 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 0.97rem; }
.sv-dates b { font-family: var(--display); font-stretch: 80%; font-size: 1.15rem; color: var(--ink); }
.sv-picto { width: 56px; height: 56px; float: left; margin: 4px 14px 4px 0; border-radius: 2px; }
.sv-dist { margin-top: 18px; }
@media (max-width: 800px) { .sv-grid { grid-template-columns: 1fr; } }
/* Articles d'opinió */
.art-body h2 { margin-top: 1.8em; }
.art-quote { margin: 1.6em 0; padding: 0.9em 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.4; color: var(--ink); text-align: center; }
.art-sign { font-family: var(--display); font-weight: 700; color: var(--ink); }
.art-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 820px; }
.art-list a { display: grid; gap: 8px; padding: 22px 0; border-top: 2px solid var(--ink); color: inherit; text-decoration: none; }
.art-list a:hover h2 { color: var(--sequia); }
.art-list h2 { margin: 0; }
.art-list p { margin: 0; color: var(--ink-2); max-width: var(--measure); }
.home-opinio { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 24px; align-items: center; padding: 18px 22px; border-left: 4px solid var(--sequia); background: var(--paper-2); border-radius: var(--radius); color: inherit; text-decoration: none; }
.home-opinio strong { font-family: var(--display); font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.25; color: var(--ink); }
.home-opinio:hover strong { color: var(--sequia); }
@media (max-width: 700px) { .home-opinio { grid-template-columns: 1fr; } }
.doc-cap { margin: 1.6em 0; }
.doc-cap .doc-img { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.doc-cap .doc-img + .doc-img { margin-top: 8px; }
.doc-cap img { display: block; width: 100%; min-width: 520px; height: auto; }
.doc-cap .doc-tag { display: inline-block; font-family: var(--display); font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sequia); margin-bottom: 6px; }
.art-body .doc-cap { width: min(1000px, calc(100vw - 2 * var(--gutter))); max-width: none; }
.art-body .doc-cap.narrow { width: min(560px, calc(100vw - 2 * var(--gutter))); }
.doc-cap.narrow img { min-width: 0; }
/* Simulació: aire sobre la ciutat (18/10/2026) */
.hud-city { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-size: 0.8rem; line-height: 1.25; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 9px; }
.hud-city b { font-size: 1.7rem; font-weight: 800; font-stretch: 85%; color: var(--c-city); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.hud-ep { margin: 0; font-size: 0.78rem; line-height: 1.3; color: var(--ink-2); }
.hud-ep:empty { display: none; }
/* Captures de documents a les pàgines temàtiques (18/10/2026) */
.doc-cap.doc-wide { max-width: 1000px; }
.doc-cap.doc-wide .doc-img img[width="723"] { max-width: 723px; }

/* Compartir (18/10/2026) */
.share-sec { padding-top: 8px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; border-top: 2px solid var(--ink); padding-top: 16px; max-width: 820px; }
.share .eyebrow { margin: 0; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn, .share .copy-btn { font-family: var(--display); font-weight: 650; font-size: 0.92rem; line-height: 1.2; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; }
.share-btn:hover, .share .copy-btn:hover { border-color: var(--sequia); color: var(--sequia); }
.share-btn.share-wa { background: #1e7a46; border-color: #1e7a46; color: #fff; }
.share-btn.share-wa:hover { background: #17633a; border-color: #17633a; color: #fff; }
