/* ==========================================================================
   A Boy's Dream — Editorial home ("un número", not a collage).
   Three magazine plates read as one issue. Two bindings share the same
   plates + reader:
     - Folio  (#/)      one plate on a desk, turn page by page (horizontal)
     - Look   (#/look)  each plate is the viewport, scroll top to bottom
   The plates already carry their own type; on desktop we never overlay type
   on them. Clicking a plate opens the reader with the same words rebuilt in
   HTML (mobile-legible + "discover a bit more behind each photo").
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital@0;1&family=Libre+Bodoni:wght@600;700&display=swap");

/* ---------- surface shell ---------- */
/* Specificity note: styles.css sets `#app.dir:not(.dir-paper){display:flex}`.
   We match that weight (#app + two classes) so this block layout wins. */
#app.dir.dir-issue {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  background: #cdbfa6;
  color: #141414;
}
/* Chrome ink follows the current plate (light plate → dark ink, dark plate → light ink). */
#app.dir-issue[data-ink="dark"] {
  --issue-chrome-ink: #141414;
}
#app.dir-issue[data-ink="light"] {
  --issue-chrome-ink: #f4efe6;
}

/* Folio never scrolls the page; the leaf turn is the whole gesture. */
body:has(.issue-folio),
body:has(.issue-mural) {
  overflow: hidden;
}

.dir-issue .site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 0;
  color: var(--issue-chrome-ink, #141414);
  font-family: var(--sans);
  transition: color 0.55s ease;
  mix-blend-mode: normal;
}
.dir-issue .site-head .brand,
.dir-issue .capricho,
.dir-issue .site-nav a,
.dir-issue .cart {
  color: inherit;
}
.dir-issue .brand-sub,
.dir-issue .brand-slash {
  color: currentColor;
  opacity: 0.55;
}
.dir-issue .site-nav a.nav-press,
.dir-issue .site-nav a.nav-press:hover {
  color: #c42021;
}
.dir-issue .site-main {
  padding: 0;
}
.dir-issue .site-foot {
  display: none;
}

/* Shared bits */
.issue {
  --bone: #efebe3;
  position: relative;
}
.issue-leaf,
.look-plate {
  background: #efeae0;
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.18);
}
.issue-plate-img {
  display: block;
  width: 100%;
  height: 100%;
  /* Never crop a plate: the box already carries the plate's own ratio, and
     contain guarantees the whole plate survives any rounding. */
  object-fit: contain;
}

/* ======================================================================
   FOLIO (A) — one plate centred on a desk, neighbours dimmed at the sides
   ====================================================================== */
.issue-folio {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--issue-stage, #cdbfa6);
  transition: background 0.6s ease;
}
.issue-stage {
  position: relative;
  width: 100%;
  height: 100%;
}
.issue-leaf {
  --gap: 55vh;
  position: absolute;
  top: 50%;
  left: 50%;
  height: min(82vh, 128vw); /* portrait; landscape overridden below */
  transform: translate(-50%, -50%);
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.5s ease, filter 0.5s ease;
  will-change: transform, opacity;
}
.issue-leaf[data-orient="landscape"] {
  --gap: 62vh;
  height: min(62vh, 68vw);
}
.issue-leaf[data-slot="0"] {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
  transform: translate(-50%, -50%) scale(1);
  filter: none;
}
.issue-leaf[data-slot="-1"] {
  opacity: 0.4;
  z-index: 2;
  transform: translate(calc(-50% - var(--gap)), -50%) scale(0.8);
  filter: brightness(0.85);
}
.issue-leaf[data-slot="1"] {
  opacity: 0.4;
  z-index: 2;
  transform: translate(calc(-50% + var(--gap)), -50%) scale(0.8);
  filter: brightness(0.85);
}
.issue-leaf[data-slot="-2"],
.issue-leaf[data-slot="2"] {
  opacity: 0;
}

/* Colophon leaf — the quiet close of the number (typeset, not a photo) */
.issue-colophon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: clamp(28px, 5vh, 64px) clamp(24px, 5vw, 60px);
  background: var(--bone);
  color: #141414;
  text-align: left;
}
.issue-colophon .col-mark {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(20, 20, 20, 0.5);
}
.issue-colophon .col-tag {
  font-family: "Libre Bodoni", Georgia, serif;
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
}
.issue-colophon .col-line {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(20, 20, 20, 0.8);
  max-width: 34ch;
  margin: 0;
}
.issue-colophon .col-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid rgba(20, 20, 20, 0.16);
  padding-top: 16px;
}
.issue-colophon .col-links a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.issue-colophon .col-links a:last-child {
  border-bottom: 0;
}
.issue-colophon .col-links a .go {
  opacity: 0.4;
}
.issue-colophon .col-links a:hover {
  text-decoration: none;
}
.issue-colophon .col-links a:hover .go {
  opacity: 1;
}
.issue-colophon .col-press {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #c42021;
}

/* Folio chrome — arrows, progress, hint, switch */
.issue-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 16, 12, 0.06);
  color: var(--issue-chrome-ink, #141414);
  cursor: pointer;
  transition: background 0.25s ease, opacity 0.25s ease;
}
.issue-nav:hover {
  background: rgba(20, 16, 12, 0.14);
}
.issue-nav svg {
  width: 22px;
  height: 22px;
}
.issue-nav.prev {
  left: clamp(10px, 3vw, 34px);
}
.issue-nav.next {
  right: clamp(10px, 3vw, 34px);
}
.issue-progress {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 40px);
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--issue-chrome-ink, #141414);
}
.issue-progress .dots {
  display: flex;
  gap: 7px;
}
.issue-progress .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.32;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.issue-progress .dot.on {
  opacity: 1;
  transform: scale(1.25);
}
.issue-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(4px, 1.6vh, 14px);
  transform: translateX(-50%);
  z-index: 8;
  margin: 0;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--issue-chrome-ink, #141414);
  opacity: 0.5;
}

