/* The project binder borrows its stock, vellum and ink from the contents sheets. */
.editorial-project-view {
  --binding-leaf-width: clamp(39px, 7vw, 92px);
  --binding-gap: clamp(7px, 1.05vw, 13px);
  --binder-stock: color-mix(in srgb, var(--paper) 75%, #fff);
  --binder-rule: color-mix(in srgb, var(--ink) 21%, transparent);
  --binder-fiber: url("assets/paper-fibers.webp");
  container-type: inline-size;
}

.editorial-project-view.editorial-legacy { display: block; }
.editorial-project-view.editorial-legacy::before { content: none; }

.editorial-project-view :is(.detail-nav, .detail-end, .page-trail, .detail-bottom) {
  margin: 0 0 14px;
  color: var(--muted);
  font: 600 10px/1.4 var(--font);
}
.editorial-project-view :is(.detail-end, .detail-bottom) { margin: 14px 0 0; }
.editorial-project-view.editorial-legacy :is(.page-trail, .detail-bottom) {
  margin-block: 0 14px;
  font: 600 10px/1.4 var(--font);
}
.editorial-project-view.editorial-legacy .detail-bottom { margin-block: 14px 0; }

.editorial-project-view .project-binder {
  display: grid;
  grid-template-columns: var(--binding-leaf-width) minmax(0, 1fr);
  gap: var(--binding-gap);
  position: relative;
  isolation: isolate;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
}
.editorial-project-view .binding-leaf {
  position: relative;
  min-width: 0;
  background-color: var(--binder-stock);
  background-image: linear-gradient(90deg, #fff7, transparent 64%, #66583b0f), var(--binder-fiber);
  background-blend-mode: normal, multiply;
  background-size: auto, 430px auto;
  box-shadow:
    0 0 0 1px #65594121,
    1px 3px 0 -1px #e5dfd2,
    2px 6px 0 -3px #d5cdbc,
    3px 10px 13px -9px #40341d69;
  z-index: 3;
  pointer-events: none;
}
.editorial-project-view .binding-ring {
  position: absolute;
  top: 19%;
  right: calc(-1 * var(--binding-gap) - clamp(14px, 2.45vw, 30px));
  width: calc(var(--binding-gap) + clamp(23px, 4.55vw, 56px));
  height: clamp(6px, .85vw, 11px);
  z-index: 5;
  border: 2px solid #c6ccc8;
  border-top-color: #f7f9f7;
  border-right-color: #8d9690;
  border-bottom-color: #5f6862;
  border-radius: 50%;
  background: #e8ece835;
  box-shadow: 0 1.6px 1.5px #1e1a1146, inset 0 1px .7px #fff;
  transform: translateY(-50%) rotate(-1.25deg);
}
.editorial-project-view .binding-ring:nth-child(2) { top: 49%; transform: translateY(-50%) rotate(.65deg); }
.editorial-project-view .binding-ring:nth-child(3) { top: 79%; }
.editorial-project-view .binding-ring::before,
.editorial-project-view .binding-ring::after {
  position: absolute;
  z-index: -1;
  top: 50%;
  width: clamp(6px, .95vw, 11px);
  height: clamp(6px, .95vw, 11px);
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle at 48% 48%, #292d29 0 29%, #6d766f 33% 42%, #dedfd6 46% 68%, #929b93 72% 100%);
  transform: translateY(-50%);
  box-shadow: inset .3px .6px 1px #1f28236b, 0 .6px .5px #fffff1bd;
}
.editorial-project-view .binding-ring::before { left: -3px; }
.editorial-project-view .binding-ring::after { right: -3px; }

.editorial-project-view .binder-page {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, .25fr) minmax(0, 1fr);
  gap: clamp(23px, 4vw, 54px);
  min-height: min(630px, 74svh);
  padding: clamp(33px, 5vw, 66px) clamp(23px, 4.7vw, 64px) clamp(39px, 5vw, 68px) 0;
}
/* The full translucent leaf overlaps a slightly displaced sheet of stock. */
.editorial-project-view .binder-page::before,
.editorial-project-view .binder-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.editorial-project-view .binder-page::before {
  z-index: -2;
  inset: -3px 4px 4px -2px;
  background: var(--binder-fiber) 0 0 / 430px, var(--binder-stock);
  border: 1px solid #d2c9b861;
  box-shadow: 1px 2px 4px #4d453423;
  transform: rotate(-.17deg);
}
.editorial-project-view .binder-page::after {
  z-index: -1;
  inset: 0;
  background-image: var(--vellum-grain), linear-gradient(122deg, #fff9, #f4f0e570 56%, #ede8da51);
  background-size: 165px, auto;
  background-color: color-mix(in srgb, var(--binder-stock) 55%, transparent);
  border: 1px solid #fff9;
  border-right-color: #b9b09d56;
  border-bottom-color: #a89b8652;
  box-shadow: 1px 2px 2px #4d453422, 3px 8px 13px -8px #40341d55;
}
.editorial-project-view .binder-veil {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 10px;
  min-width: 0;
  min-height: min(440px, 48vw);
  margin-left: -1px;
  padding: clamp(17px, 2.75vw, 38px) clamp(10px, 1.65vw, 23px) 17px clamp(18px, 2.9vw, 41px);
  border: 1px solid #fff9;
  border-left-color: transparent;
  background-color: #f5f1e758;
  background-image: var(--vellum-grain), linear-gradient(107deg, #fff8, #efe8d92e 65%, #fff1);
  background-size: 140px, auto;
  box-shadow: 1px 2px 3px #5c4d352e, inset -1px -1px 0 #96846c21;
  color: var(--ink);
  font: 600 10px/1.42 var(--font);
  overflow-wrap: anywhere;
}
.editorial-project-view .veil-index { font-size: 9px; }
.editorial-project-view .veil-caption {
  margin: 0;
  color: var(--muted);
  font: 500 10px/1.4 var(--font);
}
.editorial-project-view .veil-imprint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}
.editorial-project-view .veil-mark { width: 22px; color: var(--red); }
.editorial-project-view .veil-mark svg { display: block; width: 100%; height: auto; }

.editorial-project-view .binder-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(98px, .32fr);
  grid-template-areas: "heading heading" "figure notes" "figure margin" "writing sketch";
  align-content: start;
  align-items: start;
  gap: clamp(16px, 2.4vw, 32px) clamp(13px, 2.65vw, 36px);
  min-width: 0;
}
.editorial-project-view .binder-content > :is(.left-page, .right-page, .detail-art) { display: contents; }
.editorial-project-view .project-binder :is(.project-heading, .detail-heading) {
  grid-area: heading;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}
.editorial-project-view .project-binder :is(.project-heading, .detail-heading) h1 {
  margin: 0;
  font: 500 clamp(24px, 3.2vw, 43px)/1.04 var(--display-font);
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
.editorial-project-view .project-binder :is(.project-deck, .detail-deck) {
  max-width: 55ch;
  margin: 9px 0 0;
  color: var(--muted);
  font: 600 11px/1.5 var(--font);
}
.editorial-project-view .notebook-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font: 600 9px/1.35 var(--font);
}
.editorial-project-view .project-binder .project-figure {
  grid-area: figure;
  order: 0;
  min-width: 0;
  width: 100%;
  margin: 0;
}
.editorial-project-view .project-binder .project-artwork :is(img, svg),
.editorial-project-view.editorial-legacy .project-binder .detail-art .bone-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(300px, 46vw, 560px);
  aspect-ratio: auto;
  object-fit: contain;
  object-position: left top;
}
/* A thin, liftable wash over the artwork leaves the page type on top. */
.editorial-project-view .project-binder :is(.project-artwork, .muko-visual, .alerts-visual, .bone-figure) {
  position: relative;
  isolation: isolate;
}
.editorial-project-view .project-binder :is(.project-artwork, .muko-visual, .alerts-visual, .bone-figure)::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -2px -3px -3px 1px;
  pointer-events: none;
  background-image: var(--vellum-grain), linear-gradient(108deg, #faf7ed91, #f2eee262 52%, #ede9da40);
  background-size: 145px, auto;
  border: 1px solid #fff8;
  border-bottom-color: #ae9e843e;
  box-shadow: 1px 2px 2px #50443024;
  opacity: .45;
  transition: opacity .22s ease;
}
.editorial-project-view .project-binder :is(.project-artwork, .bone-figure):has(> img)::after { opacity: .72; }
@media (hover: hover) {
  .editorial-project-view .project-binder :is(.project-artwork, .muko-visual, .alerts-visual, .bone-figure):hover::after {
    opacity: .14;
  }
}
@media (prefers-reduced-motion: reduce) {
  .editorial-project-view .project-binder :is(.project-artwork, .muko-visual, .alerts-visual, .bone-figure)::after {
    transition: none;
  }
}
.editorial-project-view .project-binder .project-note {
  grid-area: margin;
  margin: 0;
  color: var(--muted);
  font: 400 11px/1.45 var(--font);
}
.editorial-project-view .project-binder .residence-sketch-frame {
  grid-area: sketch;
  position: static;
  display: block;
  width: min(100%, 100px);
}
.editorial-project-view .project-binder .sheet-number { bottom: 16px; right: 18px; }

