/* =====================================================================
   MOVEGANDEX · Espazo dixital
   Orde: Fontes → Variables → Reset → Base → Estrutura → Compoñentes → Utilidades
   ===================================================================== */

/* ---------- Fontes (servidas localmente, subconxunto latino) ---------- */
/* Montserrat: a tipografía do logotipo, para títulos. Source Sans 3: texto */
@font-face { font-family: "Montserrat"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fontes/montserrat-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fontes/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fontes/montserrat-700.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fontes/source-sans-3-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fontes/source-sans-3-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fontes/source-sans-3-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fontes/source-sans-3-700.woff2") format("woff2"); }

/* ---------- Variables (cores da marca) ---------- */
:root {
  /* Cores do logotipo. Contraste comprobado (WCAG AA) sobre os fondos claros:
     --verde-texto 7:1, --ocre-texto 5,2:1 ou máis; --verde e --ocre só en fondos, botóns ou texto grande */
  --verde: #307C3B;          /* verde do logotipo: fondos, botóns (texto branco 5,2:1) */
  --verde-escuro: #25632F;   /* fondos escuros e texto en verde (7:1 sobre papel) */
  --verde-texto: #25632F;
  --verde-claro: #E7F1E8;
  --ocre: #906A2B;           /* ocre do logotipo (4,8:1 sobre papel: texto grande ou elementos) */
  --ocre-texto: #7E5D25;     /* ocre para texto pequeno sobre calquera fondo claro (≥5,1:1) */
  --ocre-claro: #C39A52;     /* acento: só decoración ou fondo con texto escuro */
  --ocre-fondo: #F6EFE2;
  --ocre-fondo-2: #EFE5D2;
  --ocre-sobre-escuro: #E6CD9C; /* texto pequeno sobre verde escuro (4,7:1) */
  --pedra: #5E6B66;
  --tinta: #1B2421;
  --vermello: #B4432F;
  --papel: #FDFCF9;
  --liña: #DCE3DD;

  --titulos: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ancho: 74rem;
  --ancho-texto: 42rem;
  --marxe: clamp(1.25rem, 4vw, 2.5rem);
  --espazo-seccion: clamp(4rem, 9vw, 7.5rem);
  --raio: 6px;
  --sombra: 0 1px 2px rgb(27 36 33 / .06), 0 8px 24px -12px rgb(27 36 33 / .18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Base ---------- */
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--titulos);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--tinta);
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; line-height: 1.3; }
p, li { text-wrap: pretty; }
p + p { margin-top: 1em; }
a { color: var(--verde-texto); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ocre-texto); text-decoration-thickness: 2px; }
strong { font-weight: 600; }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ocre-fondo); }
abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Salto ao contido (accesibilidade) */
.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--tinta); color: #fff; padding: .7rem 1rem; border-radius: var(--raio);
  font-weight: 600; text-decoration: none;
}
.saltar:focus { top: 1rem; color: #fff; }

/* ---------- Estrutura ---------- */
.contedor { width: min(100% - 2 * var(--marxe), var(--ancho)); margin-inline: auto; }
.contedor--texto { width: min(100% - 2 * var(--marxe), var(--ancho-texto)); margin-left: max(var(--marxe), calc((100% - var(--ancho)) / 2)); }
.seccion { padding-block: var(--espazo-seccion); }
.seccion--verde-claro { background: var(--verde-claro); }
.seccion--ocre { background: var(--ocre-fondo); }
.seccion--ocre-2 { background: var(--ocre-fondo-2); }
/* Dúas seccións simples seguidas: sen dobre espazo */
.seccion:not([class*="--"], .cifras) + .seccion:not([class*="--"], .cifras) { padding-top: 0; }

.cabeza-seccion { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 48rem; }
.cabeza-seccion p { color: var(--pedra); font-size: 1.125rem; }

/* Etiqueta pequena sobre os títulos */
.antetitulo {
  font-family: var(--sans); font-size: .8125rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ocre-texto);
}

