/* Habitatge a la Cerdanya · 11N
   Estètica del cartell de l'Assemblea Oberta Cerdanya: pissarra, vermell i groc.
   Mobile-first, sense dependències externes. Contrastos AA comprovats. */

@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue-latin.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue-latin-ext.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --pissarra: #26313b;   /* fons del cartell */
  --pissarra-2: #1d262e;
  --groc: #f4d35e;       /* 9,6:1 sobre pissarra */
  --vermell: #c0392b;    /* blocs amb text blanc: 5,4:1 */
  --vermell-text: #a52a1e; /* text vermell sobre crema: 6,2:1 */
  --crema: #fbf3e6;
  --crema-2: #f3e7d2;
  --ink: #1b1b1b;
  --ink-2: #4b443b;
  --line: #d9ccb4;
  --ok: #1d6b3a;
  --focus: #1a56c4;
  --radius: 14px;
  --pill: 999px;
  --max: 70rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;
  --display: "Bebas Neue", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  /* escala del mapa (seqüencial) */
  --q1: #fbe3d6; --q2: #f3b597; --q3: #e2775a; --q4: #c03b2c; --q5: #7f1018;
  --q-none: #ddd6c7;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--crema); color: var(--ink); font: 1.125rem/1.6 var(--font); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--vermell-text); text-underline-offset: .15em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.salta { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.salta:focus { left: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { line-height: 1; margin: 1.6em 0 .45em; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; }
h1 { font-size: clamp(2.8rem, 11vw, 5.2rem); margin-top: .5em; }
h2 { font-size: clamp(2rem, 7vw, 2.9rem); }
h3 { font-size: 1.2rem; line-height: 1.25; }
p, li { max-width: 44em; }

