/* Case-study pages. Loaded after styles.css. */
:root {
  --white-200: #272727;   /* raised surface: gray sections, image blocks */
  --hairline: rgba(246, 246, 246, 0.12);
  --blue-400: #0fa3b1;
  --green-400: #638475;
  --purple-100: #baa5ff;
  --purple-400: #8a38f5;
  --black-50: rgba(246, 246, 246, 0.15);
}

.case-study main { display: block; }

/* Project pages: all body text in the primary color (rgb 246, 246, 246).
   The top bar keeps its gray links so they still brighten on hover. */
.case-study main,
.case-study .contact-section { --black-200: #f6f6f6; }

/* ---------- Base type ---------- */
.case-study h2 {
  color: var(--black-100);
  font-size: 2.5rem;
  line-height: 4rem;
  margin: 0 0 0.25em;
}

.case-study h3 {
  color: var(--black-100);
  font-size: 1.5rem;
  line-height: 2.8rem;
  margin: 0 0 0.5em;
}

.case-study h4 {
  color: var(--black-100);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 38px;
  margin: 2rem 0 0;
}

.case-study main p {
  color: var(--black-200);
  font-size: 1rem;
  line-height: 2rem;
  letter-spacing: -0.1px;
  margin: 0 0 1.5rem;
}

.case-study strong { color: var(--black-100); font-weight: 500; }

.case-study main ul {
  color: var(--black-200);
  margin: 0;
  padding-left: 1em;
  font-size: 1rem;
  list-style: disc;
}

.case-study main li {
  font-size: 1em;
  line-height: 25.6px;
  margin-bottom: 1rem;
}

.case-study main ul.remove-dots { padding-left: 0; list-style: none; }

.case-study main img { max-width: 100%; height: auto; }

/* ---------- Intro: hero image(s) on top, then summary + meta ---------- */
.project-intro { padding-top: 2em; margin-bottom: 3rem; }

.case-study main .container.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* Full content width, so the hero shares the 1200px cap and text edges */
.intro-media {
  width: 100%;
  justify-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
}

.hero-side { flex: 0 1 19.5%; min-width: 0; border-radius: 12px; }
.hero-main { flex: 1 1 0; min-width: 0; }
.hero-mobile { width: auto; max-height: 600px; }
.hero-main.image-round-all { border-radius: 0; }

/* Hero on a colored card, matching that project's homepage card */
.hero-card {
  padding: 2.5rem 2rem;
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero-pink { background: var(--pink-100); }
.hero-blue { background: var(--blue-100); }
.hero-sand { background: var(--sand-100); }

.meta-list { margin-top: 0.5rem; }

/* Intro row: "The problem" on the left, "What I worked on" on the right */
.intro-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem 4rem;
  align-items: start;
  margin-top: 1.75rem;
}

.intro-row .meta-list { margin-top: 0; }
.case-study .intro-row h3,
.case-study .intro-row .meta-list h4 { margin-top: 0; font-size: 1.25rem; font-weight: 600; line-height: 38px; margin-bottom: 0.25rem; }
.case-study main .intro-row .intro-problem p:last-child { margin-bottom: 0; }

/* A quote left on its own after its text moved into the intro */
.quote-solo { max-width: 36rem; }
.case-study .meta-list h4 { margin-top: 1.25rem; line-height: 1.6; }
.case-study main .meta-list ul { font-size: 1rem; }
.case-study main .meta-list li { font-size: 1em; line-height: 1.6; margin-bottom: 0.25rem; }

/* Phone screenshot on a soft gray card (Online Booking) */
.phone-shot {
  width: 100%;
  height: auto;
  padding: 2rem 0;
  object-fit: contain;
  background: var(--white-200);
  border-radius: 2rem;
}

/* ---------- Sections & layout ---------- */
.content-section {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 2rem;
}

.content-section.project-border {
  align-items: flex-start;
  border-top: 3px solid var(--hairline);
  padding-top: 3em;
}

.content-section.background-gray {
  background: var(--white-200);
  padding: 3rem 0;
}

.case-study main .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 80%;
  margin: 0 auto;
}

.eyebrow {
  color: var(--black-200);
  font-size: 0.825em;
  text-transform: capitalize;
}

