/* ==========================================================================
   Case Study — brsilva.co
   ========================================================================== */

/* ---- Hero ---- */
.cs-hero {
  padding-top: clamp(100px, 14vw, 160px);
  padding-bottom: var(--space-lg);
}

.cs-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-sec);
  margin-bottom: var(--space-md);
  transition: color var(--duration-fast) ease;
}

.cs-hero__back:hover {
  color: var(--color-text);
  opacity: 1;
}

.cs-hero__back svg {
  width: 16px;
  height: 16px;
}

.cs-hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.cs-hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.cs-meta__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-placeholder);
  margin-bottom: 4px;
}

.cs-meta__value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
}

/* ---- Hero Image ---- */
.cs-hero-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-section);
  overflow: hidden;
}

.cs-hero-image__text {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--color-placeholder);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Case Study Sections ---- */
.cs-section {
  max-width: var(--reading-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  margin-bottom: var(--space-section);
}

.cs-section__number {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-placeholder);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.cs-section__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.cs-section p {
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text-sec);
  margin-bottom: var(--space-sm);
}

.cs-section p:last-child {
  margin-bottom: 0;
}

/* ---- Metric Row ---- */
.cs-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-md);
}

@media (max-width: 600px) {
  .cs-metrics {
    grid-template-columns: 1fr;
  }
}

.cs-metric__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.cs-metric__label {
  font-size: var(--fs-xs);
  color: var(--color-text-sec);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Full-bleed Image in Case Study ---- */
.cs-image-full {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  max-width: var(--max-width);
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

@media (min-width: 1200px) {
  .cs-image-full {
    width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
  }
}

.cs-image-full__text {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-placeholder);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Real images ----
   Placeholders use a fixed 16/9 box. Actual artwork keeps its own
   proportions instead, so wide diagrams and tall documents are not cropped. */
.cs-image-full--photo {
  aspect-ratio: auto;
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-sm);
}

.cs-image-full--photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Tall documents (portrait scans, test plans) would otherwise run for several
   screens. Cap the height and show the top of the page, which is the part
   that reads. */
.cs-image-full--tall {
  max-height: 78vh;
  align-items: flex-start;
}

.cs-image-full--tall img {
  object-fit: cover;
  object-position: top center;
  max-height: 78vh;
}

.cs-image-caption {
  font-size: var(--fs-xs);
  color: var(--color-text-sec);
  text-align: center;
  max-width: 60ch;
  margin: 0 auto var(--space-lg);
  line-height: var(--lh-normal);
}

/* ---- Next Project ---- */
.cs-next {
  text-align: center;
  padding-block: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.cs-next__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-sec);
  margin-bottom: var(--space-xs);
}

.cs-next__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
}

.cs-next a {
  color: var(--color-text);
  transition: opacity var(--duration-fast) ease;
}

.cs-next a:hover {
  opacity: 0.6;
}
/* Keep documentary imagery within the page at every viewport. */
.cs-image-full{width:100%;max-width:100%;margin-inline:0}.cs-section{max-width:900px}.cs-meta__label{color:#62656a}.cs-hero__title{font-weight:500}.cs-hero-image img{object-position:center 55%}