/* ---------- Cabeceira ---------- */
.cabeceira {
  position: sticky; top: 0; z-index: 50;
  background: rgb(253 252 249 / .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--liña);
}
.cabeceira__dentro { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.25rem; }

/* Logotipo oficial (SVG) */
.logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.logo img { width: clamp(11rem, 30vw, 14.5rem); height: auto; }
.pe .logo img { width: 15rem; }

.nav__lista { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.6rem; }
.nav__lista a {
  display: inline-block; padding: .4rem 0; font-weight: 600; font-size: .98rem;
  color: var(--tinta); text-decoration: none; border-bottom: 2px solid transparent;
}
.nav__lista a:hover { color: var(--verde-texto); border-bottom-color: var(--ocre); }
.nav__lista a[aria-current="page"] { color: var(--verde-texto); border-bottom-color: var(--verde); }

.boton-menu {
  display: none; align-items: center; gap: .5rem;
  background: none; border: 1px solid var(--liña); border-radius: 999px;
  padding: .45rem .95rem; font-weight: 600; font-size: .95rem;
}
.boton-menu__icona { width: 1.1rem; height: .75rem; position: relative; }
.boton-menu__icona::before, .boton-menu__icona::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease, top .2s ease;
}
.boton-menu__icona::before { top: 0; }
.boton-menu__icona::after { top: calc(100% - 2px); }
.boton-menu[aria-expanded="true"] .boton-menu__icona::before { top: calc(50% - 1px); transform: rotate(45deg); }
.boton-menu[aria-expanded="true"] .boton-menu__icona::after { top: calc(50% - 1px); transform: rotate(-45deg); }

/* Móbil: o menú pregable só se activa con JS (sen JS, a lista vese enteira) */
@media (max-width: 63.99rem) {
  .js .boton-menu { display: inline-flex; }
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--papel); border-bottom: 1px solid var(--liña);
    box-shadow: 0 16px 24px -16px rgb(27 36 33 / .25);
    display: none;
  }
  .js .nav.aberta { display: block; }
  .js .nav__lista { flex-direction: column; gap: 0; padding: .5rem var(--marxe) 1.25rem; }
  .js .nav__lista a { display: block; padding: .85rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--liña); }
  .js .nav__lista li:last-child a { border-bottom: 0; }
  .js .nav__lista a[aria-current="page"] { border-bottom-color: var(--liña); box-shadow: inset 3px 0 0 var(--verde); padding-left: .9rem; }
  html:not(.js) .cabeceira__dentro { flex-wrap: wrap; padding-block: .75rem; }
}

