/* =====================================================
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;
}


/* =====================================================
05. DEFINICIÓN LIBRO
===================================================== */

.book-definition {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  position: relative;
}

.book-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-text {
  background: #80a0c2;
  display: flex;
  align-items: center;
  padding: 2rem;
}

.book-script {
  font-style: italic;
  font-size: 1.2rem;
  color: #f6f1ef;
}

.book-copy {
  font-size: 0.98rem;
  line-height: 1.75;
  color: #f6f1e7;
}


/* =====================================================
06. TIPOS
===================================================== */

.types-section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.types-inner {
  max-width: 800px;
  margin: 0 auto;
}

.types-title {
  margin: 1.8rem 0;
  font-size: 1.3rem;
  border-bottom: 1px solid #EDEAE2;
}

.types-stack {
  display: flex;
  flex-direction: column;
}


/* =====================================================
07. BLOQUES TIPOS
===================================================== */

.type-sheet {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-top: 1.5rem;
}

.type-sheet--cream {
  background: #f3f1ed;
}

.type-sheet--sand {
  background: #EDEAE2;
}

.type-sheet-inner {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 3rem;
  padding: 2rem 0;
}

.type-name-label,
.trigger-text{
  text-align: left;
  line-height: 1.2;
  font-weight: bold;
  font-size: 1.1rem;
  color: #988b72;
}

.type-copy p {
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}


/* =====================================================
08. BOTÓN FLECHA
===================================================== */

.example-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: transparent;
  border: none;
  cursor: pointer;
}

.arrow-line {
  position: relative;
  width: 120px;
  height: 1px;
  background: #988b72;
  margin: 8px 0;
}

.arrow-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  border-left: 7px solid #988b72;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.trigger-text {
  font-size: 0.85rem;
  font-style: italic;
  color: #988b72;
}

.example-trigger:hover {
  opacity: 0.7;
}


/* =====================================================
09. TARJETAS
===================================================== */

.cards-section {
  padding: 4rem 2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.card {
  background: #8fa8bf;
  color: white;
  border-radius: 50px;
  padding: 2.5rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.objetivo h2,
.card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.card:hover {
  background: #5C93AA;
}

.card button {
  align-self: flex-end;
  border: 1px solid white;
  background: transparent;
  color: white;
  border-radius: 999px;
  padding: 0.3rem 1.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  position: relative;
  top: 10px;
  left: 10px;
}

.card button:hover {
  background: white;
  color: #5C93AA;
}

/* =====================================================
10. MODAL
===================================================== */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.3);
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #f4f1ec;
  padding: 2rem;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
}

.carousel img {
  max-width: 350px;
}

.nav {
  font-size: 2rem;
  background: none;
  border: none;
  color: #5C93AA;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
}


/* =====================================================
11. BLOQUE ÁLBUM (FINAL)
===================================================== */

.album-bloque {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: #EDEAE2;
  border-radius: 80px;
  padding: 100px 0;
  margin: 80px 0;
}

.album-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.album-quote span {
  background: #5c93aa;
  color: #f4f1ec;
  padding: 0.1rem 0.3rem;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.album-author {
  font-size: 0.72rem;
  color: #5C93AA;
}

.album-copy {
  max-width: 760px;
  margin: 0 auto;
  text-align: justify;
}


/* =====================================================
12. LIBRO COMPOSICIÓN
===================================================== */

.libro-composicion {
  position: relative;
  max-width: 1500px;
  margin: 80px auto;
  padding: 0 40px;
}

.libro-img {
  width: 100%;
  transform: scale(1.20);
}

.libro-texto {
  text-align: justify;
  position: absolute;
  left: -5%;
  top: 30%;
  transform: translateY(-20%);
  width: 260px;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 1.2rem;
  background: #f4f1ec;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}


/* =========================
MODAL EJEMPLOS (LIMPIO)
========================= */
/* =========================
MODAL OVERLAY
========================= */
.album-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

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

  background: rgba(0,0,0,0.4);
  z-index: 9999;
}

.album-gallery-modal.open {
  display: flex;
}


/* =========================
CAJA MODAL
========================= */
.album-gallery-dialog {
  position: relative;

  width: min(1400px, 92vw);
  height: 85vh; /* � altura real */

  background: #f4f1ec;
  border-radius: 20px;

  padding: 2rem;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* � centra contenido */

  text-align: center;
}


/* =========================
CONTENEDOR IMAGEN
========================= */
.album-gallery-grid {
  flex: 1;

  width: 100%; /* � importante (quitamos 260px) */

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

  overflow: hidden;
}

/* =========================
IMÁGENES
========================= */
.album-gallery-grid img {
  position: absolute;   /* � clave */
  max-width: 100%;
  max-height: 60vh;

  width: auto;
  height: auto;

  object-fit: contain;

  opacity: 0;           /* � ocultas */
  transition: opacity 0.3s ease;
}

.album-gallery-grid img.active {
  opacity: 1;           /* � solo una visible */
  position: relative;
}


/* =========================
FLECHAS
========================= */
.album-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  font-size: 2rem;
  background: none;
  border: none;
  color: #5C93AA;
  cursor: pointer;
}

