/* ==========================================================================
   Case study pages — Trestle's own voice, not the client's.
   Tokens and base typography come from ../styles.css; this file only adds
   what a case study needs: the fact table, the live frame, the specimens.
   ========================================================================== */

.case-top { padding: clamp(44px, 6vw, 84px) 0 clamp(36px, 4.5vw, 62px); }

.crumb {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px;
  font-family: var(--text);
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  transition: color 200ms ease;
}
.crumb:hover { color: var(--orange-ink); }

.case-tag {
  display: block;
  font-family: var(--text);
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--orange-ink);
  margin: clamp(22px, 3vw, 38px) 0 16px;
}

.case-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  max-width: 16ch;
}
.case-title em { font-style: italic; color: var(--orange-deep); }

/* One line under the title, set in the display italic so it reads as an
   epigraph rather than an opening paragraph. */
.case-line {
  margin-top: clamp(16px, 2vw, 24px);
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 25px);
  line-height: 1.38;
  color: var(--ink-soft);
  max-width: 44ch;
}

/* --------------------------------------------------- the standing details */

/* The four-column table said the same thing on every case. What varies is
   the place and the trade, so those sit on one line with the way in. */
.case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(30px, 3.6vw, 50px);
  padding-top: clamp(20px, 2.4vw, 30px);
  border-top: 1px solid var(--line);
}

.meta-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px clamp(12px, 1.8vw, 20px);
  font-family: var(--text);
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.meta-row li { display: flex; align-items: center; gap: clamp(12px, 1.8vw, 20px); }
.meta-row li + li::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--orange);
  flex: none;
}

/* ------------------------------------------------------- the live frame */

.frame { margin: 0; }
.frame-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-bottom: none;
}
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.frame-bar span {
  margin-left: 10px;
  font-family: var(--text);
  font-size: 12px; letter-spacing: 0.04em; color: var(--ink-soft);
}

.frame-view {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-warm);
}
.frame-view iframe {
  position: absolute; top: 0; left: 0;
  width: 1440px; height: 900px;
  border: 0;
  transform-origin: 0 0;
  transform: scale(var(--fit, 1));
  pointer-events: none;          /* it is a preview — the button opens the real thing */
}
.frame-note {
  margin-top: 14px;
  font-family: var(--text);
  font-size: 13px; color: var(--ink-soft);
}

/* --------------------------------------------------------- reading body */

.case-read { padding: clamp(56px, 7vw, 104px) 0; }
.read-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: start;
}

/* Three statements instead of an essay. The label carries the emphasis, so the
   sentence itself stays in the reading face and keeps quiet. */
.notes { margin: 0; }

.note {
  display: grid;
  grid-template-columns: minmax(84px, 118px) minmax(0, 1fr);
  gap: clamp(16px, 2.6vw, 32px);
  align-items: baseline;
  padding: clamp(22px, 2.6vw, 34px) 0;
  border-top: 1px solid var(--line);
}
.note:last-child { border-bottom: 1px solid var(--line); }

.note dt {
  font-family: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--orange-ink);
}
.note dd {
  margin: 0;
  font-family: var(--text);
  font-weight: 400;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.62;
  color: var(--ink);
  max-width: 46ch;
}

/* --------------------------------------------------------- the specimens */

.spec { position: sticky; top: 100px; display: grid; gap: clamp(28px, 3.4vw, 40px); }
.spec-h {
  font-family: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sw { display: grid; gap: 8px; }
.sw i { display: block; height: 58px; border: 1px solid rgba(22,24,27,.09); }
.sw b {
  font-family: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.sw code { font-family: var(--text); font-size: 11px; color: var(--ink-soft); letter-spacing: .04em; }

.faces { display: grid; gap: 16px; }
.face { display: grid; gap: 4px; }
.face-sample { font-size: 27px; line-height: 1.2; color: var(--ink); }
.face-name {
  font-family: var(--text);
  font-size: 12px; color: var(--ink-soft); letter-spacing: 0.04em;
}

/* ------------------------------------------------------------- next up */

.next { border-top: 1px solid var(--line); }
.next-link {
  display: grid; gap: 12px;
  padding: clamp(44px, 5.5vw, 78px) 0;
  text-decoration: none; color: inherit;
}
.next-tag {
  font-family: var(--text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.next-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 54px);
  letter-spacing: -0.02em;
  transition: color 220ms ease;
}
.next-link:hover .next-name { color: var(--orange-ink); }
.next-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 6px; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .read-grid { grid-template-columns: 1fr; }
  .spec { position: static; }
  .frame-view { aspect-ratio: 4 / 3; }
}

@media (max-width: 560px) {
  .case-meta { align-items: stretch; }
  .case-meta .btn { width: 100%; }
  .note { grid-template-columns: 1fr; gap: 10px; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
}
