/* Template: image-text-right — mirrored glass-overlap variant of
   image-text: image on the right, glass text box on the left overlapping it
   (see js/templates/image-text-right.js). Mobile: image on top, glass box
   centered over its bottom edge. */

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

/* DOM order is [image, content]; row-reverse puts the image on the right. */
.image-text-right__inner {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  width: 100%;
}

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

.image-text-right__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-right__content {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 52%;
  margin-right: -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-right__title {
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: 0.04em;
}

.image-text-right__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-right__paragraph:first-of-type {
  margin-top: clamp(20px, 3vh, 32px);
}

/* Optional wider text box for long content (data.layout === "wide").
 * Scoped to desktop widths so mobile stacking keeps its own geometry. */
@media (min-width: 768px) {
  .image-text-right--wide .image-text-right__image {
    width: 48%;
  }

  .image-text-right--wide .image-text-right__content {
    width: 64%;
    margin-right: -16%;
  }
}

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

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

  .image-text-right__content {
    width: 88%;
    /* Auto side margins center the box over the image's bottom edge;
     * no other margin rules exist, so centering cannot be overridden. */
    margin: calc(-1 * clamp(44px, 7vh, 64px)) auto 0;
  }
}
