/* =====================================================================
   styles.css · Web de les entitats de Sant Just (entitats.santjust.net)
   Mateix sistema de disseny que les altres webs municipals a Hostinger
   (corporaciomunicipal.santjust.net): apartats 1-3, 6, 11-14.
   1. Variables   2. Base   3. Capçalera   6. Seccions i xips
   11. Peu   13. Avís de galetes   14. Pàgina legal   12. Utilitats
   20. Directori: portada, targetes, llistats, fitxa, pàgines de serveis, galeria
   ===================================================================== */
/* 1. Variables ------------------------------------------------------ */
:root {
  --blue: #0062ae;          /* blau de l'escut de l'Ajuntament */
  --blue-700: #004c88;
  --blue-900: #0b2340;
  --blue-50: #eaf3fb;
  --ink: #16202c;
  --ink-soft: #4a5666;
  --line: #dfe4ea;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 52, .06), 0 8px 24px rgba(16, 32, 52, .06);
  --shadow-lg: 0 2px 6px rgba(16, 32, 52, .08), 0 24px 48px rgba(16, 32, 52, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --focus: 0 0 0 3px #fff, 0 0 0 6px #0062ae;
}

/* 2. Base ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
  color: var(--ink); background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--blue-700); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
svg { width: 1.2em; height: 1.2em; flex: none; }
button { font: inherit; color: inherit; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }
@media (min-width: 720px) { .container { width: min(1200px, 100% - 4rem); } }

.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); margin: 0 0 .6rem;
}

/* 3. Capçalera (estil webs municipals santjust.cat) ----------------- */
.site-header { position: relative; z-index: 50; }

/* 3a. Franja negra */
.topbar { background: #000; color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; opacity: .85; }
.brand img { width: 36px; height: 36px; }
.social-mini { list-style: none; display: flex; gap: .25rem; }
.social-mini a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.social-mini a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.social-mini svg { width: 18px; height: 18px; }

/* 3b. Franja gris: títol, cercador i menú */
.mastbar { background: #414141; color: #fff; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.4rem 0 .9rem; }
.site-title { color: #d2d2d2; text-decoration: none; font-weight: 300; font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.site-title:hover { color: #fff; }

.search { position: relative; flex: 0 1 400px; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #555; pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 1rem 0 2.75rem; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem; box-shadow: inset 0 0 0 1px transparent;
}
.search input::placeholder { color: #6b7380; }
.search input:focus { outline: none; box-shadow: 0 0 0 3px #414141, 0 0 0 6px #6db7f2; }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.search-results {
  position: absolute; top: calc(100% + .5rem); left: 0; right: 0; z-index: 60;
  max-height: min(70vh, 560px); overflow: auto; padding: .5rem;
  background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
@media (min-width: 901px) { .search-results { left: auto; width: max(100%, 460px); } }
.sr-group + .sr-group { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
.sr-title { margin: .35rem .6rem .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.sr-list { list-style: none; }
.sr-item {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .6rem; border: 0; border-radius: 10px;
  background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; font: inherit;
}
.sr-item:hover, .sr-item:focus-visible { background: var(--blue-50); box-shadow: none; outline: none; }
.sr-item:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.sr-thumb { width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover; object-position: top; background: #e9edf2; }
.sr-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.sr-icon svg { width: 20px; height: 20px; }
.sr-text { display: flex; flex-direction: column; min-width: 0; }
.sr-name { font-weight: 700; line-height: 1.3; }
.sr-sub { font-size: .86rem; color: var(--ink-soft); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-item mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 .05em; }
.sr-empty { margin: .75rem; color: var(--ink-soft); }

.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.site-nav a {
  position: relative; display: inline-block; padding: .55rem 0 .95rem; color: #fff;
  text-decoration: none; font-weight: 600; font-size: .98rem;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 3px 3px 0 0;
  background: #2f8fe0; transform: scaleX(0); transition: transform .2s ease;
}
.site-nav a:hover { color: #fff; }
.site-nav a:hover::after { transform: scaleX(.5); }
.site-nav a[aria-current="true"]::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 44px; height: 44px; flex: none; border: 1px solid rgba(255, 255, 255, .3); border-radius: 12px;
  background: transparent; cursor: pointer; place-items: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; position: relative; transition: transform .2s, opacity .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .mast-row { flex-wrap: wrap; gap: .9rem 1rem; padding: 1.1rem 0 1.1rem; }
  .site-title { flex: 1; font-size: 1.75rem; }
  .nav-toggle { display: grid; }
  .search { order: 3; flex: 1 1 100%; }
  .site-nav { display: none; padding-bottom: 1rem; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: .8rem .25rem; border-top: 1px solid rgba(255, 255, 255, .12); }
  .site-nav a::after { left: 0; right: auto; top: .7rem; bottom: .7rem; width: 4px; height: auto; transform: scaleY(0); left: -.75rem; border-radius: 0 3px 3px 0; }
  .site-nav a[aria-current="true"]::after, .site-nav a[aria-current="page"]::after { transform: scaleY(1); }
}
@media (max-width: 380px) { .site-title { font-size: 1.5rem; } }


/* 6. Seccions ------------------------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); color: var(--blue-900); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .95rem;
}
.chip:hover { border-color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip-count { font-size: .8rem; padding: .05rem .5rem; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); }
.chip[aria-pressed="true"] .chip-count { background: rgba(255, 255, 255, .2); color: #fff; }

.btn-outline {
  display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.1rem; min-height: 44px;
  border: 1.5px solid var(--blue); border-radius: 999px; font-weight: 700; text-decoration: none; font-size: .95rem;
}
.btn-outline:hover { background: var(--blue); color: #fff; }


/* 11. Peu ----------------------------------------------------------- */
.site-footer { background: var(--blue-900); color: #c9d6e4; padding-top: clamp(2.5rem, 6vw, 4rem); font-size: .97rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #9fd0ff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); padding-bottom: 2.5rem; }
.footer-title { font-size: 1.5rem; margin-bottom: .75rem; }
.footer-title a { text-decoration: none; }
.footer-sub { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #9fd0ff; margin: 1.25rem 0 .7rem; }
.footer-grid > div > .footer-sub:first-child { margin-top: 0; }
.footer-links, .social, .footer-contact { list-style: none; display: grid; gap: .45rem; }
.social { grid-auto-flow: column; justify-content: start; gap: .5rem; }
.social a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .08); text-decoration: none; font-size: .9rem; }
.social a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
.footer-contact svg { margin-top: .2em; color: #9fd0ff; }
address { font-style: normal; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 1.1rem 0; font-size: .85rem; }
.footer-bottom-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; }
.footer-bottom p { margin: 0; }
.footer-bottom ul { list-style: none; display: flex; gap: 1.25rem; }
@media (max-width: 480px) { .social { grid-auto-flow: row; } }

/* 13. Avís de galetes ----------------------------------------------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90;
  max-width: 1100px; margin-inline: auto; max-height: calc(100vh - 2rem); overflow: auto;
  background: var(--blue-900); color: #e6edf5; border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35); animation: cookie-in .3s ease;
}
@keyframes cookie-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cookie-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding: 1.1rem 1.4rem; }
.cookie-text { flex: 1 1 520px; }
.cookie-text h2 { font-size: 1rem; color: #fff; margin-bottom: .3rem; letter-spacing: 0; }
.cookie-text p { margin: 0; font-size: .93rem; line-height: 1.5; }
.cookie-text a { color: #9fd0ff; font-weight: 600; }
.cookie-text a:hover { color: #fff; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
/* Tots els botons amb el mateix format: cap opció destaca sobre les altres (criteri AEPD) */
.cookie-btn {
  min-width: 120px; min-height: 44px; padding: .6rem 1.2rem; border-radius: 999px; cursor: pointer;
  border: 2px solid #fff; background: #fff; color: var(--blue-900); font-weight: 700; font-size: .95rem;
}
.cookie-btn:hover { background: #dbe9f7; border-color: #dbe9f7; }
.cookie-btn:focus-visible { box-shadow: 0 0 0 3px var(--blue-900), 0 0 0 6px #9fd0ff; }
.cookie-config ul { list-style: none; display: grid; gap: .6rem; margin-top: 1rem; }
.cookie-cat { background: rgba(255, 255, 255, .07); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.cookie-cat label { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: #fff; cursor: pointer; }
.cookie-cat input { width: 20px; height: 20px; accent-color: #2f8fe0; }
.cookie-cat p { margin: .3rem 0 0 1.9rem; font-size: .88rem; }
.cookie-sempre { margin-left: auto; font-size: .78rem; font-weight: 600; color: #9fd0ff; }
@media (max-width: 600px) {
  .cookie-banner { left: .5rem; right: .5rem; bottom: .5rem; }
  .cookie-inner { padding: 1rem; }
  .cookie-actions { width: 100%; }
  .cookie-btn { flex: 1; }
}
.link-btn { all: unset; cursor: pointer; color: #fff; text-decoration: underline; text-underline-offset: .18em; }
.link-btn:hover { color: #9fd0ff; }
.link-btn-dark { color: var(--blue); font-weight: 600; }
.link-btn-dark:hover { color: var(--blue-700); }
.link-btn:focus-visible { box-shadow: var(--focus); border-radius: 4px; }

/* 14. Pàgina de text legal ------------------------------------------- */
.legal { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.legal-inner { max-width: 820px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); color: var(--blue-900); font-weight: 800; }
.legal h2 { font-size: 1.35rem; color: var(--blue-900); margin-top: 2.2rem; }
.legal h3 { font-size: 1.05rem; margin-top: 1.4rem; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.2rem; margin-bottom: 1em; }
.legal li { margin-bottom: .35rem; }
.legal-meta { color: var(--ink-soft); font-size: .95rem; }
.legal-box { background: var(--blue-50); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.legal-box p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.legal table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 620px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.legal th { background: var(--bg); font-weight: 700; }
.legal tr:last-child td { border-bottom: 0; }
.legal code { font-size: .9em; background: var(--bg); padding: .1em .35em; border-radius: 4px; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; margin-bottom: 1.25rem; }

/* 12. Utilitats / accessibilitat ------------------------------------ */
.visually-hidden {
  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-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--blue); color: #fff;
  padding: .75rem 1rem; border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }
main:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }
.notice { padding: 1rem 1.25rem; background: #fff7e0; border: 1px solid #f0d78c; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

@media print {
  .cookie-banner, .site-header, .nav-toggle, .search, .mapa-caixa, .seccio-fotos { display: none; }
  body { background: #fff; }
}


/* 20. Directori d'entitats ------------------------------------------ */

/* 20a. Menú: submenú d'àmbits */
.site-nav .has-sub { position: relative; display: flex; align-items: center; gap: .1rem; }
.sub-toggle {
  display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: .4rem; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
}
.sub-toggle:hover { background: rgba(255, 255, 255, .14); }
.sub-toggle svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s; }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(-90deg); }
.submenu {
  position: absolute; top: calc(100% - .3rem); left: -1rem; z-index: 55; min-width: 270px;
  list-style: none; display: grid; padding: .5rem; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.site-nav .submenu a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; color: var(--ink); font-weight: 600; border-radius: 8px; }
.site-nav .submenu a::after { display: none; }
.site-nav .submenu a:hover, .site-nav .submenu a[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); }
.submenu .n { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
@media (max-width: 900px) {
  .site-nav .has-sub { flex-wrap: wrap; }
  .site-nav .has-sub > a { flex: 1; }
  .sub-toggle { margin: 0; width: 44px; height: 44px; }
  .submenu { position: static; flex-basis: 100%; min-width: 0; background: rgba(255, 255, 255, .06); box-shadow: none; margin-bottom: .5rem; }
  .site-nav .submenu a { color: #fff; border: 0; padding: .6rem .75rem; }
  .site-nav .submenu a:hover, .site-nav .submenu a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
  .submenu .n { color: #c9d6e4; }
}

/* 20b. Capçalera de pàgina i portada */
.page-head {
  background: radial-gradient(1200px 400px at 85% -10%, rgba(0, 98, 174, .12), transparent 60%), linear-gradient(#fff, var(--bg));
  padding: clamp(1.75rem, 4.5vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem);
}
.page-head h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; color: var(--blue-900); margin-bottom: .4em; }
.page-head .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 70ch; margin: 0; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem .5rem; font-size: .92rem; margin-bottom: 1rem; color: var(--ink-soft); }
.breadcrumb li + li::before { content: "›"; margin-right: .5rem; color: #9aa5b1; }
.breadcrumb a { font-weight: 600; }
.registre {
  display: flex; gap: .9rem; align-items: flex-start; margin-top: 1.5rem; max-width: 900px;
  padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.registre svg { color: var(--blue); margin-top: .2rem; width: 22px; height: 22px; }
.registre p { margin: 0; color: var(--ink); }
.section-sub { color: var(--ink-soft); margin: .35rem 0 0; max-width: 70ch; }
.section-head > div { max-width: 760px; }
.section-tight { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

/* 20c. Targetes de serveis */
.serveis-grid { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); }
.servei {
  position: relative; display: flex; flex-direction: column; gap: .6rem; height: 100%; padding: 1.2rem 1.2rem 1.1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.servei:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.servei-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.servei-icon svg { width: 24px; height: 24px; }
.servei h3 { font-size: 1.08rem; margin: 0; letter-spacing: 0; }
.servei h3 a { color: var(--blue-900); text-decoration: none; }
.servei h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }   /* tota la targeta és clicable */
.servei h3 a:focus-visible { box-shadow: none; }
.servei:focus-within { box-shadow: var(--focus); }
.servei p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }
.ext { display: inline-block; width: .8em; height: .8em; margin-left: .25em; vertical-align: .05em; color: var(--ink-soft); }
.serveis-compacte .servei { flex-direction: row; align-items: center; padding: .85rem 1rem; box-shadow: none; }
.serveis-compacte .servei p { display: none; }
.serveis-compacte .servei-icon { width: 38px; height: 38px; }
.serveis-compacte .servei-icon svg { width: 20px; height: 20px; }
.serveis-compacte .servei h3 { font-size: .98rem; }

/* 20d. Àmbits i sectors */
.ambits-grid { list-style: none; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.ambit {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 100%;
  padding: 1rem 1.15rem; border-radius: var(--radius); text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-900) 100%); box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ambit:hover { color: #fff; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ambit-nom { display: block; font-weight: 800; font-size: 1.08rem; text-transform: uppercase; letter-spacing: .03em; line-height: 1.2; }
.ambit-sub { display: block; font-size: .9rem; color: #cfe3f5; margin-top: .2rem; }
.ambit-n { flex: none; min-width: 2.4rem; padding: .25rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.ambit-ind { background: linear-gradient(135deg, #414141 0%, #1d1d1d 100%); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
a.chip { text-decoration: none; color: var(--ink); }
a.chip[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; }
a.chip[aria-current="page"] .chip-count { background: rgba(255, 255, 255, .2); color: #fff; }

/* 20e. Llistat de noms (dues columnes, en majúscules, segons el projecte) */
.llista-cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.llista-cap p { margin: 0; color: var(--ink-soft); }
.filtre { position: relative; flex: 0 1 320px; }
.filtre input { width: 100%; height: 44px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: #fff; }
.filtre input:focus { outline: none; box-shadow: var(--focus); }
.noms {
  list-style: none; columns: 2 300px; column-gap: 2.5rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1.5rem; box-shadow: var(--shadow);
}
.noms li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.noms a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .1rem; text-decoration: none; color: var(--blue-900); font-weight: 700; text-transform: uppercase; font-size: .93rem; letter-spacing: .02em; }
.noms a:hover { color: var(--blue); }
.noms a svg { width: 16px; height: 16px; color: var(--blue); flex: none; opacity: .6; }
.noms a:hover svg { opacity: 1; }
.noms small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-soft); font-size: .82rem; }
.buit { color: var(--ink-soft); padding: 1rem 0; }

/* 20f. Fitxa d'entitat / indústria */
.fitxa { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .fitxa { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.fitxa-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.fitxa-logo { max-width: 180px; max-height: 140px; object-fit: contain; margin-bottom: 1.25rem; }
.dades { margin: 0; }
.dades > div { padding: 1rem 0; border-top: 1px solid var(--line); }
.dades > div:first-child { border-top: 0; padding-top: 0; }
.dades dt { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--blue); margin-bottom: .3rem; }
.dades dd { margin: 0; white-space: pre-line; }
.fitxa-lateral { display: grid; gap: 1rem; }
@media (min-width: 900px) { .fitxa-lateral { position: sticky; top: 1rem; } }
.contacte { list-style: none; display: grid; gap: 0; }
.contacte li { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.contacte li:first-child { border-top: 0; padding-top: 0; }
.contacte li:last-child { padding-bottom: 0; }
.contacte svg { color: var(--blue); margin-top: .2em; }
.contacte .etiqueta { display: block; font-size: .8rem; color: var(--ink-soft); }
.mapa-caixa { position: relative; overflow: hidden; padding: 0; }
.mapa-caixa iframe { display: block; width: 100%; height: 300px; border: 0; }
.mapa-off { display: grid; gap: .75rem; padding: 1.25rem; background: var(--blue-50); text-align: left; }
.mapa-off p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.mapa-off .accions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* 20g. Botons */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.2rem; min-height: 44px; cursor: pointer;
  border: 1.5px solid var(--blue); border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; font-size: .95rem;
}
.btn:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
button.btn-outline { background: #fff; color: var(--blue); cursor: pointer; }
.botons { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }

/* 20h. Pàgines de serveis */
.text-page { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .text-page.amb-imatge { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); align-items: start; } }
.prosa { max-width: 760px; }
.prosa > p, .prosa li { color: var(--ink); }
.prosa h2 { font-size: 1.35rem; color: var(--blue-900); margin-top: 2rem; }
.punts { list-style: none; display: grid; gap: .6rem; margin: 0 0 1.25rem; }
.punts li { position: relative; padding-left: 1.4rem; }
.punts li::before { content: ""; position: absolute; left: .2rem; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.passos { list-style: none; counter-reset: pas; display: grid; gap: 1rem; margin: 0 0 1.5rem; }
.passos li { counter-increment: pas; position: relative; padding-left: 3.1rem; min-height: 2.2rem; }
.passos li::before {
  content: counter(pas); position: absolute; left: 0; top: -.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800;
}
.destacat { background: var(--blue-50); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }
.figura-lateral img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.docs-grup + .docs-grup { margin-top: 1.75rem; }
.docs-grup h2 { font-size: 1.1rem; color: var(--blue-900); margin: 0 0 .75rem; letter-spacing: 0; }
.doc-list { list-style: none; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.doc-list a {
  display: flex; align-items: center; gap: .8rem; height: 100%; padding: .85rem 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.35;
}
.doc-list a:hover { border-color: var(--blue); color: var(--blue-700); }
.doc-list .tipus { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.doc-list small { display: block; color: var(--ink-soft); font-weight: 500; font-size: .8rem; }

/* Vídeos (YouTube carregat en fer clic) */
.videos { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.video h3 { font-size: 1.05rem; color: var(--blue-900); margin-bottom: .6rem; letter-spacing: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-frame iframe, .video-play img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-play { all: unset; position: absolute; inset: 0; cursor: pointer; }
.video-play::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .55)); }
.video-play .play { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 98, 174, .92); color: #fff; transition: transform .2s; }
.video-play .play svg { width: 32px; height: 32px; margin-left: 4px; }
.video-play:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.video-play:focus-visible { box-shadow: inset 0 0 0 4px #9fd0ff; }
.video-play .avis { position: absolute; z-index: 1; left: .9rem; right: .9rem; bottom: .7rem; color: #fff; font-size: .8rem; }

/* 20i. Equipaments */
.equip-grid { list-style: none; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.equip { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.equip img { width: 100%; aspect-ratio: 683 / 600; object-fit: cover; background: #e9edf2; }
.equip-cos { padding: 1rem 1.15rem 1.2rem; }
.equip h3 { font-size: 1.08rem; margin-bottom: .45rem; letter-spacing: 0; text-transform: uppercase; }
.equip h3 a { color: var(--blue-900); text-decoration: none; }
.equip h3 a:hover { color: var(--blue); text-decoration: underline; }
.equip p { margin: 0; font-size: .93rem; color: var(--ink-soft); line-height: 1.5; }

/* 20j. Galeria de fotos: vegeu «Carrussel de fotos» al final del fitxer */
.carregant { color: var(--ink-soft); }
.actualitzat { display: block; opacity: .8; margin-top: .2rem; }

/* 21. v3.1.0: capçalera amb subtítol, nota del Registre al peu, àmbits amb imatge i color, icones originals dels serveis */
.site-title { display: inline-flex; flex-direction: column; gap: .3rem; white-space: normal; }
.site-title-main { white-space: nowrap; }
.site-title-sub { font-size: .95rem; font-weight: 400; letter-spacing: .02em; color: #bdbdbd; line-height: 1.2; }
.site-title:hover .site-title-sub { color: #e0e0e0; }
@media (max-width: 900px) { .site-title-sub { font-size: .85rem; } }

.footer-nota {
  display: flex; gap: .75rem; align-items: flex-start; margin: 0 0 2rem; padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: .93rem; line-height: 1.55; color: #c9d6e4; max-width: 900px;
}
.footer-nota svg { color: #9fd0ff; margin-top: .15em; }
.footer-nota .actualitzat { display: block; margin-top: .35rem; color: #9fb3c8; font-size: .86rem; }

/* Portada: primer bloc compacte (sense títol gran) */
.home-first { padding-top: clamp(2rem, 5vw, 3.25rem); }
.home-first h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); color: var(--blue-900); margin: 0 0 1.75rem; }

/* Serveis: icones i colors originals de santjust.org */
.servei { align-items: center; text-align: center; padding: 1.4rem 1.1rem 1.2rem; }
.servei-icon { width: 64px; height: 64px; background: none; border-radius: 0; color: var(--svc, var(--blue)); }
.servei-icon svg { width: 52px; height: 52px; fill: currentColor; }
.serveis-compacte .servei { text-align: left; }
.serveis-compacte .servei-icon { width: 40px; height: 40px; }
.serveis-compacte .servei-icon svg { width: 32px; height: 32px; }
.sr-icon svg { fill: currentColor; }
@media (max-width: 480px) {
  .serveis-grid:not(.serveis-compacte) { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .serveis-grid:not(.serveis-compacte) .servei { padding: 1rem .7rem; }
  .serveis-grid:not(.serveis-compacte) .servei-icon svg { width: 40px; height: 40px; }
  .serveis-grid:not(.serveis-compacte) .servei h3 { font-size: .95rem; }
  .serveis-grid:not(.serveis-compacte) .servei p { font-size: .82rem; }
}

/* Àmbits: imatge i color de cada àmbit del web original (franja de color translúcida amb el nom) */
.ambits-foto { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
@media (max-width: 560px) { .ambits-foto { grid-template-columns: repeat(2, 1fr); gap: .7rem; } }
.ambit-foto {
  position: relative; display: grid; align-items: center; aspect-ratio: 38 / 54; overflow: hidden;
  border-radius: var(--radius); text-decoration: none; color: #1b252f; background: #e9edf2; box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}
.ambit-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.ambit-foto:hover { color: #1b252f; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ambit-foto:hover img { transform: scale(1.08); }
.ambit-foto:focus-visible { box-shadow: var(--focus); }
.ambit-banda {
  position: relative; display: grid; place-content: center; gap: .35rem; min-height: 100px; padding: .9rem .6rem;
  background: var(--amb); text-align: center;
}
.ambit-banda .ambit-nom { font-size: clamp(1rem, 1.6vw, 1.3rem); font-weight: 800; letter-spacing: 0; line-height: 1.05; color: var(--amb-text, #1b252f); text-transform: uppercase; overflow-wrap: anywhere; }
.ambit-banda .ambit-sub { font-size: .85rem; font-weight: 600; color: var(--amb-text, #1b252f); line-height: 1.15; margin: 0; }
.ambit-foto .ambit-n {
  position: absolute; top: .6rem; right: .6rem; min-width: 2.2rem; padding: .2rem .55rem; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #1b252f; font-weight: 800; font-size: .9rem; text-align: center; box-shadow: var(--shadow);
}
@media (max-width: 560px) {
  .ambit-banda { min-height: 80px; padding: .7rem .4rem; }
  .ambit-banda .ambit-sub { font-size: .75rem; }
}
/* Àmbits que no existien al web original (sense imatge ni color propis) i indústries */
.altres-ambits { margin-top: 1.5rem; }
.altres-ambits h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .7rem; }

/* Carrussel de fotos a tota l'amplada (v3.1.0; substitueix la graella de l'apartat 20j) */
.seccio-fotos { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.seccio-fotos .section-head { align-items: center; }
.carrusel-accions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.carrusel-accions a { font-weight: 600; }
.carrusel-boto {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem 1.1rem; cursor: pointer;
  border: 1.5px solid var(--blue); border-radius: 999px; background: #fff; color: var(--blue); font-weight: 700; font-size: .95rem;
}
.carrusel-boto:hover { background: var(--blue); color: #fff; }
.carrusel-boto svg { width: 16px; height: 16px; fill: currentColor; }
.carrusel { width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; }
.carrusel::-webkit-scrollbar { display: none; }
.carrusel:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.carrusel-pista { list-style: none; display: flex; gap: .75rem; width: max-content; padding: 0 .75rem; }
.carrusel-pista figure { position: relative; margin: 0; width: clamp(240px, 26vw, 380px); aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: #e9edf2; }
.carrusel-pista img { width: 100%; height: 100%; object-fit: cover; }
.carrusel-pista figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .75rem .55rem; color: #fff; font-size: .82rem; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
@media (max-width: 560px) { .carrusel-pista figure { width: 72vw; } }

/* Peu del mateix gris que la franja principal de la capçalera (v3.1.1) */
.site-footer { background: #414141; color: #e0e0e0; }
.site-footer a:hover { color: #9fd0ff; }
.footer-sub { color: #9fd0ff; }
.footer-nota { color: #e0e0e0; border-bottom-color: rgba(255, 255, 255, .15); }
.footer-nota .actualitzat { color: #c4c4c4; }
.footer-bottom { border-top-color: rgba(255, 255, 255, .15); }
.social a { background: rgba(255, 255, 255, .1); }
.seccio-fotos { padding-top: 0; padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.seccio-fotos .carrusel-accions { justify-content: flex-end; margin-top: .9rem; }

/* Peu: xarxes socials només amb icona (v3.2.0) */
.site-footer .social { grid-auto-flow: column; gap: .5rem; }
.site-footer .social a { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
.site-footer .social svg { width: 20px; height: 20px; }

/* 22. Ticker de notícies de Ràdio Desvern (sota la capçalera; js/ticker.js) ----
   Mateixa amplada que els apartats (.container) i grisos del web. */
.ticker-cont { position: relative; z-index: 2; }
.ticker {
  display: flex; align-items: stretch; margin-top: 1.25rem; overflow: hidden; font-size: .95rem; color: var(--ink);
  background: #fff; border: 1px solid #d2d2d2; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.ticker[hidden] { display: none; }
.ticker-titol {
  flex: none; display: flex; align-items: center; padding: .7rem 1.1rem; background: #414141; color: #fff;
  font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.ticker-finestra { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-pista, .ticker-copia ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; width: max-content; }
.ticker-pista.is-anim { animation: ticker-mou var(--ticker-durada, 80s) linear infinite; }
@keyframes ticker-mou { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--ticker-dist, 0px))); } }
.ticker:hover .ticker-pista, .ticker:focus-within .ticker-pista, .ticker.is-aturat .ticker-pista { animation-play-state: paused; }
.ticker-item { display: flex; align-items: center; white-space: nowrap; padding: .7rem 0; }
.ticker-data { color: #6b6b6b; font-weight: 600; font-variant-numeric: tabular-nums; }
.ticker-guio { color: #6b6b6b; white-space: pre; }
.ticker-titular { color: #2b2b2b; font-weight: 600; text-decoration: none; }
.ticker-titular:hover { color: #000; text-decoration: underline; }
.ticker-titular:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
.ticker-sep { flex: none; width: 20px; height: 20px; margin: 0 1.5rem; object-fit: contain; }
.ticker.is-reduit .ticker-finestra { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 640px) {
  .ticker { font-size: .88rem; margin-top: .9rem; }
  .ticker-titol { padding: .6rem .7rem; max-width: 38vw; white-space: normal; line-height: 1.15; font-size: .8rem; }
  .ticker-sep { width: 16px; height: 16px; margin: 0 1rem; }
}
@media print { .ticker { display: none; } }

/* Carrussel dins de l'amplada dels apartats (v3.5.3) */
.seccio-fotos .carrusel { border-radius: var(--radius); }
.seccio-fotos .carrusel-pista { padding: 0; }

/* Canals i suports (v3.6.0) */
.salutacio { font-weight: 700; font-size: 1.15rem; color: var(--blue-900); }
.canals-intro { max-width: 70ch; margin: 0 0 1.5rem; }
.canals { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin: 0 0 1.5rem; }
.canal { background: #fff; border: 1px solid #d2d2d2; border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.canal h2 { font-size: 1.1rem; color: var(--blue-900); margin: 0 0 .6rem; }
.canal p { margin: 0 0 .6rem; }
.canal .canal-ubi { font-weight: 700; margin: .9rem 0 .4rem; }
.canal .punts { margin: 0; gap: .35rem; }
.canals-avis { font-weight: 600; }