/* Shared 3-way mode switcher (Folio / Scroll / Spread) */
.issue-modes {
  position: fixed;
  right: clamp(12px, 3vw, 34px);
  bottom: clamp(14px, 3.5vh, 34px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--issue-chrome-ink, #141414);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.issue-modes a {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.issue-modes a:hover {
  opacity: 0.9;
  text-decoration: none;
}
.issue-modes a.on {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.issue-modes-sep {
  opacity: 0.3;
}

/* ======================================================================
   LOOK (B) — each plate is the viewport, scroll top to bottom (snap)
   ====================================================================== */
.issue-look {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #201a13;
}
.look-page {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 78px 16px 56px;
  background: var(--tint, #cdbfa6);
  transition: background 0.5s ease;
}
.look-plate {
  position: relative;
  height: min(84vh, 128vw); /* portrait */
  cursor: pointer;
}
.look-plate[data-orient="landscape"] {
  /* cap the WIDTH so the derived height (w * 3/4) still clears the page:
     112vh wide => 84vh tall, the same height the portraits get */
  height: auto;
  width: min(92vw, 112vh);
}
.look-tag {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vh, 30px);
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #141414;
  opacity: 0.62;
  transition: opacity 0.25s ease;
}
.look-page[data-pink="light"] .look-tag {
  color: #f4efe6;
}
.look-tag:hover {
  opacity: 1;
}
.look-tag b {
  font-family: var(--mono);
  font-weight: 400;
}
.look-tag .read {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.look-scroll-cue {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 20;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--issue-chrome-ink, #141414);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.issue-look.is-scrolled .look-scroll-cue {
  opacity: 0;
}

/* Look colophon page */
.look-page.look-end {
  background: var(--bone, #efebe3);
}
.look-end .issue-colophon {
  height: auto;
  width: min(560px, 92vw);
  box-shadow: none;
  background: transparent;
  padding: 0;
}

/* ======================================================================
   PLIEGO — three portraits on one horizontal, full-bleed. Landscapes are
   their own screen (.is-wide). 2px thread (--tint) is the only gap.
   ====================================================================== */
.issue-mural {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #1a140e;
  scrollbar-width: none;
}
.issue-mural::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.mural-spread {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  grid-template-rows: 1fr;
  gap: 2px;
  background: var(--tint, #1a140e);
}
.issue-mural figure {
  margin: 0;
}
.mural-cell,
.mural-colophon-band {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.mural-cell {
  position: relative;
  cursor: pointer;
}
.mural-cell picture {
  display: block;
  width: 100%;
  height: 100%;
}
.mural-cell .issue-plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mural-colophon-band {
  color: #141414;
  background: var(--bone, #efebe3);
  display: flex;
  align-items: center;
  height: 100%;
  padding: clamp(16px, 4vh, 40px) clamp(24px, 5vw, 64px);
}
.mural-colophon-band .issue-colophon {
  display: flex;
  flex-flow: row wrap;
  align-items: baseline;
  gap: 6px 40px;
  height: auto;
  padding: 0;
  background: transparent;
}
.mural-colophon-band .col-line {
  display: none;
}
.mural-colophon-band .col-tag {
  font-size: clamp(20px, 2.4vw, 30px);
}
.mural-colophon-band .col-links {
  flex-direction: row;
  gap: 0 26px;
  border-top: 0;
  padding-top: 0;
}
.mural-colophon-band .col-links a {
  border-bottom: 0;
  padding: 0;
}

/* Phone: each plate is its own screen. display:contents so figures snap. */
@media (max-width: 720px) {
  .mural-spread {
    display: contents;
  }
  .mural-cell,
  .mural-colophon-band {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
  }
}

/* ======================================================================
   READER — the same words rebuilt as an HTML column (shared A + B)
   ====================================================================== */
.issue-reader {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
}
.issue-reader.is-open {
  display: grid;
  place-items: center;
}
.issue-reader-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(22, 17, 12, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.issue-reader-card {
  position: relative;
  z-index: 1;
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--issue-bone, #efebe3);
  color: #141414;
  padding: clamp(30px, 5vw, 56px);
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.6);
  animation: issueReaderIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes issueReaderIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.issue-reader-kicker {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(20, 20, 20, 0.5);
}
.issue-reader-title {
  margin: 0 0 20px;
  font-family: "Libre Bodoni", Georgia, serif;
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.issue-reader-body {
  margin: 0;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 17px;
  line-height: 1.62;
  color: rgba(20, 20, 20, 0.9);
}
.issue-reader-body p + p {
  margin-top: 0.9em;
}
.issue-reader-foot {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(20, 20, 20, 0.18);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(20, 20, 20, 0.6);
}
.issue-reader-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 26px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid #141414;
  padding-bottom: 3px;
}
.issue-reader-cta:hover {
  text-decoration: none;
  gap: 12px;
}
.issue-reader-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: rgba(20, 20, 20, 0.6);
}
.issue-reader-close:hover {
  color: #141414;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .issue-leaf,
  .issue-folio,
  .look-page,
  .issue-reader-card,
  .dir-issue .site-head {
    transition: none;
    animation: none;
  }
  .issue-look {
    scroll-behavior: auto;
  }
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .issue-leaf {
    --gap: 84vw;
  }
  .issue-leaf[data-orient="landscape"] {
    height: min(50vh, 92vw);
  }
  .issue-hint,
  .issue-progress .label {
    display: none;
  }
  .dir-issue .site-nav {
    gap: 16px;
  }
}
