/* Les normes, a DESIGN.md: sempre clar, lletra de 20 px, un sol color de marca. */
:root {
  --bg: #fff; --ink: #1a1a18; --muted: #4d4d47; --line: #cfcfc6; --soft: #f3f3ee;
  --accent: #0b6e4f; --accent-dark: #08573e; --accent-ink: #fff;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 20px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-wrap: anywhere; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
header, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Capçalera i peu */
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; text-decoration: none; color: var(--ink); padding: 8px 0; }
.lang { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 99px; font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
footer { margin-top: 56px; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); }

/* Text */
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 24px 0 8px; text-wrap: balance; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 40px 0 14px; text-wrap: balance; }
.lead { margin: 12px 0; }
.updated, .crumbs, footer { color: var(--muted); font-size: .9rem; }
.updated { margin: 0 0 20px; }
.crumbs { margin-top: 12px; }
.crumbs a { display: inline-block; padding: 8px 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }

/* Botó */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 32px; padding: 8px 16px; background: var(--bg); color: var(--accent); border: 2px solid var(--accent); border-radius: 12px; font-weight: 700; text-decoration: none; }
.btn:hover, .btn:active { background: var(--soft); }

/* Calendari: cada festiu en una fila; les festes locals amb la vora de marca, els passats en gris */
.cal { display: grid; gap: 6px; }
.cal li { display: flex; flex-direction: column; min-height: 56px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 12px; }
.cal .d::first-letter { text-transform: uppercase; }
.cal .d { color: var(--muted); font-size: .9rem; }
.cal li.loc { border: 2px solid var(--accent); }
/* Passats: fons soft i text muted (7,6 de contrast), no transparència, que baixava el text per sota d'AA */
.cal li.past { background: var(--soft); border-color: var(--line); }
.cal li.past b { color: var(--muted); font-weight: 600; }
/* El pròxim (o el d'avui), com l'hora d'ara de la llum: vora de 3 px. La paraula «el pròxim» és a la data. */
.cal li.next { border: 3px solid var(--accent); }
.cal li.next .d { color: var(--ink); font-weight: 600; }

/* Llistes de municipis i comarques (com a la gasolina) */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.links a, .row { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.links a { font-weight: 600; }
a.row:hover, .links a:hover, a.row:active, .links a:active { border-color: var(--accent); color: var(--ink); }
.rows { display: grid; gap: 8px; }
.row small { color: var(--muted); font-size: .9rem; }

/* Buscador */
.find { display: block; margin: 24px 0 14px; font-weight: 700; }
.find input { display: block; width: 100%; min-height: 56px; margin-top: 8px; padding: 0 16px; background: var(--bg); color: var(--ink); border: 2px solid var(--muted); border-radius: 12px; font: inherit; }
.empty { color: var(--muted); }
