/* Portada index (CAP 0) — estilos específicos de la home */

/* Bajo 820px la topbar pasa a dos filas (~145px) pero .home solo reserva 118px,
   por lo que la barra fija tapaba la parte superior de la portada. Reservamos la
   altura real de la topbar para que no quede cortada por arriba. */
@media (max-width: 820px) {
  .home {
    padding-top: 150px;
  }
}

/* Portada — ajuste a la altura real de la imagen en pantallas estrechas
   (evita el hueco vertical al usar object-fit: contain sobre 100svh) */
@media (max-width: 920px) {
  .home .cover {
    display: block;
    height: auto;
    min-height: 0;
  }

  .home .cover__image,
  .home .cover > .gif-once-stack,
  .home .cover .gif-once-stack .cover__image {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
  }
}

/* BIENVENIDA — composición editorial Bauhaus
------------------------------------------------------------ */
.home-welcome-lede {
  padding: clamp(3.25rem, 6vw, 4.75rem) 0;
  background: var(--c-white);
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}
.home-welcome-lede h2 {
  color: var(--c-ink)!important;
}
.home-welcome-lede__title {
  margin: 0 auto;
  max-width: 22ch;
  font-family: var(--ff-heading);
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--ls-tight);
  color: #000;
  text-align: center;
  text-transform: none;
}

.home-welcome-lede__title span {
  color: inherit;
}

.home-welcome {
  padding: 0;
  background: var(--c-paper);
  border-top: 1px solid var(--c-rule);
}

.home-welcome__stage {
  position: relative;
  --welcome-divider-x: 58%;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(4rem, 9vw, 7rem);
}

.home-welcome__prose {
  margin: 0 auto;
  max-width: min(114ch, 100%);
  color: inherit;
}

.home-welcome__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(217px, 22.5rem);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  justify-content: center;
}

.home-welcome__copy {
  max-width: 42rem;
}

.home-welcome__quote {
  margin: 0;
  font-family: var(--ff-heading);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: var(--ls-tight);
  color: var(--c-ink);
}

.home-welcome__quote p {
  margin: 0;
}

.home-welcome__attrib {
  margin: clamp(.85rem, 1.6vw, 1.15rem) 0 0;
  font-family: var(--ff-ui);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #000;
}

.home-welcome__rule {
  display: block;
  width: clamp(4.5rem, 10vw, 5.5rem);
  height: auto;
  margin: clamp(1rem, 2vw, 1.35rem) 0 clamp(1.25rem, 2.4vw, 1.75rem);
}

.home-welcome__text {
  font-size: 1.0625rem;
  line-height: var(--lh-relaxed);
  color: #000;
  max-width: 52ch;
}

.home-welcome__text p {
  margin: 0;
}

.home-welcome__text p + p {
  margin-top: 1em;
}

.home-welcome__actions {
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

.home-welcome__action {
  display: inline-flex;
}

.home-welcome__action img {
  display: block;
  width: clamp(4.5rem, 8vw, 5.5rem);
  height: auto;
}

.home-welcome__qr {
  justify-self: center;
  text-align: center;
  padding-top: clamp(1rem, 3vw, 2.5rem);
}

.home-welcome__qr-label {
  margin: 0 0 .85rem;
  font-family: var(--ff-ui);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #b08a57;
}

.home-welcome__qr-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  padding: .35rem;
  background: var(--c-white);
}

.home-welcome__qr-code {
  display: block;
  width: clamp(6.5rem, 10vw, 8.25rem);
  height: auto;
}

.home-welcome__qr-corner {
  position: absolute;
  width: .85rem;
  height: .85rem;
}

.home-welcome__qr-corner--tl {
  top: 0;
  left: 0;
  background: #206cb6;
}

.home-welcome__qr-corner--tr {
  top: 0;
  right: 0;
  background: #00a239;
}

.home-welcome__qr-corner--bl {
  bottom: 0;
  left: 0;
  background: #de2126;
}

.home-welcome__card {
  justify-self: start;
    width: min(100%, 15.5rem);
}

.home-welcome__card-inner {
  position: relative;
  display: block;
  padding: 0;
  border-radius: 2.1rem;
  background: transparent;
  box-shadow: none;
}

.home-welcome__front-figure {
  position: absolute;
  left: 69.75rem;
  top: 67.85%;
  transform: translate(-50%, -50%);
  width: clamp(25rem, 34vw, 37.5rem);
  height: auto;
  z-index: 0;
  pointer-events: none;
}

.home-welcome__card-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2.1rem;
  box-shadow: 0 18px 42px -28px rgba(12, 12, 15, .28);
}

