  /* ==================================================
VARIABLES
================================================== */

:root {
--paper: #fff3ef;
--ink: #9b8883;
--ink-strong: #8f746b;
--rust: #9b8883;
--mauve: #9b8883;
--veil: rgba(46, 38, 31, 0.58);
--editorial-text-width: min(76vw, 880px);
--editorial-gallery-width: min(82vw, 1040px);
}

@font-face {
  font-family: "Breathney Demo";
  src: url("fonts/Breathney-Demo.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Charter";
  src: url("fonts/Charter.ttc") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ==================================================
RESET + QUARTO
================================================== */

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #fff3ef; 
  color: var(--ink);
  font-family: "Charter", Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

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

/* Ocultar elementos propios de Quarto */

.quarto-title-block,
#title-block-header,
nav,
.toc {
  display: none;
}

.page-columns,
.page-layout-article,
.content,
main.content {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

#quarto-content {
  display: block;
  width: 100%;
  max-width: none;
}

/* ==================================================
CONTENEDORES GENERALES
================================================== */

.tan-page {
  width: 100%;
}

.section-narrow {
  width: var(--editorial-text-width);
  margin: 0 auto;
  padding: clamp(54px, 7vw, 108px) 0;
}

.section-wide {
  width: var(--editorial-gallery-width);
  margin: 0 auto;
  padding: clamp(32px, 4.6vw, 70px) 0;
}

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

/* ==================================================
NAVEGACIÓN SUPERIOR
================================================== */

.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);
  color: rgb(92, 147, 170);
  font-family: "Charter", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  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);
}


/* ==================================================
MASTHEAD
================================================== */

.tan-masthead {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: clamp(180px, 28vw, 310px);
  padding: clamp(34px, 6vw, 78px) 24px clamp(22px, 3.8vw, 52px);
  text-align: center;
}

.masthead-kicker {
  display: none;
}

.masthead-creature {
  width: clamp(62px, 9vw, 110px);
  aspect-ratio: 1;
  display: block;
  margin-bottom: clamp(2px, 0.5vw, 7px);
  object-fit: contain;
  object-position: center;
}

.masthead-script {
  margin: 0 0 14px;
  color: #9d806b;
  font-family: "Breathney Demo", cursive;
  font-size: clamp(1.23rem, 2vw, 1.62rem);
  font-weight: 400;
  line-height: 0.95;
}

.tan-masthead h1 {
  max-width: 52rem;
  margin: 0;
  color: #9d806b;

  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  line-height: 1.25;
  text-transform: uppercase;
}

/* ==================================================
IMAGEN DE APERTURA
================================================== */

.opening-strip {
  width: 100vw;
  margin: 0 calc(50% - 50vw) clamp(54px, 8vw, 112px);
  overflow: hidden;
  background: var(--paper);
  isolation: isolate;
}

.opening-strip img {
  display: block;
  width: 100%;
  height: clamp(170px, 24vw, 315px);
  object-fit: cover;
  object-position: center 52%;
}

/* ==================================================
ARCHIVE SPREAD
================================================== */

.archive-spread {
  position: relative;
  width: min(82vw, 980px);
  margin: 0 auto clamp(180px, 14vw, 260px);
  aspect-ratio: 5997 / 7995;
  background: transparent;
  isolation: isolate;
  transform: translateX(clamp(18px, 2.4vw, 56px));
}

.archive-page-img {
  background: transparent;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* ==================================================
RETRATO CENTRAL
================================================== */

.portrait-frame img,
.bottom-gallery img,
.analysis-block img,
.cloud-modal-grid img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: opacity;
}

.portrait-frame img {
  filter: sepia(0.20) saturate(0.72) contrast(1.0) brightness(1.04);
  mix-blend-mode: opacity;
  opacity: 0.75;
}

/* ==================================================
CAPTION DEL RETRATO
================================================== */

.portrait-caption {
  position: absolute;
  top: calc(100% + 24px);
  right: 6%;
  width: clamp(190px, 21vw, 260px);
  margin: 0;
  color: #987f70;
  font-size: clamp(0.66rem, 0.9vw, 0.84rem);
  line-height: 1.4;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  text-align: justify;
  text-align-last: left;
}

.portrait-caption p {
  margin: 0;
}

.portrait-caption cite {
  font-style: normal;
}

.caption-arrow-img {
  position: absolute;
  right: 48%;
  bottom: calc(100% + 4px);
  transform: none;
  display: block;
  width: clamp(54px, 6.8vw, 86px);
  height: auto;
}

/* ==================================================
MEMORIA, SILENCIO Y MIGRACIÓN
================================================== */

.section-narrow .script-title {
  margin: 0 0 clamp(26px, 3vw, 42px);
  color: #b8947c;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  line-height: normal;
  font-style: italic;
  text-align: center;
}


