/* IPPA — sistema visual
   Tinta: azul noche de la pampa. Azul y verde: los del logo del IPPA.
   Hormigón: el gris piedra de Salamone. */
:root {
  --tinta: #0f1f3a;
  --azul: #253775;
  --celeste: #bcd6f2;
  --hormigon: #d6d2c8;
  --hormigon-claro: #ecebe6;
  --verde: #c4d22c;
  --blanco: #ffffff;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text: "Public Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--hormigon-claro);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--blanco); padding: 8px 12px; }
.skip:focus { left: 8px; }
.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: .95;
  letter-spacing: -.01em;
  margin: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  color: var(--blanco);
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.site-header.is-solid {
  background: var(--blanco);
  color: var(--tinta);
  box-shadow: 0 1px 0 rgba(15, 31, 58, .12);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo { display: block; height: 40px; width: auto; }
.brand__logo--color { display: none; }
.site-header.is-solid:not(.menu-open) .brand__logo--claro { display: none; }
.site-header.is-solid:not(.menu-open) .brand__logo--color { display: block; }
.brand__name { font-size: .75rem; line-height: 1.25; opacity: .85; }

.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; align-items: center; }
.nav a, .nav__label { text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav__group { position: relative; }
.nav__label { cursor: default; }
.nav__sub {
  list-style: none; margin: 0; padding: 10px 0;
  position: absolute; top: 100%; left: -16px; min-width: 220px;
  background: var(--blanco); color: var(--tinta);
  box-shadow: 0 12px 32px rgba(15, 31, 58, .18);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav__sub a { display: block; padding: 8px 16px; font-weight: 400; }
.nav__group:hover .nav__sub,
.nav__group:focus-within .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__group::after { content: ""; position: absolute; inset: 100% -16px auto; height: 12px; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .brand__name { display: none; }
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px;
    background: none; border: 0; color: inherit; cursor: pointer;
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    display: block; width: 24px; height: 2px; background: currentColor; position: relative; content: "";
    transition: transform .25s;
  }
  .nav-toggle__bar::before { position: absolute; top: -7px; }
  .nav-toggle__bar::after { position: absolute; top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    background: var(--tinta); color: var(--blanco);
    padding: 24px var(--gutter);
    overflow-y: auto;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: flex-start; gap: 20px; }
  .nav a, .nav__label { font-size: 1.25rem; }
  .nav__label { opacity: .6; font-size: .9rem; }
  .nav__sub { position: static; opacity: 1; visibility: visible; transform: none; background: none; color: inherit; box-shadow: none; padding: 6px 0 0 0; }
  .nav__sub a { padding: 6px 0; font-size: 1.25rem; }
  .site-header.menu-open { background: var(--tinta); color: var(--blanco); box-shadow: none; }
}

/* ---------- Hero ---------- */
.hero { height: 190vh; position: relative; background: var(--tinta); }
.hero__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  color: var(--blanco);
}
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: 60% 40%;
  transform: scale(calc(1.04 + var(--p, 0) * .22)) translateY(calc(var(--p, 0) * -4%));
  transform-origin: 62% 45%;
  will-change: transform;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(15, 31, 58, .85) 0%, rgba(15, 31, 58, .15) 55%, rgba(15, 31, 58, .35) 100%);
  opacity: calc(.85 + var(--p, 0) * .15);
}
.hero__shade::after {
  content: ""; position: absolute; inset: 0; background: var(--tinta);
  opacity: calc(var(--p, 0) * var(--p, 0) * .9);
}
.hero__copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(72px, 14vh, 140px);
  transform: translateY(calc(var(--p, 0) * -28vh));
  opacity: calc(1 - var(--p, 0) * 1.6);
}
.hero__title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.6rem, min(10.5vw, 15vh), 9.5rem);
  line-height: .86; letter-spacing: -.005em;
  margin: 0;
}
.hero__title span { display: block; }
.hero__title span:nth-child(2) { color: var(--verde); }
.hero__place { margin: 20px 0 0; font-size: clamp(1rem, 1.6vw, 1.25rem); max-width: 40ch; }
.hero__cue {
  position: absolute; right: var(--gutter); bottom: clamp(24px, 5vh, 48px);
  font-size: .9rem; font-weight: 600; text-decoration: none;
  padding-bottom: 28px;
  opacity: calc(1 - var(--p, 0) * 3);
}
.hero__cue::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 22px; background: currentColor;
  animation: cue 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Nosotros (pinning) ---------- */