.album-gallery-nav--prev { left: 2rem; }
.album-gallery-nav--next { right: 2rem; }


/* =========================
CAPTION
========================= */
.album-gallery-caption {
  margin-top: 1.5rem;
  text-align: center;
}

#carouselTitle {
  font-size: 1rem;
  color: #988b72;
  margin-bottom: 0.03rem;
}

#carouselAuthor {
  font-size: 1rem;
  color: #988b72;
  font-style: italic;
}


/* =========================
DOTS
========================= */
.album-gallery-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.album-gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #5C93AA;
  cursor: pointer;
}

.album-gallery-dot.active {
  background: #5C93AA;
}


/* =========================
BOTÓN CERRAR
========================= */
.album-gallery-close {
  position: absolute;
  top: 15px;
  right: 20px;

  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
}



/* ======================================
RESPONSIVE GENERAL (CELULAR)
====================================== */
@media (max-width: 768px) {

  /* HERO */
  .hero-editorial {
    padding: 1rem;
  }

  .hero-intro .quote {
    font-size: 0.9rem;
  }

  /* TEXTO GENERAL */
  .statement {
    padding: 0 1rem;
  }

  /* OBJETIVO */
  .objetivo {
    padding: 0 1rem;
  }

  /* =====================
  BOOK DEFINITION (2 columnas → 1)
  ===================== */
  .book-definition {
    grid-template-columns: 1fr;
  }

  .book-text {
    padding: 1.5rem;
  }

  /* =====================
  TIPOS
  ===================== */
  .type-sheet-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  /* =====================
  TARJETAS
  ===================== */
  .cards-grid {
    grid-template-columns: 1fr; /* � 1 por fila */
  }

  .card {
    border-radius: 30px;
    padding: 1.5rem;
  }

  /* =====================
  LIBRO COMPOSICIÓN
  ===================== */
  .libro-composicion {
    padding: 0 1rem;
  }

  .libro-img {
    transform: scale(1);
  }

  .libro-texto {
    position: relative;
    left: 0;
    top: 0;
    transform: none;
    width: 100%;
    margin-top: 1rem;
  }

  /* =====================
  BLOQUE ÁLBUM
  ===================== */
  .album-bloque {
    border-radius: 40px;
    padding: 60px 1rem;
  }

  /* =====================
  MODAL (EL TUYO)
  ===================== */
  .album-gallery-dialog {
    width: 95vw;
    height: 90vh;
    padding: 1rem;
  }

  .album-gallery-grid img {
    max-height: 65vh;
  }

  .album-gallery-nav {
    font-size: 2.5rem;
  }

  .album-gallery-nav--prev {
    left: 0.5rem;
  }

  .album-gallery-nav--next {
    right: 0.5rem;
  }

  .album-gallery-caption {
    font-size: 0.85rem;
  }

}



/* =====================================================
TIPOS DE LIBROS
===================================================== */

.tipos-grid {
  max-width: 1300px;
  margin: 3rem auto;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

/* CARD */
.tipo-card {
  text-align: center;
}

/* CONTENEDOR IMAGEN */
.tipo-image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

/* IMAGEN */
.tipo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* � */
  display: block;
}

