/* Shared styles for the NCB service pages.
   Load this after styles.min.css and before each page-specific stylesheet.
   The header, logo, navigation, dropdown and mobile menu live in styles.min.css only. */

:root {
  --navy: #0f1a45;
  --navy-mid: #17245a;
  --blueprint: #1f2f72;
  --ink: #0f1a45;
  --muted: #646c7c;
  --paper: #f5f6f8;
  --line: #dde1e7;
  --accent: #dde1e7;
  --pale-sage: #eceef2;
}

/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------ */

*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

.container {
  width: min(1120px, calc(100% - 48px));
}

.section {
  padding: 110px 0;
}

.skip-link {
  left: -9999px;
  top: 12px;
  z-index: 200;
  padding: 10px 15px;
  background: #fff;
  color: #000;
}

/* ------------------------------------------------------------------
   Header
   Everything else (logo, nav, dropdown, mobile menu) is in styles.min.css.
------------------------------------------------------------------ */

/* Keeps the fixed header from covering the hero */
.service-hero {
  margin-top: 88px;
}

/* ------------------------------------------------------------------
   Typography and buttons
------------------------------------------------------------------ */

.eyebrow {
  margin: 0 0 16px;
  color: #3a50a6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.eyebrow.light {
  color: var(--accent);
}

.section-heading {
  max-width: 800px;
  margin-bottom: 54px;
}

.section-heading h2,
.project-callout h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 4vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.light-heading h2 {
  color: var(--white);
}

.button {
  gap: 16px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 800;
}

.button-light {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--navy);
}

/* ------------------------------------------------------------------
   Service hero (research, renovation, inspection)
   Each page sets its own background-image in its own stylesheet.
------------------------------------------------------------------ */

.research-hero-content,
.renovation-hero-content,
.inspection-hero {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  justify-items: start;
  width: 100%;
  max-width: none;
  min-height: 800px;
  margin: 0;
  padding: 0 0 90px 8%;
  color: #fff;
}

/* Background image: research and renovation use the hero itself,
   home inspection uses a separate element. */
