/* ---------------------------------------------------------------
   Case study — shared chrome across OKRs, Mamut and Ceibal.
   Each page sets --tint for its hero band.
   --------------------------------------------------------------- */

.case-hero {
  background: var(--tint);
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}
.breadcrumb a:hover { text-decoration: underline; }
/* Arrow slides left on hover to reinforce "back". */
.breadcrumb .arrow {
  font-weight: 700;
  transition: transform 220ms var(--ease);
}
.breadcrumb a:hover .arrow { transform: translateX(-4px); }

.case-hero__title {
  max-width: 900px;
  margin: 40px auto 0;
  font-size: var(--title-size, clamp(2.25rem, 1.2rem + 3.6vw, 4rem));
  line-height: var(--title-leading, 1.28);
  text-align: center;
}

/* Lede paragraph used where a case study leads with a summary. */
.case-hero__lede {
  max-width: 852px;
  margin: var(--space-lg) auto 0;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.6;
}

/* --- Fact row (role / product / timeline / scope) --------------- */
.case-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  justify-content: center;
  max-width: 900px;
  margin: 40px auto 0;
}
.case-facts div { min-width: 0; }
.case-facts dt {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(30, 30, 30, 0.6);
}
.case-facts dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .case-facts { gap: var(--space-lg); justify-content: flex-start; }
}

.case-context {
  max-width: 900px;
  margin: var(--space-xl) auto 0;
}
.case-context__label {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(30, 30, 30, 0.6);
}
.case-context p {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.7;
}

/* --- Body sections ---------------------------------------------- */
.case-body { padding-block: var(--space-4xl); }
/* On a phone the page padding plus the footer margin stacked to ~160px
   under the last paragraph. Keep a clear gap, not a gulf. */
@media (max-width: 760px) {
  .case-body { padding-bottom: var(--space-xl); }
  main:has(.case-body) + .site-footer { margin-top: var(--space-xl); }
}

.case-section + .case-section { margin-top: var(--space-3xl); }
.case-section h2 {
  font-size: 28px;
  line-height: 1.3;
}
.case-section p {
  margin-top: var(--space-md);
  font-size: 17px;
  line-height: 1.75;
}

/* Figure with caption, used for the inline screenshots. */
.case-figure { margin: var(--space-xl) 0 0; }
.case-figure img,
.case-figure .ph {
  width: 100%;
  border-radius: var(--radius-lg);
}
/* Placeholder block for images that aren't in the design yet. */
.case-figure .ph {
  display: grid;
  place-items: center;
  aspect-ratio: 852 / 373;
  background: var(--tint);
  border: 1px dashed rgba(30, 30, 30, 0.25);
  font-size: 14px;
  color: var(--ink-muted);
}
.case-figure figcaption {
  max-width: 620px;
  margin-top: var(--space-sm);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* --- Ceibal-flavoured variants ---------------------------------- */
/* Hero reads left-aligned on this case study. */
.case-hero--left { padding-inline: 0; }
.case-hero--left .case-hero__title,
.case-hero--left .case-hero__lede,
.case-hero--left .case-facts,
.case-hero--left .breadcrumb {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
  text-align: left;
  justify-content: flex-start;
}


/* Pull-quote with an accent rule. */
.pullquote {
  max-width: 900px;
  margin-inline: auto;
  padding: var(--space-4xl) var(--space-lg);
}
.pullquote blockquote {
  margin: 0;
  padding-left: var(--space-xl);
  border-left: 3px solid var(--accent, #00a096);
}
.pullquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.65;
}
.pullquote footer {
  margin-top: var(--space-md);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(30, 30, 30, 0.6);
}

/* Placeholder tint follows the case study's accent. */
.case-figure .ph--teal {
  background: rgba(175, 214, 224, 0.1);
  border: 2px dashed rgba(0, 160, 150, 0.3);
  border-radius: 12px;
}

/* Who-was-on-the-team credits under the group photo. */
.credits {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  margin-top: var(--space-md);
}
.credits dt {
  font-family: var(--font-serif);
  font-size: 15px;
}
.credits dd {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* The framework map reads best on its own light card. */
.case-figure .diagram {
  background: #fff;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
}


/* --- Placeholders for content still to come ---------------------------
   Anything marked OPEN is unfinished. These boxes are deliberately loud so
   they cannot be mistaken for copy. */
.open-box {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 190, 165, 0.3);
  border: 2px dashed #a04020;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.6;
}
.open-box__tag {
  display: inline-block;
  margin-right: var(--space-xs);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: #a04020;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.open-box--heading { font-family: var(--font-serif); font-size: 22px; }
.open-inline {
  padding: 1px 8px;
  background: rgba(255, 190, 165, 0.3);
  border: 1px dashed #a04020;
  border-radius: 6px;
}
.case-figure .ph--open {
  background: rgba(255, 190, 165, 0.12);
  border: 2px dashed #a04020;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #a04020;
}

/* --- One spacing rhythm for every case study ---------------------------
   16px from a heading or a paragraph to what follows, 32px around every
   visual (above and below), 64px between sections (set above).
   ------------------------------------------------------------------- */
.case-section :is(figure, .swap, .explorations, .flow-wrap, .ruledemo, .dgm-gallery, .pullquote, iframe) + p {
  margin-top: var(--space-xl);
}
.case-section .pullquote { padding: 0; margin-top: var(--space-xl); }
.case-section .pullquote + .pullquote { margin-top: var(--space-md); }
/* The first thing in a section sits flush under its top edge. */
.case-section > :first-child { margin-top: 0; }

/* --- End of a case study: back to the work, or on to the next case --- */
.case-end {
  margin-top: var(--space-4xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--rule);
}
.case-end__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.case-end__back:hover { text-decoration: underline; }
.case-end__label {
  margin-top: var(--space-xl);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.case-end__next {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  background: var(--surface);
  border: 3px solid var(--brand-ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.case-end__next:hover,
.case-end__next:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 -4px rgba(27, 25, 25, 0.18);
}
.case-end__thumb {
  flex: 0 0 200px;
  align-self: stretch;
  background: var(--wash, #f5f5f5);
}
.case-end__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-end__title {
  flex: 1;
  padding-block: var(--space-lg);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.3;
}
.case-end__arrow { padding-right: var(--space-lg); font-size: 24px; }
@media (max-width: 760px) {
  .case-end__next { flex-direction: column; align-items: stretch; gap: 0; }
  .case-end__thumb { flex-basis: auto; aspect-ratio: 489 / 261; }
  .case-end__title { padding: var(--space-lg) var(--space-lg) 0; font-size: 19px; }
  .case-end__arrow { padding: var(--space-xs) var(--space-lg) var(--space-lg); }
}