.story { position: relative; height: 480vh; background: var(--tinta); }
.story__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  color: var(--blanco);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  padding: calc(var(--header-h) + 24px) var(--gutter) clamp(32px, 6vh, 64px);
}
.story__photos img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 1s ease, transform 6s ease-out;
}
.story__photos img.is-active { opacity: 1; transform: scale(1.02); }
.story__shade {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(15, 31, 58, .92) 0%, rgba(15, 31, 58, .7) 42%, rgba(15, 31, 58, .1) 80%);
}
.story__section {
  position: relative; grid-column: 1 / -1;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: .04em;
  margin: 0; color: var(--celeste);
}
.story__steps { position: relative; grid-column: 1; align-self: center; max-width: 640px; display: grid; }
.step {
  grid-area: 1 / 1;
  align-self: center;
  opacity: 0; transform: translateY(40px);
  transition: opacity .6s ease, transform .6s ease;
  pointer-events: none;
}
.step.is-active { opacity: 1; transform: none; pointer-events: auto; }
.step.is-past { transform: translateY(-40px); }
.step__title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.2rem, min(6.5vw, 9vh), 5.5rem); line-height: .9; margin: 0 0 clamp(12px, 2.5vh, 24px);
}
.step p, .step__list { font-size: clamp(.95rem, min(1.35vw, 2.1vh), 1.2rem); line-height: 1.6; margin: 0 0 14px; max-width: 58ch; }
.step__list { padding-left: 1.1em; }
.step__list li { margin-bottom: 10px; }
.step__list li::marker { color: var(--verde); }

.story__index {
  position: relative; grid-column: 2; align-self: center;
  display: flex; flex-direction: column; gap: 4px;
  border-left: 1px solid rgba(255, 255, 255, .25);
}
.story__index button {
  background: none; border: 0; color: rgba(255, 255, 255, .6);
  font: 600 .9rem var(--text); text-align: left; cursor: pointer;
  padding: 8px 0 8px 18px; margin-left: -1px; border-left: 3px solid transparent;
  transition: color .3s, border-color .3s;
}
.story__index button:hover { color: var(--blanco); }
.story__index button[aria-current="true"] { color: var(--blanco); border-left-color: var(--verde); }

@media (max-width: 860px) {
  .story__stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .story__shade { background: linear-gradient(to top, rgba(15, 31, 58, .95) 0%, rgba(15, 31, 58, .75) 60%, rgba(15, 31, 58, .35) 100%); }
  .story__steps { align-self: end; }
  .step { align-self: end; }
  .story__index { grid-column: 1; flex-direction: row; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .25); margin-top: 16px; overflow-x: auto; }
  .story__index button { padding: 10px 10px 0 0; border-left: 0; border-top: 3px solid transparent; margin: -1px 8px 0 0; white-space: nowrap; font-size: .8rem; }
  .story__index button[aria-current="true"] { border-top-color: var(--verde); }
}

/* ---------- Publicaciones ---------- */
.pubs { padding: clamp(80px, 12vw, 160px) 0; background: var(--hormigon-claro); }
.pubs__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.link-more { font-weight: 600; color: var(--azul); text-underline-offset: 4px; }
.pubs__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); }
.pub {
  display: grid; grid-template-columns: 80px 1fr auto auto; gap: 8px 32px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px solid rgba(15, 31, 58, .2);
}
.pub__year { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--azul); }
.pub__title { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; margin: 0; }
.pub__meta { font-size: .9rem; opacity: .7; white-space: nowrap; }
.pub__actions { display: flex; gap: 8px; }
.pub__actions a {
  text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: 8px 16px; border: 1.5px solid var(--tinta);
  transition: background-color .2s, color .2s;
}
.pub__actions a:hover { background: var(--tinta); color: var(--blanco); }
.pub__actions a[download] { background: var(--tinta); color: var(--blanco); }
.pub__actions a[download]:hover { background: var(--azul); border-color: var(--azul); }
@media (max-width: 700px) {
  .pub { grid-template-columns: 1fr auto; }
  .pub__year { grid-column: 1 / -1; font-size: 1.2rem; }
  .pub__title { grid-column: 1 / -1; }
}