.research-hero-content,
.renovation-hero-content,
.inspection-hero-image {
  background-color: #0f1a45;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.inspection-hero-image {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Dark gradient behind the text */
.research-hero-content::before,
.renovation-hero-content::before,
.inspection-hero-overlay {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: min(58%, 720px);
  background: linear-gradient(
    90deg,
    rgba(15, 26, 69, 0.9) 0%,
    rgba(15, 26, 69, 0.76) 72%,
    rgba(15, 26, 69, 0) 100%
  );
}

.research-hero-content > *,
.renovation-hero-content > *,
.inspection-hero-content > * {
  position: relative;
  z-index: 1;
}

/* The wrapper takes no part in layout, so its children become direct grid
   items of .inspection-hero and space out exactly like the other two pages. */
.inspection-hero-content {
  display: contents;
}

.research-hero-content h1,
.renovation-hero-content h1,
.inspection-hero-content h1 {
  max-width: 620px;
  margin: 0;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(2rem, 3vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.research-hero-content .hero-intro,
.renovation-hero-content .hero-intro,
.inspection-hero-content p:not(.eyebrow) {
  max-width: 480px;
  margin: 28px 0 36px;
  color: #e4e8f4;
  font-size: 1.06rem;
  line-height: 1.75;
}

.research-hero-content .eyebrow,
.renovation-hero-content .eyebrow,
.inspection-hero-content .eyebrow {
  margin-bottom: 18px;
  color: #dde1e7;
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.research-hero-content .button-light,
.renovation-hero-content .button-light,
.inspection-hero-content .button-light {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.research-hero-content .button-light:hover,
.renovation-hero-content .button-light:hover,
.inspection-hero-content .button-light:hover {
  background: #fff;
  color: #293b86;
}

/* ------------------------------------------------------------------
   Service cards (project research and renovation)
------------------------------------------------------------------ */

.service-detail-section {
  background: #eceef2;
}

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

.service-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
}

.service-detail-card > img {
  width: 100%;
  height: 270px;
  object-fit: cover;
}

.service-card-content {
  padding: 30px;
}

.service-number {
  margin: 0 0 16px;
  color: #3a50a6;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.service-detail-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.service-detail-card p:not(.service-number) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.details-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 26px;
  padding: 15px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.details-toggle span {
  font-size: 1.3rem;
  line-height: 0.8;
  transition: transform 0.2s ease;
}

.service-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.service-details ul {
  overflow: hidden;
  margin: 0;
  padding: 0;
  color: var(--muted);
  line-height: 1.7;
}

.service-details li {
  margin: 10px 0;
}

.service-detail-card.is-open .service-details {
  grid-template-rows: 1fr;
}

.service-detail-card.is-open .service-details ul {
  padding: 12px 0 0 18px;
}

.service-detail-card.is-open .details-toggle span {
  transform: rotate(45deg);
}

/* ------------------------------------------------------------------
   How we work (research and renovation)
   Photo height is set in each page stylesheet.
------------------------------------------------------------------ */

.work-process-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10%;
  align-items: center;
}

.process-copy h2 {
  margin: 0 0 42px;
  font-size: clamp(36px, 4.3vw, 58px);
}

.steps {
  border-top: 1px solid var(--line);
}

.step {
  display: flex;
  gap: 20px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.step > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.step h3 {
  margin: 0 0 7px;
  font-size: 22px;
}

.step p {
  margin: 0;
  font-size: 15px;
}

.process-photo {
  position: relative;
}

.process-photo img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.photo-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  padding: 17px 22px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
}

.photo-label span {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-label strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------------
   Why work with NCB (research and renovation)
------------------------------------------------------------------ */

.process-section {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(15, 26, 69, 0.18), rgba(15, 26, 69, 0.18)),
    url("../images/backgrounds/project-gallery-blueprint.webp") center / cover no-repeat;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(221, 225, 231, 0.25);
}

.process-grid article {
  min-height: 250px;
  padding: 32px 28px;
  background: rgba(15, 26, 69, 0.84);
}

.process-grid span {
  display: block;
  margin-bottom: 48px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.process-grid h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1.3rem;
}

.process-grid p {
  margin: 0;
  color: #c4cdea;
  line-height: 1.65;
}

/* ------------------------------------------------------------------
   Call to action (research and renovation)
------------------------------------------------------------------ */

.project-callout {
  background: var(--white);
}

.project-callout-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 72px;
  align-items: end;
}

.project-callout-grid > div:last-child p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.7;
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */

@media (max-width: 850px) {
  .research-hero-content,
  .renovation-hero-content,
  .inspection-hero {
    min-height: 620px;
    padding: 80px 24px;
  }

  .research-hero-content,
  .renovation-hero-content,
  .inspection-hero-image {
    background-position: 35% top;
  }

  .research-hero-content::before,
  .renovation-hero-content::before,
  .inspection-hero-overlay {
    inset: 0;
    width: 100%;
    background: linear-gradient(
      90deg,
      rgba(15, 26, 69, 0.78),
      rgba(15, 26, 69, 0.42)
    );
  }

  .research-hero-content h1,
  .research-hero-content .hero-intro,
  .research-hero-content .eyebrow,
  .renovation-hero-content h1,
  .renovation-hero-content .hero-intro,
  .renovation-hero-content .eyebrow,
  .inspection-hero-content h1,
  .inspection-hero-content p:not(.eyebrow),
  .inspection-hero-content .eyebrow {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  }

  .work-process-grid,
  .project-callout-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .section {
    padding: 76px 0;
  }

  .container {
    width: min(100% - 36px, 1120px);
  }

  .service-detail-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .service-card-content {
    padding: 24px;
  }

  .process-grid article {
    min-height: 0;
    padding: 26px 22px;
  }

  .process-grid span {
    margin-bottom: 18px;
  }

  .photo-label {
    position: static;
    max-width: none;
    margin-top: -1px;
  }
}

/* ==========================================================================
   Service cards — same responsive card design as the home page "What we do"
   section. Used by Renovation (with photos), Project Research and Home
   Inspection (text only). Keep this block last.
   ========================================================================== */
:is(.service-detail-grid, .inspection-service-grid) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  border: 0;
  background: transparent;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card) {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(20px, 2vw, 26px);
  overflow: hidden;
  border: 1px solid #dde1e7;
  background: #fff;
  color: #0f1a45;
  transition: color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

/* Cards with a photo: thin white frame around the image, like the home page */
.service-detail-grid>.service-detail-card:has(> img) {
  padding: 14px;
}

/* When a card is opened, only that card grows; the others keep their height */
:is(.service-detail-grid, .inspection-service-grid):has(.is-open)> :is(.service-detail-card, .inspection-service-card) {
  align-self: start;
}

/* Navy blueprint hover, same as the home page */
:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/backgrounds/contact-panel-blueprint.webp") center / cover no-repeat, #0f1a45;
  opacity: 0;
  transition: opacity .4s ease;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover {
  border-color: #0f1a45;
  box-shadow: 0 18px 40px #0f1a4540;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover::before {
  opacity: 1;
}

.service-detail-grid>.service-detail-card>img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10.5;
  object-fit: cover;
}

.service-detail-grid .service-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0;
}

.service-detail-grid>.service-detail-card:has(> img) .service-card-content {
  padding: 20px 6px 4px;
}

:is(.service-detail-grid, .inspection-service-grid) .service-number {
  display: block;
  margin: 0 0 12px;
  color: #293b86;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .2em;
  line-height: 1;
  transition: color .35s ease, background .35s ease;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card) h3 {
  margin: 0 0 12px;
  color: #17245a;
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, .95rem + .55vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  overflow-wrap: break-word;
  transition: color .35s ease;
}

:is(.service-detail-grid, .inspection-service-grid) :is(.service-card-content, .inspection-service-card)>p:not(.service-number) {
  margin: 0 0 22px;
  color: #646c7c;
  font-size: .94rem;
  line-height: 1.6;
  transition: color .35s ease;
}

/* The "What this can include" toggle sits at the bottom so the cards line up */
:is(.service-detail-grid, .inspection-service-grid) :is(.details-toggle, .inspection-toggle) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding: 14px 0 4px;
  border: 0;
  border-top: 1px solid #dde1e7;
  background: transparent;
  color: #293b86;
  font: 700 .74rem/1.3 var(--font-sans);
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .35s ease, border-color .35s ease;
}

