/* Fotografía / fotoensayo — la obra se lee como serie, no como tarjetas. */
.photo-essay {
  padding-bottom: clamp(82px, 10vw, 150px);
}

.photo-essay__header {
  padding-bottom: clamp(30px, 4vw, 54px);
  padding-top: clamp(36px, 4.8vw, 66px);
  text-align: center;
}

.photo-essay__kicker {
  color: var(--ed-accent-text-on-paper);
  font-family: var(--ed-ui-sans);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.15em;
  margin: 0;
  text-transform: uppercase;
}

.photo-essay__header h1 {
  font-family: var(--ed-serif);
  font-size: var(--ed-article-opening-title-size);
  font-weight: 500;
  letter-spacing: -0.042em;
  line-height: 0.96;
  margin: 16px auto 16px;
  max-width: 13ch;
  overflow-wrap: normal;
  text-transform: none;
}

.photo-essay__header .ed-meta {
  font-size: 12px;
  gap: 8px 18px;
  justify-content: center;
  margin-top: 16px;
}

.photo-essay__deck {
  font-family: var(--ed-serif);
  font-size: clamp(1.15rem, 1.55vw, 1.55rem);
  font-style: italic;
  line-height: 1.42;
  margin: 0 auto;
  max-width: 42ch;
}

/* La obra ocupa la retícula visual y termina con una respiración inequívoca. */
.photo-essay__work {
  margin-bottom: clamp(6rem, 10vw, 11rem);
}

.photo-essay__content {
  display: block;
  font-size: var(--ed-reading-size);
  line-height: var(--ed-reading-leading);
}

.photo-essay__content > *:first-child {
  margin-top: 0;
}

.photo-essay__content > p,
.photo-essay__content > ul,
.photo-essay__content > ol,
.photo-essay__content > blockquote,
.photo-essay__content > h2,
.photo-essay__content > h3,
.photo-essay__content > h4 {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--ed-reading);
}

.photo-essay__content > p,
.photo-essay__content > ul,
.photo-essay__content > ol,
.photo-essay__content > blockquote {
  font-family: var(--ed-article-body-font, var(--ed-body-serif));
  font-size: var(--ed-reading-size);
  line-height: var(--ed-reading-leading);
}

/* Hoja de contacto: ritmo, gutters constantes y proporción natural. */
.photo-contact-sheet,
.is-style-nocturnalia-contact-sheet {
  align-items: start;
  display: grid !important;
  gap: clamp(10px, 1.15vw, 18px) !important;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin: 0 auto clamp(22px, 3vw, 42px) !important;
  padding: 0 !important;
  width: 100%;
}

.photo-contact-sheet + .photo-contact-sheet,
.is-style-nocturnalia-contact-sheet {
  margin-top: clamp(10px, 1.15vw, 18px) !important;
}

.photo-contact-sheet__item,
.photo-contact-sheet > figure,
.photo-contact-sheet > .wp-block-image,
.is-style-nocturnalia-contact-sheet > figure {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  grid-column: span 6;
  margin: 0 !important;
  min-width: 0;
  outline: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.photo-contact-sheet__item.is-landscape,
.photo-contact-sheet > figure.is-landscape,
.is-style-nocturnalia-contact-sheet > figure.is-landscape {
  grid-column: 1 / -1;
}

.photo-contact-sheet--three-up > .photo-contact-sheet__item:not(.is-landscape),
.photo-contact-sheet--three-up > figure:not(.is-landscape) {
  grid-column: span 4;
}

.photo-contact-sheet img,
.is-style-nocturnalia-contact-sheet img,
.photo-contact-sheet__item img,
.photo-essay__content > .wp-block-image img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  display: block;
  height: auto !important;
  margin: 0 auto !important;
  max-height: none !important;
  max-width: 100%;
  object-fit: contain !important;
  outline: 0 !important;
  width: 100% !important;
}