.case-study h2.group-heading {
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.case-study main p.sub-title.project-page {
  font-size: 1rem;
  line-height: 1.6em;
  margin-bottom: 0;
}

.cols {
  display: flex;
  width: 100%;
}

.cols > * { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.cols > :first-child { padding-left: 0; }
.cols > :last-child { padding-right: 0; }

.cols:has(.icon-larger) > * { text-align: center; }

.row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.row.flex-align-top { justify-content: space-between; align-items: flex-start; }
.row.align-top { align-items: flex-start; }
.row.flex-row { flex-direction: column; align-items: flex-start; }
.row.add-margin-bottom { margin-bottom: 3rem; }

.half   { width: 50%; }
.wide   { width: 70%; }
.narrow { width: 30%; display: flex; align-items: flex-start; }
.half.add-margin-right,
.wide.add-margin-right { margin-right: 2em; }
.half.add-padding-bottom { padding-bottom: 1em; }

.split {
  display: flex;
  width: 100%;
  margin: 1em 0 2rem;
}

.split > :first-child { width: 50%; margin-right: 2em; }

.split-quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 50%;
}

.text-block { width: 100%; margin-bottom: 2rem; }

.add-margin-top { margin-top: 2em; padding-top: 2em; }
.add-margin-top-small { margin-top: 1em; }
.case-study .remove-margin-bottom { margin-bottom: 0; }
.case-study .remove-margin-top { margin-top: 0; }
.align-center { text-align: center; align-self: center; }
.align-image-center { padding-top: 2rem; }

/* ---------- Image blocks ---------- */
.image-block {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  width: 100%;
  margin: 2rem 0 3rem;
  padding: 2rem 0;
  background: var(--white-200);
  border-radius: 2rem;
}

.image-block > .half { flex: 1 1 0; }
.image-block.single-image { margin-top: 0; padding-left: 2rem; padding-right: 2rem; }
.image-block.single-image.add-margin-top { margin-top: 3rem; }
.image-block.single-image.remove-margin-bottom { margin-bottom: 0; }
.image-block.flex-down { flex-direction: column; padding-left: 2rem; padding-right: 2rem; }
.image-block.cols { padding-left: 2rem; padding-right: 2rem; }
.image-block.cols > * { padding: 0; }

/* Image block with its own heading and text above the images */
.image-block.image-block-titled {
  flex-direction: column;
  align-items: stretch;
  padding: 2rem;
}

.image-block-text { width: 100%; }
.case-study .image-block-text h3 { line-height: 1.3; margin-bottom: 0.25rem; }
.case-study main .image-block-text p { margin-bottom: 0; }
.image-block-titled .cols { gap: 2rem; }
.image-block-titled .cols > * { padding: 0; }

/* Image blocks sit on gray; on gray sections they need contrast */
.background-gray .image-block { background: var(--white-100); }

.caption {
  color: var(--black-200);
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
}

.case-study main p.caption { font-size: 1rem; }

.image-round-all { border-radius: 16px; }
.image-round-all.add-shadow { box-shadow: -10px 12px rgba(0, 0, 0, 0.2); }
.image-round-all.add-border { background: #000; border: 1px solid #000; }
.image-round-all.add-shadow.add-border { border: 3px solid var(--black-50); }
.image-round-all.image-border { border: 2px solid var(--hairline); border-radius: 1rem; }
.image-round-all.image-border.add-margin-bottom { margin-bottom: 3rem; }

/* ---------- Quotes ---------- */
.quote-block {
  font-size: 1.5rem;
  font-style: italic;
  line-height: 2em;
}

.quote-block-image { margin: 0 0 -1.25rem 1.25rem; }

.quote-text {
  background: var(--white-100);
  border-radius: 1.5rem;
  padding: 1.5rem;
}

.quote-text.background-gray { background: var(--white-200); }

/* ---------- Results ---------- */
.material-icons {
  font-family: "Material Icons Outlined", sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  white-space: nowrap;
  display: inline-block;
  font-feature-settings: "liga";
}

.icon-larger { color: var(--black-200); font-size: 4em; }
.icon-larger.blue-400   { color: var(--blue-400); }
.icon-larger.red-400    { color: var(--green-400); }
.icon-larger.purple-100 { color: var(--purple-100); }

.bar-rail {
  height: 2rem;
  margin: 0.5rem 0 1rem;
  background: var(--hairline);
  border-radius: 1rem;
  overflow: hidden;
}

.bar-drop-off,
.bar-progress { height: 100%; border-radius: 1rem; }
.bar-drop-off { width: 33%; background: var(--purple-400); }

.bar-progress {
  width: 0;
  background: var(--blue-400);
  transition: width 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.bar-progress.is-visible { width: 40%; }

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

/* Results: image on the left, stats stacked on the right */
.results-split {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: 100%;
  margin-top: 2rem;
}

.results-media { flex: 0 0 auto; }
.results-media img { width: 260px; }

.results-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1 1 0;
  min-width: 0;
}

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.25rem;
  align-items: start;
}

.stat .icon-larger { grid-row: span 2; font-size: 2.5rem; }
.case-study .stat h4 { margin: 0; line-height: 1.4; }
.case-study main .stat p { margin: 0.25rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .case-study main .container { width: auto; margin: 0 24px; }
  .intro-media { width: 100%; }
  .hero-card { padding: 1.5rem 1rem; border-radius: 24px; }
  .intro-row { grid-template-columns: 1fr; }
  .hero-mobile { max-height: 360px; }
  .phone-shot { max-height: 480px; }

  .case-study h2 { font-size: 2rem; line-height: 1.3; margin-bottom: 0.5em; }
  .case-study h3 { line-height: 1.4; }
  .quote-block { font-size: 1.25rem; }


  .row,
  .split,
  .cols { flex-direction: column; align-items: stretch; }

  .half, .wide, .narrow,
  .split > :first-child,
  .split-quote { width: 100%; margin-right: 0 !important; }

  .row > * + *,
  .split > * + * { margin-top: 1.5rem; }

  .cols > * { padding: 0; }
  .cols:has(.icon-larger) > * + * { margin-top: 1.5rem; }

  .image-block { flex-direction: column; padding: 1.25rem; gap: 1.25rem; border-radius: 1.25rem; }
  .image-block.single-image,
  .image-block.flex-down,
  .image-block.cols { padding: 1.25rem; }
  .image-block.cols { flex-direction: row; gap: 0.75rem; padding: 1rem; }
  .image-block.cols > * + * { margin-top: 0; }
  .image-block-titled { padding: 1.25rem; }
  .results-split { flex-direction: column; gap: 2rem; }
  .results-media img { width: 220px; }
  .image-block-titled .cols { flex-direction: row; gap: 0.75rem; }
  .image-block-titled .cols > * + * { margin-top: 0; }

  .case-study main li { font-size: 1em; line-height: 1.5; margin-bottom: 0.75rem; }
}

/* Heading sitting close to the line below it */
.case-study h2.tight-heading { margin-bottom: 0.5rem; }
