/**
 * Prompt 1 — Master mobile homepage structure
 * Spacing, section rhythm, typography, card language for ~360–430px.
 * Desktop keeps existing layouts; this file focuses on mobile-first polish.
 */

:root {
  --hm-navy: #0b2f5b;
  --hm-blue: #1d4ed8;
  --hm-sky: #e8f3ff;
  --hm-mint: #eefaf3;
  --hm-soft: #f7fafc;
  --hm-green: #16a34a;
  --hm-wa: #25d366;
  --hm-text: #1e293b;
  --hm-muted: #64748b;
  --hm-radius: 18px;
  --hm-shadow: 0 10px 28px rgba(11, 47, 91, 0.08);
  --hm-section-y: 1.65rem;
  --hm-title: clamp(1.35rem, 5.2vw, 1.65rem);
  --hm-body: clamp(0.95rem, 3.6vw, 1.05rem);
}

/* Homepage body rhythm */
body.public-home-v2 .hp-page {
  overflow-x: clip;
}

@media (max-width: 767px) {
  body.public-home-v2 {
    --hm-section-y: 1.55rem;
  }

  body.public-home-v2 .hp-page > section,
  body.public-home-v2 .hp-page > .faq-section {
    padding-block: var(--hm-section-y) !important;
    margin-block: 0 !important;
  }

  /* Alternating section backgrounds */
  body.public-home-v2 .hp-hero {
    background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 70%, #fff 100%);
  }
  body.public-home-v2 .hp-journey {
    background: #fff;
  }
  body.public-home-v2 .ilj-mrev {
    background: var(--hm-sky);
  }
  body.public-home-v2 .hp-why-trust {
    background: #fff;
  }
  body.public-home-v2 .hp-specs {
    background: var(--hm-soft);
  }
  body.public-home-v2 .hp-hospitals {
    background: #fff;
  }
  body.public-home-v2 .hp-cost,
  body.public-home-v2 [class*="cost"],
  body.public-home-v2 .ilj-cost,
  body.public-home-v2 .hp-stats,
  body.public-home-v2 section.pub-p3.hp-stats,
  body.public-home-v2 .hp-transparency {
    background: var(--hm-mint);
  }
  body.public-home-v2 .hp-stories {
    background: #fff;
  }
  body.public-home-v2 .hp-visa-travel {
    background: var(--hm-sky);
  }
  body.public-home-v2 .hp-track-journey {
    background: var(--hm-navy) !important;
  }
  body.public-home-v2 .hp-track-journey h2,
  body.public-home-v2 .hp-track-journey h2 *,
  body.public-home-v2 .hp-track-journey p,
  body.public-home-v2 .hp-track-journey .hp-track-journey__subtitle,
  body.public-home-v2 .hp-track-journey li {
    color: #fff !important;
  }
  body.public-home-v2 .ilj-fcta {
    background: linear-gradient(180deg, #0b2f5b 0%, #123e73 100%);
  }
  body.public-home-v2 .faq-section {
    background: #fff;
  }

  /* Typography */
  body.public-home-v2 .hp-page h1,
  body.public-home-v2 .hp-page h2,
  body.public-home-v2 .hp-page .hp-journey__heading-text,
  body.public-home-v2 .hp-page .hp-why-trust__heading-text,
  body.public-home-v2 .hp-page .hp-hs__title,
  body.public-home-v2 .hp-page .ilj-mrev__title,
  body.public-home-v2 .hp-page .ilj-fcta__title {
    font-size: var(--hm-title) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
    color: var(--hm-navy);
  }

  body.public-home-v2 .ilj-fcta__title,
  body.public-home-v2 .ilj-fcta__title * {
    color: #fff !important;
  }

  body.public-home-v2 .hp-page p,
  body.public-home-v2 .hp-page .hp-hero__subtitle,
  body.public-home-v2 .hp-page .hp-journey__sub,
  body.public-home-v2 .hp-page .hp-why-trust__subtitle,
  body.public-home-v2 .hp-page .ilj-mrev__lead {
    font-size: var(--hm-body) !important;
    line-height: 1.5 !important;
    color: var(--hm-muted);
  }

  /* Controlled hero */
  body.public-home-v2 .hp-hero--master {
    padding-bottom: 0.35rem !important;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__swiper {
    max-height: none;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__grid {
    gap: 0.85rem !important;
    padding-inline: 1rem !important;
    padding-block: 0.85rem 0.4rem !important;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__title {
    font-size: clamp(1.45rem, 6vw, 1.8rem) !important;
    margin: 0.35rem 0 0.4rem !important;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__subtitle {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.7rem !important;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__visual {
    max-height: 210px !important;
    margin-inline: auto;
  }
  body.public-home-v2 .hp-hero--master .hp-hero__visual img,
  body.public-home-v2 .hp-hero--master .hp-hero__img {
    max-height: 210px !important;
    width: auto !important;
    margin-inline: auto;
    object-fit: contain !important;
  }
  body.public-home-v2 .hp-hero--master .pub-hero__actions {
    display: none !important; /* WA band is primary mobile CTA */
  }
  body.public-home-v2 .hp-hero--master .pub-hero__metric {
    display: none !important;
  }

  /* Trust pills */
  .hp-hero__trust-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    list-style: none;
    margin: 0.55rem 0 0.35rem;
    padding: 0;
  }
  .hp-hero__trust-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    text-align: center;
    background: #fff;
    border: 1px solid #dbe7f5;
    border-radius: 14px;
    padding: 0.55rem 0.3rem;
    box-shadow: 0 4px 14px rgba(11, 47, 91, 0.05);
    min-height: 74px;
  }
  .hp-hero__trust-pill-ico {
    width: 28px;
    height: 28px;
    color: var(--hm-blue);
    display: grid;
    place-items: center;
  }
  .hp-hero__trust-pill-ico svg {
    width: 24px;
    height: 24px;
  }
  .hp-hero__trust-pill span:last-child {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--hm-navy);
  }

  /* WhatsApp CTA band */
  .hp-hero__wa-band {
    padding: 0.65rem 1rem 0.9rem;
  }
  .hp-hero__wa-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #0b2f5b, #155e9c);
    color: #fff;
    text-decoration: none;
    border-radius: 16px;
    padding: 0.85rem 0.95rem;
    box-shadow: 0 12px 28px rgba(11, 47, 91, 0.22);
  }
  .hp-hero__wa-ico {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--hm-wa);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
  }
  .hp-hero__wa-ico svg {
    width: 22px;
    height: 22px;
    color: #fff;
  }
  .hp-hero__wa-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
  }
  .hp-hero__wa-copy strong {
    font-size: 0.98rem;
    line-height: 1.2;
  }
  .hp-hero__wa-copy span {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.25;
  }
  .hp-hero__wa-arrow {
    font-size: 1.2rem;
    opacity: 0.9;
  }

  /* How it works — 4 step compact */
  body.public-home-v2 .hp-journey__inner {
    padding-inline: 1rem !important;
  }
  body.public-home-v2 .hp-journey__sub {
    margin: 0.35rem auto 0.7rem !important;
    max-width: 22rem;
    text-align: center;
  }
  body.public-home-v2 .hp-journey__grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
  }
  body.public-home-v2 .hp-journey__step {
    background: #fff;
    border: 1px solid #e2eef8;
    border-radius: 16px;
    padding: 0.85rem 0.65rem 0.75rem !important;
    box-shadow: var(--hm-shadow);
    min-height: 0 !important;
  }
  body.public-home-v2 .hp-journey__icon {
    width: 52px !important;
    height: 52px !important;
    margin-inline: auto  !important;
  }
  body.public-home-v2 .hp-journey__icon svg {
    width: 34px !important;
    height: 34px !important;
  }
  body.public-home-v2 .hp-journey__label {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
    margin: 0.45rem 0 0.2rem !important;
  }
  body.public-home-v2 .hp-journey__desc {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
  }
  body.public-home-v2 .hp-journey__conn,
  body.public-home-v2 .hp-journey__support,
  body.public-home-v2 .hp-journey__dots {
    display: none !important;
  }

  /* Medical form card */
  body.public-home-v2 .ilj-mrev__wrap {
    padding-inline: 1rem !important;
  }
  body.public-home-v2 .ilj-mrev__card {
    border-radius: 20px !important;
    box-shadow: var(--hm-shadow) !important;
    padding: 1rem !important;
    background: #fff;
  }
  body.public-home-v2 .ilj-mrev__visual {
    display: none !important; /* form-first on mobile master flow */
  }
  body.public-home-v2 .ilj-mrev__submit {
    min-height: 52px !important;
    border-radius: 14px !important;
    background: var(--hm-green) !important;
    font-size: 0.98rem !important;
    font-weight: 700 !important;
  }
  body.public-home-v2 .ilj-mrev__upload {
    border: 1.5px dashed #93c5fd !important;
    background: #f0f7ff !important;
    border-radius: 14px !important;
    padding: 0.95rem !important;
  }
  body.public-home-v2 .ilj-mrev__trust {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    margin-top: 0.85rem !important;
  }
  body.public-home-v2 .ilj-mrev__trust-item {
    background: #fff;
    border-radius: 12px;
    padding: 0.55rem 0.35rem !important;
    text-align: center;
  }
  body.public-home-v2 .ilj-mrev__trust-item strong {
    font-size: 0.72rem !important;
    display: block;
  }
  body.public-home-v2 .ilj-mrev__trust-item span:last-child {
    font-size: 0.68rem !important;
  }

  /* Why trust 2x2 */
  body.public-home-v2 .hp-why-trust__grid--4,
  body.public-home-v2 .hp-why-trust--master .hp-why-trust__grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
    padding-inline: 1rem !important;
  }
  body.public-home-v2 .hp-why-trust__card {
    min-height: 0 !important;
    padding: 0.95rem 0.75rem !important;
    border-radius: 16px !important;
    box-shadow: var(--hm-shadow);
  }
  body.public-home-v2 .hp-why-trust__icon {
    width: 48px !important;
    height: 48px !important;
  }
  body.public-home-v2 .hp-why-trust__card h3 {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
    margin: 0.45rem 0 0.25rem !important;
  }
  body.public-home-v2 .hp-why-trust__card p {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
  }
  body.public-home-v2 .hp-why-trust__laurel,
  body.public-home-v2 .hp-why-trust__ribbon {
    display: none !important;
  }

  /* Treatments / hospitals horizontal feel */
  body.public-home-v2 .hp-specs .swiper-slide,
  body.public-home-v2 .hp-hospitals .swiper-slide {
    width: min(78vw, 280px) !important;
  }
  body.public-home-v2 .hp-specs,
  body.public-home-v2 .hp-hospitals,
  body.public-home-v2 .hp-stories,
  body.public-home-v2 .hp-visa-travel {
    padding-inline: 0 !important;
  }
  body.public-home-v2 .hp-specs .section-heading,
  body.public-home-v2 .hp-hs__head,
  body.public-home-v2 .hp-visa-travel__head,
  body.public-home-v2 .hp-specs > .container-shell,
  body.public-home-v2 .hp-hospitals .container-shell {
    padding-inline: 1rem !important;
  }

  /* Stories: one large card */
  body.public-home-v2 .hp-stories .swiper-slide {
    width: min(88vw, 340px) !important;
  }

  /* Final CTA buttons */
  body.public-home-v2 .ilj-fcta__actions {
    display: grid !important;
    gap: 0.65rem !important;
  }
  body.public-home-v2 .ilj-fcta__btn {
    min-height: 50px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    justify-content: center;
  }
  body.public-home-v2 .ilj-fcta__btn--cb {
    background: var(--hm-green) !important;
    color: #fff !important;
  }
  body.public-home-v2 .ilj-fcta__btn--chat {
    background: #fff !important;
    color: var(--hm-navy) !important;
  }
  body.public-home-v2 .ilj-fcta__visual {
    display: none !important;
  }

  /* FAQ compact */
  body.public-home-v2 .faq-section .container-shell,
  body.public-home-v2 .faq-section .section-pad {
    padding-inline: 1rem !important;
  }
  body.public-home-v2 .faq-card .accordion-trigger {
    min-height: 52px;
    font-size: 0.95rem !important;
    font-weight: 650;
  }

  /* Reduce huge empty gaps from older sheets */
  body.public-home-v2 .hp-page .section-pad {
    padding-block: 0 !important;
  }
}

