/* =====================================================
01. BASE GENERAL
===================================================== */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Charter", serif;
  background: rgb(244, 241, 236);
  color: rgb(152, 139, 114);
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

.quarto-title-block,
#title-block-header,
.quarto-title,
.quarto-title-meta,
#quarto-header,
.navbar {
  display: none !important;
}


/* =====================================================
02. HERO
===================================================== */
.hero-editorial {
  width: 100%;
  text-align: justify;
  padding: 4.5rem 1.25rem 2rem;
  box-sizing: border-box;
}

.session-links {
  position: fixed;
  z-index: 20;
  top: clamp(16px, 2.5vw, 32px);
  left: clamp(18px, 3vw, 44px);
  right: clamp(18px, 3vw, 44px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.back-link,
.bibliography-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid rgb(128, 184, 219);
  border-radius: 999px;
  background: rgba(244, 241, 236, 0.9);
  box-shadow: 0 1px 4px rgba(92, 147, 170, 0.12);
  text-decoration: none;
  font-family: "Charter", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: rgb(92, 147, 170);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.back-link:hover,
.back-link:focus-visible,
.bibliography-link:hover,
.bibliography-link:focus-visible {
  background: rgb(128, 184, 219);
  color: #f4f1ec;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(92, 147, 170, 0.18);
}

.intro-gif {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.intro-gif img {
  width: 110px;
}

.hero-intro {
  text-align: center;
}

.hero-intro .quote {
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #5C93AA;
}

/* =====================================================
03. CONTENIDO GENERAL
===================================================== */
.statement {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.statement p {
  text-align: justify;
}

/* =====================================================
04. OBJETIVO
===================================================== */

.objetivo {
  margin: 1.5rem auto 2.5rem;
}

.objetivo h2 {
  font-size: 1.3rem;
}

.objetivo p {
  font-size: 0.97rem;
  line-height: 1.7;
}

/* =====================================================
PARTES DEL LIBRO (GRID + HOVER)
===================================================== */

.partes-grid {
  max-width: 900px;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

/* contenedor de cada imagen */
.parte-item {
  position: relative;        /* � CLAVE (arregla el overlay) */
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* imagen */
.parte-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* overlay */
.overlay {
  position: absolute;
  inset: 0; /* � reemplaza top/left/width/height */

  background: rgba(152, 139, 114, 0.85);
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: justify;
  padding: 1.5rem;

  opacity: 0;
  transition: opacity 0.3s ease;
}

/* hover */
.parte-item:hover .overlay {
  opacity: 1;
}

/* texto dentro del overlay */
.overlay p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* =====================================================
RESPONSIVE (CELULAR)
===================================================== */

@media (max-width: 768px) {
  .partes-grid {
    grid-template-columns: 1fr;
  }

  .overlay {
    padding: 1rem;
    font-size: 0.9rem;
  }
}

/* =====================================================
HERO ÁLBUM
===================================================== */

.hero-album {
  position: relative;
  width: 100vw;
  min-height: 430px;
  height: auto;
  margin-left: calc(-50vw + 50%);
  padding: clamp(4.25rem, 7vw, 5.5rem) 0 clamp(2.75rem, 5vw, 4rem);

  background-image: url("images/fondo3.jpg");
  background-size: cover;
  background-position: center;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  
}

/* OVERLAY OSCURO */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(62, 53, 37, 0.55);
}

/* CONTENIDO */
.hero-content {
  position: relative;
  max-width: 700px;
  padding: 0.75rem 1.5rem 0;
  color: #f4f1ec;
}

/* TÍTULO */
.hero-title {
  font-family: "Charter", serif;
  font-size: 2.2rem;
  line-height: 1.18;
  margin-top: 0;
  margin-bottom: 1.5rem;
  overflow: visible;
}

/* PALABRA "TODO" */
.hero-script {
  font-family: "Breathney Demo", cursive; /* � tu tipografía */
  font-size: 2.8rem;
  display: inline-block;
  margin-right: 0.3rem;
  line-height: 1;
  padding-top: 0.28em;
  padding-bottom: 0.04em;
}

/* TEXTO */
.hero-text {
  font-size: 1rem;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* AUTOR */
.hero-author {
  font-size: 1rem;
  font-style: italic;
}



/* =====================================================
MATERIALIDAD (2 COLUMNAS)
===================================================== */

.materialidad {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 20px;
}

/* TÍTULO */
.materialidad-title {
  text-align: center;
  color: #5C93AA;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  display: block;
}

.linea-abajo {
  margin-top: 0.2rem;
}

/* GRID */
.materialidad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

/* COLUMNAS */
.materialidad-col p {
  text-align: justify;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* LINKS (como en tu diseño azul) */
.link {
  color: #5C93AA;
}

/* =====================================================
ROMPECABEZAS INTERACTIVO
===================================================== */

.puzzle-grid {
  --final-image: url("images/final.jpg");
  width: min(100%, 760px);
  max-width: calc(100vw - 2rem);
  margin: 3rem auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  aspect-ratio: 3 / 2;
}

.puzzle-piece {
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font: inherit;
  color: rgb(76, 145, 191);
  background-color: rgb(221, 216, 202);
  background-image: none;
  background-size: 300% 200%;
  background-position: var(--x) var(--y);
  transition:
    transform 180ms ease,
    filter 180ms ease,
    color 180ms ease;
}



.puzzle-piece:hover,
.puzzle-piece:focus-visible {
  transform: translateY(-2px);
  filter: brightness(0.98);
  outline: 2px solid rgb(76, 145, 191);
  outline-offset: 2px;
}

.puzzle-piece.is-revealed {
  color: transparent;
  background-image: var(--final-image);
}

/* =====================================================
03. VENTANA DE EJEMPLOS
===================================================== */

.example-modal {
  width: min(950px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: min(760px, calc(100dvh - 54px));
  max-height: calc(100dvh - 54px);
  margin: auto;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.example-modal::backdrop {
  background: rgba(0, 0, 0, 0.34);
}

.example-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: 3.2rem 1.75rem 1.15rem;
  background: rgb(244, 241, 236);
  border-radius: 14px;
  color: rgb(152, 139, 114);
}

.example-shell h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.modal-close {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  border: 0;
  background: transparent;
  color: rgb(0, 0, 0);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.example-viewer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 0;
  height: 100%;
  gap: 0.75rem;
}

.example-arrow {
  border: 0;
  background: transparent;
  color: rgb(76, 145, 191);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.example-slide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  height: 100%;
  margin: 0;
  text-align: center;
}

.example-slide img {
  display: block;
  width: min(100%, 720px);
  height: min(68vh, 560px);
  margin: 0 auto;
  object-fit: contain;
}

.example-slide figcaption {
  min-height: 1.4em;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.example-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 0.55rem;
}

.example-dot {
  width: 9px;
  height: 9px;
  border: 1px solid rgb(128, 184, 219);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.example-dot.is-active {
  background: rgb(128, 184, 219);
}

@media (max-width: 560px) {
  .puzzle-piece {
    font-size: 0.8rem;
  }

  .example-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: min(700px, calc(100dvh - 28px));
    max-height: calc(100dvh - 28px);
  }

  .example-shell {
    padding: 3rem 0.75rem 1rem;
    border-radius: 12px;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
  }

  .example-viewer {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 0.2rem;
  }

  .example-arrow {
    font-size: 1.65rem;
  }

  .example-slide img {
    width: 100%;
    height: min(62vh, 470px);
  }

  .example-slide figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
  }
}


/* =====================================================
RESPONSIVE FINAL SESION 2
===================================================== */

@media (max-width: 900px) {
  .statement,
  .materialidad {
    max-width: 100%;
  }

  .hero-album {
    width: 100%;
    margin-left: 0;
  }

  .materialidad-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .partes-grid {
    max-width: min(92vw, 680px);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .hero-editorial {
    padding: 4rem 1rem 1.5rem;
  }

  .session-links {
    top: 12px;
    left: 12px;
    right: 12px;
    gap: 0.5rem;
  }

  .back-link,
  .bibliography-link {
    width: 156px;
    min-height: 38px;
    padding: 0 0.8rem;
    font-size: 0.78rem;
  }

  .intro-gif img {
    width: 86px;
  }

  .hero-intro .quote {
    font-size: 0.92rem;
    line-height: 1.55;
    letter-spacing: 0.08em;
  }

  .statement,
  .objetivo,
  .materialidad {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .objetivo {
    margin: 1.2rem auto 2rem;
  }

  .objetivo h2,
  .materialidad-title {
    font-size: 1.12rem;
    line-height: 1.35;
  }

  .statement p,
  .objetivo p,
  .materialidad-col p {
    font-size: 0.94rem;
    line-height: 1.65;
    text-align: left;
    hyphens: auto;
  }

  .partes-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin: 1.5rem auto 2.5rem;
    padding: 0 1.1rem;
  }

  .parte-item {
    aspect-ratio: auto;
    overflow: visible;
    background: #EDEAE2;
  }

  .parte-item img {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .overlay {
    position: static;
    opacity: 1;
    padding: 1.1rem;
    background: rgba(152, 139, 114, 0.92);
  }

  .overlay p {
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: left;
  }

  .hero-album {
    min-height: 520px;
    height: auto;
    padding: 3rem 0;
    background-position: center;
  }

  .hero-content {
    max-width: 100%;
    padding: 0 1.25rem;
  }

  .hero-title {
    font-size: 1.55rem;
    line-height: 1.35;
    margin-bottom: 1rem;
  }

  .hero-script {
    display: block;
    margin-right: 0;
    font-size: 2.15rem;
  }

  .hero-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .hero-author {
    font-size: 0.92rem;
  }

  .materialidad {
    margin: 2.5rem auto;
  }

  .materialidad-title span {
    display: block;
  }

  .puzzle-grid {
    width: min(100%, 520px);
    max-width: calc(100vw - 2.2rem);
    gap: 4px;
    margin: 2.5rem auto;
  }

  .puzzle-piece {
    min-width: 0;
    padding: 0.25rem;
    text-align: center;
    font-size: clamp(0.62rem, 2.6vw, 0.85rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .example-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: min(700px, calc(100dvh - 32px));
    max-height: calc(100dvh - 32px);
  }

  .example-shell {
    overflow: hidden;
    padding: 3rem 0.8rem 0.95rem;
  }

  .example-shell h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .example-viewer {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 0.3rem;
  }

  .example-arrow {
    font-size: 1.6rem;
  }

  .example-slide img {
    width: 100%;
    max-width: 100%;
    height: 64vh;
    max-height: 470px;
    object-fit: contain;
  }

  .example-slide figcaption {
    font-size: 0.86rem;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 420px) {
  .hero-album {
    min-height: 560px;
  }

  .puzzle-grid {
    width: min(100%, 520px);
    max-width: calc(100vw - 1.5rem);
    gap: 3px;
  }

  .example-viewer {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
  }

  .example-arrow {
    font-size: 1.35rem;
  }
}