.text-columns {
  position: relative;
  left: 50%;
  width: var(--editorial-text-width);
  margin-right: 0 !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  padding-top: clamp(20px, 3vw, 42px);
  padding-bottom: clamp(42px, 5vw, 72px);
}

/* ==================================================
COLUMNAS DE TEXTO
================================================== */

.memory-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(34px, 6vw, 88px);
  align-items: start;
  width: 100%;
  font-size: 0.97rem;
  line-height: 1.7;
  hyphens: auto;
  text-align: justify;
  text-align-last: left;
}

.memory-columns p {
  margin: 0;
}

/* ==================================================
GALERÍA INTERACTIVA
================================================== */

.hover-gallery {
  position: relative;
  left: 50%;
  display: grid;
  width: var(--editorial-gallery-width);
  margin-right: 0 !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(9px, 1.2vw, 16px);
}

/* ==================================================
TARJETAS
================================================== */

.hover-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: 0.71;
  background: #d8cabc;
}

.hover-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.16) saturate(0.74) contrast(0.94);
  mix-blend-mode: multiply;
  transition: transform 420ms ease, filter 420ms ease;
}

/* ==================================================
AJUSTE INDIVIDUAL DE ENCUADRES
================================================== */

.hover-card:nth-child(1) img {
  object-position: 50% 58%;
}

.hover-card:nth-child(2) img {
  object-position: 50% 45%;
}

.hover-card:nth-child(3) img {
  object-position: 50% 40%;
}

.hover-card:nth-child(4) img {
  object-position: 50% 40%;
}

/* ==================================================
CAPA OSCURA
================================================== */

.hover-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, 0);
  transition: background 320ms ease;
}

/* ==================================================
TEXTO OVERLAY
================================================== */

/* ==================================================
TEXTO OVERLAY
================================================== */

.hover-card-text {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 40px); /* Aumentamos el padding para dar aire en los bordes */
  color: #fff8f0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 320ms ease, transform 320ms ease;
}

.hover-card-text h2 {
  margin-top: auto;        /* Empuja el título hacia abajo desde el tope para que no quede pegado arriba */
  margin-bottom: 20px;     /* Separa el título de manera fija del párrafo */
  color: inherit;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  font-style: italic;
  font-weight: 500;
  text-align: center;
}

/* Si tienes una etiqueta <hr> o un divisor en el HTML, esto lo ocultará */
.hover-card-text hr, 
.hover-card-text .divider { 
  display: none; 
}


.hover-card-text p {
  max-width: 20ch;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  hyphens: none;
  text-align: center;
  text-align-last: center;
  word-spacing: normal;
}


/* ==================================================
EFECTOS HOVER
================================================== */

.hover-card:hover img,
.hover-card:focus-within img {
  transform: scale(1.035);
  filter: sepia(0.1) saturate(0.62) contrast(0.88);
}

.hover-card:hover::after,
.hover-card:focus-within::after {
  background: var(--veil);
}

.hover-card:hover .hover-card-text,
.hover-card:focus-within .hover-card-text {
  opacity: 1;
  transform: translateY(0);
}

/* ==================================================
CITA PRINCIPAL
================================================== */

.quote-panel {
  position: relative;
  display: grid;
  min-height: clamp(330px, 37vw, 505px);
  place-items: center;
  overflow: hidden;
  background: #342b25;
}

.quote-panel img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.12) saturate(0.72) contrast(0.9) brightness(0.88);
}

.quote-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(38, 31, 27, 0.34);
}

/* ==================================================
CONTENIDO DE LA CITA
================================================== */

.quote-overlay {
  position: relative;
  z-index: 1;
  width: min(78vw, 940px);
  color: #fff7ef;
  font-family: "Charter";
  text-align: center;
}

.quote-overlay h2 {
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  padding-bottom: 0;
  border-bottom: 0;
  color: inherit;
  font-size: clamp(1.15rem, 2.1vw, 1.85rem);
  font-weight: 700;
  text-align: center;
}

.quote-overlay h2 span {
  display: inline-block;
  margin-right: 0.2em;
  margin-left: 0.2em;
  font-size: 1.18em;
  font-family: "Breathney Demo", cursive;
  font-weight: 400;
}

.quote-overlay blockquote {
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 0;
  border: 0;
  font-size: clamp(0.88rem, 1.12vw, 1.08rem);
  font-weight: 600;
  line-height: 1.55;
  color: #fff7ef;
  text-align: justify;
  text-align-last: left;
  text-decoration: none;
}