/* Desktop: keep WA band + trust pills usable but not disruptive */
@media (min-width: 768px) {
  .hp-hero__trust-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    list-style: none;
    margin: 0.75rem 0 0.5rem;
    padding: 0;
  }
  .hp-hero__trust-pill {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    border: 1px solid #dbe7f5;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
  }
  .hp-hero__trust-pill-ico {
    width: 22px;
    height: 22px;
    color: var(--hm-blue);
  }
  .hp-hero__trust-pill-ico svg {
    width: 20px;
    height: 20px;
  }
  .hp-hero__trust-pill span:last-child {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--hm-navy);
  }
  .hp-hero__wa-band {
    max-width: 720px;
    margin: 0 auto 1rem;
    padding-inline: 1.25rem;
  }
  .hp-hero__wa-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, #0b2f5b, #155e9c);
    color: #fff;
    text-decoration: none;
    border-radius: 16px;
    padding: 0.95rem 1.1rem;
  }
  .hp-hero__wa-ico {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hm-wa);
    display: grid;
    place-items: center;
  }
  .hp-hero__wa-ico svg {
    width: 24px;
    height: 24px;
    color: #fff;
  }
  .hp-hero__wa-copy {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .hp-why-trust__grid--4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* RTL tweaks */
[dir="rtl"] .hp-hero__wa-arrow {
  transform: scaleX(-1);
}
[dir="rtl"] .hp-hero__trust-pill,
[dir="rtl"] .hp-hero__wa-card {
  text-align: right;
}
