/* ==========================================================================
   Case study (/design-process)

   Figma file robertmihai.design, frame "case-study-detail-page" (2189:1553).
   Loaded after site.css, which gives the page wrapper, the bar, the dividers
   and the footer. Sizes are the Figma values: an 876px content column, blocks
   36px apart, Inter with normal line height (14px text = 17px lines).
   ========================================================================== */

.cs-page {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 0 12px;
  line-height: 17px; /* Figma's line heights, in px so the blocks add up */
}

.cs-page h1,
.cs-page h2,
.cs-page h3,
.cs-page h4,
.cs-page p,
.cs-page figure,
.cs-page dl,
.cs-page dd {
  margin: 0;
}

.cs-page p {
  color: #777;
}

.cs-page img,
.cs-page video {
  display: block;
  max-width: 100%;
}

/* ---------- Type ---------- */

/* 36px titles: page title, case title, section headings */
.cs-title,
.cs-heading {
  color: #000;
  font-size: 36px;
  font-weight: 500;
  line-height: 43px;
}

/* 20px statements that open a block */
.cs-lead {
  color: #000;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
}

/* Small caps labels above a block (PROJECT CONSTRAINTS, METHODOLOGY, ...) */
.cs-label {
  color: #aaa;
  font-size: 14px;
  font-weight: 500;
}

.cs-page .cs-note,
.cs-page figcaption {
  color: #aaa;
}

/* ---------- Sections ---------- */

.cs-section {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Section heading: a divider 24px down, 36px of air, the title, and a second
   line 16px under it (121px in all, as in Figma) */
.cs-heading {
  padding: 61px 0 16px;
  border-bottom: 1px solid #ebebeb;
  background: linear-gradient(#ebebeb, #ebebeb) 0 24px / 100% 1px no-repeat;
}

/* A statement or label with what follows it */
.cs-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* A statement and its paragraphs */
.cs-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Intro ---------- */

.cs-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* Project Type / Role / Tools / Duration */
.cs-facts {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.cs-facts > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-facts dt {
  font-weight: 500;
}

.cs-facts dd {
  color: #777;
}

/* ---------- Cards ---------- */

.cs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cs-cards--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cs-cards--1 {
  grid-template-columns: minmax(0, 1fr);
}

.cs-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #ebebeb;
  border-radius: 4px;
  padding: 15px; /* 16px in Figma, where the border sits inside */
}

.cs-card__title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #000;
  font-size: 16px;
  font-weight: 500;
  line-height: 19px;
}

.cs-card__icon {
  flex: none;
  width: 16px;
  height: 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
}

.cs-card p {
  padding-left: 24px;
}

/* Cards with a checkbox: the chosen ones are blue */
.cs-check {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1.5px;
  border: 1px solid #ebebeb;
  border-radius: 3px;
}

.cs-card.is-checked {
  border-color: #cbe5f0;
  background-color: #e7f3f8;
}

.cs-card.is-checked .cs-check {
  border: 0;
  border-radius: 4px;
  background: #50bfed url("/images/ui/check.svg") center / 17px no-repeat;
}

/* A card with a note under it, in a row whose last card is taller */
.cs-usecase {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Findings on the left, the design insight they lead to on the right */
.cs-pairs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-pairs__head,
.cs-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
}

.cs-pairs__head > :last-child {
  grid-column: 3;
}

.cs-pair__link {
  align-self: center;
  height: 1px;
  background-color: #ebebeb;
}

/* ---------- Quotes ---------- */

.cs-quote {
  margin: 0;
  border-left: 1px solid #bdbdbd;
  padding-left: 10px;
}

/* ---------- Images and recordings ---------- */

.cs-figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-figure > img,
.cs-figure > picture > img,
.cs-wide {
  width: 100%;
  height: auto;
}

/* Phone recordings: 240 × 445 */
.cs-phone {
  aspect-ratio: 240 / 445;
}

/* Phone screenshots: 268 × 343 */
.cs-shot {
  aspect-ratio: 268 / 343;
}

/* Keep the slot size: without this, an aspect-ratio box grows to fit the taller
   screenshot inside it. */
.cs-phone,
.cs-shot {
  min-height: 0;
  overflow: hidden;
}

.cs-phone > img,
.cs-phone > picture > img,
.cs-phone > video,
.cs-shot > img,
.cs-shot > picture > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Media on the left, text on the right, starting 24px lower */
.cs-split {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
}

.cs-split--wide {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
}

.cs-split--wide img {
  width: 100%;
  height: auto;
}

.cs-split__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
}

/* The three tasks and the still frames */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-grid > li,
.cs-grid figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Phones ---------- */

@media (max-width: 639px) {
  .cs-title,
  .cs-heading {
    font-size: 30px;
    line-height: 36px;
  }

  .cs-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }

  .cs-cards,
  .cs-cards--3,
  .cs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-grid {
    gap: 24px;
  }

  /* Pairs stack, joined by a short vertical line under the icon */
  .cs-pairs__head,
  .cs-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-pairs__head {
    gap: 4px;
  }

  .cs-pairs__head > :last-child {
    grid-column: auto;
  }

  .cs-pair__link {
    justify-self: start;
    width: 1px;
    height: 16px;
    margin-left: 24px;
  }

  .cs-split,
  .cs-split--wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .cs-split > .cs-phone {
    width: min(240px, 100%);
  }

  .cs-split__text {
    padding-top: 0;
  }

  .cs-shot {
    width: min(268px, 100%);
  }
}
