/**
 * Section: Image + Text Split — "Meridian" redesign
 *
 * @package Ortorodzina
 */

/* ═══════════════════════════════════════════════════════════
   Shell
   ═══════════════════════════════════════════════════════════ */

.img-text {
  padding: var(--space-8) 0;
  background: #fff;
}

.img-text--surface {
  background: var(--color-surface);
}

/* ═══════════════════════════════════════════════════════════
   Layout — mobile-first single column
   ═══════════════════════════════════════════════════════════ */

.img-text__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

/* Image-left: reorder at desktop via modifier, not here */

/* ═══════════════════════════════════════════════════════════
   Content column
   ═══════════════════════════════════════════════════════════ */

.img-text__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ── Heading ── */

.img-text__heading {
  font-size: clamp(22px, 7vw, 36px);
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

.img-text__heading em,
.img-text__heading strong {
  color: var(--color-accent);
  font-style: normal;
  font-weight: inherit;
}

/* ── Body text ── */

.img-text__body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--color-text);
}

.img-text__body p {
  margin: 0 0 var(--space-4);
}

.img-text__body p:last-child {
  margin-bottom: 0;
}

/* ── Bullet list ── */

.img-text__bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px; /* hairline dividers via gap + surface bg on items */
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.img-text__bullet {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: #fff;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.img-text__bullet:last-child {
  border-bottom: none;
}

.img-text__bullet-dot {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 58, 45, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  border: 1.5px solid rgba(255, 58, 45, 0.18);
}

.img-text__bullet-dot svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.8;
}

/* ─── CTA wrapper ─── */
.img-text__content > div:last-child {
  margin-top: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════
   Media column
   ═══════════════════════════════════════════════════════════ */

.img-text__media {
  position: relative;
  margin: 0;
}

/* Offset accent shadow — consistent with hero */
.img-text__media::before {
  content: "";
  position: absolute;
  inset: 18px -16px -20px 16px;
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  background: var(--color-accent);
  opacity: 0.1;
  z-index: 0;
}

/* img-right default: shadow peeks right */
.img-text--img-right .img-text__media::before {
  inset: 18px -16px -20px 16px;
}

/* img-left: shadow peeks left */
.img-text--img-left .img-text__media::before {
  inset: 18px 16px -20px -16px;
}

.img-text__media-frame {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-surface);
}

.img-text__media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   Responsive — mobile-first
   ═══════════════════════════════════════════════════════════ */

/* ── 480px: bullets 2-col ── */
@media (min-width: 480px) {
  .img-text__bullets {
    grid-template-columns: 1fr 1fr;
  }

  /* Restore correct borders in 2-col */
  .img-text__bullet {
    border-bottom: none;
    border-right: 1px solid var(--color-border);
  }

  .img-text__bullet:nth-child(2n) {
    border-right: none;
  }

  .img-text__bullet:nth-last-child(-n + 2) {
    /* border-bottom: none; */
  }
}

/* ── 768px: side-by-side layout ── */
@media (min-width: 768px) {
  .img-text__inner {
    grid-template-columns: 1fr 1fr;
    gap: clamp(var(--space-7), 5%, var(--space-10));
  }

  /* img-left: media in first visual position */
  .img-text--img-left .img-text__media {
    order: -1;
  }

  /* Portrait frame at tablet */
  .img-text__media-frame {
    aspect-ratio: 3 / 4;
  }

  /* Bullets collapse back to 1-col inside narrower content column */
  .img-text__bullets {
    grid-template-columns: 1fr;
  }

  .img-text__bullet {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .img-text__bullet:last-child {
    border-bottom: none;
  }
}

/* ── 1024px: full desktop ── */
@media (min-width: 1024px) {
  .img-text {
    padding: var(--space-10) 0;
  }

  .img-text__inner {
    gap: clamp(var(--space-8), 6%, var(--space-12));
  }

  .img-text__heading {
    font-size: clamp(28px, 2.8vw, 38px);
  }

  /* Taller portrait at desktop */
  .img-text__media-frame {
    aspect-ratio: 4 / 5;
  }

  .img-text__media::before {
    inset: 22px -20px -24px 20px;
  }

  .img-text--img-left .img-text__media::before {
    inset: 22px 20px -24px -20px;
  }
}

/* ── 1280px: wide desktop ── */
@media (min-width: 1280px) {
  .img-text__inner {
    grid-template-columns: 55fr 45fr;
  }

  .img-text--img-left .img-text__inner {
    grid-template-columns: 45fr 55fr;
  }
}

/* ── Hover: image scale on mouse devices ── */
@media (hover: hover) and (pointer: fine) {
  .img-text__media-frame img {
    transition: transform 0.55s ease;
  }

  .img-text__media-frame:hover img {
    transform: scale(1.04);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .img-text__media-frame img {
    transition: none;
  }
}

/* ── Landscape phones ── */
@media (max-height: 520px) and (orientation: landscape) {
  .img-text__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: start;
  }

  .img-text__media-frame {
    aspect-ratio: 16 / 9;
  }

  .img-text__media::before {
    display: none;
  }
}