.editorial-project-view .project-binder .notebook-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font: 600 9px/1.4 var(--font);
}
.editorial-project-view .project-binder .notebook-record {
  grid-area: notes;
  order: 0;
  display: grid;
  gap: 11px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font: 600 10px/1.42 var(--font);
}
.editorial-project-view .notebook-entry-index {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 9px;
}
.editorial-project-view .notebook-observation { margin: 0; font-weight: 400; }
.editorial-project-view .notebook-fields p {
  display: grid;
  gap: 1px;
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}
.editorial-project-view .notebook-fields p > span:first-child { color: var(--muted); font-size: 9px; }
.editorial-project-view .notebook-stamp { width: 23px; color: var(--red); }
.editorial-project-view .notebook-stamp svg { display: block; width: 100%; height: auto; }

.editorial-project-view .project-binder :is(.project-copy, .detail-writing) {
  grid-area: writing;
  min-width: 0;
  max-width: 66ch;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--binder-rule);
  font: 400 13px/1.65 var(--font);
}
.editorial-project-view .project-binder .project-credit {
  margin-top: 16px;
  color: var(--muted);
  font: 600 10px/1.5 var(--font);
}

.editorial-project-view.editorial-legacy .binder-content {
  grid-template-areas: "heading heading" "figure notes" "caption notes" "writing writing";
}
.editorial-project-view.editorial-legacy .detail-art > :is(.muko-visual, .alerts-visual, .bone-figure) {
  grid-area: figure;
  min-width: 0;
  margin: 0;
}
.editorial-project-view.editorial-legacy .detail-art > .notebook-caption { grid-area: caption; margin-top: -8px; }
.editorial-project-view.editorial-legacy .project-binder .detail-writing { gap: 17px; }