:is(.service-detail-grid, .inspection-service-grid) :is(.details-toggle, .inspection-toggle) span {
  flex: none;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: .8;
}

:is(.service-detail-grid, .inspection-service-grid) :is(.service-details, .inspection-panel) ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-detail-grid .service-detail-card.is-open .service-details ul {
  padding: 4px 0 6px;
}

:is(.service-detail-grid, .inspection-service-grid) :is(.service-details, .inspection-panel) li {
  position: relative;
  margin: 0;
  padding: 8px 0 0 18px;
  color: #646c7c;
  font-size: .86rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  transition: color .35s ease;
}

:is(.service-detail-grid, .inspection-service-grid) :is(.service-details, .inspection-panel) li::before {
  content: "\2192";
  position: absolute;
  top: 8px;
  left: 0;
  color: #293b86;
  transition: color .35s ease;
}

/* Hover colours: white text on the navy blueprint */
:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover :is(h3, .service-number, .details-toggle, .inspection-toggle) {
  color: #fff;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover :is(p:not(.service-number), li) {
  color: #ffffffdb;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover li::before {
  color: #fff;
}

:is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover :is(.details-toggle, .inspection-toggle) {
  border-color: #ffffff40;
}

/* Tablet: two cards per row */
@media (max-width: 1100px) {
  :is(.service-detail-grid, .inspection-service-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: stacked cards, number badge beside the title (home page mobile style) */
@media (max-width: 700px) {
  :is(.service-detail-grid, .inspection-service-grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    max-width: 620px;
  }

  :is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card) {
    padding: 18px;
    border: 0;
    box-shadow: 0 6px 22px #0f1a451a;
  }

  .service-detail-grid>.service-detail-card:has(> img) {
    padding: 14px;
  }

  .service-detail-grid>.service-detail-card>img {
    aspect-ratio: 16 / 9.4;
  }

  /* Badge + title on one row; everything else full width */
  .service-detail-grid .service-card-content,
  .inspection-service-grid>.inspection-service-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
  }

  .service-detail-grid>.service-detail-card:has(> img) .service-card-content {
    padding: 18px 4px 2px;
  }

  .service-detail-grid .service-card-content> :not(.service-number):not(h3),
  .inspection-service-grid>.inspection-service-card> :not(.service-number):not(h3) {
    grid-column: 1 / -1;
  }

  :is(.service-detail-grid, .inspection-service-grid) .service-number {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 0 8px;
    border-radius: 4px;
    background: #eef1f6;
    font-size: 17px;
    letter-spacing: 0;
  }

  :is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card):hover .service-number {
    background: #ffffff1f;
  }

  :is(.service-detail-grid, .inspection-service-grid)> :is(.service-detail-card, .inspection-service-card) h3 {
    margin: 0;
    font-size: clamp(1.2rem, 1rem + 1.2vw, 1.4rem);
  }

  :is(.service-detail-grid, .inspection-service-grid) :is(.service-card-content, .inspection-service-card)>p:not(.service-number) {
    margin: 14px 0 20px;
    font-size: clamp(.95rem, .9rem + .3vw, 1.02rem);
  }

  :is(.service-detail-grid, .inspection-service-grid) :is(.details-toggle, .inspection-toggle) {
    font-size: .78rem;
  }

  :is(.service-detail-grid, .inspection-service-grid) :is(.service-details, .inspection-panel) li {
    font-size: .92rem;
  }
}