/* ---------- Localidades ---------- */
.places { padding: 0 0 clamp(80px, 12vw, 160px); background: var(--hormigon-claro); }
.places__intro { margin: 16px 0 40px; max-width: 52ch; }
.places__grid {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 12px;
  max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto;
}
.place {
  position: relative; display: flex; align-items: flex-end;
  height: clamp(220px, 34vw, 440px); overflow: hidden;
  text-decoration: none; color: var(--blanco); background: var(--tinta);
}
.place img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.place--photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(15, 31, 58, .85), rgba(15, 31, 58, 0) 55%);
}
.place:hover img { transform: scale(1.05); }
.place__name {
  position: relative; z-index: 2; padding: 20px;
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: .9;
}
.place--plain { background: var(--azul); }
.place--plain.place--alt { background: var(--tinta); }
.place--plain::after {
  /* trama de surcos: campo arado visto desde arriba */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-28deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 18px);
  transition: transform .8s ease;
}
.place--plain:hover::after { transform: translateX(18px); }
@media (max-width: 860px) {
  .places__grid { grid-template-columns: 1fr 1fr; }
  .places__grid li:first-child { grid-column: 1 / -1; }
}

/* ---------- Contacto ---------- */
.contact { position: relative; overflow: hidden; color: var(--blanco); padding: clamp(100px, 16vw, 200px) 0; background: var(--tinta); }
.contact__bg {
  position: absolute; left: 0; width: 100%; height: 130%; top: -15%; object-fit: cover;
  transform: translateY(calc((var(--p, .5) - .5) * -16%));
  will-change: transform;
}
.contact__shade { position: absolute; inset: 0; background: rgba(15, 31, 58, .72); }
.contact__body { position: relative; }
.contact__lead { margin: 32px 0 4px; font-size: 1.1rem; opacity: .85; }
.contact__mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0 0 48px; }
.contact__mail a {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2rem, 7vw, 5.5rem); line-height: 1; text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--verde), var(--verde)) 0 100% / 0 4px no-repeat;
  transition: background-size .4s ease;
}
.contact__mail a:hover { background-size: 100% 4px; }
.copy {
  font: 600 .9rem var(--text); color: var(--blanco); background: none;
  border: 1.5px solid rgba(255, 255, 255, .6); padding: 8px 16px; cursor: pointer;
}
.copy:hover { border-color: var(--blanco); }
.contact__data { display: flex; flex-wrap: wrap; gap: 24px 64px; margin: 0; }
.contact__data dt { font-size: .85rem; color: var(--celeste); margin-bottom: 4px; }
.contact__data dd { margin: 0; font-size: 1.15rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--tinta); color: rgba(255, 255, 255, .75); padding: 32px 0 48px; font-size: .85rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.site-footer p { margin: 0 0 12px; }
.credits summary { cursor: pointer; }
.credits ul { margin: 12px 0 0; padding-left: 1.1em; }
.credits li { margin-bottom: 6px; }

/* ---------- Sin movimiento ----------
   Con "reducir movimiento" (o sin JS) todo se ve estático y apilado. */
.no-motion .hero { height: auto; }
.no-motion .hero__stage { position: relative; }
.no-motion .hero__img, .no-motion .hero__copy, .no-motion .contact__bg { transform: none; }
.no-motion .hero__copy, .no-motion .hero__cue { opacity: 1; }
.no-motion .hero__shade::after { opacity: 0; }
.no-motion .hero__cue::after { animation: none; }
.no-motion .story { height: auto; }
.no-motion .story__stage { position: relative; height: auto; display: block; }
.no-motion .story__photos img:not(:first-child) { display: none; }
.no-motion .story__photos img { opacity: 1; transform: none; transition: none; }
.no-motion .story__steps { display: block; max-width: 680px; }
.no-motion .step { position: relative; opacity: 1; transform: none; margin: 48px 0; pointer-events: auto; transition: none; }
.no-motion .story__index { display: none; }

/* =========================================================
   Páginas internas
   ========================================================= */