@container (max-width: 800px) {
  .editorial-project-view .binder-page { gap: 20px; padding-right: clamp(16px, 3.8vw, 34px); }
}
@container (max-width: 640px) {
  .editorial-project-view .binder-content,
  .editorial-project-view.editorial-legacy .binder-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "figure" "caption" "notes" "margin" "writing" "sketch";
    gap: 16px;
  }
  .editorial-project-view .project-binder .notebook-record { max-width: 32ch; }
  .editorial-project-view .project-binder :is(.project-heading, .detail-heading) h1 { font-size: clamp(21px, 5.4cqw, 32px); }
}
@container (max-width: 495px) {
  .editorial-project-view .project-binder { --binding-leaf-width: 18px; --binding-gap: 5px; }
  .editorial-project-view .binder-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding: 22px 16px 30px 18px;
  }
  .editorial-project-view .binding-ring {
    right: calc(-1 * var(--binding-gap) - 10px);
    width: calc(var(--binding-gap) + 22px);
    height: 6px;
    border-width: 1.4px;
  }
  .editorial-project-view .binder-veil {
    flex-flow: row wrap;
    align-items: baseline;
    gap: 3px 8px;
    min-height: 0;
    margin-left: -18px;
    padding: 7px 9px 7px 14px;
    font-size: 8px;
  }
  .editorial-project-view .veil-caption { font-size: 11px; }
  .editorial-project-view .veil-imprint { margin: 0 0 0 auto; }
  .editorial-project-view .veil-mark { width: 14px; }
}
