/* ==========================================================================
   Medi Ambient · Ajuntament de Sant Just Desvern
   Full d'estils únic del web estàtic (mediambient.santjust.net)

   Índex
   1. Tipografia (Roboto allotjada al mateix servidor)
   2. Variables de disseny (colors, mides)
   3. Base i accessibilitat
   4. Capçalera: barra negra, banda gris, cercador i menú
   5. Banda de capçalera de pàgina (degradat blau-verd de l'original)
   6. Contingut: títols, targetes, imatges
   7. Components: desplegables, carrusel, notícies, accessos, enllaços
   8. Peu de pàgina
   9. Cercador (resultats)
   10. Avís de galetes i pàgines legals
   11. Adaptació a mòbil
   12. Impressió
   ========================================================================== */

/* 1. Tipografia ----------------------------------------------------------- */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/roboto-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/roboto-latin-700-normal.woff2") format("woff2"); }

/* 2. Variables ------------------------------------------------------------ */
:root {
  --c-black: #000;
  --c-band: #424242;          /* banda gris de la capçalera i peu (com l'original) */
  --c-band-dark: #333;
  --c-text: #232a25;
  --c-muted: #55615a;
  --c-head: #2b6439;          /* títols (verd fosc, a partir del verd de l'original) */
  --c-accent: #2e7448;        /* botons i detalls (contrast AA amb text blanc) */
  --c-accent-dark: #225a37;
  --c-teal: #8fd3e6;          /* blau del degradat original, només decoratiu */
  --c-green: #a6e3a8;         /* verd del degradat original, només decoratiu */
  --c-green-light: #b5e8b2;   /* subratllat del menú actiu i títols del peu */
  --c-pill: #dff2df;          /* botons d'accés de l'inici (verd pàl·lid de l'original) */
  --c-bg: #f2f7f3;            /* fons general verdós molt clar */
  --c-soft: #f4faf5;
  --c-card: #fff;
  --c-line: #d8e8dc;
  --c-link: #23653a;
  --c-focus: #ffbf47;
  --c-mark: #fff1a8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(30, 80, 45, .08);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: 400 1.0625rem/1.65 "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--c-accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--c-head); line-height: 1.22; margin: 0 0 .55em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li + li { margin-top: .35em; }
strong { font-weight: 700; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--c-focus); color: #000; padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.ico { width: 1em; height: 1em; fill: currentColor; flex: none; }
mark { background: var(--c-mark); color: inherit; padding: 0 .1em; border-radius: 3px; }

/* 4. Capçalera ------------------------------------------------------------ */
.topbar { background: var(--c-black); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand img { width: 34px; height: 34px; }
.social { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.social li + li { margin: 0; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; }
.social a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.social .ico { width: 17px; height: 17px; }

.band { background: var(--c-band); color: #fff; }
.band-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; }
.site-title { margin: 0; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 300; letter-spacing: -.015em; line-height: 1.15; color: #ececec; }
.site-title a { color: inherit; text-decoration: none; }
.site-title a:hover { color: #fff; }

.search { position: relative; flex: 0 1 400px; }
.search form { display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 0 8px 0 18px; height: 48px; }
.search .ico { width: 17px; height: 17px; color: #555; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: 0;
  font: inherit; font-size: 1rem; color: #222; padding: 0 10px;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search form:focus-within { box-shadow: 0 0 0 3px var(--c-focus); }
.search button[type="submit"] {
  border: 0; background: var(--c-accent); color: #fff; font: inherit; font-weight: 700; font-size: .9rem;
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.search button[type="submit"]:hover { background: var(--c-accent-dark); }
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  background: #fff; color: var(--c-text); border-radius: var(--radius-sm);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .3); padding: 6px; max-height: 70vh; overflow: auto;
}
.suggest ul { list-style: none; margin: 0; padding: 0; }
.suggest li + li { margin: 0; }
.suggest a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: inherit; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--c-soft); }
.suggest .s-sec { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-accent); font-weight: 700; }
.suggest .s-tit { display: block; font-weight: 700; color: var(--c-head); }
.suggest .s-snip { display: block; font-size: .88rem; color: var(--c-muted); line-height: 1.45; }
.suggest .s-all { font-weight: 700; color: var(--c-link); text-align: center; border-top: 1px solid var(--c-line); margin-top: 4px; }
.suggest .s-empty { padding: 12px; font-size: .95rem; color: var(--c-muted); }

.nav { margin-top: 18px; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0 22px; list-style: none; margin: 0; padding: 0; }
.nav li + li { margin: 0; }
.nav a {
  position: relative; display: block; padding: 10px 0 16px; color: #fff; text-decoration: none;
  font-weight: 700; font-size: .95rem; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  border-radius: 4px 4px 0 0; background: transparent; transition: background .15s;
}
.nav a:hover::after { background: rgba(255, 255, 255, .35); }
.nav a[aria-current="page"]::after { background: var(--c-green-light); }
.nav-tools { display: none; }

/* 5. Banda de capçalera de pàgina ----------------------------------------------
   Degradat blau → verd amb forma ondulada, com les capçaleres del web original. */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, #9dd7ea 0%, #a8dfd0 45%, #b4e8b4 100%);
  padding: clamp(28px, 4.5vw, 52px) 0 clamp(52px, 7vw, 92px);
  clip-path: ellipse(140% 100% at 50% 0%);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .22);
}
.hero::before { width: 420px; height: 420px; right: -80px; top: -140px; }
.hero::after { width: 300px; height: 300px; left: -120px; bottom: -150px; background: rgba(255, 255, 255, .16); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #1d4a2a; margin: 0; }
.hero .eyebrow { color: #2d4d37; }
.hero-text { margin-top: 18px; max-width: 980px; font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); font-weight: 300; color: #1f3326; line-height: 1.6; }
.hero-text p:last-child { margin-bottom: 0; }
.hero--home .hero-text { margin-top: 0; }


/* 6. Contingut -------------------------------------------------------------- */
main { display: block; }
.page-head { padding-top: clamp(30px, 5vw, 52px); padding-bottom: 8px; }
.page-head h1 { margin: 0; }
.section { padding-top: clamp(22px, 3.5vw, 36px); }
.card {
  background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(22px, 3.5vw, 40px);
}
.card > :last-child, .card-body > :last-child { margin-bottom: 0; }
.card h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); }
.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 3vw, 32px); align-items: start; }
.grid-2--even { grid-template-columns: 1fr 1fr; }
.grid-2--side { grid-template-columns: 1.7fr 1fr; }
.figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.figure img { width: 100%; }
.figure--plain { box-shadow: none; background: transparent; border-radius: 0; }
.lead { font-size: 1.12rem; }
.center { text-align: center; }
.symbol { width: 74px; margin: clamp(26px, 4vw, 40px) auto 0; }
.doc-link {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none;
  background: var(--c-soft); border: 1px solid var(--c-line); border-radius: 999px; padding: 9px 18px 9px 14px;
  margin: 0 0 1em;
}
.doc-link .ico { width: 18px; height: 18px; color: var(--c-accent); }
.doc-link:hover { background: #fff; border-color: var(--c-green-light); }
.ext-note { font-size: .82rem; color: var(--c-muted); }
.kicker { font-size: 1.12rem; font-weight: 500; color: var(--c-head); line-height: 1.5; }
.dash-list { list-style: none; padding: 0; }
.dash-list li { position: relative; padding-left: 1.2em; }
.dash-list li::before { content: "–"; position: absolute; left: 0; color: var(--c-accent); font-weight: 700; }
.float-img { float: right; width: min(42%, 220px); margin: 4px 0 12px 22px; border-radius: var(--radius-sm); }
.clear::after { content: ""; display: table; clear: both; }
.stack > * + * { margin-top: clamp(20px, 3vw, 28px); }

/* 7. Components ------------------------------------------------------------- */
/* Desplegables (Participació) */
.acc { border-radius: var(--radius-sm); background: var(--c-card); box-shadow: var(--shadow); }
.acc + .acc { margin-top: 12px; }
.acc summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; font-weight: 700; color: var(--c-head); font-size: 1.1rem; border-radius: var(--radius-sm);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: ""; flex: none; width: 12px; height: 12px; border-right: 3px solid var(--c-accent); border-bottom: 3px solid var(--c-accent);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s;
}
.acc[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.acc summary:hover { background: var(--c-soft); }
.acc-body { padding: 4px 22px 20px; }
.acc-body > :last-child { margin-bottom: 0; }
.acc-tools { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.btn-link { font: inherit; font-weight: 700; color: var(--c-link); background: none; border: 0; cursor: pointer; padding: 6px 4px; text-decoration: underline; text-underline-offset: .18em; }

/* 7b. Components propis de medi ambient ---------------------------------------- */
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; font-weight: 500; color: var(--c-muted); }
.split { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(20px, 3.5vw, 40px); align-items: start; }
.split--right { grid-template-columns: 1fr minmax(220px, 340px); }
.split .figure { position: sticky; top: 20px; }
.figure--wide img { aspect-ratio: 3 / 1; object-fit: cover; }
.figure--land img { aspect-ratio: 407 / 288; object-fit: cover; }
.ol-num { padding-left: 1.6em; }
.ol-num > li { padding-left: .2em; }
.ol-num > li::marker { color: var(--c-accent); font-weight: 700; }
.callout { background: var(--c-soft); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: 16px 20px; }
.callout > :last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .split, .split--right { grid-template-columns: 1fr; }
  .split .figure { position: static; max-width: 420px; }
  .split--right .figure { order: -1; }
    }