.photo-contact-sheet figcaption,
.photo-essay__figure figcaption {
  color: var(--ed-muted);
  font-family: var(--ed-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin-top: 9px;
  max-width: 72ch;
}

.photo-essay__figure {
  margin: 0 auto clamp(42px, 5vw, 76px);
  max-width: var(--ed-visual);
}

.photo-essay__figure img {
  height: auto;
  max-height: none;
  object-fit: contain;
  width: 100%;
}

.photo-essay .editorial-content > p:first-of-type::first-letter,
.photo-essay .editorial-content > p.has-drop-cap:first-of-type:not(:focus)::first-letter {
  color: inherit;
  float: none;
  font: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

/* El cierre vuelve a la retícula editorial para distinguir recomendación de obra. */
.related-posts--photography .section-heading {
  margin-bottom: clamp(26px, 3vw, 38px);
}

.related-posts--photography .section-heading h2 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  letter-spacing: -0.045em;
}

.related-posts--photography .ed-card__media {
  background: var(--ed-paper-deep);
}

.related-posts--photography .ed-card__body {
  padding-top: 16px;
}

/* Fotoensayo: papel por defecto; cámara oscura sigue siendo una opción explícita. */
.photo-essay--dark {
  background: #0d0d0d;
  color: #f7f3ea;
}

.photo-essay--dark .photo-essay__header,
.photo-essay--dark .photo-essay__content,
.photo-essay--dark .related-posts {
  color: #f7f3ea;
}

.photo-essay--dark .photo-essay__deck,
.photo-essay--dark .ed-meta,
.photo-essay--dark .ed-meta a,
.photo-essay--dark .ed-meta span,
.photo-essay--dark .ed-meta time,
.photo-essay--dark figcaption,
.photo-essay--dark .nocturnalia-media-credit {
  color: #c9c2b8;
}

.photo-essay--dark .section-heading,
.photo-essay--dark .ed-card__meta,
.photo-essay--dark .ed-card__body {
  color: #f7f3ea;
}

.photo-essay--dark .section-heading,
.photo-essay--dark .ed-card__body {
  border-color: rgba(247, 243, 234, 0.58);
}

.photo-essay--dark .ed-card__media {
  background: #171717;
}

.photo-essay--dark .ed-card__title a {
  color: #f7f3ea;
}

.photo-essay--dark .ed-card__meta {
  color: #b7b0a6;
}

.nocturnalia-body-font-underwood .photo-essay__content > p,
.nocturnalia-body-font-underwood .photo-essay__content > ul,
.nocturnalia-body-font-underwood .photo-essay__content > ol,
.nocturnalia-body-font-underwood .photo-essay__content > blockquote:not(.is-style-nocturnalia-epigraph):not(.is-style-nocturnalia-aside) {
  font-family: var(--ed-typewriter);
}

.nocturnalia-body-font-underwood .photo-essay__content h2,
.nocturnalia-body-font-underwood .photo-essay__content h3,
.nocturnalia-body-font-underwood .photo-essay__content h4,
.nocturnalia-body-font-underwood .photo-essay__content figcaption {
  font-family: var(--ed-display-serif);
}

@media (max-width: 760px) {
  .photo-contact-sheet__item,
  .photo-contact-sheet > figure,
  .photo-contact-sheet > .wp-block-image,
  .photo-contact-sheet--three-up > .photo-contact-sheet__item:not(.is-landscape),
  .photo-contact-sheet--three-up > figure:not(.is-landscape),
  .is-style-nocturnalia-contact-sheet > figure {
    grid-column: 1 / -1;
  }

  .photo-essay__work {
    margin-bottom: clamp(5rem, 18vw, 7rem);
  }
}


.photo-essay__credit {
  font-family: var(--ed-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0.85rem 0 0;
  text-transform: uppercase;
}


/* 1.1.71 — Fotografía como sala editorial: imagen primero, interfaz después. */
.photo-essay__hero {
  margin: 0 auto;
  max-width: var(--ed-visual);
  padding-bottom: clamp(18px, 2.4vw, 34px);
  padding-top: clamp(28px, 4vw, 58px);
}

.photo-essay__hero-image {
  background: transparent;
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 84svh;
  object-fit: contain;
  width: 100%;
}

.photo-essay__hero .editorial-media-caption {
  margin-left: 0;
  margin-right: auto;
  max-width: 78ch;
  text-align: left;
}

.photo-essay__hero + .photo-essay__header {
  padding-top: clamp(18px, 2.5vw, 34px);
}

.photo-essay__location {
  color: var(--ed-muted);
  font-family: var(--ed-sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  margin: 0.45rem 0 0;
  text-transform: uppercase;
}

/* La lectura principal es secuencial. Una galería sólo se vuelve hoja de
   contacto cuando el editor aplica expresamente ese estilo. */
.photo-sequence {
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  width: 100%;
}

.photo-sequence > figure,
.photo-sequence > .wp-block-image,
.photo-essay__content > .wp-block-image,
.photo-essay__content > figure:has(> img) {
  display: block;
  margin: 0 auto clamp(58px, 8vw, 122px) !important;
  width: 100% !important;
}

.photo-sequence > figure.is-portrait,
.photo-sequence > .wp-block-image.is-portrait,
.photo-essay__content > .wp-block-image.is-portrait,
.photo-essay__content > figure.is-portrait {
  max-width: min(100%, 920px);
}

.photo-sequence > figure.is-squareish,
.photo-sequence > .wp-block-image.is-squareish,
.photo-essay__content > .wp-block-image.is-squareish,
.photo-essay__content > figure.is-squareish {
  max-width: min(100%, 1080px);
}

.photo-sequence > figure.is-landscape,
.photo-sequence > .wp-block-image.is-landscape,
.photo-essay__content > .wp-block-image.is-landscape,
.photo-essay__content > figure.is-landscape {
  max-width: var(--ed-visual);
}

.photo-sequence img,
.photo-essay__content > .wp-block-image img,
.photo-essay__content > figure > img {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: block;
  height: auto !important;
  margin: 0 auto !important;
  max-height: none !important;
  object-fit: contain !important;
  width: 100% !important;
}

.photo-sequence figcaption,
.photo-essay__content > .wp-block-image figcaption,
.photo-essay__content > figure > figcaption {
  margin-top: 10px;
}

.photo-essay--dark .photo-essay__location {
  color: #c9c2b8;
}

@media (max-width: 760px) {
  .photo-essay__hero {
    padding-bottom: 14px;
    padding-top: 20px;
  }

  .photo-essay__hero-image {
    max-height: none;
  }

  .photo-sequence > figure,
  .photo-sequence > .wp-block-image,
  .photo-essay__content > .wp-block-image,
  .photo-essay__content > figure:has(> img) {
    margin-bottom: clamp(44px, 14vw, 76px) !important;
  }
}