/* OVERLAY */
.tipo-overlay {
  position: absolute;
  inset: 0;

  background: rgba(92, 147, 170, 0.88);

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding: 2rem 1.5rem;

  opacity: 0;
  transition: opacity 0.3s ease;

  color: white;
}

/* HOVER */
.tipo-image:hover .tipo-overlay {
  opacity: 1;
}

/* TEXTO OVERLAY */
.tipo-overlay p {
  text-align: justify;
  line-height: 1.7;
  font-size: 0.95rem;
}

/* BOTÓN */
.tipo-overlay button {
  align-self: center;

  border: 1px solid white;
  background: transparent;
  color: white;

  border-radius: 999px;

  padding: 0.5rem 1.5rem;

  cursor: pointer;
}

/* TITULO */
.tipo-card h3 {
  margin-top: 1rem;
  color: #5C93AA;
  font-size: 1.2rem;
  min-height: 60px; /* � clave */
}


/* =========================
RELACIÓN TEXTO IMAGEN
========================= */

/* TEXTO SUPERIOR */
.types-inner {
  max-width: 800px;
  margin: 0 auto;
}

.statement {
  text-align: justify;
}

/* CONTENEDOR FULL WIDTH */
.relacion-fondo {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background-color: #EDEAE2;
  min-height: 520px;
  overflow: hidden;
}

/* IMAGEN FONDO */
.relacion-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;
  display: block;
}

/* =========================
COLUMNAS (CLAVE)
========================= */
.relacion-bloque {
  position: absolute;
  width: 15%;
  height: 230px;
  text-align: center;
}

/* CONTENIDO INTERNO */
.columna {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* =========================
POSICIONES (AJUSTE FINO)
========================= */

.acuerdo {
  top: 20%;
  left: 15%;
}

.extension {
  top: 20%;          
  left: 50%;
  transform: translateX(-50%);
}

.contradiccion {
  top:20%;
  right: 10%;
}

/* =========================
TIPOGRAFÍA
========================= */

.relacion-bloque h3 {
  color: #5C93AA;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.relacion-bloque p {
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 220px;
  margin: 0 auto;

  flex-grow: 1;        /* � ESTO ARREGLA TODO */
  display: flex;
  align-items: center; /* centra el texto verticalmente */
}

/* =========================
BOTÓN (ALINEADO)
========================= */

.relacion-btn {
  margin-top: auto;  /* � ahora sí funciona */
  margin-bottom: 9px;

  border: 1px solid #5C93AA;
  background: transparent;
  color: #5C93AA;
  border-radius: 999px;
  padding: 0.25rem 1rem;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.3s ease;
}


.relacion-btn:hover {
  background: #5C93AA;
  color: white;
}

.relacion-cierre-wrapper {
  position: absolute;
  bottom: 12%;
  width: 100%;
  display: flex;
  justify-content: center;
}

.relacion-cierre {
  max-width: 800px;
  width: 100%;
  padding: 0 1rem;
  text-align: justify;
}


/* =========================
RELACIÓN TEXTO IMAGEN — MOBILE
========================= */
@media (max-width: 768px) {

  /* CONTENEDOR */
  .relacion-fondo {
    height: auto;
    padding: 3rem 1rem;
  }

  /* OCULTAR IMAGEN DE FONDO (opcional pero recomendado) */
  .relacion-bg {
    display: none;
  }

  /* BLOQUES → vertical */
  .relacion-bloque {
    position: relative;   /* � clave */
    width: 100%;
    height: auto;
    
    top: auto;
    left: auto;
    right: auto;
    transform: none;

    margin-bottom: 2.5rem;
  }

  /* CONTENIDO */
  .columna {
    align-items: center;
    text-align: center;
  }

  .relacion-bloque p {
    max-width: 280px;
  }

  /* BOTÓN */
  .relacion-btn {
    margin-top: 1rem;
  }

  /* TEXTO FINAL */
  .relacion-cierre {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;

    width: 100%;
    margin-top: 2rem;

    text-align: justify;
  }
}


/* =====================================================
RESPONSIVE FINAL SESION 1
Estos ajustes se aplican al final para proteger la vista
de celular sin alterar el diseño principal de escritorio.
===================================================== */

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

  .book-definition {
    width: 100%;
    margin-left: 0;
    left: auto;
    transform: none;
  }

  .type-sheet,
  .types-section,
  .album-bloque,
  .relacion-fondo {
    width: 100%;
    margin-left: 0;
  }

  .tipos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 1rem;
  }
}