/* Menú amb submenús (Energia, Natura, Meteo) */
.nav .has-sub { position: relative; display: flex; align-items: stretch; }
.nav .sub-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 0 16px; margin: 0;
  font: inherit; font-weight: 700; font-size: .95rem; color: #fff; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav .sub-toggle--icon { padding-left: 6px; padding-right: 2px; }
.nav .sub-toggle .chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.nav .sub-toggle[aria-expanded="true"] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.nav .sub-toggle::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: transparent; transition: background .15s;
}
.nav .sub-toggle--icon::after { display: none; }
.nav .sub-toggle:hover::after { background: rgba(255, 255, 255, .35); }
.nav .is-current > a::after, .nav .is-current > .sub-toggle::after { background: var(--c-green-light); }
.nav .sub {
  position: absolute; top: 100%; left: -14px; z-index: 60; min-width: 280px; display: none; flex-direction: column; gap: 0;
  background: #fff; border-radius: var(--radius-sm); box-shadow: 0 18px 48px rgba(0, 0, 0, .28); padding: 8px;
}
.nav .sub.is-open { display: flex; }
.nav .sub a { color: var(--c-text); font-weight: 500; padding: 10px 12px; border-radius: 8px; white-space: normal; }
.nav .sub a::after { display: none; }
.nav .sub a:hover, .nav .sub a:focus-visible { background: var(--c-soft); color: var(--c-head); }
.nav .sub a[aria-current="page"] { background: var(--c-pill); color: var(--c-head); }
.nav .ext { width: 12px; height: 12px; margin-left: 6px; vertical-align: -1px; opacity: .65; }

