/* ───────────── Base ───────────── */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Gochi Hand";
  src: url("../fonts/gochi-hand-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --verde: #6fa81a;
  --verde-texto: #4c7a0e;
  --azul: #0076be;
  --azul-osc: #005a93;
  --azul-noche: #00304f;
  --naranja: #e8731a;
  --amarillo: #ffe45c;
  --papel: #fbf8f1;
  --papel-2: #f3ecdc;
  --blanco: #fff;
  --tinta: #1b2a36;
  --tinta-2: #52626e;
  --linea: #e4ddcc;
  --radio: 18px;
  --sombra: 0 1px 2px rgba(20, 40, 60, 0.06), 0 10px 28px -10px rgba(20, 40, 60, 0.22);
  --sombra-alta: 0 2px 4px rgba(20, 40, 60, 0.08), 0 22px 44px -14px rgba(20, 40, 60, 0.34);
  --cuerpo: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mano: "Gochi Hand", "Bradley Hand", cursive;
  --ancho: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--cuerpo);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--azul-osc); }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 6px; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contenedor { width: min(100% - 2 * var(--gutter), var(--ancho)); margin-inline: auto; }
svg.ico { width: 1.25em; height: 1.25em; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ───────────── Botones ───────────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.8em 1.4em; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 0.95rem; text-decoration: none; line-height: 1.2;
  background: var(--azul); color: #fff;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.boton:hover { background: var(--azul-osc); transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(0, 60, 100, 0.6); }
.boton:active { transform: none; }
.boton--amarillo { background: var(--amarillo); color: var(--tinta); }
.boton--amarillo:hover { background: #ffd92e; }
.boton--verde { background: var(--verde-texto); }
.boton--verde:hover { background: #3d6309; }
.boton--contorno { background: transparent; color: var(--azul-osc); border-color: currentColor; }
.boton--contorno:hover { background: rgba(0, 118, 190, 0.08); box-shadow: none; }
.boton--peligro { background: #b3261e; }
.boton--peligro:hover { background: #8c1d17; }
.boton--chico { padding: 0.5em 1em; font-size: 0.85rem; }
.boton[disabled] { opacity: 0.5; pointer-events: none; }

/* ───────────── Cabecera / hero ───────────── */
.hero {
  position: relative; color: #fff; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(111, 168, 26, 0.35), transparent 60%),
    linear-gradient(165deg, #0a84d0 0%, var(--azul-osc) 55%, var(--azul-noche) 100%);
  padding-bottom: clamp(80px, 12vw, 140px);
}
/* hoja de cuaderno: renglones y margen rojo */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent calc(var(--margen, 9%) - 1px), rgba(255, 130, 130, 0.35) calc(var(--margen, 9%) - 1px), rgba(255, 130, 130, 0.35) calc(var(--margen, 9%) + 1px), transparent calc(var(--margen, 9%) + 1px)),
    repeating-linear-gradient(180deg, transparent 0 47px, rgba(255, 255, 255, 0.09) 47px 48px);
}
.hero__barra { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.hero__logo { width: clamp(110px, 18vw, 150px); height: auto; }
.hero__enlace {
  display: inline-flex; align-items: center; gap: 0.5em; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; opacity: 0.9; padding: 0.45em 0.9em; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}
.hero__enlace:hover { background: rgba(255, 255, 255, 0.14); opacity: 1; }
.hero__enlace svg { width: 1em; height: 1em; }

.hero__cuerpo {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center;
  padding-top: clamp(24px, 6vw, 64px);
}
.hero__etiqueta {
  display: inline-block; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.45em 1em; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3);
}
.hero h1 { font-size: clamp(2.5rem, 8.5vw, 5rem); font-weight: 800; margin: 18px 0 6px; letter-spacing: -0.03em; }
.hero__lema {
  font-family: var(--mano); font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.2; color: #fff;
  display: inline; padding: 0 0.3em; margin-left: -0.3em;
  background: linear-gradient(transparent 12%, rgba(255, 228, 92, 0.9) 12% 92%, transparent 92%);
  color: var(--tinta); -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero__lema-bloque { margin: 12px 0 22px; }
.hero__intro { max-width: 36em; font-size: 1.05rem; color: rgba(255, 255, 255, 0.92); }
.hero__acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__cifras { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 38px; }
.cifra { display: flex; flex-direction: column; }
.cifra b { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1; }
.cifra span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; margin-top: 4px; }

/* carteles del programa (castellano y portugués), como fotos pegadas */
.carteles { display: flex; justify-content: center; align-items: flex-start; gap: 14px; padding-top: 10px; }
.cartel {
  position: relative; flex: 0 1 215px; min-width: 0; margin: 0; padding: 8px 8px 10px; border: 0; border-radius: 6px;
  background: #fff; color: var(--tinta); box-shadow: var(--sombra-alta); cursor: zoom-in; text-align: center;
  transform: rotate(-3deg); transition: transform 0.2s;
}
.cartel:nth-child(2) { transform: rotate(3deg); margin-top: 22px; }
.cartel:hover, .cartel:focus-visible { transform: rotate(0) scale(1.04); z-index: 1; }
.cartel img { width: 100%; height: auto; border-radius: 2px; }
.cartel span { display: block; margin-top: 6px; font-family: var(--mano); font-size: 1.15rem; line-height: 1.1; }
.cartel::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 70px; height: 24px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 228, 92, 0.85); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
@media (min-width: 880px) {
  .hero__cuerpo { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}
.hero__ola { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(40px, 7vw, 90px); }

/* ───────────── Explorador ───────────── */
.explorador { padding-block: clamp(36px, 6vw, 64px) 72px; }
.explorador__cabecera { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 32px; }
.explorador h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); font-weight: 800; }
.explorador__sub { color: var(--tinta-2); margin-top: 6px; max-width: 32em; }

.buscador { position: relative; flex: 1 1 280px; max-width: 420px; }
.buscador svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--tinta-2); pointer-events: none; }
.buscador input {
  width: 100%; font: inherit; padding: 0.85em 1.1em 0.85em 2.9em; border-radius: 999px;
  border: 2px solid var(--linea); background: #fff; color: var(--tinta);
}
.buscador input:focus { border-color: var(--azul); outline: none; box-shadow: 0 0 0 4px rgba(0, 118, 190, 0.15); }