.quote-overlay p {
  margin: 0;
  font-size: clamp(0.72rem, 0.92vw, 0.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==================================================
CITA FINAL
================================================== */

.quote-panel-small {
  min-height: clamp(300px, 31vw, 430px);
  background: var(--mauve);
}

.quote-panel-small::after {
  background: rgba(26, 23, 22, 0.58);
}

.quote-panel-small .quote-overlay {
  width: min(78vw, 1040px);
}

.quote-panel-small .quote-overlay blockquote {
  max-width: 1040px;
}

/* ==================================================
TEXTO INTERMEDIO
================================================== */

.quiet-copy {
  position: relative;
  left: 50%;
  width: var(--editorial-gallery-width);
  margin-right: 0 !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  padding-top: clamp(52px, 7vw, 92px);
  padding-bottom: clamp(26px, 4vw, 54px);
}

.section-narrow h2 {
  margin: 0 0 18px;
  color: #b28a72;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  font-style: italic;
  font-weight: 500;
}

.section-narrow p {
  margin-top: 0;
  font-size: 0.97rem;
  line-height: 1.7;
}

.quiet-copy p,
.analysis-block p,
.cloud-modal-window p {
  hyphens: auto;
  text-align: justify;
  text-align-last: left;
}


/* ==================================================
NUBES
================================================== */

.clouds-section {
  position: relative;
  left: 50%;
  width: var(--editorial-gallery-width);
  margin-right: 0 !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  padding-top: clamp(18px, 3vw, 38px);
  padding-bottom: clamp(36px, 5vw, 70px);
}

/* ==================================================
BOTÓN / TRIGGER
================================================== */

.cloud-trigger {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 clamp(58px, 6vw, 86px);
  border: 0;
  background: transparent;
  color: #9a8475;
  cursor: pointer;
  box-shadow: none;
}

.cloud-trigger img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: none;
}

.cloud-trigger::after {
  display: none;
}

/* ==================================================
CALLOUT
================================================== */

.cloud-trigger .cloud-callout {
  position: absolute;
  z-index: 1;
  inset: auto;
  left: auto;
  right: clamp(8px, 2vw, 30px);
  bottom: clamp(8px, 1vw, 16px);
  display: block;
  width: min(14vw, 138px);
  padding: 0;
  font-size: clamp(0.78rem, 1.15vw, 1.05rem);
  line-height: 1.1;
  text-align: left;
  text-shadow: none;
}

.cloud-trigger .cloud-callout > span:last-child {
  display: block;
  padding: 0;
}

/* ==================================================
FLECHA
================================================== */

.cloud-trigger .cloud-arrow {
  position: relative;
  display: block;
  width: 100%;
  height: 10px;
  margin-bottom: 4px;
  padding: 0;
  border-top: 1.5px solid currentColor;
}

.cloud-trigger .cloud-arrow::after {
  position: absolute;
  top: -5.5px;
  right: 0;
  width: 11px;
  height: 11px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.bottom-gallery {
  position: relative;
  left: 50%;
  display: grid;
  width: var(--editorial-gallery-width);
  transform: translateX(-50%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.35vw, 18px);
  align-items: start;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-top: clamp(18px, 3vw, 58px);
}

.bottom-gallery img {
  filter: sepia(0.15) saturate(0.76) contrast(0.96);
}

/* ==================================================
ANÁLISIS
================================================== */

.analysis-block {
  position: relative;
  left: 50%;
  width: var(--editorial-gallery-width);
  margin-right: 0 !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  padding-top: clamp(62px, 8vw, 112px);
  padding-bottom: clamp(86px, 10vw, 150px);
}

/* ==================================================
FILAS DE ANÁLISIS
================================================== */

.analysis-row {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1fr);
  gap: clamp(32px, 6vw, 86px);
  align-items: start;
  margin-top: clamp(34px, 5vw, 70px);
}

.analysis-row-reverse {
  grid-template-columns: minmax(280px, 1fr) minmax(0, 0.92fr);
}

.analysis-block img {
  filter: sepia(0.12) saturate(0.78) contrast(0.96);
}

.analysis-row p {
  hyphens: auto;
  text-align: justify;
  text-align-last: left;
}

.analysis-row p + p {
  margin-top: 1.1rem;
}

/* ==================================================
MODAL
================================================== */

.cloud-modal[hidden] {
  display: none;
}

.cloud-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
}

/* ==================================================
FONDO OSCURO
================================================== */

.cloud-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 19, 16, 0.68);
  backdrop-filter: blur(6px);
}

/* ==================================================
VENTANA
================================================== */

.cloud-modal-window {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: clamp(24px, 4vw, 48px);
  background: rgba(246, 237, 229, 0.97);
  box-shadow: 0 28px 80px rgba(24, 19, 16, 0.25);
}

/* ==================================================
BOTÓN CERRAR
================================================== */

.cloud-modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(93, 81, 67, 0.25);
  border-radius: 50%;
  background: rgba(255, 250, 245, 0.9);
  color: var(--ink-strong);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

/* ==================================================
CONTENIDO DEL MODAL
================================================== */

