/* Shared mobile layout guardrails for DiYou Education pages. */
@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  #root,
  .site-shell,
  main,
  main > div,
  main > section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  main > div,
  main > section,
  main .container,
  main [class*="container"] {
    padding-left: 20px;
    padding-right: 20px;
  }

  main [class*="grid"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  main [class*="flex"],
  main [class*="grid"] > *,
  main [class*="flex"] > * {
    min-width: 0;
    max-width: 100%;
  }

  main h1,
  main h2,
  main h3,
  main p,
  main li,
  main a,
  main strong,
  main span {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  main h1 {
    font-size: clamp(2rem, 9vw, 2.65rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.02em;
  }

  main p,
  main li {
    width: 100%;
    font-size: 1rem;
    line-height: 1.8;
  }

  main img,
  main picture,
  main picture img,
  main svg {
    display: block;
    max-width: 100%;
  }

  main img,
  main picture img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .site-header,
  .native-static-header {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    min-width: 0;
    box-sizing: border-box;
  }

  .site-header > *,
  .native-static-header > *,
  .brand,
  .brand > span,
  .header-actions,
  .mobile-menu {
    min-width: 0;
    max-width: 100%;
  }

  .brand {
    flex: 1 1 auto;
    overflow: visible;
  }

  .brand > span {
    overflow: hidden;
  }

  .brand small,
  .brand-tagline,
  .brand-tagline-wide,
  .brand-tagline-mobile,
  .native-static-header .brand small {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .header-actions {
    flex: 0 1 auto;
  }

  .family-hero,
  .content-width,
  .site-footer {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    min-width: 0;
    box-sizing: border-box;
  }

  .family-hero img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}