/* ---------- capçalera ---------- */
.cap { background: var(--pissarra); color: #fff; position: sticky; top: 0; z-index: 5; border-bottom: 3px solid var(--vermell); }
.cap .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding-top: .55rem; padding-bottom: .55rem; }
.marca { color: #fff; text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: .6rem; line-height: 1; }
.marca b { font: 400 2.1rem/1 var(--display); color: var(--groc); letter-spacing: .02em; }
.marca span { font-weight: 800; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; max-width: 9rem; }
.menu-btn { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 2px solid var(--groc); color: var(--groc); font: 700 .95rem var(--font); padding: .3rem 1rem; border-radius: var(--pill); cursor: pointer; min-height: 44px; }
.nav { width: 100%; display: none; }
.nav.obert { display: block; }
.nav ul { list-style: none; margin: .4rem 0 .6rem; padding: 0; display: grid; gap: 2px; }
.nav a { display: block; color: #fff; text-decoration: none; padding: .7rem .4rem; border-bottom: 1px solid #ffffff1f; font-weight: 700; font-size: .95rem; letter-spacing: .03em; text-transform: uppercase; }
.nav a[aria-current="page"] { color: var(--groc); }
@media (min-width: 64rem) {
  .menu-btn { display: none; }
  .nav { display: block; width: auto; }
  .nav ul { display: flex; gap: .1rem; margin: 0; }
  .nav a { border: 0; padding: .45rem .55rem; font-size: .8rem; }
  .nav a:hover { color: var(--groc); }
}

/* ---------- portada ---------- */
.hero { background: var(--pissarra); color: #fff; padding: 2.2rem 0 2.6rem; position: relative; overflow: hidden; }
.hero::before { /* textura de pissarra, molt suau */
  content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 7px 7px;
}
.hero .wrap { position: relative; display: grid; gap: 1.5rem; }
@media (min-width: 56rem) { .hero .wrap { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.hero .data { display: inline-block; justify-self: start; margin: 0; background: var(--groc); color: var(--pissarra); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; padding: .35rem .9rem; border-radius: var(--pill); }
.hero h1 { margin: .8rem 0 .3rem; color: #fff; }
.hero .consigna { font: 400 clamp(1.7rem, 6vw, 2.4rem)/1 var(--display); color: var(--groc); margin: 0 0 1rem; letter-spacing: .02em; }
.hero p { font-size: 1.15rem; margin: 0 0 1.4rem; color: #e9edf0; }
.hero .entrada { font-size: 1.25rem; max-width: 38rem; }
.manifest { margin: 0 0 2rem; padding: 1.2rem 1.4rem; border-left: 6px solid var(--vermell); background: var(--crema-2); }
.manifest p { font-size: 1.15rem; font-style: italic; margin: 0 0 .6rem; }
.manifest footer { font-size: .9rem; }

.hero .onze { font: 400 clamp(7rem, 30vw, 12rem)/.85 var(--display); color: var(--vermell); margin: 0; letter-spacing: -.01em; }
.hero .compte { display: flex; align-items: center; gap: 1rem; background: var(--pissarra-2); border: 2px solid #ffffff22; border-radius: var(--radius); padding: .9rem 1.2rem; margin-top: .8rem; max-width: 22rem; }
.compte .n { font: 400 3.6rem/1 var(--display); color: var(--groc); }
.compte .t { font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; line-height: 1.35; }

/* franja en moviment */
.franja { background: var(--vermell); color: #fff; overflow: hidden; white-space: nowrap; border-block: 3px solid var(--pissarra); }
.franja div { display: inline-block; padding: .55rem 0; font: 400 1.6rem/1 var(--display); letter-spacing: .06em; animation: franja 40s linear infinite; }
.franja span { color: var(--groc); padding: 0 .6rem; }
@keyframes franja { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.xifres { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 2rem 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .xifres { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .xifres { grid-template-columns: repeat(4, 1fr); } }
.xifra { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.1rem 1.1rem .9rem; display: flex; flex-direction: column; box-shadow: 5px 5px 0 var(--pissarra); max-width: none; }
.xifra:nth-child(2) { box-shadow: 5px 5px 0 var(--vermell); }
.xifra:nth-child(3) { box-shadow: 5px 5px 0 var(--groc); }
.xifra .n { font: 400 clamp(3.4rem, 14vw, 4.2rem)/.95 var(--display); color: var(--vermell-text); }
.xifra .t { font-weight: 650; margin: .4rem 0 .7rem; line-height: 1.35; }
.xifra .f { margin-top: auto; font-size: .82rem; color: var(--ink-2); line-height: 1.4; }

.boto {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.4rem; border-radius: var(--pill);
  background: var(--pissarra); color: #fff; font: 800 1rem var(--font); text-decoration: none; border: 2px solid var(--pissarra); cursor: pointer;
}
a.boto::after { content: "→"; }
.boto:hover { background: var(--vermell); border-color: var(--vermell); }
.boto.clar { background: transparent; color: var(--ink); border-color: var(--ink); }
.boto.clar:hover { background: var(--ink); color: #fff; }
.hero .boto { background: var(--groc); color: var(--pissarra); border-color: var(--groc); }
.hero .boto:hover { background: #fff; border-color: #fff; }
.hero .boto.clar { background: transparent; color: #fff; border-color: #fff; }
.hero .boto.clar:hover { background: #fff; color: var(--pissarra); }
.accions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0; }

.cerca { background: var(--pissarra); color: #fff; border-radius: var(--radius); padding: 1.2rem; margin: 1.5rem 0; }
.cerca label { display: block; font: 400 1.8rem/1 var(--display); color: var(--groc); margin-bottom: .6rem; letter-spacing: .02em; }
.cerca .fila { display: flex; flex-wrap: wrap; gap: .6rem; }
.cerca .boto { background: var(--groc); color: var(--pissarra); border-color: var(--groc); }
select, input[type="text"], input[type="email"], textarea {
  font: inherit; font-size: 1.05rem; padding: .6rem .9rem; min-height: 48px; border: 2px solid var(--ink-2); border-radius: var(--pill); background: #fff; color: var(--ink); max-width: 100%;
}
.cerca select { flex: 1 1 14rem; border-color: #fff; }

/* ---------- estat de les dades ---------- */
.estat { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: .05rem .5rem; border-radius: var(--pill); vertical-align: .1em; white-space: nowrap; text-transform: uppercase; }
.estat.verificat { background: #dcefe2; color: var(--ok); }
.estat.pendent { background: #fbe8c8; color: #8a4b00; }

/* ---------- taules ---------- */
.taula-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
caption { text-align: left; padding: .8rem .9rem; font: 400 1.5rem/1 var(--display); letter-spacing: .02em; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--pissarra); color: #fff; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
tfoot th, tfoot td { font-weight: 800; background: var(--crema-2); }
tr.destacat th, tr.destacat td { font-weight: 800; background: var(--groc); color: var(--pissarra); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fdf8ef; }

/* ---------- mapa ---------- */
.capes { border: 0; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.capes legend { font-weight: 800; margin-bottom: .4rem; width: 100%; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.capes label { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--pill); padding: .4rem 1rem; min-height: 44px; cursor: pointer; font-weight: 700; font-size: .95rem; }
.capes input { accent-color: var(--vermell); width: 1.1rem; height: 1.1rem; }
.capes label:has(input:checked) { background: var(--pissarra); color: #fff; border-color: var(--pissarra); }
.mapa-wrap { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: .6rem; }
.mapa svg { display: block; width: 100%; height: auto; }
.mapa a path { stroke: #fff; stroke-width: 1.6; transition: opacity .15s; }
.mapa a:hover path, .mapa a:focus path { stroke: var(--pissarra); stroke-width: 4; }
.mapa a:focus { outline: none; }
.mapa text { font: 700 17px var(--font); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.llegenda { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; font-size: .9rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.llegenda li { display: inline-flex; align-items: center; gap: .35rem; }
.llegenda i { width: 1.1rem; height: 1.1rem; border-radius: 4px; display: inline-block; border: 1px solid #0003; }
.info-capa { font-size: .92rem; color: var(--ink-2); }

/* ---------- fitxa ---------- */
.fitxa-cap { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.dades { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .dades { grid-template-columns: 1fr 1fr; } }
.dada { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: .9rem 1.1rem; max-width: none; }
.dada:first-child { background: var(--pissarra); color: #fff; border-color: var(--pissarra); }
.dada:first-child .val { color: var(--groc); }
.dada:first-child .comp, .dada:first-child .font { color: #d7dde2; }
.dada:first-child a { color: var(--groc); }
.dada .etq { font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.dada .val { font: 400 2.8rem/1 var(--display); margin: .25rem 0; color: var(--vermell-text); }
.dada .comp { font-size: .9rem; color: var(--ink-2); }
.dada .font { font-size: .8rem; color: var(--ink-2); margin-top: .5rem; }
.barra { height: .75rem; background: #ffffff2a; border-radius: var(--pill); overflow: hidden; margin: .5rem 0 .3rem; }
.barra span { display: block; height: 100%; background: var(--groc); border-radius: var(--pill); }

/* ---------- blocs de text ---------- */
.avis { background: #fff; border: 2px solid var(--ink); border-left: 10px solid var(--groc); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0; }
.nota { font-size: .92rem; color: var(--ink-2); }
details { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); margin: .7rem 0; overflow: hidden; }
summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 800; min-height: 44px; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 1.8rem/1 var(--display); color: var(--vermell-text); }
details[open] summary::after { content: "–"; }
details > div { padding: 0 1.1rem 1rem; }
details[open] summary { border-bottom: 2px solid var(--crema-2); margin-bottom: .6rem; }
.cronologia { list-style: none; padding: 0; margin: 1rem 0; border-left: 4px solid var(--vermell); }
.cronologia li { position: relative; padding: 0 0 1.2rem 1.2rem; }
.cronologia li::before { content: ""; position: absolute; left: -11px; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--groc); border: 3px solid var(--pissarra); }
.cronologia time { font: 400 1.5rem/1.1 var(--display); display: block; letter-spacing: .02em; }
.targetes { list-style: none; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 48rem) { .targetes { grid-template-columns: 1fr 1fr; } }
.targetes li { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 1rem 1.1rem; max-width: none; }
.targetes .meta { font-size: .85rem; color: var(--ink-2); }

/* ---------- assemblea (cartell + dades) ---------- */
.assemblea { display: grid; gap: 1.2rem; align-items: center; background: var(--pissarra); color: #fff; border-radius: var(--radius); padding: 1.2rem; margin: 2rem 0; }
.assemblea img { width: 100%; max-width: 22rem; border-radius: 8px; justify-self: center; box-shadow: 6px 6px 0 var(--vermell); }
.assemblea h2 { margin-top: 0; color: var(--groc); }
.assemblea a { color: var(--groc); }
.assemblea .mini { font: 400 1.6rem/1 var(--display); color: var(--vermell-text); background: var(--groc); display: inline-block; padding: .3rem .7rem .2rem; border-radius: 6px; letter-spacing: .03em; }
@media (min-width: 44rem) { .assemblea { grid-template-columns: minmax(0, 20rem) 1fr; padding: 1.6rem; } }

/* ---------- peu ---------- */
.peu { background: var(--pissarra); color: #e6eaed; margin-top: 3rem; padding: 2.2rem 0; font-size: .93rem; border-top: 6px solid var(--vermell); }
.peu a { color: var(--groc); }
.peu p { margin: .35rem 0; }
.peu strong { font: 400 1.7rem/1 var(--display); color: #fff; letter-spacing: .02em; }

main { padding-bottom: 1rem; }
.mini { font-size: .85rem; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .franja div { animation: none; }
}

/* ---------- impressió (fitxa A4) ---------- */
@page { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.4; }
  .cap, .no-print, .salta, .menu-btn, .franja, .compte, .onze { display: none !important; }
  .hero { background: #fff; color: #000; padding: 0; border-bottom: 3pt solid var(--vermell); }
  .wrap { max-width: none; padding: 0; }
  h1 { font-size: 30pt; margin-top: 0; }
  h2 { font-size: 18pt; margin-top: 1em; }
  a { color: #000; text-decoration: none; }
  .xifra, .dada, .taula-wrap, details, .targetes li { box-shadow: none; border-width: 1pt; }
  .dades { grid-template-columns: 1fr 1fr; gap: 6pt; }
  .dada { break-inside: avoid; padding: 6pt 8pt; }
  .dada:first-child { background: #fff; color: #000; border-color: #000; }
  .dada:first-child .val { color: var(--vermell-text); }
  .dada:first-child .comp, .dada:first-child .font { color: #333; }
  .barra { background: #eee; }
  .barra span { background: var(--vermell); }
  .dada .val { font-size: 20pt; }
  .taula-wrap { overflow: visible; }
  thead th { background: #eee; color: #000; }
  th, td { padding: 3pt 5pt; }
  .assemblea { background: #fff; color: #000; break-inside: avoid; }
  .assemblea h2, .assemblea a { color: #000; }
  .assemblea img { max-width: 45mm; box-shadow: none; }
  .peu { background: #fff; color: #000; margin-top: 10pt; padding: 6pt 0 0; border-top: 1pt solid #000; font-size: 8.5pt; }
  .peu a, .peu strong { color: #000; }
  .print-url::after { content: " (" attr(href) ")"; font-size: 8pt; }
}
@media (max-width: 55.99rem) { .hero .onze { display: none; } .hero .compte { margin-top: 0; } }