.cloud-modal-window h2 {
  margin: 0 56px 10px 0;
  color: var(--ink-strong);
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  font-style: italic;
  font-weight: 500;
}

.cloud-modal-window p {
  max-width: 620px;
  margin: 0 0 28px;
  line-height: 1.68;
}

/* ==================================================
GALERÍA DEL MODAL
================================================== */

.cloud-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cloud-modal-grid img {
  filter: sepia(0.12) saturate(0.8);
}

@media (max-width: 820px) {
  :root {
    --editorial-text-width: min(88vw, 640px);
    --editorial-gallery-width: min(88vw, 640px);
  }

  .section-narrow,
  .section-wide {
    width: min(88vw, 640px);
  }

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

  .back-link,
  .bibliography-link {
    flex: 1 1 0;
    width: auto;
    max-width: 170px;
    min-height: 38px;
    padding: 0 0.55rem;
    font-size: 0.76rem;
  }

  .tan-masthead {
    min-height: 190px;
    padding-top: 58px;
    
  }

  .opening-strip {
    margin-bottom: 44px;
  }

  .opening-strip img {
    height: clamp(136px, 38vw, 230px);
  }

  .archive-spread {
    width: min(94vw, 620px);
    margin: 0 auto clamp(176px, 36vw, 238px);
    transform: none;
  }

  .portrait-band {
    top: 50.8%;
    left: 3.1%;
    width: 93.8%;
  }

  .portrait-caption {
    top: calc(100% + 22px);
    right: 7%;
    width: clamp(140px, 42vw, 220px);
    font-size: clamp(0.62rem, 1.7vw, 0.76rem);
    line-height: 1.38;
  }

  .caption-arrow-img {
    right: 44%;
    bottom: calc(100% + 4px);
    width: clamp(38px, 9.5vw, 58px);
  }

  .hover-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hover-card {
    aspect-ratio: 0.75;
  }

  .hover-card-text {
    opacity: 1;
    transform: none;
    background: rgba(48, 39, 33, 0.48);
  }

  .bottom-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-row,
  .analysis-row-reverse {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .analysis-row-reverse img {
    order: 2;
  }

  .analysis-row-reverse div {
    order: 1;
  }
}

@media (max-width: 520px) {
  :root {
    --editorial-text-width: min(86vw, 440px);
    --editorial-gallery-width: min(86vw, 440px);
  }

  .section-narrow,
  .section-wide {
    width: min(86vw, 440px);
  }

  .tan-masthead h1 {
    max-width: 20rem;
    font-size: 0.98rem;
  }

  .masthead-script {
    font-size: 1.7rem;
  }

  .archive-spread {
    width: min(92vw, 430px);
    margin: 0 auto 188px;
  }

  .text-columns {
    padding-top: 28px;
  }

  .memory-columns {
    grid-template-columns: 1fr;
  }

  .memory-columns p + p {
    margin-top: 18px;
  }

  .hover-gallery,
  .bottom-gallery,
  .cloud-modal-grid {
    grid-template-columns: 1fr;
  }

  .hover-card {
    aspect-ratio: 1.08;
  }

  .quote-overlay {
    width: min(76vw, 360px);
  }

  .quote-panel:not(.quote-panel-small) {
    box-sizing: border-box;
    min-height: 590px;
    padding-top: 44px;
    padding-bottom: 24px;
    place-items: start center;
  }

  .quote-overlay h2 {
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(1.25rem, 6vw, 1.65rem);
    line-height: 1.05;
  }

  .quote-overlay h2 span {
    margin-right: 0.16em;
    margin-left: 0.16em;
    font-size: 1.22em;
  }

  .quote-overlay blockquote {
    font-size: clamp(0.86rem, 3.7vw, 1rem);
    line-height: 1.45;
  }

  .portrait-caption {
    top: calc(100% + 20px);
    right: 5%;
    width: min(58vw, 230px);
    font-size: clamp(0.66rem, 2.65vw, 0.78rem);
    line-height: 1.35;
  }

  .caption-arrow-img {
    right: 44%;
    bottom: calc(100% + 4px);
    width: clamp(34px, 8.8vw, 50px);
  }

  .cloud-trigger {
    padding-bottom: 64px;
  }

  .cloud-trigger .cloud-callout {
    right: 0;
    bottom: 8px;
    width: 112px;
    font-size: 1rem;
    line-height: 1.05;
  }

  .cloud-trigger .cloud-arrow {
    height: 10px;
    margin-bottom: 5px;
    border-top-width: 1.5px;
  }

  .cloud-trigger .cloud-arrow::after {
    top: -5px;
    width: 10px;
    height: 10px;
    border-top-width: 1.5px;
    border-right-width: 1.5px;
  }

  .quiet-copy,
  .memory-columns,
  .analysis-block p {
    overflow-wrap: normal;
    word-break: normal;
  }
}