/* Template: image-text — image on the left, glass text box overlapping it on
   the right (see js/templates/image-text.js). For the mirrored layout use
   the image-text-right template. Desktop keeps the side-by-side overlap;
   mobile stacks with the box overlapping the image bottom. */

.image-text {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  padding: clamp(96px, 16vh, 160px) 0;
}

.image-text__inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.image-text__image {
  flex: 0 0 auto;
  width: 60%;
  height: clamp(300px, 60vh, 620px);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.image-text__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Glass text box: translucent surface tint + backdrop blur, so the part
   covering the image stays visible while the text stays readable. */
.image-text__content {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 52%;
  margin-left: -14%;
  padding: clamp(28px, 4vw, 48px);
  background: var(--color-surface);
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.image-text__title {
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: 0.04em;
}

.image-text__paragraph {
  margin-top: clamp(16px, 2.5vh, 24px);
  font-size: clamp(14px, 1.9vw, 16.5px);
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  color: var(--color-text-secondary);
}

.image-text__paragraph:first-of-type {
  margin-top: clamp(20px, 3vh, 32px);
}

/* Optional plain layout (data.layout === "plain"): image and box sit side
 * by side with a gap — no overlap — and the text box takes the remaining
 * (wider) space. */
@media (min-width: 768px) {
  .image-text--plain .image-text__inner {
    gap: clamp(32px, 5vw, 72px);
  }

  .image-text--plain .image-text__image {
    flex-basis: 38%;
    width: 38%;
  }

  .image-text--plain .image-text__content {
    flex: 1 1 auto;
    width: auto;
    margin-left: 0;
  }
}

/* Optional wider text box for long content (data.layout === "wide"),
 * mirroring the wide variant of image-text-right. */
@media (min-width: 768px) {
  .image-text--wide .image-text__image {
    width: 48%;
  }

  .image-text--wide .image-text__content {
    width: 64%;
    margin-left: -16%;
  }
}

/* Full-width editorial layout: the image is deliberately cropped vertically,
 * then the copy sits in its own card below without overlapping the artwork. */
@media (min-width: 768px) {
  .image-text--stacked .image-text__inner {
    display: block;
  }

  .image-text--stacked .image-text__image {
    width: min(88%, 860px);
    height: clamp(300px, 36vw, 460px);
    margin-inline: auto;
    border-radius: var(--radius-md);
  }

  .image-text--stacked .image-text__content {
    width: min(88%, 860px);
    margin: clamp(28px, 4vw, 52px) auto 0;
    padding: clamp(32px, 5vw, 60px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }
}

@media (max-width: 767px) {
  .image-text__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .image-text__image {
    width: 100%;
    height: clamp(240px, 34vh, 380px);
  }

  .image-text__content {
    width: 88%;
    margin: calc(-1 * clamp(44px, 7vh, 64px)) auto 0;
  }

  .image-text--plain .image-text__content {
    width: 100%;
    margin: 0;
  }

  .image-text--stacked .image-text__image {
    width: 100%;
    height: clamp(250px, 62vw, 390px);
    border-radius: var(--radius-md);
  }

  .image-text--stacked .image-text__content {
    width: 100%;
    margin: 20px 0 0;
    padding: 28px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }
}