/* ==========================================================================
   Navy credentials / "why work with NCB" section — compact and fluid so the
   heading and all four cards fit in one window height. Keep this block last.
   ========================================================================== */
.process-section.section {
  padding: clamp(32px, 7vh, 96px) 0;
}

.process-section .section-heading {
  margin-bottom: clamp(16px, 3.2vh, 36px);
}

.process-section .section-heading .eyebrow {
  margin-bottom: 8px;
  font-size: clamp(11px, .7rem + .15vw, 13px);
}

.process-section .section-heading h2 {
  max-width: 760px;
  margin-top: 0;
  font-size: clamp(24px, min(3.4vw, 5.6vh), 50px);
  line-height: 1.1;
  overflow-wrap: break-word;
}

.process-section .process-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.process-section .process-grid article {
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, min(2vw, 3.4vh), 30px) clamp(14px, 1.8vw, 26px);
}

.process-section .process-grid span {
  margin-bottom: clamp(8px, 2.6vh, 28px);
  font-size: clamp(.7rem, .66rem + .15vw, .78rem);
}

.process-section .process-grid h3 {
  margin-bottom: 8px;
  font-size: clamp(1rem, .9rem + .45vw, 1.3rem);
  line-height: 1.2;
  overflow-wrap: break-word;
}

