/* "know more": a job's own page, opened over the site (scripts/scenes/calendar.js). Laid out like an editorial
   spread: a bracketed tag and a set-caps title beside the story; a full-bleed photo with a phrase spaced across
   it; a ruled box of numbered points; and what it taught me. Paper, ink and the calendar's red. */

html.has-casefile { overflow: hidden; }

.casefile {
  --paper: #ebe7de;
  --ink: #23201c;
  --red: #9a3b2c;
  --rule: rgba(35, 32, 28, 0.28);
  --gutter: max(20px, 6vw);
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Figtree', var(--font-ui);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-out);
}

.casefile.is-open { opacity: 1; transform: none; }

.casefile__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.casefile__bar button {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: 'Figtree', var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.casefile__bar button:hover { color: var(--red); }

/* ── The spread ── */

.case__tag {
  margin: 0 0 1.4em;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(35, 32, 28, 0.75);
}

.case__intro {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(48px, 10vh, 110px) var(--gutter) clamp(48px, 9vh, 96px);
}

.case__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.6rem);
  font-variation-settings: 'opsz' 144;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.case__title em,
.case__endtitle em {
  font-style: italic;
  text-transform: none;
  color: var(--red);
}

.case__when {
  margin: 1.2em 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
}

.case__aka { margin: 0.4em 0 0; font-size: 0.85rem; color: rgba(35, 32, 28, 0.7); }

.case__text {
  max-width: 36rem;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.7;
}

.case__text p { margin: 0 0 1.2em; }

.case__marks {
  margin: 1.8em 0 0;
  padding-left: 1.1em;
  line-height: 1.9;
}

/* A full-bleed photo, a phrase spaced from edge to edge across its top. */
.case__band {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.case__spread {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 14px var(--gutter);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.case__band img {
  display: block;
  width: 100%;
  height: clamp(260px, 62vh, 640px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

/* A ruled box: a photo beside numbered points. */
.case__box {
  margin: clamp(56px, 10vh, 110px) var(--gutter);
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--rule);
}

.case__boxgrid {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
}

.case__photo {
  min-height: 240px;
  aspect-ratio: 4 / 5;
  background: #d9d3c6;
}

.case__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.case__photo .ph {
  height: 100%;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, rgba(35, 32, 28, 0.05) 0 10px, transparent 10px 20px);
}

.case__photo .ph span {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(35, 32, 28, 0.55);
}

.case__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: point;
  align-self: center;
}

.case__list li {
  counter-increment: point;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  padding: 0.9em 0;
  line-height: 1.6;
}

.case__list li::before {
  content: counter(point) '.';
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--red);
}

/* What it taught me: the title in its own column, as "Meet the judges" is in the reference. */
.case__end {
  display: grid;
  border-top: 1px solid var(--rule);
}

.case__endtitle {
  margin: 0;
  padding: clamp(32px, 6vh, 64px) var(--gutter) 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.case__endtext {
  max-width: 40rem;
  padding: clamp(32px, 6vh, 64px) var(--gutter) clamp(64px, 12vh, 128px);
  line-height: 1.7;
}

.case__endtext p:not(.case__tag) { margin: 0 0 1.2em; }

@media (min-width: 900px) {
  .case__intro { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .case__boxgrid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
  .case__end { grid-template-columns: minmax(0, 0.35fr) minmax(0, 1fr); }
  .case__endtitle { border-right: 1px solid var(--rule); padding-bottom: clamp(32px, 6vh, 64px); }
}

@media (max-width: 640px) {
  .case__spread { font-size: 9px; letter-spacing: 0.14em; }
  .cal__index button { padding: 7px 9px; font-size: 11px; }
  .casefile__bar button { font-size: 10px; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .casefile { transition: none; transform: none; }
}