.chips { display: flex; gap: 8px; margin: 26px 0 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.55em; padding: 0.55em 1.1em;
  border-radius: 999px; border: 2px solid var(--linea); background: #fff; font-weight: 600; font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--tinta-2)); }
.chip small { font-weight: 600; color: var(--tinta-2); font-size: 0.8em; }
.chip:hover { border-color: var(--c, var(--tinta-2)); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.75); }

.grupo { margin-top: 38px; }
.grupo h3 {
  display: flex; align-items: center; gap: 0.6em; font-size: 1.35rem; font-weight: 800;
  padding-bottom: 12px; border-bottom: 2px solid var(--linea); margin-bottom: 22px;
}
.grupo h3 i { width: 14px; height: 14px; border-radius: 4px; background: var(--c); transform: rotate(45deg); }
.grupo h3 small { font-weight: 600; font-size: 0.85rem; color: var(--tinta-2); margin-left: auto; }

.rejilla { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }

.obra {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radio); overflow: hidden;
  text-decoration: none; color: inherit; box-shadow: var(--sombra); border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.obra:hover { transform: translateY(-4px); box-shadow: var(--sombra-alta); }
.obra:hover .obra__portada img { transform: scale(1.05); }
.obra__portada { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--papel-2); }
.obra__portada img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.obra__cinta { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; }
.insignia {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.75em; border-radius: 999px;
  background: rgba(14, 28, 40, 0.82); color: #fff; font-size: 0.75rem; font-weight: 700; backdrop-filter: blur(4px);
}
.insignia svg { width: 1.1em; height: 1.1em; }
.obra__cuerpo { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.obra__ubic { display: flex; align-items: center; gap: 0.4em; font-size: 0.78rem; font-weight: 700; color: var(--c, var(--azul)); text-transform: uppercase; letter-spacing: 0.06em; }
.obra__ubic svg { width: 1.15em; height: 1.15em; }
.obra h4 { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.obra__zona { color: var(--tinta-2); font-size: 0.9rem; }

/* portada sin imagen: hoja de cuaderno con el nombre del país a mano */
.portada-papel {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background:
    linear-gradient(90deg, transparent 13%, rgba(214, 120, 120, 0.55) 13% calc(13% + 2px), transparent calc(13% + 2px)),
    repeating-linear-gradient(180deg, #fffdf7 0 27px, #cfe2e6 27px 28px);
}
.portada-papel span {
  font-family: var(--mano); font-size: clamp(2.6rem, 9vw, 3.6rem); color: var(--c); transform: rotate(-4deg); padding: 0 14%; line-height: 1.05;
}

.vacio {
  margin-top: 40px; padding: 48px 24px; text-align: center; border: 2px dashed var(--linea); border-radius: var(--radio); color: var(--tinta-2);
}
.vacio b { display: block; font-size: 1.2rem; color: var(--tinta); margin-bottom: 6px; }

.esqueleto { height: 300px; border-radius: var(--radio); background: linear-gradient(100deg, #efe8d6 30%, #f8f3e6 50%, #efe8d6 70%) 0 0 / 300% 100%; animation: brillo 1.4s infinite linear; }
@keyframes brillo { to { background-position: -300% 0; } }

/* ───────────── Pie ───────────── */
.pie { background: var(--azul-noche); color: rgba(255, 255, 255, 0.85); padding-block: 44px; font-size: 0.9rem; }
.pie__fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.pie img { width: 130px; height: auto; }
.pie a { color: #fff; }
.pie__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.pie__acceso { opacity: 0.6; }
.pie__acceso:hover { opacity: 1; }

/* ───────────── Ficha de obra ───────────── */
.cabecera-ficha {
  position: relative; color: #fff; isolation: isolate; overflow: hidden;
  background: linear-gradient(165deg, #0a84d0 0%, var(--azul-osc) 60%, var(--azul-noche) 100%);
  padding-bottom: clamp(60px, 9vw, 96px);
}
.cabecera-ficha::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(180deg, transparent 0 47px, rgba(255, 255, 255, 0.08) 47px 48px);
}
.volver {
  display: inline-flex; align-items: center; gap: 0.4em; color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  padding: 0.45em 1em 0.45em 0.7em; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.45);
}
.volver:hover { background: rgba(255, 255, 255, 0.14); }
.volver svg { width: 1.2em; height: 1.2em; }
.miga { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: clamp(20px, 5vw, 44px); font-size: 0.85rem; font-weight: 600; }
.miga span { padding: 0.35em 0.9em; border-radius: 999px; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.28); }
.miga span:first-child { background: var(--c); border-color: transparent; }
.miga svg { width: 1.1em; opacity: 0.6; margin-inline: -2px; }
.cabecera-ficha h1 { font-size: clamp(2.2rem, 7vw, 3.8rem); font-weight: 800; letter-spacing: -0.025em; margin-top: 14px; }
.cabecera-ficha__zona { display: flex; align-items: center; gap: 0.5em; margin-top: 10px; font-size: 1.05rem; opacity: 0.92; }
.cabecera-ficha__zona svg { width: 1.3em; }
.etiqueta-provincia { margin-left: 8px; font-family: var(--mano); font-size: 1.25rem; padding: 0 0.5em; background: rgba(255, 228, 92, 0.92); color: var(--tinta); border-radius: 4px; transform: rotate(-1.5deg); display: inline-block; }

.ficha { display: grid; gap: 36px; margin-top: -48px; padding-bottom: 72px; position: relative; }
@media (min-width: 960px) { .ficha { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 40px; } }
.ficha__principal { display: grid; gap: 28px; min-width: 0; }
.panel { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: clamp(18px, 3.5vw, 30px); border: 1px solid rgba(0, 0, 0, 0.04); }
.panel > h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 0.5em; }
.panel > h2 svg { width: 1.2em; color: var(--c, var(--azul)); }
.panel--video { padding: 0; overflow: hidden; background: #000; }
.reproductor { position: relative; aspect-ratio: 16 / 9; background: #000; }
.reproductor video { width: 100%; height: 100%; background: #000; object-fit: contain; }
.reproductor + .reproductor { margin-top: 2px; }
.reproductor__titulo { padding: 12px 18px; background: #0d1b26; color: #fff; font-weight: 600; font-size: 0.9rem; }
.texto p + p { margin-top: 1em; }
.texto { font-size: 1.05rem; max-width: 62ch; }
.texto p { white-space: pre-line; }

.documentos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.documento {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: inherit;
  border: 2px solid var(--linea); transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.documento:hover { border-color: var(--azul); background: #f4faff; transform: translateX(3px); }
.documento__icono {
  flex: none; width: 48px; height: 56px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; position: relative; clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
}
.documento__datos { flex: 1; min-width: 0; }
.documento__nombre { font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; }
.documento__meta { font-size: 0.82rem; color: var(--tinta-2); }
.documento__accion { flex: none; display: inline-flex; align-items: center; gap: 0.4em; color: var(--azul-osc); font-weight: 700; font-size: 0.88rem; }
.documento__accion svg { width: 1.2em; }
@media (max-width: 480px) { .documento__accion span { display: none; } }

.galeria { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.galeria button { padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--papel-2); }
.galeria img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.galeria button:hover img { transform: scale(1.06); }
dialog.visor { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.visor::backdrop { background: rgba(8, 18, 28, 0.88); }
dialog.visor img { max-width: 96vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
.visor__cerrar { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); display: grid; place-items: center; }
.visor__cerrar svg { width: 22px; }

.lateral { display: grid; gap: 20px; position: sticky; top: 20px; }
.tarjeta-qr { text-align: center; }
.tarjeta-qr h2 { justify-content: center; font-size: 1.1rem; margin-bottom: 14px; }
.tarjeta-qr svg.qr { width: min(220px, 100%); margin: 0 auto; border-radius: 10px; border: 1px solid var(--linea); }
.tarjeta-qr p { font-size: 0.85rem; color: var(--tinta-2); margin: 12px 0 16px; }
.tarjeta-qr__acciones { display: grid; gap: 8px; }
.otras { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.otras a { display: block; padding: 10px 12px; margin-inline: -12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--tinta); }
.otras a:hover { background: var(--papel-2); }
.otras small { display: block; font-weight: 500; color: var(--tinta-2); }
@media (max-width: 959px) { .lateral { position: static; } }

.aviso-estado { text-align: center; padding: 80px 20px; }
.aviso-estado h1 { font-size: 1.8rem; margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--tinta); color: #fff; padding: 0.8em 1.4em; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--sombra-alta); transition: opacity 0.25s, transform 0.25s; z-index: 100; max-width: 92vw;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── Colaboradores ───────────── */
.colaboran { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.colaboran a { display: block; }
.colaboran img { height: 44px; width: auto; }
.hero__barra .colaboran { margin-left: auto; }
.pie .colaboran img { height: 52px; }
.hero__barra .colaboran img, .cabecera-ficha .colaboran img { height: 56px; }
