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

.photo-panel {
  position: relative;
  max-width: 1760px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* Photo */
.photo-panel__media {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  overflow: hidden;
}

.photo-panel__media--mobile {
  display: none;
}

.photo-panel__media img {
  width: 100%;
  height: 620px;
  object-fit: cover;
  display: block;
}

/* Teal offset block — sits BEHIND the photo, poking out bottom-right.
   z-index 0 puts it under the photo (z-index 1); it extends past the
   photo's right and bottom edges to show the corner-touch overlap. */
.photo-panel__shape {
  position: absolute;
  z-index: 0;
  height: 420px;
  left: 54%;
  right: calc(-50vw + 50%);
  bottom: 40px;
  background: #005E81;
  border-radius: 8px 0 0 8px;
}
/* Frosted glass panel over the photo's left side */
.photo-panel__card {
  position: absolute;
  z-index: 2;
  /* above the photo */
  top: 110px;
  left: 80px;
  width: 560px;
  max-width: calc(100% - 120px);
  padding: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Safari */
}

.photo-panel__heading {
  margin: 0 0 20px;
  font-family: 'Crimson Text', serif;
  font-size: 52px;
  font-weight: 400;
  color: #1A1A1A;
}

.photo-panel__body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #2E2E2E;
}

.photo-panel__body p {
  margin: 0 0 14px;
}

.photo-panel__body p:last-child {
  margin-bottom: 0;
}

/* ===== Button (shared by both styles) ===== */
.photo-panel__button {
  margin-top: 24px;
}

.photo-panel__button a {
  display: inline-flex;
  align-items: center;
  background: #0B3B4C;
  color: #fff;
  border: 2px solid #0B3B4C;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.photo-panel__button a:hover {
  background: transparent;
  color: #0B3B4C;
}

/* ===== Framed variant (UTeams "AIM Fellowship") ===== */
.photo-panel--framed {
  background: #005E81;
  /* teal band behind the whole section */
  max-width: none;
  margin: 0;
  padding: 56px 60px 72px;
}

/* Taller photo, inset within the teal band */
.photo-panel--framed .photo-panel__media--desktop {
  border-radius: 10px;
  overflow: hidden;
}

.photo-panel--framed .photo-panel__media--desktop img {
  height: 760px;
}

/* Wider frosted card */
.photo-panel--framed .photo-panel__card {
  top: 120px;
  left: 100px;
  width: 720px;
  max-width: calc(100% - 160px);
  padding: 40px;
}

/* The teal offset block isn't needed — the whole band is teal now */
/* Frosted shapes — two clusters, each a rectangle + a corner-touching square.
   Geometry is explicit here because the base .photo-panel__shape rule carries
   the default variant's teal-block dimensions.

   Corner-touch math (cluster A): square.left = rect.right  →  with right-anchoring,
   square's `right` + its width equals the rect's `right`. Square sits ABOVE the
   rect, so square.bottom = rect.bottom + rect.height. */

.photo-panel--framed .photo-panel__shape {
  display: block;
  position: absolute;
  z-index: 1;
  left: auto;
  top: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  border-radius: 0;
  width: auto;
  height: auto;
}

/* Cluster A — bottom-right of the section */
.photo-panel--framed .photo-panel__shape--1 {
  right: 213px;
  bottom: 40px;
  width: 180px;
  height: 90px;
  background: rgba(2, 175, 239, 0.20);
}

.photo-panel--framed .photo-panel__shape--2 {
  right: 140px;
  bottom: 130px;
  width: 75px;
  height: 75px;
  background: rgba(255, 255, 255, 0.20);
}

/* Cluster B — bottom-right of the frosted card.
   Square sits BELOW-right: square.top = rect.bottom, square.left = rect.right. */
.photo-panel--framed .photo-panel__shape--3 {
  z-index: 2;
  left: 620px;
  bottom: 240px;
  width: 180px;
  height: 90px;
  background: rgba(2, 175, 239, 0.20);
}

.photo-panel--framed .photo-panel__shape--4 {
  z-index: 2;
  left: 800px;
  bottom: 165px;
  width: 75px;
  height: 75px;
  background: rgba(255, 255, 255, 0.20);
}

@media (max-width: 767px) {
  .photo-panel--framed .photo-panel__shape {
    display: none;
  }
}

@media (max-width: 767px) {
  .photo-panel__media--desktop {
    display: none;
  }

  .photo-panel__media--mobile {
    display: block;
  }

  /* Spacing on the section's padding — child margins would collapse out
     and the photo would have no height to fill. Outer margin = the white
     space against the hero above and the next section below. */
    .photo-panel {
      padding: 210px 30px 100px;
      margin: 56px 0 40px;
    }

  /* Purpose-cropped mobile export as the background layer.
     Anchored top+bottom so it fills the section minus the teal strip. */
    .photo-panel__media--mobile {
      position: absolute;
      top: 0;
      right: 0;
      left: 16px;
      bottom: 56px;
      height: auto;
      z-index: 0;
      overflow: hidden;
      border-radius: 12px 0 0 12px;
      /* top-left + bottom-left */
    }

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

  /* Card in flow on top — the section padding places it */
  .photo-panel__card {
    position: relative;
    z-index: 2;
    top: auto;
    left: auto;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 24px 20px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .photo-panel__heading {
    font-size: 40px;
    line-height: 1.1;
    margin-bottom: 14px;
  }

  .photo-panel__body {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Teal banner along the bottom — fills the strip the photo leaves */
  .photo-panel__shape {
    display: block;
    position: absolute;
    z-index: 1;
    left: 40%;
    right: 0;
    bottom: 0;
    height: 56px;
    border-radius: 0 0 0 12px;   /* bottom-left only */
  }

    .photo-panel--framed {
      padding: 20px 16px 220px;
      /* bottom padding = how much photo shows below the card */
      margin: 0;
    }

    .photo-panel--framed .photo-panel__media--desktop {
      display: none;
    }

    .photo-panel--framed .photo-panel__media--mobile {
      display: block;
      position: absolute;
      top: 20px;
      left: 16px;
      right: 16px;
      bottom: 20px;
      height: auto;
      z-index: 0;
      border-radius: 10px;
      overflow: hidden;
    }

    .photo-panel--framed .photo-panel__media--mobile img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* Card in normal flow at the top, near full width */
    .photo-panel--framed .photo-panel__card {
      position: relative;
      z-index: 2;
      top: auto;
      left: auto;
      width: auto;
      max-width: none;
      margin: 24px 12px 0;
      padding: 24px 20px;
    }

    .photo-panel--framed .photo-panel__heading {
      font-size: 30px;
      line-height: 1.15;
      margin-bottom: 12px;
    }

    .photo-panel--framed .photo-panel__body {
      font-size: 14px;
      line-height: 1.55;
    }

    .photo-panel--framed .photo-panel__button a {
      font-size: 14px;
      padding: 10px 22px;
    }
}