/* ---------- Portada (heroe) ---------- */
.heroe { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.heroe__grella { display: grid; gap: 2.5rem; align-items: end; }
.heroe h1 { max-width: 15ch; }
.heroe h1 em { font-style: normal; color: var(--verde); }
.heroe__entrada { font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: #3B4743; max-width: 36rem; }
.heroe__accions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.heroe__foto { margin-top: clamp(2.5rem, 6vw, 4rem); position: relative; }
.heroe__foto img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 50%; border-radius: var(--raio); }
.heroe__foto figcaption { font-size: .875rem; color: var(--pedra); margin-top: .7rem; }
@media (min-width: 60rem) {
  .heroe__grella { grid-template-columns: 1.35fr 1fr; gap: 4rem; }
  .heroe__foto img { aspect-ratio: 21 / 9; }
}

/* ---------- Botóns ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.9rem; padding: .7rem 1.35rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  border: 2px solid var(--verde); background: var(--verde); color: #fff;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.boton:hover { background: var(--verde-escuro); border-color: var(--verde-escuro); color: #fff; }
.boton--contorno { background: transparent; color: var(--verde-texto); }
.boton--contorno:hover { background: var(--verde-claro); color: var(--verde-escuro); }
.boton--pequeno { min-height: 2.5rem; padding: .5rem 1rem; font-size: .95rem; }
.boton svg { width: 1.05em; height: 1.05em; flex: none; }
.boton[aria-disabled="true"] {
  background: #EEF1EF; border-color: #EEF1EF; color: var(--pedra); cursor: default; pointer-events: none;
}

/* Ligazón con frecha */
.ligazon-frecha { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.ligazon-frecha::after { content: "→"; transition: transform .15s ease; }
.ligazon-frecha:hover::after { transform: translateX(3px); }

/* ---------- Itinerario en 8 pasos ---------- */
.itinerario { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--liña); border: 1px solid var(--liña); border-radius: var(--raio); overflow: hidden; counter-reset: paso; }
.paso { background: var(--papel); }
.paso a {
  display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.1rem; align-content: start;
  height: 100%; padding: 1.5rem 1.4rem 1.6rem; text-decoration: none; color: inherit;
  transition: background-color .15s ease;
}
.paso a:hover { background: #fff; color: inherit; }
.paso a:hover .paso__titulo { color: var(--verde-texto); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.paso__num {
  grid-row: span 3; min-width: 1.6rem; font-family: var(--titulos); font-size: 2.6rem; line-height: .9; font-weight: 500;
  color: var(--ocre); font-variant-numeric: lining-nums;
}
.paso__fase { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pedra); }
.paso__titulo { font-family: var(--titulos); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.paso__texto { font-size: .95rem; color: #46524E; margin-top: .35rem; }
@media (min-width: 40rem) { .itinerario { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) {
  .itinerario { grid-template-columns: repeat(4, 1fr); }
  .paso a { grid-template-columns: 1fr; padding: 1.75rem 1.6rem 2rem; }
  .paso__num { grid-row: auto; font-size: 3.2rem; margin-bottom: .9rem; }
}

/* ---------- Cifras ---------- */
.cifras { position: relative; overflow: hidden; background: var(--verde-escuro); color: #fff; }
.cifras::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background: url("../img/curvas-nivel.svg") center / cover no-repeat;
}
.cifras > * { position: relative; }
.cifras h2, .cifras .antetitulo { color: #fff; }
.cifras .antetitulo { color: var(--ocre-sobre-escuro); }
.cifras :focus-visible, .calculadora :focus-visible, .pe :focus-visible, .lightbox :focus-visible { outline-color: var(--ocre-sobre-escuro); }
.cifras__lista { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.25rem 1.5rem; margin-top: 2.75rem; }
.cifra { border-top: 1px solid rgb(255 255 255 / .28); padding-top: 1rem; }
.cifra__valor { display: block; font-family: var(--titulos); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; color: var(--ocre-fondo); font-weight: 500; letter-spacing: -0.02em; }
.cifra__texto { display: block; margin-top: .55rem; color: rgb(255 255 255 / .86); font-size: 1rem; line-height: 1.4; }
.cifras__fonte { margin-top: 2.5rem; font-size: .875rem; color: rgb(255 255 255 / .75); }
@media (min-width: 48rem) { .cifras__lista { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 72rem) { .cifras__lista { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Bloque de texto + foto ---------- */
.dobre { display: grid; gap: 2.5rem; align-items: center; }
.dobre img { border-radius: var(--raio); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.dobre figcaption { font-size: .875rem; color: var(--pedra); margin-top: .6rem; }
.dobre__texto > * + * { margin-top: 1rem; }
.dobre__texto p { font-size: 1.08rem; }
@media (min-width: 56rem) { .dobre { grid-template-columns: 1fr 1fr; gap: 4.5rem; } .dobre--inverso > :first-child { order: 2; } }

/* ---------- Tarxetas (destacados) ---------- */
.tarxetas { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .tarxetas { grid-template-columns: repeat(3, 1fr); } }
.tarxeta {
  position: relative; display: flex; flex-direction: column; gap: .7rem;
  background: #fff; border: 1px solid var(--liña); border-radius: var(--raio);
  padding: 1.75rem 1.6rem; transition: border-color .15s ease, box-shadow .15s ease;
}
.tarxeta:hover { border-color: #B9C6BF; box-shadow: var(--sombra); }
.tarxeta__icona { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--ocre-fondo); color: var(--ocre-texto); margin-bottom: .4rem; }
.tarxeta__icona svg { width: 1.35rem; height: 1.35rem; }
.tarxeta p { color: #46524E; }
.tarxeta .ligazon-frecha { margin-top: auto; padding-top: .5rem; }
/* Toda a tarxeta é clicable a través da ligazón principal */
.tarxeta .ligazon-frecha::before { content: ""; position: absolute; inset: 0; border-radius: var(--raio); }

/* ---------- Crédito institucional ---------- */
.credito { display: grid; gap: 1.5rem; align-items: center; padding: 2rem; border: 1px solid var(--liña); border-radius: var(--raio); background: #fff; }
.credito__texto { font-family: var(--titulos); font-size: 1.3rem; line-height: 1.35; }
.credito__texto small { display: block; font-family: var(--sans); font-size: .95rem; color: var(--pedra); margin-top: .5rem; }
.oco-logo {
  display: grid; place-items: center; min-height: 6.5rem; padding: 1rem; text-align: center;
  border: 2px dashed #AAB6B0; border-radius: var(--raio);
  font-size: .9rem; color: var(--pedra); background: repeating-linear-gradient(-45deg, #fff 0 10px, #F7F9F8 10px 20px);
}
@media (min-width: 48rem) { .credito { grid-template-columns: 1fr 17rem; padding: 2.25rem 2.5rem; } }

.logo-deputacion { width: 100%; max-width: 15rem; height: auto; justify-self: center; }
.pe .logo-deputacion { max-width: 12rem; justify-self: start; }

/* ---------- Cabeceira das páxinas interiores ---------- */
.cabeza-paxina { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: clamp(2.5rem, 5vw, 3.5rem); border-bottom: 1px solid var(--liña); position: relative; overflow: hidden; }
.cabeza-paxina::after {
  content: ""; position: absolute; right: -10%; top: -30%; width: 60%; height: 160%;
  background: url("../img/curvas-nivel.svg") center / cover no-repeat; opacity: .22; pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent); mask-image: linear-gradient(to left, #000 30%, transparent);
}
.cabeza-paxina > * { position: relative; z-index: 1; }
.cabeza-paxina h1 { margin-top: .75rem; max-width: 20ch; }
.cabeza-paxina p { margin-top: 1.1rem; font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: #3B4743; max-width: 40rem; }
.migas { font-size: .9rem; color: var(--pedra); }
.migas a { color: var(--pedra); }

/* ---------- Guías ---------- */
.guias { list-style: none; padding: 0; display: grid; gap: 2.5rem 2rem; }
@media (min-width: 40rem) { .guias { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .guias { grid-template-columns: repeat(4, 1fr); } }
.guia { display: flex; flex-direction: column; scroll-margin-top: 6rem; }
.guia:target .guia__portada { outline: 3px solid var(--ocre-claro); outline-offset: 4px; }
.guia__portada {
  position: relative; aspect-ratio: 210 / 297; border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 1px rgb(0 0 0 / .08), 0 14px 28px -14px rgb(27 36 33 / .45);
  background: var(--verde);
}
.guia__portada img { width: 100%; height: 100%; object-fit: cover; }
/* Portada debuxada en CSS cando o PDF aínda non existe (imita a portada das guías) */
.portada-css { position: absolute; inset: 0; padding: 9% 10%; display: flex; flex-direction: column; color: #fff; }
.portada-css__marca { font-size: .55rem; font-weight: 700; letter-spacing: .2em; opacity: .9; }
.portada-css__num { margin-top: auto; font-family: var(--titulos); font-size: clamp(4rem, 9vw, 5.5rem); line-height: .85; color: var(--ocre-claro); font-weight: 500; }
.portada-css__liña { width: 30%; height: 2px; background: var(--ocre-claro); margin: .6rem 0 .8rem; }
.portada-css__titulo { font-family: var(--titulos); font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.portada-css__pe { margin-top: auto; padding-top: .6rem; border-top: 1px solid rgb(255 255 255 / .35); font-size: .55rem; opacity: .8; }
.guia__corpo { padding-top: 1.25rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.guia__num { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ocre-texto); }
.guia__corpo h2, .guia__corpo h3 { font-size: 1.3rem; }
.guia__corpo p { font-size: .97rem; color: #46524E; }
.guia__pe { margin-top: auto; padding-top: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }

/* Metadatos (páxinas, tamaño) e estado */
.meta { font-size: .875rem; color: var(--pedra); font-variant-numeric: tabular-nums; }
.etiqueta-estado {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  padding: .3rem .7rem; border-radius: 999px; background: var(--ocre-fondo); color: #6B4A0E;
}
.etiqueta-estado::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--ocre-claro); }

/* ---------- Listas de documentos (anexos, xornadas) ---------- */
.documentos { list-style: none; padding: 0; border-top: 1px solid var(--liña); }
.documento { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; align-items: center; padding: 1.15rem 0; border-bottom: 1px solid var(--liña); }
.documento__tipo {
  grid-row: span 2; width: 3rem; height: 3.6rem; border-radius: 3px; display: grid; place-items: end center;
  padding-bottom: .45rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--ocre-texto);
  clip-path: polygon(0 0, 72% 0, 100% 20%, 100% 100%, 0 100%);
}
.documento__tipo--xlsx { background: var(--verde); }
.documento__titulo { font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.documento__descricion { font-size: .95rem; color: #46524E; }
.documento__accion { grid-column: 2; }
@media (min-width: 48rem) {
  .documento { grid-template-columns: auto 1fr auto; }
  .documento__accion { grid-column: 3; grid-row: 1 / span 2; }
}
.baleiro { padding: 1.5rem; border: 1px dashed #B9C6BF; border-radius: var(--raio); color: var(--pedra); background: #fff; }

/* Calculadora destacada */
.calculadora { display: grid; gap: 1.5rem; padding: clamp(1.75rem, 4vw, 2.75rem); border-radius: var(--raio); background: var(--verde-escuro); color: #fff; position: relative; overflow: hidden; }
.calculadora .antetitulo { color: var(--ocre-sobre-escuro); }
.calculadora::before { content: ""; position: absolute; inset: 0; background: url("../img/curvas-nivel.svg") right center / cover no-repeat; opacity: .14; }
.calculadora > * { position: relative; }
.calculadora h2, .calculadora h3 { color: #fff; }
.calculadora p { color: rgb(255 255 255 / .88); }
.calculadora .meta { color: rgb(255 255 255 / .75); }
.calculadora .boton { background: var(--ocre-claro); border-color: var(--ocre); color: var(--tinta); }
.calculadora .boton:hover { background: #F0BC52; border-color: #F0BC52; }
.calculadora .etiqueta-estado { background: rgb(255 255 255 / .14); color: #fff; }
@media (min-width: 56rem) { .calculadora { grid-template-columns: 1fr auto; align-items: center; gap: 3rem; } }

/* ---------- Galería de gráficos ---------- */
.galeria { list-style: none; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 40rem) { .galeria { gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); } }
@media (max-width: 39.99rem) {
  .grafico__corpo { padding: .75rem .75rem .85rem; }
  .grafico__titulo { font-size: .93rem; }
  .grafico__descargas .boton { padding: .4rem .7rem; min-height: 2.25rem; font-size: .88rem; }
}
.grafico { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--liña); border-radius: var(--raio); overflow: hidden; }
.grafico__abrir { display: block; padding: 0; border: 0; background: var(--verde-claro); aspect-ratio: 4 / 5; width: 100%; position: relative; }
.grafico__abrir img { width: 100%; height: 100%; object-fit: contain; }
.grafico__abrir::after {
  content: "Ampliar"; position: absolute; right: .6rem; bottom: .6rem; font-size: .8rem; font-weight: 600;
  background: rgb(27 36 33 / .82); color: #fff; padding: .25rem .6rem; border-radius: 999px; opacity: 0; transition: opacity .15s;
}
.grafico__abrir:hover::after, .grafico__abrir:focus-visible::after { opacity: 1; }
.grafico__corpo { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.grafico__titulo { font-weight: 600; line-height: 1.3; font-size: 1rem; font-family: var(--sans); }
.grafico__descargas { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.grafico--oco .grafico__abrir { display: grid; place-items: center; cursor: default; }
.grafico--oco .grafico__abrir::after { display: none; }
.grafico__num { font-family: var(--titulos); font-size: 3rem; color: #9DB5A8; }

/* Lightbox accesible con <dialog> */
.lightbox { margin: auto; border: 0; padding: 0; max-width: min(96vw, 70rem); max-height: 94vh; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgb(15 22 19 / .88); }
.lightbox__dentro { display: flex; flex-direction: column; gap: .75rem; max-height: 94vh; }
.lightbox img { max-height: calc(94vh - 5rem); width: auto; margin-inline: auto; border-radius: 4px; background: #fff; }
.lightbox__barra { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; color: #fff; }
.lightbox__titulo { font-weight: 600; }
.lightbox__accions { display: flex; gap: .5rem; flex-wrap: wrap; }
.lightbox .boton--contorno { color: #fff; border-color: rgb(255 255 255 / .6); }
.lightbox .boton--contorno:hover { background: rgb(255 255 255 / .12); }

/* ---------- Vídeos ---------- */
.videos { display: grid; gap: clamp(3rem, 6vw, 4.5rem); }
.video { display: grid; gap: 1.5rem; align-items: start; scroll-margin-top: 6rem; }
.video__marco { position: relative; aspect-ratio: 16 / 9; background: var(--tinta); border-radius: var(--raio); overflow: hidden; }
.video__marco video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video__oco { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .9rem; text-align: center; color: #fff; padding: 1.5rem; background: var(--verde-escuro); }
.video__oco::before { content: ""; position: absolute; inset: 0; background: url("../img/curvas-nivel.svg") center / cover; opacity: .15; }
.video__oco > * { position: relative; }
.video__oco .etiqueta-estado { background: rgb(255 255 255 / .15); color: #fff; }
.video__xogo { width: 4rem; height: 4rem; border-radius: 50%; border: 2px solid rgb(255 255 255 / .6); display: grid; place-items: center; }
.video__xogo svg { width: 1.4rem; height: 1.4rem; margin-left: .2rem; }
.video__texto > * + * { margin-top: .85rem; }
.video__texto p { color: #46524E; }
.video__descargas { display: flex; flex-wrap: wrap; gap: .6rem; padding-top: .4rem; }
@media (min-width: 60rem) { .video { grid-template-columns: 1.6fr 1fr; gap: 3rem; } }

/* ---------- Xornadas ---------- */
.xornadas { list-style: none; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 60rem) { .xornadas { grid-template-columns: repeat(3, 1fr); } }
.xornada { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--liña); border-radius: var(--raio); overflow: hidden; }
.xornada__cabeza { padding: 1.6rem 1.6rem 1.4rem; background: var(--verde-claro); border-bottom: 1px solid var(--liña); }
.xornada:nth-child(2) .xornada__cabeza { background: var(--ocre-fondo); }
.xornada:nth-child(3) .xornada__cabeza { background: var(--ocre-fondo-2); }
.xornada__formato { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ocre-texto); }
.xornada__cabeza h2, .xornada__cabeza h3 { margin-top: .45rem; font-size: 1.4rem; }
.xornada__corpo { padding: 1.4rem 1.6rem 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; flex: 1; }
.xornada__datos { display: grid; font-size: .97rem; border-top: 1px solid var(--liña); }
.xornada__datos > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--liña); }
.xornada__datos dt { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--verde-texto); }
.xornada__datos dd { margin: 0; font-weight: 600; color: var(--tinta); display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; }
.selo { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.4; background: var(--ocre-fondo-2); color: var(--ocre-texto); }
.selo--suave { background: transparent; border: 1px solid var(--ocre-claro); font-weight: 500; }
.xornada__guias { gap: .4rem; }
.xornada__guias a { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--verde-claro); color: var(--verde-texto); font-weight: 700; font-size: .9rem; text-decoration: none; transition: background .15s ease, color .15s ease; }
.xornada__guias a:hover, .xornada__guias a:focus-visible { background: var(--verde); color: #fff; }
.xornada__documentos { list-style: none; padding: 0; display: grid; gap: .5rem; margin-top: auto; border-top: 1px solid var(--liña); padding-top: 1.1rem; }
.xornada__documentos li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; font-size: .97rem; }
.xornada__documentos .meta { white-space: nowrap; }
.pendente { color: var(--pedra); font-style: italic; }

/* Arquivo de actividades */
.actividades { list-style: none; padding: 0; display: grid; gap: 2rem; }
.actividade { display: grid; gap: 1.25rem; padding-bottom: 2rem; border-bottom: 1px solid var(--liña); }
.actividade__data { font-size: .9rem; font-weight: 600; color: var(--ocre-texto); }
.actividade__fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; list-style: none; padding: 0; }
.actividade__fotos img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; width: 100%; }
@media (min-width: 56rem) { .actividade { grid-template-columns: 12rem 1fr; } }

/* ---------- Texto longo (sobre, legais) ---------- */
.prosa > * + * { margin-top: 1.1rem; }
.prosa h2 { margin-top: 3rem; font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.prosa h3 { margin-top: 2rem; }
.prosa ul, .prosa ol { padding-left: 1.25rem; }
.prosa li + li { margin-top: .4rem; }
.prosa .nota { font-size: .95rem; color: var(--pedra); }

.comunidades { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--liña); border: 1px solid var(--liña); border-radius: var(--raio); overflow: hidden; }
.comunidades li { background: #fff; padding: 1.1rem 1.25rem; margin: 0; }
.comunidades strong { display: block; font-family: var(--titulos); font-size: 1.15rem; }
.comunidades span { font-size: .93rem; color: var(--pedra); }
@media (min-width: 40rem) { .comunidades { grid-template-columns: repeat(2, 1fr); } }

.aviso { padding: 1.1rem 1.25rem; border-left: 4px solid var(--ocre-claro); background: var(--ocre-fondo); border-radius: 0 var(--raio) var(--raio) 0; font-size: .98rem; }
.aviso--vermello { border-left-color: var(--vermello); background: #F7E4E0; }

/* ---------- Preguntas frecuentes ---------- */
.faq { border-top: 1px solid var(--liña); }
.faq details { border-bottom: 1px solid var(--liña); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1.5rem; align-items: baseline;
  padding: 1.3rem 0; font-family: var(--titulos); font-weight: 600; font-size: 1.2rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 400; font-size: 1.6rem; line-height: 1; color: var(--ocre-texto); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--verde-texto); }
.faq__resposta { padding-bottom: 1.5rem; color: #3B4743; max-width: 46rem; }
.faq__resposta > * + * { margin-top: .8rem; }

/* ---------- Formulario ---------- */
.formulario { display: grid; gap: 1.25rem; padding: clamp(1.5rem, 4vw, 2.5rem); background: #fff; border: 1px solid var(--liña); border-radius: var(--raio); }
.campo { display: grid; gap: .4rem; }
.campo label, .campo legend { font-weight: 600; }
.campo .axuda { font-size: .9rem; color: var(--pedra); }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: .75rem .9rem; border: 1px solid #A9B5AF; border-radius: 4px; background: #fff; font-size: 1rem;
}
.campo textarea { min-height: 9rem; resize: vertical; }
.campo input:focus-visible, .campo select:focus-visible, .campo textarea:focus-visible { outline: 3px solid var(--ocre); outline-offset: 1px; border-color: var(--verde); }
.campo [aria-invalid="true"] { border-color: var(--vermello); }
.erro { color: var(--vermello); font-size: .92rem; font-weight: 600; }
.erro:empty { display: none; }
.campos-dobres { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .campos-dobres { grid-template-columns: 1fr 1fr; } }
.formulario__estado:empty { display: none; }

/* ---------- Pé ---------- */
.pe { background: var(--verde-escuro); color: rgb(255 255 255 / .9); padding-block: 3.5rem 2rem; font-size: .97rem; }
.pe a { color: #fff; }
.pe a:hover { color: var(--ocre-sobre-escuro); }
.pe__grella { display: grid; gap: 2.5rem; }
.pe__titulo { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ocre-sobre-escuro); margin-bottom: .8rem; font-family: var(--sans); }
.pe__lista { list-style: none; padding: 0; display: grid; gap: .45rem; }
.pe__credito { display: grid; gap: 1rem; }
.pe .oco-logo { background: transparent; border-color: rgb(255 255 255 / .35); color: rgb(255 255 255 / .75); min-height: 5rem; }
.pe__baixo { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .15); display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; font-size: .9rem; color: rgb(255 255 255 / .85); }
@media (max-width: 55.99rem) { .pe__grella { grid-template-columns: 1fr 1fr; } .pe__grella > :first-child, .pe__credito { grid-column: 1 / -1; } }
@media (min-width: 56rem) { .pe__grella { grid-template-columns: 1.3fr 1fr 1fr 1.3fr; } }

/* ---------- 404 ---------- */
.erro-404 { min-height: 55vh; display: grid; align-content: center; gap: 1.25rem; padding-block: 4rem; }
.erro-404__num { font-family: var(--titulos); font-size: clamp(5rem, 16vw, 9rem); line-height: .9; color: var(--ocre-texto); }

/* ---------- Utilidades ---------- */
.visualmente-oculto { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.texto-pedra { color: var(--pedra); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  .cabeceira, .pe, .boton-menu, .heroe__accions { display: none !important; }
  body { background: #fff; }
}

/* Cartel da xornada (imaxe para redes) */
.xornada__cartel { display: block; background: var(--verde); border-bottom: 1px solid var(--liña); }
.xornada__cartel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity .15s ease; }
.xornada__cartel:hover img { opacity: .92; }

[hidden] { display: none !important; }
.calculadora [data-ficheiro] { display: grid; gap: .6rem; justify-items: start; }

/* Guías en móbil: portada pequena á esquerda e texto á dereita */
@media (max-width: 39.99rem) {
  .guias { gap: 2rem; }
  .guia { flex-direction: row; gap: 1.1rem; align-items: flex-start; }
  .guia__portada { width: 6.5rem; flex: none; }
  .guia__corpo { padding-top: 0; }
  .guia__corpo h2 { font-size: 1.2rem; }
  .guia__corpo p { font-size: .93rem; }
  .portada-css { padding: 12% 10%; }
  .portada-css__marca, .portada-css__pe { display: none; }
  .portada-css__num { font-size: 2.4rem; }
  .portada-css__titulo { font-size: .7rem; }
}

/* Comunidades socias cos seus logotipos */
.comunidades--logos .comunidade { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.6rem 1rem 1.4rem; }
.comunidades--logos img { width: min(9rem, 80%); height: auto; margin-bottom: .6rem; }
.comunidades--logos strong { font-size: 1.05rem; }
@media (max-width: 39.99rem) { .comunidades--logos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .comunidades--logos { grid-template-columns: repeat(4, 1fr); } }
.heroe__foto figcaption a { color: inherit; }