.inner main { padding-top: var(--header-h); }
.crumb { margin: 0 0 8px; font-weight: 600; font-size: .9rem; color: var(--azul); }
.page-head { padding: clamp(48px, 8vw, 96px) 0 24px; }
.page-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.8rem, 8vw, 6.5rem); line-height: .88; margin: 0 0 20px;
}
.pubs--page { padding-top: 24px; }

/* Buscador y filtros */
.filters { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 32px; }
.search { flex: 1 1 280px; max-width: 460px; }
.search input {
  width: 100%; font: 1rem var(--text); color: var(--tinta);
  padding: 12px 14px 12px 42px; border: 1.5px solid var(--tinta); border-radius: 0;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%230f1f3a' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m12.5 12.5 4 4'/%3E%3C/svg%3E") 14px 50% no-repeat;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 600 .875rem var(--text); color: var(--tinta); background: transparent;
  border: 1.5px solid rgba(15, 31, 58, .35); padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--tinta); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }
.chip__n { font-weight: 400; opacity: .7; margin-left: 2px; }
.empty { padding: 32px 0; font-size: 1.1rem; }
.results { margin: 0; min-height: 1.6em; font-size: .9rem; opacity: .75; }

/* Banda de cabecera de localidad */
.band {
  position: relative; overflow: hidden; color: var(--blanco); background: var(--tinta);
  min-height: clamp(280px, 46vh, 500px); display: flex; align-items: flex-end;
}
.band__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band--photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(15, 31, 58, .9), rgba(15, 31, 58, .1) 70%);
}
.band--plain { background: var(--azul); }
.band--plain.band--alt { background: var(--tinta); }
.band--plain::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-28deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 22px);
}
.band__copy { position: relative; z-index: 2; padding: 48px 0 40px; }
.band .crumb { color: var(--celeste); }
.band__title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(3.4rem, 12vw, 9rem); line-height: .85; margin: 0;
}
.band__sub { margin: 16px 0 0; max-width: 52ch; }

/* Guía */
.guide__bar {
  position: sticky; top: var(--header-h); z-index: 20;
  background: var(--hormigon-claro); border-bottom: 1px solid rgba(15, 31, 58, .15);
  padding: 16px 0;
}
.guide__tools { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.guide__body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 24px; padding-bottom: 120px; }
.guide__index { position: sticky; top: calc(var(--header-h) + 96px); align-self: start; max-height: calc(100vh - var(--header-h) - 120px); overflow-y: auto; font-size: .9rem; padding-top: 40px; }
.guide__index ul { list-style: none; margin: 0; padding: 0; }
.guide__index > ul > li { margin-bottom: 14px; }
.guide__index > ul > li > a { font-weight: 600; text-decoration: none; }
.guide__index li ul { margin-top: 6px; padding-left: 12px; border-left: 1px solid rgba(15, 31, 58, .2); }
.guide__index li li { margin: 4px 0; }
.guide__index li li a { text-decoration: none; opacity: .75; }
.guide__index a:hover { text-decoration: underline; opacity: 1; }

.cat { margin-top: 40px; scroll-margin-top: calc(var(--header-h) + 110px); }
.cat__title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1; margin: 0;
  padding-bottom: 10px; border-bottom: 2px solid var(--tinta);
}
.group { scroll-margin-top: calc(var(--header-h) + 110px); }
.group__title { font-size: 1.05rem; font-weight: 600; color: var(--azul); margin: 32px 0 4px; }
.entries { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 40px; }
.entry { padding: 18px 0; border-bottom: 1px solid rgba(15, 31, 58, .15); }
.entry__name { font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; line-height: 1.3; }
.entry__noname { font-weight: 400; font-style: italic; }
.entry__data { margin: 0; font-size: .92rem; line-height: 1.45; }
.entry__data div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; margin-top: 3px; }
.entry__data dt { opacity: .6; }
.entry__data dd { margin: 0; overflow-wrap: anywhere; }
.entry__data a { color: var(--azul); text-underline-offset: 3px; }
.maps { font-size: .82rem; margin-left: 4px; white-space: nowrap; }

@media (max-width: 960px) {
  .guide__body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide__index { display: none; }
  .guide__tools .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
  .search { max-width: none; }
}
.results:empty { display: none; }