.home-welcome__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.home-welcome__nfc {
  display: grid;
  justify-items: center;
  gap: .2rem;
  color: var(--c-ink);
  font-family: var(--ff-ui);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.home-welcome__nfc svg {
  width: 2rem;
  height: auto;
}

.home-welcome__card-dot {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #00a239;
  flex: 0 0 auto;
}

.home-welcome__card-title {
  display: grid;
  gap: .15rem;
  font-family: var(--ff-heading);
  font-size: clamp(.95rem, 1.5vw, 1.05rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--c-ink);
}

.home-welcome__card-year {
  margin-top: .35rem;
  font-size: clamp(2rem, 3.4vw, 2.45rem);
  font-weight: 700;
  line-height: 1;
  color: #00a239;
}

.home-welcome__card-art {
  position: relative;
  min-height: 9.5rem;
}

.home-welcome__card-shape {
  position: absolute;
}

.home-welcome__card-shape--red {
  left: 0;
  bottom: 1.2rem;
  width: 2.1rem;
  height: 5.4rem;
  background: #de2126;
}

.home-welcome__card-shape--yellow {
  left: 1.15rem;
  bottom: .35rem;
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 50%;
  background: #faa739;
}

.home-welcome__card-shape--lines {
  right: 0;
  bottom: .2rem;
  width: 3.4rem;
  height: 6.4rem;
  background:
    repeating-linear-gradient(
      90deg,
      #111 0 1px,
      transparent 1px 5px
    );
}

.home-welcome__card-shape--blue {
  right: 0;
  bottom: 0;
  width: 2.2rem;
  height: 1.35rem;
  background: #206cb6;
}

.home-welcome__card-shape--vline {
  left: 54%;
  top: .2rem;
  bottom: 0;
  width: 1px;
  background: #111;
}

.home-welcome__card-logo {
  display: block;
  width: min(100%, 9.5rem);
  height: auto;
  margin: 0 auto;
}

.home-welcome__decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.home-welcome__decor-line {
  position: absolute;
  background: #111;
}

.home-welcome__decor-line--h {
  left: 0;
  right: 0;
  top: 72%;
  height: 1px;
}

.home-welcome__decor-line--v {
  top: 0;
  bottom: 0;
  left: var(--welcome-divider-x);
  width: 1px;
}

.home-welcome__decor-semi {
  position: absolute;
  left: 50%;
  top: calc(72% - 2.1rem);
  width: 4.2rem;
  height: 2.1rem;
  transform: translateX(-50%);
  border-radius: 4.2rem 4.2rem 0 0;
  background: #e84616;
}

.home-welcome__decor-lines {
  position: absolute;
  left: 34%;
  bottom: 0;
  width: clamp(7rem, 14vw, 11rem);
  height: clamp(4.5rem, 8vw, 6.5rem);
  background:
    repeating-linear-gradient(
      90deg,
      #111 0 1px,
      transparent 1px 5px
    );
  mask-image: linear-gradient(to top, #000 70%, transparent);
}

.home-welcome__decor-dots {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 2.5vw, 2rem);
  width: 3.4rem;
  height: 2.5rem;
  background-image: radial-gradient(circle, #111 1.5px, transparent 1.6px);
  background-size: .85rem .85rem;
}

@media (max-width: 1080px) {
  .home-welcome__grid {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.85fr);
  }

  .home-welcome__card {
    grid-column: 2;
    align-self: center;
  }

  .home-welcome__stage { --welcome-divider-x: 66%; }
}

@media (max-width: 760px) {
  .home-welcome__grid {
    grid-template-columns: 1fr;
  }

  .home-welcome__card {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
  }

  .home-welcome__card {
    width: min(100%, 18rem);
  }

  .home-welcome__decor-line--v {
    display: none;
  }

  .home-welcome__front-figure {
    display: none;
  }

  .home-welcome__decor-lines,
  .home-welcome__decor-dots {
    opacity: .45;
  }
}

/* PRE-ÍNDICE — portadas CAP 0 en franjas
------------------------------------------------------------ */
.home-prechapters {
  background: var(--c-white);
  border-top: 1px solid var(--c-rule);
}

.home-prechapter {
  border-bottom: 1px solid var(--c-rule);
}

.home-prechapter__band {
  position: relative;
  display: block;
  min-height: clamp(22rem, 42vw, 36rem);
  background: #f8f7f2;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.home-prechapter__canvas {
  position: relative;
  width: 100%;
  min-height: clamp(22rem, 42vw, 36rem);
  aspect-ratio: 1920 / 1080;
}

.home-prechapter__decor,
.home-prechapter__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.home-prechapter__decor {
  z-index: 0;
  object-fit: contain;
  object-position: left center;
}

.home-prechapter__photo {
  z-index: 1;
  object-fit: contain;
  object-position: left center;
}

.home-prechapter__head {
  position: absolute;
  top: clamp(12%, 10vw, 18%);
  right: clamp(4%, 3vw, 8%);
  left: clamp(46%, 38vw, 52%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(.65rem, 1.2vw, 1rem);
  max-width: min(46vw, 38rem);
  pointer-events: none;
}

.home-prechapter--presidente .home-prechapter__head {
  top: clamp(8%, 7vw, 12%);
  right: clamp(2%, 1.5vw, 4%);
  left: clamp(52%, 46vw, 58%);
  gap: clamp(.85rem, 1.6vw, 1.35rem);
}

.home-prechapter--directora .home-prechapter__head {
  top: clamp(18%, 14vw, 18%);
  left: clamp(22%, 24vw, 30%);
}

.home-prechapter--cifras .home-prechapter__head {
  top: clamp(14%, 11vw, 18%);
  left: clamp(44%, 36vw, 50%);
}

.home-prechapter__title.chapter-hero__title {
  position: static;
  margin: 0;
  max-width: none;
  font-family: var(--ff-heading);
  font-weight: 700;
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: #000;
}

.home-prechapter--presidente .chapter-hero__title-line,
.home-prechapter--cifras .chapter-hero__title-line {
  display: block;
  font-size: clamp(3rem, 5.6vw, 5.6rem);
  line-height: .88;
  color: var(--c-ink) !important;
}

.home-prechapter--presidente .chapter-hero__title-line:first-child,
.home-prechapter--cifras .chapter-hero__title-line:first-child {
  font-size: clamp(1.65rem, 3.4vw, 3rem);
  line-height: .9;
}

.home-prechapter--directora .chapter-hero__title-kicker {
  display: block;
  font-family: var(--ff-heading);
  font-size: clamp(1.65rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--c-ink) !important;
}

.home-prechapter--directora .chapter-hero__title-main {
  display: block;
  font-family: var(--ff-heading);
  font-size: clamp(2.35rem, 5.8vw, 5.25rem);
  font-weight: 700;
  line-height: .88;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--c-ink) !important;
}

.home-prechapter--cifras .chapter-hero__title-year {
  display: block;
  margin-top: clamp(.15rem, .4vw, .35rem);
  font-family: var(--ff-heading);
  font-size: clamp(3rem, 8.5vw, 7.25rem);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -.02em;
  color: var(--c-ink) !important;
}

.home-prechapter__lede.chapter-hero__lede {
  position: static;
  margin: clamp(.35rem, 1vw, .75rem) 0 0;
  font-family: var(--ff-medium);
  font-weight: 400;
  font-size: clamp(.85rem, 1.25vw, 1.05rem);
  line-height: 1.45;
  color: #000;
}

.home-prechapter--presidente .home-prechapter__lede.chapter-hero__lede {
  margin-top: clamp(.55rem, 1.2vw, 1rem);
}

.home-prechapter__lede.chapter-hero__lede strong {
  font-weight: 700;
}

.home-prechapter__copy {
  position: absolute;
  top: 0;
  right: 0;
  bottom: auto;
  left: clamp(50%, 30vw, 45%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: clamp(.65rem, 1.2vw, 1rem);
  width: auto;
  max-width: min(46vw, 38rem);
  min-height: 0;
  height: auto;
  padding: clamp(2.75rem, 9vh, 5.5rem) clamp(1rem, 2.5vw, 2rem) 0 0;
  background: transparent;
  pointer-events: none;
}

.home-prechapter--presidente .home-prechapter__copy {
  left: clamp(51%, 30vw, 45%);
  top: clamp(42%, 32vw, 44%);
  gap: clamp(1rem, 2.2vh, 1.6rem);
}

.home-prechapter--directora .home-prechapter__copy {
  left: clamp(15%, 15vw, 20%);
  top: clamp(42%, 32vw, 44%);
  gap: clamp(1rem, 2.2vh, 1.6rem);
}

.home-prechapter--cifras .home-prechapter__copy {
  top: clamp(36%, 25vw, 36%);
}

.home-prechapter .cifras-hero-highlight,
.home-prechapter--presidente .cifras-hero-highlight,
.home-prechapter--directora .cifras-hero-highlight {
  position: relative;
  width: 100%;
  max-width: clamp(14.5rem, 22vw, 18rem);
  margin-top: 0;
  padding-bottom: 0;
  pointer-events: auto;
}

.home-prechapter--cifras .cifras-hero-highlight {
  margin-left: 0;
}

.home-prechapter--presidente .cifras-hero-highlight,
.home-prechapter--directora .cifras-hero-highlight {
  align-self: center;
  margin-left: 0;
}

.home-prechapter--cifras .cifras-hero-highlight__box {
  position: relative;
  min-height: clamp(11.5rem, 23vw, 14.5rem);
  padding: clamp(1.1rem, 2vw, 1rem) clamp(.95rem, 1.8vw, 2rem) clamp(.85rem, 1.5vw, 2rem);
  background: #fff;
  border: 1px solid #000;
}

.home-prechapter--presidente .cifras-hero-highlight.gov-destacado .gov-destacado__panel--quote,
.home-prechapter--directora .cifras-hero-highlight.gov-destacado .gov-destacado__panel--quote {
  min-height: clamp(11.5rem, 23vw, 14.5rem);
  padding: clamp(1.1rem, 2vw, 1rem) clamp(.95rem, 1.8vw, 2rem) clamp(.85rem, 1.5vw, 2rem);
}

.home-prechapter--presidente .cifras-hero-highlight.gov-destacado .gov-destacado__quote,
.home-prechapter--directora .cifras-hero-highlight.gov-destacado .gov-destacado__quote {
  margin: 0 0 .6rem;
}

.home-prechapter--presidente .cifras-hero-highlight.gov-destacado .gov-destacado__quote img,
.home-prechapter--directora .cifras-hero-highlight.gov-destacado .gov-destacado__quote img {
  width: clamp(2rem, 3.8vw, 2.6rem);
}

.home-prechapter--presidente .cifras-hero-highlight.gov-destacado .gov-destacado__text,
.home-prechapter--directora .cifras-hero-highlight.gov-destacado .gov-destacado__text {
  font-family: var(--ff-ui);
  font-size: clamp(.78rem, .95vw, 1rem);
  font-weight: 400;
  line-height: 1.42;
  max-width: none;
}

.home-prechapter--cifras .cifras-hero-highlight__bar {
  position: absolute;
  top: -7px;
  right: -1px;
  width: clamp(3.8rem, 6.5vw, 7rem);
  height: clamp(.38rem, .6vw, 1rem);
  background: #000;
  z-index: 2;
  opacity: 0;
  transform: translateX(130%);
  transition:
    transform 900ms cubic-bezier(.22, 1, .36, 1),
    opacity 650ms cubic-bezier(.22, 1, .36, 1);
}

.home-prechapter--cifras .cifras-hero-highlight.reveal.is-in .cifras-hero-highlight__bar {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 180ms;
}

.home-prechapter--cifras .cifras-hero-highlight__quote {
  margin: 0 0 .6rem;
}

.home-prechapter--cifras .cifras-hero-highlight__quote img {
  display: block;
  width: clamp(2rem, 3.8vw, 2.6rem);
  height: auto;
}

.home-prechapter--cifras .cifras-hero-highlight__text {
  margin: 0;
  max-width: none;
  font-family: var(--ff-ui);
  font-size: clamp(.78rem, .95vw, 1rem);
  font-weight: 400;
  line-height: 1.42;
  color: #000;
}

@media (max-width: 920px) {
  .home-prechapter__band {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .home-prechapter__canvas {
    aspect-ratio: auto;
    min-height: min(58vh, 28rem);
  }

  .home-prechapter__decor,
  .home-prechapter__photo {
    position: absolute;
    inset: 0;
    min-height: min(58vh, 28rem);
  }

  .home-prechapter__head {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    max-width: none;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: rgba(248, 247, 242, .92);
  }

  .home-prechapter__copy {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    max-width: none;
    padding: 0 clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 4vw, 2rem);
    background: #f8f7f2;
  }

  .home-prechapter--presidente .chapter-hero__title-line,
  .home-prechapter--cifras .chapter-hero__title-line {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .home-prechapter--presidente .chapter-hero__title-line:first-child,
  .home-prechapter--cifras .chapter-hero__title-line:first-child {
    font-size: clamp(1.65rem, 8.5vw, 2.5rem);
  }

  .home-prechapter--directora .chapter-hero__title-kicker {
    font-size: clamp(1.35rem, 6.5vw, 2rem);
  }

  .home-prechapter--directora .chapter-hero__title-main {
    font-size: clamp(1.85rem, 9vw, 2.75rem);
  }

  .home-prechapter--cifras .chapter-hero__title-year {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .home-prechapter--cifras .cifras-hero-highlight,
  .home-prechapter--presidente .cifras-hero-highlight,
  .home-prechapter--directora .cifras-hero-highlight {
    max-width: none;
    margin-left: 0;
  }

  .home-prechapter--presidente .cifras-hero-highlight,
  .home-prechapter--directora .cifras-hero-highlight {
    margin-left: clamp(1.35rem, 5vw, 2.5rem);
  }
}
