/* Phone and small tablet layout for every page. Desktop is untouched. */

/* Sticky Call / Free consultation bar shows below 980px, so the hero buttons are not needed there */
@media (max-width: 979.98px) {
  .mhc-hero-ctas { display: none !important; }
}

@media (max-width: 647.98px) {

  /* ---------- Type scale: hero stays the biggest thing on the page ---------- */
  h2 { font-size: 25px !important; line-height: 1.15 !important; letter-spacing: -0.02em !important; }
  h3 { line-height: 1.25 !important; }
  [style*="font-size: 26px"]:is(h3, span),
  [style*="font-size: 34px"]:is(h3) { font-size: 21px !important; }
  :is(h3, span)[style*="font-size: 23px"],
  :is(h3, span)[style*="font-size: 22px"],
  :is(h3, span)[style*="font-size: 21px"],
  :is(h3, span)[style*="font-size: 20px"] { font-size: 17.5px !important; }
  p[style*="font-size: 19px"],
  p[style*="font-size: 18px"] { font-size: 16px !important; line-height: 1.55 !important; }
  p[style*="font-size: 17px"] { font-size: 15px !important; line-height: 1.5 !important; }
  section:not([style*="padding: 0px"]) { padding-top: 40px !important; padding-bottom: 40px !important; }
  section > div > [style*="margin-bottom: 36px"],
  section > div > [style*="margin-bottom: 40px"] { margin-bottom: 22px !important; }
  a[style*="padding: 15px 26px"], a[style*="padding: 14px 24px"], a[style*="padding: 16px 28px"] {
    font-size: 15.5px !important; padding: 12px 20px !important;
  }

  /* ---------- Home hero: writing over the photo, compact ---------- */
  .mhc-hero { min-height: 0 !important; border-radius: 0 0 32px 32px !important; }
  .mhc-hero-img { object-position: 74% 20% !important; }
  .mhc-hero-shade { background: linear-gradient(0deg, rgba(52,46,48,.82) 0%, rgba(52,46,48,.56) 55%, rgba(52,46,48,.28) 100%) !important; }
  .mhc-hero-body { padding: 140px 22px 30px !important; }
  .mhc-hero-body > div { gap: 10px !important; }
  .mhc-hero-body h1 { font-size: 25px !important; line-height: 1.12 !important; }
  .mhc-hero-body p { font-size: 14.5px !important; line-height: 1.5 !important; }

  /* ---------- Where would you like to start: short rows ---------- */
  .mhc-start { gap: 8px !important; }
  .mhc-start > a { min-height: 0 !important; flex-direction: row !important; align-items: center !important; gap: 14px !important; padding: 14px 14px 14px 18px !important; border-radius: 20px !important; }
  .mhc-start > a > span:first-child { flex: 1; gap: 3px !important; }
  .mhc-start > a > span:first-child > span:first-child { font-size: 17.5px !important; }
  .mhc-start > a > span:first-child > span:last-child { font-size: 14px !important; line-height: 1.4 !important; }
  .mhc-start > a > span:last-child { font-size: 0 !important; border: 0 !important; padding: 0 !important; align-self: center !important; }
  .mhc-start > a > span:last-child > span { font-size: 17px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; opacity: .7; }

  /* ---------- Team strip ---------- */
  .mhc-marq > div { gap: 10px !important; }
  .mhc-marq > div > div { width: 120px !important; gap: 6px !important; }
  .mhc-marq > div > div > div:first-child { width: 120px !important; height: 144px !important; border-radius: 18px !important; }
  .mhc-marq > div > div > div:last-child { padding: 0 2px !important; }
  .mhc-marq > div > div > div:last-child > div:first-child { font-size: 13.5px !important; line-height: 1.25; }
  .mhc-marq > div > div > div:last-child > div:last-child { font-size: 12px !important; line-height: 1.3; }
  section [data-reveal][style*="margin: 0px auto clamp(36px"] { margin-bottom: 22px !important; }

  /* ---------- Services on the home page ---------- */
  .mhc-feature { min-height: 220px !important; border-radius: 22px !important; }
  .mhc-feature > div:not([aria-hidden]) { padding: 20px !important; gap: 6px !important; }
  .mhc-feature h3 { font-size: 22px !important; }
  .mhc-feature p { font-size: 14.5px !important; }
  .mhc-tiles { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .mhc-tiles a { min-height: 0 !important; padding: 14px !important; border-radius: 18px !important; gap: 6px !important; }
  .mhc-tiles a > div > span:first-child { width: 36px !important; height: 36px !important; border-radius: 11px !important; }
  .mhc-tiles a > div > span:first-child img { height: 20px !important; }
  .mhc-tiles a > div > span:last-child { display: none !important; }
  .mhc-tiles a h3 { font-size: 16px !important; margin-top: 4px !important; }
  .mhc-tiles a p { font-size: 13px !important; line-height: 1.4 !important; }
  .mhc-rest { gap: 8px !important; margin-top: 8px !important; }
  .mhc-rest > a { padding: 14px 16px !important; border-radius: 18px !important; gap: 12px !important; }
  .mhc-rest > a > span:first-child { width: 36px !important; height: 36px !important; border-radius: 11px !important; }
  .mhc-rest > a > span:first-child img { height: 20px !important; }
  .mhc-rest h3 { font-size: 16px !important; margin-bottom: 2px !important; }
  .mhc-rest p { font-size: 13px !important; line-height: 1.4 !important; }
  .mhc-rest > a > span:last-child { width: 34px !important; height: 34px !important; }
  .mhc-rest > a:last-child > span:first-child { width: auto !important; height: auto !important; font-size: 17px !important; }
  .mhc-rest > a:last-child > span:first-child > span { font-size: 14px !important; }

  /* ---------- Numbered cards (01, 02, 03) used across the site ---------- */
  div[style*="grid-template-columns: 44px 1fr"] { padding: 14px 16px !important; gap: 12px !important; grid-template-columns: 34px 1fr !important; border-radius: 18px !important; }
  div[style*="grid-template-columns: 44px 1fr"] > span:first-child { width: 34px !important; height: 34px !important; font-size: 13px !important; }
  div[style*="grid-template-columns: 44px 1fr"] h3 { font-size: 16.5px !important; margin: 4px 0 4px !important; }
  div[style*="grid-template-columns: 44px 1fr"] p { font-size: 14px !important; line-height: 1.45 !important; }
  div:has(> div[style*="grid-template-columns: 44px 1fr"]) { gap: 8px !important; }

  /* ---------- Why families choose us ---------- */
  #approach h2 ~ div { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  #approach h2 ~ div > div { padding: 12px 10px 11px !important; border-radius: 16px !important; gap: 4px !important; }
  #approach h2 ~ div > div > span:first-child { font-size: clamp(19px, 23cqi, 26px) !important; }
  #approach h2 ~ div > div > span:last-child { font-size: 12px !important; line-height: 1.3 !important; }
  #approach [data-steps] { padding: 0 0 84px 78px !important; gap: 12px !important; }
  #approach h2 ~ a { display: none !important; }
  #approach [data-steps] > div { padding: 14px 16px !important; border-radius: 18px !important; box-shadow: 0 8px 20px rgba(77,77,79,.07) !important; }
  #approach [data-steps] > div > span { left: -64px !important; top: 12px !important; width: 40px !important; height: 40px !important; font-size: 14px !important; }
  #approach [data-steps] h3 { font-size: 16.5px !important; margin: 0 0 4px !important; }
  #approach [data-steps] p { font-size: 14px !important; line-height: 1.45 !important; }
  #approach > div:nth-child(2) { gap: 18px !important; }
  #approach > div:nth-child(2) > div:first-child { gap: 22px !important; }
  #approach > div:nth-child(2) > div:nth-child(2) { gap: 8px !important; }

  /* ---------- Reviews: swipe sideways ---------- */
  div:has(> figure) { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px !important; margin: 0 -24px; padding: 0 24px 6px; scrollbar-width: none; }
  div:has(> figure)::-webkit-scrollbar { display: none; }
  div:has(> figure) > figure { flex: 0 0 84%; scroll-snap-align: center; padding: 20px !important; border-radius: 22px !important; gap: 12px !important; }
  div:has(> figure) blockquote { font-size: 15px !important; line-height: 1.5 !important; }
  div:has(> figure) figcaption { font-size: 14px !important; }
  div:has(> figure) > figure > span:first-child { font-size: 16px !important; }

  /* ---------- Contact details: small tiles, two to a row ---------- */
  section div:has(> a[href^="tel:"]):has(> a[href^="mailto:"]) { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  section div:has(> a[href^="tel:"]):has(> a[href^="mailto:"]) > :is(a, div):not([style*="grid-column"]) { padding: 11px 12px !important; border-radius: 14px !important; min-width: 0; }
  section div:has(> a[href^="tel:"]):has(> a[href^="mailto:"]) > :is(a, div):not([style*="grid-column"]) > div:first-child { font-size: 12px !important; margin-bottom: 2px !important; }
  section div:has(> a[href^="tel:"]):has(> a[href^="mailto:"]) > :is(a, div):not([style*="grid-column"]) > div:last-child { font-size: 14px !important; overflow-wrap: anywhere; }
  section div:has(> a[href^="tel:"]):has(> a[href^="mailto:"]) > div[style*="grid-column"] { font-size: 13px !important; padding: 6px 14px 6px 8px !important; }

  /* "What happens next" list */
  div[style*="grid-template-columns: 34px 1fr"] { font-size: 14.5px !important; gap: 10px !important; grid-template-columns: 28px 1fr !important; }
  div[style*="grid-template-columns: 34px 1fr"] > span:first-child { width: 26px !important; height: 26px !important; font-size: 13px !important; }
  div[style*="grid-template-columns: 34px 1fr"] > span:last-child { padding-top: 2px !important; }

  /* ---------- Forms ---------- */
  form { gap: 12px !important; }
  form input, form select, form textarea { font-size: 16px !important; padding: 11px 13px !important; border-radius: 12px !important; }
  form label { font-size: 14px !important; gap: 4px !important; }
  form button[type="button"] { font-size: 14.5px !important; padding: 8px 14px !important; }
  form button[type="submit"] { font-size: 16.5px !important; padding: 14px !important; }
  [data-callback-form] { padding: 20px !important; border-radius: 24px !important; }
  form > div[style*="minmax(min(100%, 170px)"] { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  form > div[style*="minmax(min(100%, 170px)"] > label { min-width: 0; }
  form input, form select { width: 100%; min-width: 0; box-sizing: border-box; }

  /* ---------- Questions (FAQ) ---------- */
  details summary, button[aria-expanded] { font-size: 16px !important; }

  /* ---------- Careers perks ---------- */
  body .mhc-perks { gap: 8px !important; }
  body .mhc-perks > * { padding: 14px !important; border-radius: 18px !important; gap: 6px !important; }
  body .mhc-perks h3 { font-size: 15.5px !important; }
  body .mhc-perks p { font-size: 13px !important; line-height: 1.4 !important; }

  /* ---------- Footer: two columns ---------- */
  footer > div:first-child { grid-template-columns: 1fr 1fr !important; gap: 24px 16px !important; font-size: 14.5px !important; line-height: 1.7 !important; padding-top: 36px !important; padding-bottom: 20px !important; }
  footer > div:first-child > div:first-child, footer > div:first-child > div:nth-child(4) { grid-column: 1 / -1; }
  footer > div:first-child > div:first-child { gap: 12px !important; }
  footer > div:first-child > div:first-child img { height: 36px !important; }

  /* ---------- Other page heroes (Services, Careers, Contact, About) ---------- */
  h1 { font-size: 27px !important; line-height: 1.1 !important; }
  section > div[style*="min-height: min(52vh"] { min-height: 300px !important; border-radius: 0 0 32px 32px !important; }
  section > div[style*="min-height: min(52vh"] > div[style*="padding: clamp(56px"] { padding: 40px 22px 28px !important; gap: 10px !important; }
  section > div[style*="min-height: min(52vh"] p { font-size: 15px !important; line-height: 1.5 !important; }
  section:has(> div[style*="min-height: min(52vh"]) { padding-bottom: 0 !important; }
  /* Pathway hero shares the home hero classes */
  .mhc-hero-body { gap: 10px !important; }
  .mhc-hero-img[src*="pathway-hero"] { object-position: 85% 40% !important; }

  /* ---------- Services page: six service cards as small tiles ---------- */
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:has(> div[style*="min-height: 250px"]) { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"] > div[style*="min-height: 250px"] { min-height: 0 !important; padding: 14px !important; border-radius: 18px !important; gap: 6px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"] > div[style*="min-height: 250px"] > span:first-child { font-size: 12px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"] > div[style*="min-height: 250px"] h3 { font-size: 16px !important; margin-top: 10px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"] > div[style*="min-height: 250px"] p { font-size: 13px !important; line-height: 1.4 !important; }
  .mhc-visits { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .mhc-visits > div { padding: 12px !important; border-radius: 16px !important; gap: 10px !important; }
  .mhc-visits > div > :first-child { width: 34px !important; height: 34px !important; flex: none; }
  .mhc-visits > div > div > div:first-child { font-size: 15px !important; }
  .mhc-visits > div > div > div:last-child { font-size: 12.5px !important; }

  /* ---------- Rings (1 hour, 24 hours, 42 hrs ...) side by side ---------- */
  div[style*="minmax(min(100%, 180px)"] { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)) !important; gap: 18px 8px !important; }
  div[style*="minmax(min(100%, 180px)"] > div { gap: 6px !important; }
  div[style*="minmax(min(100%, 180px)"] > div > div:first-child { zoom: .52; }
  div[style*="minmax(min(100%, 180px)"] > div > span { font-size: 12.5px !important; line-height: 1.3 !important; }
  div[style*="margin: 0px 0px 56px"], div[style*="margin: 8px 0px 56px"] { margin-bottom: 28px !important; }

  /* ---------- Careers benefits list: two to a row ---------- */
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"]:has(> div[style*="min-height: 150px"]) { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div[style*="min-height: 150px"] { min-height: 0 !important; padding: 12px !important; border-radius: 16px !important; gap: 8px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div[style*="min-height: 150px"] > :first-child { width: 26px !important; height: 26px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div[style*="min-height: 150px"] span[style*="font-size: 19px"] { font-size: 14.5px !important; }

  /* ---------- Meet the team: photo beside the words ---------- */
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"]:has(> div > div[style*="aspect-ratio: 1 / 1"]) { gap: 8px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div:has(> div[style*="aspect-ratio: 1 / 1"]) { display: grid !important; grid-template-columns: 96px 1fr; align-items: start; gap: 12px !important; padding: 8px !important; border-radius: 20px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div > div[style*="aspect-ratio: 1 / 1"] { aspect-ratio: 4 / 5 !important; border-radius: 14px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div > div[style*="padding: 0px 12px 14px"] { padding: 4px 6px 4px 0 !important; gap: 2px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div > div h3 { font-size: 16px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div > div span { font-size: 12.5px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 230px)"] > div > div p { font-size: 13px !important; line-height: 1.45 !important; margin-top: 4px !important; }
  div[style*="border-radius: 36px"]:has(> div[style*="aspect-ratio: 1 / 1"]) { display: grid !important; grid-template-columns: 110px 1fr; align-items: start; gap: 12px !important; padding: 10px !important; border-radius: 22px !important; }
  div[style*="border-radius: 36px"] > div[style*="aspect-ratio: 1 / 1"] { width: 110px !important; aspect-ratio: 4 / 5 !important; border-radius: 16px !important; }
  div[style*="border-radius: 36px"] > div[style*="flex: 1 1 320px"] { padding: 2px 4px 4px 0 !important; gap: 4px !important; min-width: 0; }
  div[style*="border-radius: 36px"] > div[style*="flex: 1 1 320px"] h2 { font-size: 19px !important; margin: 0 !important; }
  div[style*="border-radius: 36px"] > div[style*="flex: 1 1 320px"] > span { font-size: 12px !important; padding: 3px 9px !important; }
  div[style*="border-radius: 36px"] > div[style*="flex: 1 1 320px"] p { font-size: 13px !important; line-height: 1.45 !important; }

  /* ---------- Pathway to Care ---------- */
  div[style*="minmax(min(100%, 210px)"]:not(.mhc-tiles) { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  div[style*="minmax(min(100%, 210px)"]:not(.mhc-tiles) > div { padding: 14px !important; border-radius: 18px !important; }
  div[style*="minmax(min(100%, 210px)"]:not(.mhc-tiles) > div > span:first-child { font-size: 10.5px !important; letter-spacing: .08em !important; }
  span[style*="font-size: clamp(60px"] { font-size: 46px !important; }
  div[style*="minmax(min(100%, 210px)"]:not(.mhc-tiles) > div > span:last-child { font-size: 13px !important; line-height: 1.4 !important; }
  div[style*="minmax(min(100%, 220px)"] { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  div[style*="minmax(min(100%, 220px)"] > div { padding: 12px 10px !important; border-radius: 16px !important; gap: 4px !important; }
  div[style*="minmax(min(100%, 220px)"] span[style*="font-size: 28px"] { font-size: 16px !important; }
  div[style*="minmax(min(100%, 220px)"] span[style*="font-size: 16px"] { font-size: 12px !important; line-height: 1.3 !important; }
  div[style*="minmax(min(100%, 260px)"] { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  div[style*="minmax(min(100%, 260px)"] > div { padding: 14px !important; border-radius: 18px !important; gap: 2px !important; }
  div[style*="minmax(min(100%, 260px)"] > div:nth-child(3):last-child { grid-column: 1 / -1; }
  div[style*="minmax(min(100%, 260px)"] span[style*="font-size: 17px"] { font-size: 13.5px !important; }
  div[style*="minmax(min(100%, 260px)"] span[style*="font-size: clamp(44px"] { font-size: 28px !important; margin-top: 2px !important; }
  div[style*="minmax(min(100%, 260px)"] span[style*="font-size: 16px"] { font-size: 12.5px !important; }
  /* Network of organisations: swipe sideways */
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"])) { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px !important; margin: 0 -24px; padding: 0 24px 6px; scrollbar-width: none; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"]))::-webkit-scrollbar { display: none; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"])) > div { flex: 0 0 82%; scroll-snap-align: center; padding: 16px !important; border-radius: 20px !important; gap: 8px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"])) h3 { font-size: 16.5px !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"])) p { font-size: 13.5px !important; line-height: 1.45 !important; }
  div[style*="repeat(auto-fill, minmax(min(100%, 300px)"]:not(:has(> div[style*="min-height: 250px"])) > div > div:last-child { font-size: 13.5px !important; padding-top: 8px !important; }
}