.process-section .process-grid p {
  font-size: clamp(.84rem, .8rem + .2vw, .96rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* Tablets: two cards per row */
@media (max-width: 1000px) {
  .process-section .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-section .section-heading h2 {
    font-size: clamp(24px, min(4.6vw, 4.4vh), 40px);
  }
}

/* Phones: still two compact cards per row, so all four fit on screen */
@media (max-width: 600px) {
  .process-section.section {
    padding: 24px 0;
  }

  .process-section .section-heading h2 {
    font-size: clamp(22px, 6.4vw, 30px);
  }

  .process-section .process-grid article {
    padding: 14px 12px;
  }

  .process-section .process-grid span {
    margin-bottom: 8px;
  }

  .process-section .process-grid h3 {
    margin-bottom: 6px;
    font-size: clamp(.95rem, .85rem + .6vw, 1.05rem);
  }

  .process-section .process-grid p {
    font-size: clamp(.8rem, .74rem + .35vw, .86rem);
    line-height: 1.45;
  }
}

/* Short phone screens: tighter cards so the section still fits */
@media (max-width: 600px) and (max-height: 700px) {
  .process-section.section {
    padding: 18px 0;
  }

  .process-section .section-heading {
    margin-bottom: 12px;
  }

  .process-section .process-grid article {
    padding: 10px;
  }

  .process-section .process-grid span {
    margin-bottom: 4px;
  }

  .process-section .process-grid p {
    font-size: .78rem;
    line-height: 1.4;
  }
}

/* ==========================================================================
   "How we work" (Project research + Renovation)
   Compact photo shown whole: it keeps its own proportions (never cropped or
   stretched) and its caption sits below it instead of covering it.
   Desktop/tablet: photo column + steps. Phones: the photo moves to a narrow
   column beside the heading and steps so the section fits one screen.
   Scoped to #process so it overrides each page's own photo rules.
   ========================================================================== */
#process.work-process {
  padding: clamp(28px, 6vh, 96px) 0;
}

#process .work-process-grid {
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

/* The photo block is exactly as wide as the photo, caption included */
#process .process-photo {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

/* max-width + max-height (not fixed sizes) so the browser always scales the
   photo in proportion, whatever its shape */
#process .process-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(36vw, 420px);
  max-height: clamp(220px, calc(100svh - 88px - 12vh - 86px), 520px);
  aspect-ratio: auto;
  object-fit: contain;
  align-self: flex-start;
}

/* Caption as a strip under the photo (no longer overlapping it) */
#process .photo-label {
  position: static;
  flex-direction: column;
  gap: 2px;
  /* the caption takes the photo width instead of widening the block */
  width: 0;
  min-width: 100%;
  margin: 0;
  padding: clamp(8px, 1.3vh, 12px) clamp(10px, 1.2vw, 16px);
}

#process .photo-label span {
  margin: 0;
}

#process .process-copy {
  min-width: 0;
}

#process .process-copy h2 {
  margin: 6px 0 clamp(12px, 2.6vh, 36px);
}

#process .step {
  gap: 16px;
  padding: clamp(8px, 1.7vh, 22px) 0;
}

#process .step h3 {
  margin: 0 0 4px;
}

/* Tablets: same side-by-side layout, photo a little shorter */
@media (max-width: 900px) {
  #process .work-process-grid {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
  }

  #process .process-photo img {
    max-width: 34vw;
    max-height: clamp(200px, calc(100svh - 88px - 12vh - 86px), 440px);
  }
}

/* Phones: narrow photo column on the left, heading + steps on the right */
@media (max-width: 650px) {
  #process.work-process {
    padding: 22px 0;
  }

  #process .work-process-grid {
    grid-template-columns: clamp(92px, 30vw, 140px) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }

  #process .process-photo {
    width: 100%;
    /* stays in view next to the steps while scrolling the section */
    position: sticky;
    top: calc(88px + 12px);
  }

  #process .process-photo img {
    width: 100%;
    max-width: none;
    max-height: none;
    height: auto;
  }

  #process .photo-label {
    padding: 6px 7px;
  }

  #process .process-copy h2 {
    margin: 4px 0 10px;
  }

  #process .step {
    gap: 8px;
    padding: 8px 0;
  }

  #process .step h3 {
    margin-bottom: 2px;
  }
}

@media (max-width: 650px) and (max-height: 760px) {
  #process.work-process {
    padding: 16px 0;
  }

  /* short phones: slimmer photo column gives the steps more width */
  #process .work-process-grid {
    grid-template-columns: clamp(80px, 24vw, 110px) minmax(0, 1fr);
    gap: 12px;
  }

  #process .step {
    padding: 6px 0;
  }
}