/* Carrusel de fotos de l'inici (sense moviment automàtic) */
.carousel { position: relative; margin: 0; border-radius: 48% 48% 40% 40% / 30% 30% 24% 24%; overflow: hidden; box-shadow: var(--shadow); background: #dfe9e2; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track figure { flex: 0 0 100%; margin: 0; scroll-snap-align: start; position: relative; }
.carousel-track img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.carousel-track figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 62px; text-align: center;
  color: #fff; font-weight: 500; font-size: .95rem; background: linear-gradient(transparent, rgba(0, 0, 0, .6));
}
.carousel-ctrl { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; align-items: center; gap: 12px; }
.carousel-ctrl button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: var(--c-head); box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.carousel-ctrl button:hover { background: #fff; }
.carousel-ctrl .ico { width: 18px; height: 18px; }
.carousel-count { color: #fff; font-weight: 700; font-size: .9rem; min-width: 56px; text-align: center; background: rgba(0, 0, 0, .72); border-radius: 999px; padding: 4px 10px; }

/* Notícies de medi ambient (es llegeixen de comunicacio.santjust.net) */
.news-title { color: var(--c-head); }
.news { list-style: none; margin: 0 0 18px; padding: 0; }
.news li + li { margin-top: 12px; }
.news-item {
  display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start;
  background: var(--c-card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: border-color .15s, transform .15s;
}
.news-item:hover { border-color: var(--c-green); transform: translateY(-2px); color: inherit; }
.news-item img { width: 150px; height: 120px; object-fit: cover; border-radius: 8px; background: var(--c-line); }
.news-item .n-tit { display: block; font-weight: 700; color: var(--c-link); line-height: 1.35; margin-bottom: 4px; }
.news-item:hover .n-tit { text-decoration: underline; }
.news-item .n-exc { display: block; font-size: .92rem; color: var(--c-muted); line-height: 1.5; }
.news-item time { display: block; font-size: .8rem; color: var(--c-muted); margin-top: 6px; }
.news-item--noimg { grid-template-columns: 1fr; }
.news-status { color: var(--c-muted); font-size: .95rem; }

/* Accessos de l'inici (botons verds pàl·lids de l'original) */
.quick { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: clamp(20px, 4vw, 48px); align-items: center; }
.quick-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; justify-items: end; }
.quick-links li + li { margin: 0; }
.quick-links li:nth-child(2) { margin-right: 44px; }
.quick-links li:nth-child(3) { margin-right: 56px; }
.quick-links li:nth-child(4) { margin-right: 36px; }
.quick-links a {
  display: inline-flex; align-items: center; gap: 10px; padding: 18px 34px; text-decoration: none;
  background: var(--c-pill); color: #24452f; font-size: 1.1rem; font-weight: 500;
  border-radius: 28px 28px 28px 6px; box-shadow: var(--shadow); transition: background .15s, transform .15s;
}
.quick-links a:hover { background: #c9ebc9; transform: translateX(-3px); color: #1a3a24; }
.quick-links .ico { width: 16px; height: 16px; color: var(--c-accent); }
.blob { margin: 0; border-radius: 48% 48% 42% 42% / 36% 36% 30% 30%; overflow: hidden; box-shadow: var(--shadow); }
.blob img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; }

/* Llista d'enllaços d'interès */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.link-list li + li { margin: 0; }
.link-list a {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 18px; text-decoration: none; font-weight: 500;
  background: var(--c-soft); border: 1px solid var(--c-line); border-radius: var(--radius-sm); color: var(--c-link);
}
.link-list a:hover { background: #fff; border-color: var(--c-green); }
.link-list .ico { width: 18px; height: 18px; color: var(--c-accent); }

/* Blocs de dades: horaris, contactes */
.info-box { background: var(--c-soft); border-left: 5px solid var(--c-green); border-radius: var(--radius-sm); padding: 16px 20px; margin: 0 0 1em; }
.info-box > :last-child { margin-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contact-grid p { margin: 0; background: var(--c-soft); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: 16px 18px; }
.chart { margin: 0 0 1.2em; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: 10px; }
.chart img { width: 100%; }
.figure--flyer img { width: 100%; }
.figure--flyer a { display: block; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before { content: ""; position: absolute; left: 4px; top: .35em; width: 8px; height: 14px; border-right: 3px solid var(--c-accent); border-bottom: 3px solid var(--c-accent); transform: rotate(40deg); }
@media (max-width: 960px) {
  .nav .has-sub { flex-wrap: wrap; }
  .nav .has-sub > a { flex: 1; }
  .nav .sub-toggle { flex: 1; justify-content: space-between; padding: 12px 4px; border-top: 1px solid rgba(255, 255, 255, .12); white-space: normal; }
  .nav .sub-toggle--icon { flex: 0 0 auto; padding: 12px 14px; }
  .nav .sub-toggle::after { top: 10px; bottom: 10px; left: auto; right: 0; width: 5px; height: auto; border-radius: 4px; }
  .nav .sub { position: static; flex-basis: 100%; min-width: 0; box-shadow: none; background: rgba(255, 255, 255, .06); border-radius: 8px; margin: 0 0 8px; padding: 4px; }
  .nav .sub a { color: #fff; border-top: 0; padding: 10px 12px; }
  .nav .sub a:hover, .nav .sub a:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }
  .nav .sub a[aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .quick { grid-template-columns: 1fr; }
  .quick-links { justify-items: stretch; }
  .quick-links li:nth-child(n) { margin-right: 0; }
  .quick-links a { display: flex; justify-content: space-between; }
  .blob { max-width: 460px; }
  .link-list, .contact-grid { grid-template-columns: 1fr; }
  .carousel { max-width: 460px; }
}
@media (max-width: 520px) {
  .news-item { grid-template-columns: 96px 1fr; gap: 12px; }
  .news-item img { width: 96px; height: 96px; }
  .news-item .n-exc { display: none; }
}

/* 8. Peu ---------------------------------------------------------------------- */
.footer { background: var(--c-band); color: #e2e2e2; font-size: .93rem; }
.footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 0; padding: 0; }
.footer-col { padding: 34px 26px 30px; }
.footer-col + .footer-col { border-left: 1px solid #555; }
.footer-col:first-child { padding-left: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.footer h2 { color: var(--c-green-light); font-size: 1.15rem; font-weight: 500; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li + li { margin-top: 4px; }
.footer .social li + li { margin-top: 0; }
.footer address a { color: #fff; }
.footer .links a { text-decoration: none; }
.footer .links a:hover { text-decoration: underline; }
.footer .social { gap: 8px; }
.footer .social a { background: #5a5a5a; border-radius: 6px; width: 36px; height: 36px; }
.footer .social a:hover { background: var(--c-accent); }
.footer .brand { font-size: 1.15rem; }
.footer .brand img { width: 30px; height: 30px; }
.footer address { font-style: normal; }
.footer-bottom { border-top: 1px solid #555; background: var(--c-band-dark); font-size: .84rem; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 16px; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-bottom li + li { margin: 0; }
.link-btn { font: inherit; color: #fff; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }

/* 9. Cercador: pàgina de resultats ------------------------------------------------ */
.results { list-style: none; padding: 0; margin: 0; }
.results li + li { margin-top: 14px; }
.results a { display: block; background: var(--c-card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 16px 20px; text-decoration: none; color: inherit; }
.results a:hover { outline: 2px solid var(--c-green-light); }
.results .s-sec { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-accent); font-weight: 700; }
.results .s-tit { display: block; font-size: 1.15rem; font-weight: 700; color: var(--c-head); margin: 2px 0 4px; }
.results .s-snip { display: block; color: var(--c-muted); font-size: .95rem; }
.search-page form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-page input { flex: 1 1 260px; font: inherit; padding: 12px 18px; border: 2px solid var(--c-line); border-radius: 999px; background: #fff; }
.search-page input:focus { border-color: var(--c-accent); outline: 0; box-shadow: 0 0 0 3px var(--c-focus); }
.btn { font: inherit; font-weight: 700; cursor: pointer; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--c-accent); background: var(--c-accent); color: #fff; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: #fff; color: var(--c-accent); }
.btn--ghost:hover { background: var(--c-soft); color: var(--c-accent-dark); }
.flash { animation: flash 2.4s ease-out 1; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--c-green-light); } 100% { box-shadow: var(--shadow); } }

/* 10. Avís de galetes --------------------------------------------------------------
   Criteris (LSSI art. 22.2, RGPD i Guia sobre l'ús de galetes de l'AEPD, actualització 2023):
   el consentiment no s'infereix de seguir navegant; «Acceptar» i «Rebutjar» tenen el mateix
   pes visual a la primera capa; les opcions no necessàries surten desmarcades; l'elecció es
   pot canviar en qualsevol moment des del peu («Configuració de galetes»). */
.cc {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
  max-width: 820px; margin-inline: auto; max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; color: var(--c-text); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .3); border-top: 5px solid var(--c-accent);
}
.cc[hidden] { display: none; }
.cc-inner { padding: 20px 22px 18px; }
.cc-title { font-size: 1.15rem; margin: 0 0 8px; }
.cc-text { font-size: .93rem; margin: 0 0 14px; }
.cc-prefs fieldset { border: 1px solid var(--c-line); border-radius: var(--radius-sm); margin: 0 0 14px; padding: 6px 14px 4px; }
.cc-prefs legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.cc-opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: .9rem; }
.cc-opt + .cc-opt { border-top: 1px solid var(--c-line); }
.cc-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--c-accent); }
.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-actions .btn { flex: 1 1 180px; padding: 11px 18px; font-size: .93rem; }
.legal { max-width: 880px; }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.legal-date { color: var(--c-muted); font-size: .95rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
.legal table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
.legal th { background: var(--c-soft); }

/* 11. Mòbil --------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .nav ul { gap: 0 16px; }
  .nav a { font-size: .9rem; }
}
@media (max-width: 960px) {
  .band-row { padding-top: 16px; padding-bottom: 14px; }
  .nav-tools { display: flex; gap: 8px; }
  .nav-tools button {
    display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem;
    color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px; padding: 9px 14px; cursor: pointer;
  }
  .nav-tools button[aria-expanded="true"] { background: var(--c-accent); border-color: var(--c-accent); }
  .nav-tools .ico { width: 17px; height: 17px; }
  .js .search { display: none; flex-basis: 100%; }
  .js .search.is-open { display: block; padding-bottom: 14px; }
  .band-row { flex-wrap: wrap; gap: 12px; }
  .site-title { flex: 1 1 auto; min-width: 0; }
  .js .nav { display: none; margin-top: 0; padding-bottom: 12px; }
  .js .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: 12px 4px; border-top: 1px solid rgba(255, 255, 255, .12); white-space: normal; }
  .nav a::after { top: 10px; bottom: 10px; left: auto; right: 0; width: 5px; height: auto; border-radius: 4px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col:first-child { grid-column: 1 / -1; padding: 30px 0 6px; }
  .footer-col { padding: 22px 0; }
  .footer-col + .footer-col { border-left: 0; }
}
@media (max-width: 760px) {
  .grid-2, .grid-2--even, .grid-2--side { grid-template-columns: 1fr; }
  .float-img { float: none; width: 100%; max-width: 300px; margin: 0 0 14px; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .topbar .wrap { min-height: 50px; }
  .brand { font-size: 1.12rem; gap: 9px; }
  .brand img { width: 28px; height: 28px; }
  .social a { width: 34px; height: 34px; }
  .footer-grid { grid-template-columns: 1fr; }
  .cc { left: 8px; right: 8px; bottom: 8px; max-height: calc(100vh - 16px); }
  .cc-inner { padding: 16px 16px 14px; }
  .cc-text { font-size: .87rem; }
  .cc-actions .btn { flex-basis: 100%; }
  .site-title { font-size: 1.6rem; }
  .nav-tools button { padding: 8px 12px; }
}
@media (max-width: 430px) {
  .site-title { font-size: 1.38rem; }
  .nav-tools { gap: 6px; }
  .nav-tools button { padding: 7px 11px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* 12. Impressió ------------------------------------------------------------------ */
@media print {
  .topbar .social, .search, .nav, .nav-tools, .cc, .footer .social, .skip,   .card, .acc, .figure,   body { background: #fff; }
  .acc-body { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; word-break: break-all; }
}
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--c-line); }
.plain-list li + li { margin: 0; }
main { padding-bottom: clamp(40px, 6vw, 72px); }
@media (max-width: 760px) {
  .split .figure img { aspect-ratio: 4 / 3; object-fit: cover; }
}
@media (min-width: 961px) and (hover: hover) {
  .nav .has-sub:hover > .sub { display: flex; }
}
