:root {
  --black: #000;
  --grey: #d2d2d2;
  --white: #fff;
  --margin: 1rem;
  --width: 1160px;
  /* text sizes */
  --text-l: 26px;
  --text-height-l: 32px;
  --text-m: 16px;
  --text-height-m: 23px;
  --text-s: 13px;
  --text-height-s: 16px;
  /* text format */
  --letter-spacing: 0.07em;
}

* {
  box-sizing: border-box;
}

/* Ocultar scrollbars solo en los contenedores con scroll */
.main-scroller,
.horizontal-scroll,
.exhibition {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.main-scroller::-webkit-scrollbar,
.horizontal-scroll::-webkit-scrollbar,
.exhibition::-webkit-scrollbar {
  display: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: var(--text-m);
  line-height: var(--text-height-m);
}

a {
  color: inherit;
  text-decoration: none;
}

a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

/* --- CONTENEDOR DE SCROLL PRINCIPAL --- */
/* Este es el único elemento que mueve la página */
.main-scroller {
  width: 100%;
  height: 100svh; /* Ocupa exactamente la pantalla */
  overflow-y: auto; /* Scroll vertical */
  overflow-x: hidden;

  /* EL MOTOR DE SCROLL SNAP */
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* --- CLASES UTILITARIAS --- */

.snap-target {
  width: 100%;
  position: relative;
  height: 100svh;
  flex-shrink: 0; /* Evita que se encojan en algunos navegadores */
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* --- 1. SECCIÓN TOP (ARCHIVE, SHOP, etc.) --- */
.top-sections {
  background-color: white;
  z-index: 1;
  position: relative;
  overflow: hidden;
}

.top-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.top-section.is-active {
  opacity: 1;
  pointer-events: auto;
}

.archive.top-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.shop.top-section {
  background-color: white;
  text-align: center;
}

.info.top-section {
  background-color: white;
  font-size: var(--text-m);
  line-height: var(--text-height-m);
  letter-spacing: var(--letter-spacing);
  font-weight: normal;
  padding: var(--margin);
}

.info-content {
  max-width: var(--width);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-content a {
  text-decoration: underline;
}

.info-content .logos {
  margin-top: calc(var(--margin) * 3);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(var(--margin) * 3);
}

.info-content .credits {
  font-size: var(--text-s);
  line-height: var(--text-height-s);
  letter-spacing: var(--letter-spacing);
}

.info-content .logos img {
  width: 100%;
  max-width: 128px;
}

.top-sections.snap-target {
  height: calc(100svh - (var(--text-height-l) * 3.15));
}

.archive-years {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: var(--margin);
  flex-shrink: 0;
}

.archive-years .archive-year-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: inherit;
  font-size: var(--text-l);
  line-height: var(--text-height-l);
  padding: 0;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.archive-years .archive-year-btn:hover,
.archive-years .archive-year-btn.is-active {
  opacity: 1;
}

.archive.top-section .horizontal-scroll {
  flex: 1;
  min-height: 0;
}

/* --- 2. SECCIÓN HOME --- */
.home {
  /* height y width ya los hereda de .snap-target */
  overflow: hidden;
  background-color: white;
  z-index: 5;
  /* sobrescribe .snap-target */
  height: calc(100svh - (var(--margin) * 2));
}

/* CAPA A: TEXTO */
.home-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--margin);
  /* z-index: 10; */
  pointer-events: none;
}

.home-header,
.home-details,
.archive-years {
  pointer-events: auto;
  width: calc(100% - (var(--margin) * 10));
  margin: 0 auto;
}

.home-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1em;
}

body:not(.target-top) .home-header nav ul li a {
  color: var(--grey);
}

body:not(.target-top) .home-header nav ul li a:hover {
  color: var(--black);
}

body.target-top .home-title:hover {
  color: var(--black);
}

.home-header {
  /* display: flex;
  justify-content: space-between; */
  font-size: var(--text-l);
  line-height: var(--text-height-l);
  z-index: 999;
  position: relative;
  top: -32px;
  transition: 0.8s top;
}

.target-top .home-header {
  top: 0;
}

.home-title {
  cursor: pointer;
}

.home-title,
.home-header nav a {
  transition: color 0.3s ease;
}

.home.is-at-top .home-title,
.home.is-at-top nav a:not(.is-active-nav) {
  color: var(--grey);
}

.home-details a {
  position: relative;
  pointer-events: all;
  z-index: 30;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

/* font sizes */

.home-exhibition,
.archive-item {
  font-size: var(--text-l);
  line-height: var(--text-height-l);
}

/* CAPA B: TÍTULOS (Overlay) */
.home-exhibitions {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

.home-exhibitions .horizontal-scroll {
  height: 100%;
  pointer-events: auto;
  align-items: center;
}

.prev-exhibition-hint {
  position: absolute;
  bottom: 6rem;
  right: 4rem;
  width: 20rem;
  height: auto;
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.home-exhibition {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

/* --- 3. SECCIÓN EXHIBITIONS (DETALLE) --- */
.exhibitions {
  background-color: white;
  z-index: 10;
  position: relative;
}

.exhibitions .horizontal-scroll {
  align-items: flex-start;
}

/* El Slide individual con scroll interno */
.exhibition {
  height: 100%;
  overflow-y: auto; /* Scroll interno si el texto es largo */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-image: var(--logo);
  background-size: 6.25%;

  /* IMPORTANTE: Evita que el scroll interno mueva la página padre accidentalmente */
  overscroll-behavior-y: auto;
}

.exhibition-content-wrapper {
  margin: auto;
  width: 100%;
  padding-left: calc(var(--margin) * 2);
  padding-right: calc(var(--margin) * 2);
  padding-top: calc(var(--margin) * 4);
  padding-bottom: calc(var(--margin) * 4);
  display: flex;
  flex-direction: column;
  gap: calc(var(--margin) * 2);
}

.exhibition-content-wrapper.theme-dark .highlight,
.exhibition-content-wrapper.theme-dark .block-type-text,
.exhibition-content-wrapper.theme-dark .block-type-document figcaption,
.exhibition-content-wrapper.theme-dark .block-type-image figcaption,
.exhibition-content-wrapper.theme-dark .block-type-gallery figcaption,
.exhibition-content-wrapper.theme-dark .block-type-gallery .gallery-figcaption {
  background-color: var(--black);
  color: var(--grey);
}

.exhibition-content-wrapper.theme-light .highlight,
.exhibition-content-wrapper.theme-light .block-type-text,
.exhibition-content-wrapper.theme-light .block-type-image figcaption,
.exhibition-content-wrapper.theme-light .block-type-document figcaption,
.exhibition-content-wrapper.theme-light .block-type-gallery figcaption,
.exhibition-content-wrapper.theme-light
  .block-type-gallery
  .gallery-figcaption {
  background-color: var(--white);
  color: var(--black);
}

.exhibition p {
  margin-bottom: 1rem;
}

/* .exhibition {
  background-image: var(--logo);
} */

/* --- SISTEMA DE SCROLL HORIZONTAL (Opción Sencilla) --- */

.horizontal-scroll {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  /* 1. GAP: Espacio entre elementos */
  /* gap: var(--margin); */

  /* 2. PADDING: Espacio a los lados del contenedor */
  /* Esto hace que el primero y el último no empiecen pegados al borde */
  /* padding: 0 var(--margin); */
}

.horizontal-scroll-page {
  /* 3. TAMAÑO DE LA CARTA */
  /* Restamos espacio para que se vea la siguiente */
  /* Cuanto mayor sea el número que restas (ej. 4rem), más se verá de la siguiente */
  flex: 0 0 calc(100% - (var(--margin) * 4));

  /* 4. ALINEACIÓN SIEMPRE AL CENTRO */
  /* Esto distribuye el espacio sobrante a izquierda y derecha por igual */
  scroll-snap-align: center;

  position: relative;
}

.horizontal-scroll-page:first-child,
.horizontal-scroll-page:last-child {
  flex: 0 0 calc(100% - (var(--margin) * 2));
}

/* ELIMINAMOS cualquier regla específica para :first-child o :last-child */
/* Queremos que todos se comporten igual */

/* block */

.block-type-text {
  font-size: var(--text-m);
  line-height: var(--text-height-m);
  font-weight: normal;
  letter-spacing: var(--letter-spacing);
  width: 100%;
  max-width: var(--width);
  background-color: white;
  padding: var(--margin) calc(var(--margin) * 2);
  margin: 0 auto 0 auto;
}

.block-type-text p:first-child {
  margin-top: 0;
}

.block-type-text p:last-child {
  margin-bottom: 0;
}

.block-type-title {
  font-size: var(--text-m);
  line-height: var(--text-height-m);
  letter-spacing: var(--letter-spacing);
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
}

.block-type-title h4 {
  font-style: italic;
  text-transform: uppercase;
}

.block-type-title .artists {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
  font-weight: normal;
  letter-spacing: var(--letter-spacing);
}

.block-type-title .highlight {
  padding: 0 2em;
}

.block-type-date {
  font-weight: normal;
  letter-spacing: var(--letter-spacing);
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
}

.block-type-date .highlight {
  display: inline-block;
  padding: 0 2em;
}

.block-type-date .highlight:not(:first-child) {
  margin-top: 2px;
}

.block-type-image {
  margin: 0 auto 0 auto;
  display: flex;
  justify-content: center;
}

.block-type-image figure {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.block-type-image img {
  width: 100%;
  height: auto;
}

.block-type-image img.landscape {
  max-width: 960px;
}

.block-type-image img.portrait {
  max-width: 512px;
}

.postcard img {
  max-height: 60svh;
  object-fit: contain;
}

.top {
  top: 0;
}

.bottom {
  bottom: 0;
}

.shop-item-image {
  width: 100%;
  margin-bottom: 0.5rem;
}

.shop-item-image img {
  width: 100%;
  height: auto;
  max-height: 40vh;
  object-fit: contain;
}

.buy-link {
  text-decoration: underline;
  margin-top: 0.5rem;
  display: inline-block;
}

.archive-item,
.shop-item {
  /* Ocupa 1/3 de la pantalla exactamente */
  flex: 0 0 40% !important;

  /* Alineación centrada (para sincronizar con las de abajo) */
  scroll-snap-align: center;

  /* Estilos visuales del item de archivo */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
}

.archive-item:first-child,
.shop-item:first-child {
  margin-left: 60%;
}
.archive-item:last-child,
.shop-item:last-child {
  margin-right: 60%;
}

.highlight {
  /* display: inline-block; */
  background-color: white;
  padding: 0 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  display: inline-block;
  line-height: 1.4em;
}

.clickable-item:not(.is-active) {
  cursor: pointer;
}

.on-target {
  opacity: 0;
  transition: opacity 0.3s;
}

.on-target.targeted {
  opacity: 1;
}

.block-type-gallery {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
}

.block-type-gallery figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
}

.block-type-gallery ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  flex-wrap: wrap;
}

.block-type-gallery ul li img {
  display: block;
  width: 100%;
  transition: 0.3s max-width;
}

.block-type-gallery ul li img.landscape {
  max-width: 256px;
}

.block-type-gallery ul li img.portrait {
  max-width: 156px;
}

.block-type-gallery ul li img.landscape.enlarged {
  max-width: 960px;
}

.block-type-gallery ul li img.portrait.enlarged {
  max-width: 512px;
}

.block-type-gallery .gallery-figcaption,
.block-type-gallery figcaption,
.block-type-image figcaption,
.block-type-document figcaption {
  width: fit-content;
  padding: 0.4em calc(var(--margin) * 2);
  font-weight: normal;
  font-size: var(--text-s);
  line-height: var(--text-height-s);
  letter-spacing: var(--letter-spacing);
}

/* document */

.block-type-document {
  display: flex;
  justify-content: center;
  align-items: center;
}

.block-type-document figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.block-type-document figure img {
  width: 100%;
  max-width: 156px;
}

.upcoming {
  font-weight: 400;
  font-size: var(--text-m);
  line-height: var(--text-height-m);
}

.home-exhibition .artists {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  margin-bottom: var(--text-height-m);
}

.home-exhibition .artists span:not(:last-child)::after {
  content: ", ";
}

@media (max-width: 720px) {
  :root {
    --text-xs: 11px;
    --text-height-xs: 14px;
    --text-s: 14px;
    --text-height-s: 18px;
    --text-m: 14px;
    --text-height-m: 18px;
    --text-l: 22px;
    --text-height-l: 24px;
  }

  .horizontal-scroll-page:first-child,
  .horizontal-scroll-page:last-child {
    flex: 0 0 calc(100% - (var(--margin) * 1));
  }

  .top-sections.snap-target {
    height: calc(100svh - 5.5rem);
  }

  .home-header,
  .home-details,
  .archive-years {
    width: calc(100% - (var(--margin) * 2));
  }

  .home-header {
    top: -26px;
  }

  .horizontal-scroll-page {
    flex: 0 0 calc(100% - (var(--margin) * 2));
  }

  .prev-exhibition-hint {
    right: 0rem;
    bottom: 8rem;
  }

  .exhibition {
    background-size: 20%;
  }

  .exhibition-content-wrapper {
    padding-left: var(--margin);
    padding-right: var(--margin);
  }

  .block-type-text {
    padding: var(--margin);
  }

  .block-type-title .highlight,
  .block-type-date .highlight {
    padding: 0 var(--margin);
  }

  /*.block-type-date {
    padding: 0 var(--margin);
  }*/

  .postcard img {
    max-height: 40svh;
    object-fit: contain;
  }

  .archive-item,
  .shop-item {
    flex: 0 0 65% !important;
  }

  .info-content .logos img {
    max-width: 100px;
  }

  .info-content p:first-child {
    margin-top: 0;
  }

  .block-type-gallery ul li img.landscape {
    max-width: 156px;
  }

  .block-type-gallery ul li img.portrait {
    max-width: 128px;
  }

  .upcoming,
  .home-details,
  .block-type-gallery .gallery-figcaption,
  .block-type-gallery figcaption,
  .block-type-image figcaption,
  .block-type-document figcaption {
    font-size: var(--text-xs);
    line-height: var(--text-height-xs);
  }
}

@media (min-width: 1280px) {
  .archive-item:first-child,
  .shop-item:first-child {
    margin-left: 75%;
  }

  .archive-item,
  .shop-item {
    flex: 0 0 25% !important;
  }

  .archive-item:last-child,
  .shop-item:last-child {
    margin-right: 75%;
  }
}

@media (min-width: 1600px) {
  :root {
    --width: 1400px;
    --margin: 2rem;
    /* text sizes */
    --text-l: 32px;
    --text-height-l: 36px;
    --text-m: 20px;
    --text-height-m: 24px;
    --text-s: 18px;
    --text-height-s: 22px;
  }
}

/* --- NEWSLETTER WIDGET --- */
.newsletter-widget {
  position: relative;
  z-index: 9999;
}

.newsletter-trigger {
  cursor: pointer;
}

.newsletter-trigger__word {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

.newsletter-form {
  display: none;
}

.newsletter-widget.active .newsletter-trigger {
  display: none;
}

.newsletter-widget.active .newsletter-form {
  display: inline;
}

.newsletter-widget .inf-content {
  display: flex;
  gap: 8px;
}

.newsletter-widget input,
.newsletter-widget button {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
}

.newsletter-widget input[type=email] {
  border-bottom: 1px solid var(--black) !important;
}

.newsletter-widget input:focus,
.newsletter-widget button:focus {
  outline: 0;
}