@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 {
    padding: 0 1.1rem;
  }

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

  .statement p,
  .objetivo p,
  .type-copy p,
  .album-copy,
  .relacion-cierre {
    font-size: 0.94rem;
    line-height: 1.65;
    text-align: left;
    hyphens: auto;
  }

  .book-definition {
    display: grid;
    grid-template-columns: 1fr;
  }

  .book-image img {
    display: block;
    width: 100%;
    max-height: 58vh;
    object-fit: cover;
  }

  .book-text {
    padding: 1.5rem 1.2rem;
  }

  .book-script {
    font-size: 1.08rem;
  }

  .book-copy {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .types-section {
    padding: 0;
  }

  .types-title {
    margin: 1.5rem 1.1rem 0.8rem;
  }

  .type-sheet {
    padding-top: 0;
  }

  .type-sheet-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.35rem 1.1rem;
  }

  .type-name-label {
    display: block;
    font-size: 1rem;
  }

  .example-trigger {
    margin-top: 0.45rem;
  }

  .arrow-line {
    width: 92px;
  }

  .cards-section {
    padding: 2rem 1rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .card {
    min-height: auto;
    border-radius: 24px;
    padding: 1.35rem;
  }

  .card button {
    top: 0;
    left: 0;
  }

  .album-bloque {
    border-radius: 34px;
    padding: 3rem 1.1rem;
    margin: 3rem 0;
  }

  .album-quote {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .album-quote span {
    font-size: 1rem;
  }

  .libro-composicion {
    margin: 2.5rem auto 0;
    padding: 0;
  }

  .libro-img {
    transform: none;
  }

  .libro-texto {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin-top: 1rem;
    font-size: 0.88rem;
    box-shadow: none;
  }

  .tipos-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem auto;
    padding: 0 1.1rem;
  }

  .tipo-card h3 {
    min-height: auto;
    margin: 0.75rem 0 0;
    font-size: 1.05rem;
  }

  .tipo-overlay {
    position: static;
    opacity: 1;
    padding: 1.1rem;
    background: #5C93AA;
  }

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

  .tipo-image {
    aspect-ratio: auto;
    overflow: visible;
  }

  .tipo-image img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .relacion-fondo {
    padding: 2.5rem 1.1rem;
  }

  .relacion-bg {
    display: none;
  }

  .relacion-bloque {
    position: relative;
    width: 100%;
    height: auto;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    margin-bottom: 2rem;
  }

  .relacion-bloque h3 {
    font-size: 1.08rem;
  }

  .relacion-bloque p {
    display: block;
    max-width: 100%;
    font-size: 0.92rem;
    line-height: 1.55;
    text-align: left;
  }

  .relacion-cierre-wrapper {
    position: relative;
    bottom: auto;
    width: 100%;
  }

  .relacion-cierre {
    margin: 0;
    padding: 0;
  }

  .album-gallery-dialog {
    width: 94vw;
    height: 88vh;
    border-radius: 16px;
    padding: 3rem 0.9rem 1rem;
  }

  .album-gallery-grid img {
    max-width: calc(100vw - 6rem);
    max-height: 58vh;
  }

  .album-gallery-nav {
    font-size: 2rem;
  }

  .album-gallery-nav--prev {
    left: 0.4rem;
  }

  .album-gallery-nav--next {
    right: 0.4rem;
  }

  .album-gallery-close {
    top: 10px;
    right: 14px;
  }

  #carouselTitle,
  #carouselAuthor {
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .album-gallery-grid img {
    max-width: calc(100vw - 4.5rem);
    max-height: 54vh;
  }

  .card {
    border-radius: 20px;
  }
}
