/* ================================
   DEPARTMENTS OVERVIEW PAGE
================================ */

/* ---- HERO (white title, centered-left, shared overlay — like project hero) ---- */

.ov-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero-overlay);
}

/* ---- FULL-SCREEN SECTION ---- */

/* ---- SPLIT (shape image + text) ---- */
.ov-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.ov-split__text .label { margin-bottom: var(--space-sm); }
.ov-split__text h2 { margin-bottom: var(--space-md); }
.ov-split__text p { margin-bottom: var(--space-md); max-width: 520px; }
.ov-split__text .btn { margin-top: var(--space-sm); }

.ov-split__media img { width: 100%; height: auto; }

/* Methodology shape: labels overlaid on the image (mono label style) */
.ov-methodology { position: relative; }

.ov-methodology__label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
}

/* placed just OUTSIDE the image — upper-left above it, lower-right below it */
.ov-methodology__label--dept {
  bottom: 100%;
  left: 0;
  margin-bottom: var(--space-sm);
  color: var(--color-blue);
}

.ov-methodology__label--proj {
  top: 100%;
  right: 0;
  margin-top: var(--space-sm);
  color: var(--color-blue);
}

/* ---- ALL DEPARTMENTS ---- */
.ov-allhead { margin-bottom: var(--head-gap); }
.ov-allhead .label { margin-bottom: var(--space-sm); }

.ov-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* Fit the whole grid on one screen (like the homepage projects section):
   fixed-height section, grid fills the leftover space, card images flex. */
.ov-departments {
  height: 100vh;
  height: 100svh;
  align-items: stretch;
  overflow: hidden;
}

.ov-departments .ov-section__inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ov-departments .ov-grid {
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(2, 1fr);
}

.ov-departments .project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* image grows/shrinks to fit; show the top of the photo */
.ov-departments .project-card__image {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  height: auto;
  object-position: top;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .ov-hero__content { padding-inline: var(--space-md); }

  .ov-split {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .ov-split__media { order: -1; } /* shape on top when stacked */
}

/* When the 3 department cards no longer fit side by side, stack them and lay
   each out horizontally: image on the LEFT at the card's (text-driven) height. */
@media (max-width: 900px) {
  .ov-departments {
    height: auto;
    align-items: center;
    overflow: visible;
  }

  .ov-departments > .ov-section__inner { display: block; }

  .ov-grid { grid-template-columns: 1fr; }

  .ov-departments .ov-grid {
    flex: none;
    grid-template-rows: none;
  }

  .ov-departments .project-card {
    flex-direction: row;
    height: auto;
  }

  .ov-departments .project-card__image {
    flex: none;
    width: 40%;
    max-width: 240px;
    min-height: 0;
    height: auto;
    align-self: stretch;      /* image height = card height (= text height) */
    aspect-ratio: auto;
    object-position: center;
  }

  .ov-departments .project-card__body { flex: 1; }
}
