/* =========================================================
   MEDIA PAGE
   Values copied from the "Media" frame in Figma (1512 × 5653).
   Loaded after styles.css (shared header, footer and tokens).
   Every class here starts with "md-" (or "pg-back"), so other
   pages are not affected.
   ========================================================= */
:root {
  --md-grey-text: #787f82;   /* hero side text */
  --md-radius: 26px;         /* gallery photos */
}

/* Back chevron in the hero's top-left corner (Figma: iconamoon arrow, rotated) */
.pg-back {
  position: absolute;
  left: 55px;
  top: 33px;
  z-index: 2;
  display: flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: rotate(90deg);
}
.pg-back:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }

/* ---------- HERO (Figma: 1416 × 392, #f8f8f8, radius 30) ---------- */
.md-hero {
  position: relative;
  height: 392px;
  margin-top: 12px;
  padding-top: 64px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-card-grey);
  text-align: center;
}
.md-kicker {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: var(--lh);
}
.md-hero h1 {
  margin: 12px 0 0;
  font-size: 64px;
  font-weight: 600;
  line-height: var(--lh);
  white-space: nowrap;
}
.md-hero-row {
  display: grid;
  grid-template-columns: 1fr 345px 1fr;
  margin-top: 13px;
  text-align: left;
}
.md-hero-row p {
  margin: 36px 0 0;
  font-size: 24px;
  font-weight: 500;
  line-height: var(--lh);
  color: var(--md-grey-text);
}
.md-hero-left { justify-self: end; width: 259px; margin-right: 13.5px !important; text-align: right; }
.md-hero-right { width: 431px; margin-left: 21.5px !important; }
/* Camera keeps Figma's crop and runs off the bottom of the card */
.md-camera {
  position: relative;
  width: 345px;
  height: 243px;
  overflow: hidden;
}
.md-camera img {
  position: absolute;
  left: -5.28%;
  top: -33.47%;
  width: 117.3%;
  max-width: none;
  height: 166.94%;
}

/* ---------- SECTION HEADINGS (36px SemiBold + 18px Medium, centred) ---------- */
.md-section { margin-top: 48px; }
.md-head { text-align: center; }
.md-head h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: var(--lh);
  color: var(--color-text);
}
.md-head p {
  max-width: 623px;
  margin: 8px auto 0;
  font-size: 18px;
  font-weight: 500;
  line-height: var(--lh);
}
.md-head--narrow p { max-width: 541px; }

/* ---------- PHOTOS ---------- */
.md-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--md-radius);
}
.md-photo > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* First photo uses Figma's own crop rather than a centred one */
.md-photo > img.md-crop-team {
  position: absolute;
  left: -25.79%;
  top: -29.16%;
  width: 141.09%;
  max-width: none;
  height: 134.64%;
  object-fit: fill;
}

/* Clinic Moments: Figma's mosaic of 3 columns × 4 rows (gaps 40px) */
.md-grid-clinic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 271px 280px 280px 328px;
  grid-template-areas:
    "a b b"
    "a c d"
    "e e f"
    "trio trio f";
  gap: 40px;
  margin-top: 48px;
}
.md-a { grid-area: a; }
.md-b { grid-area: b; }
.md-c { grid-area: c; }
.md-d { grid-area: d; }
.md-e { grid-area: e; }
.md-f { grid-area: f; }
.md-trio {
  grid-area: trio;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px;
}

/* Beyond Dentistry and Smiles Worth Sharing: 3 equal columns */
.md-grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 48px;
}
.md-grid-beyond { grid-auto-rows: 561px; }
.md-grid-smiles { grid-auto-rows: 533px; margin-top: 52px; }   /* Figma: 52px under this heading */

/* Gold POD seal in the top-right of each smile photo (Figma: 88.84px at 323, 31).
   Built from Figma's layers: the transparent seal, then two small POD marks
   blended into it with the same blend modes as the design. */
