/* ==========================================================================
   Component: datpro_text_image
   Two-column text / image block. One component serves Giới thiệu, Sản phẩm
   and Giải pháp — stack several inside one .dp-section and alternate the
   sides with --reverse.

     <div class="dp-text-image dp-text-image--reverse">
       <div class="dp-text-image__body">
         <span class="dp-eyebrow dp-eyebrow--muted">…</span>
         <h2 class="dp-text-image__title">…</h2>
         <div class="dp-text-image__desc">
           <p>…</p>
           <p>…</p>
         </div>
         <ul class="dp-text-image__list"><li>…</li></ul>      <!-- optional -->
         <div class="dp-text-image__actions"> …dp-btn / dp-link-arrow… </div>
       </div>
       <div class="dp-text-image__media">
         <img src="…" width="…" height="…" loading="lazy" alt="…">
       </div>
     </div>

   MOBILE READING ORDER IS GUARANTEED. The side swap is expressed only inside
   the desktop media query, so below 900px the block always stacks in source
   order — heading → description → CTA → image — whatever modifier is applied.
   Keep __body before __media in the markup and --reverse can never scramble it.
   ========================================================================== */

.dp-text-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 3.2vw, 3.25rem);
}

/* Vertical rhythm when several blocks are stacked in one section */
.dp-text-image + .dp-text-image {
  margin-top: clamp(3rem, 5.5vw, 5rem);
}

/* ---------- Copy ---------------------------------------------------------- */

.dp-text-image__body {
  min-width: 0;
  max-width: 40rem;
}

.dp-text-image__title {
  margin-bottom: var(--sp-4);
}

.dp-text-image__desc {
  display: grid;
  gap: var(--sp-4);
  color: var(--dp-text-body);
  font-size: var(--fs-body);
  text-wrap: pretty;
}

.dp-text-image__list {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.dp-text-image__list li {
  position: relative;
  padding-left: 1.375rem;
  color: var(--dp-text-body);
  font-size: var(--fs-body);
  line-height: 1.6;
}

.dp-text-image__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dp-blue);
}

.dp-text-image__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  margin-top: clamp(1.5rem, 2.4vw, 2rem);
}

/* ---------- Media --------------------------------------------------------- */

.dp-text-image__media {
  min-width: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.dp-text-image__media img {
  width: 100%;
  height: auto;
}

/* Light framed variant — for flat SVG illustrations that need a ground */
.dp-text-image__media--framed {
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 2.4vw, 2rem);
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
}

/* ---------- Desktop: two columns, optional side swap ---------------------- */

@media (min-width: 900px) {
  .dp-text-image {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2.5rem, 4.4vw, 4.5rem);
  }

  .dp-text-image--reverse .dp-text-image__body {
    grid-row: 1;
    grid-column: 2;
  }

  .dp-text-image--reverse .dp-text-image__media {
    grid-row: 1;
    grid-column: 1;
  }

  /* Text column narrower than the image column */
  .dp-text-image--wide-media {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  }

  .dp-text-image--reverse.dp-text-image--wide-media {
    grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  }
}

@media (max-width: 899px) {
  .dp-text-image__media {
    max-width: 34rem;
  }
}
