/* =====================
   m_essential — «Essential Architecture»
   Desktop: Figma 1:397 (1142×928) — full viewport: H 52 + intro (16/1.3, <br>)
            top, 3-col card grid bottom with STAGGERED image heights
            (improve 367 / lead 247 / renovate 480), gap 20, card gap 12.
   Mobile:  Figma 1:669 — title 28 (no intro), horizontal Swiper rail:
            slides 260w, gap 12, image 180h, text gap 6, title 20/1.2.
   DOM order = mobile order (renovate → lead → improve); desktop restores
   its order via CSS `order` (Swiper needs true DOM order on mobile).
===================== */

.m_essential {
  min-height: calc(100svh - 40px); /* page_main pad-block 20×2 */
  display: flex;
  flex-direction: column;
  /* three children — head / button / rail — distributed like Figma 2084:2338 */
  justify-content: space-between;
  align-items: flex-start;
  gap: 36px;
  padding-block: 16px;
}

.m_essential_head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.m_essential_title {
  font-size: var(--font-size--h1);
  line-height: var(--line-height--tight);
}

.m_essential_intro p {
  font-size: var(--font-size--body);
  line-height: var(--line-height--body);
  margin-bottom: 6px;
}
.m_essential_intro p:last-child { margin-bottom: 0; }


.m_essential_rail { width: 100%; }

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

.m_essential_card_text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m_essential_card_title {
  font-size: var(--font-size--h3);
  line-height: var(--line-height--card);
}

.m_essential_card_desc {
  font-size: var(--font-size--body);
  line-height: var(--line-height--body);
}

/* ---- desktop: static 3-col grid (Swiper is destroyed ≥992) ---- */
@media (min-width: 992px) {
  .m_essential_rail.swiper { overflow: visible; }
  .m_essential_rail .swiper-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 20px;
  }
  .m_essential_card {
    flex: 1 0 0;
    min-width: 1px;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  /* uniform image height (Figma 2084:2348/2353/2358 — 264/264/266;
     normalised to 264, the 2px outlier reads as a design slip) */
  .m_essential_card_media { height: 264px; }

  /* Figma's card row is 512 tall (card 1 carries a fixed height; its content is
     ~358, so ~154px sit empty below). Reproducing it keeps the whole section
     rhythm — button lands mid-section at y≈279 as designed. */
  .m_essential_rail { min-height: 512px; }
}

/* ---- mobile: Swiper rail ---- */
@media (max-width: 991px) {
  .m_essential { min-height: 0; padding-block: 0; }
  .m_essential_title { font-size: var(--font-size--h1-mob); }
  .m_essential_rail { margin-top: 0; }

  .m_essential_card {
    width: 260px; /* slidesPerView:'auto' reads this */
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .m_essential_card_media { height: 180px; }
  .m_essential_card_text { gap: 6px; }
  .m_essential_card_title { font-size: var(--font-size--h3-mob); }
}