.md-badge {
  position: absolute;
  right: 7.45%;
  top: 5.82%;
  width: 19.96%;
  aspect-ratio: 1;
  isolation: isolate;
  pointer-events: none;
}
.md-badge img { position: absolute; max-width: none; }
.md-badge img:first-child { inset: 0; width: 100%; height: 100%; }
.md-mark { width: 30.37%; height: 11.39%; }
.md-mark--overlay { left: 34.68%; top: 43.93%; mix-blend-mode: overlay; }
.md-mark--light { left: 34.16%; top: 43.49%; mix-blend-mode: plus-lighter; }

.page-media .site-footer { margin-top: 41px; }


/* =========================================================
   LAPTOP (up to 1400px)
   ========================================================= */
@media (max-width: 1400px) {
  .md-hero h1 { font-size: clamp(48px, 4.6vw, 64px); }
  .md-hero-row p { font-size: 20px; }
  .md-hero-right { width: auto; max-width: 431px; margin-right: 24px; }
  .md-grid-clinic { grid-template-rows: 220px 230px 230px 270px; gap: 32px; }
  .md-trio { gap: 32px; }
  .md-grid-three { gap: 32px; }
  /* Below the Figma width the cards keep Figma's proportions instead of fixed heights */
  .md-grid-beyond, .md-grid-smiles { grid-auto-rows: auto; }
  .md-grid-beyond .md-photo { aspect-ratio: 445 / 561; }
  .md-grid-smiles .md-photo { aspect-ratio: 445 / 533; }
}


/* =========================================================
   TABLET (up to 1080px)
   ========================================================= */
@media (max-width: 1080px) {
  .md-hero { height: auto; padding: 56px 32px 0; }
  .md-hero h1 { font-size: 44px; white-space: normal; }
  /* Side texts sit above the camera, which stays cut off at the bottom */
  .md-hero-row { display: flex; flex-direction: column; align-items: center; margin-top: 0; text-align: center; }
  .md-hero-row p { margin: 16px 0 0 !important; width: auto; max-width: 560px; font-size: 19px; text-align: center; }
  .md-hero-left, .md-hero-right { justify-self: auto; }
  .md-camera { order: 3; margin-top: 24px; height: 200px; }

  .md-section { margin-top: 56px; }
  .md-head h2 { font-size: 32px; }
  .md-head p { font-size: 17px; }

  .md-grid-clinic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 220px 220px 240px 340px 200px;
    grid-template-areas:
      "b b"
      "a c"
      "a d"
      "e e"
      "f f"
      "trio trio";
    gap: 24px;
    margin-top: 32px;
  }
  .md-trio { gap: 24px; }
  .md-grid-three { grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
  .page-media .site-footer { margin-top: 56px; }
}


/* =========================================================
   PHONE (up to 640px)
   ========================================================= */
@media (max-width: 640px) {
  .md-hero { border-radius: 20px; padding: 48px 20px 0; }
  .pg-back { left: 20px; top: 18px; }
  .md-kicker { font-size: 24px; }
  .md-hero h1 { font-size: 34px; }
  .md-hero-row p { font-size: 17px; }
  .md-camera { width: 280px; height: 170px; }

  .md-section { margin-top: 48px; }
  .md-head h2 { font-size: 28px; }
  .md-head p { font-size: 16px; }

  .md-photo { border-radius: 20px; }
  .md-grid-clinic {
    grid-template-columns: 1fr;
    grid-template-rows: 380px 200px 220px 220px 200px 300px 120px;
    grid-template-areas: "a" "b" "c" "d" "e" "f" "trio";
    gap: 16px;
  }
  .md-trio { gap: 12px; }
  .md-trio .md-photo { border-radius: 14px; }
  .md-grid-three { gap: 16px; }
  .page-media .site-footer { margin-top: 48px; }
}

@media (max-width: 480px) {
  .md-grid-three { grid-template-columns: 1fr; }
}
