/* Ledra College — current shared responsive implementation.
   Homepage-derived rule: use desktop horizontal space deliberately and recompose only when the
   actual composition no longer fits. Equal peers reduce columns progressively; editorial,
   discovery and conversion compositions remain side-by-side through compact-laptop widths.
   Legacy filename retained during V1 migration; this is the current responsive owner. */

@media(max-width:1100px){
  /* Complex Home/programme compositions remain horizontal at compact-laptop widths, but every
     internal grid/flex item must be allowed to shrink inside the viewport instead of widening it. */
  main,
  main section,
  main div,
  main article,
  main aside,
  main figure{min-width:0}
  main img{max-width:100%}

  /* Home's three editorial news cards no longer fit the accepted shell at compact-laptop width.
     Reduce only this peer grid to two tracks; the existing mobile rule still takes it to one. */
  .home-page .edu-news-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  [data-ledra-scheme="programme-cards"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  [data-ledra-scheme="route-cards"],
  [data-ledra-scheme="information-cards"],
  [data-ledra-scheme="process-steps"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .filter-buttons{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .core-image-grid-four,
  .student-life-gallery-grid,
  .campus-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  .content-accreditation-table,
  .content-fee-table{max-width:100%!important;overflow-x:auto!important;overscroll-behavior-inline:contain!important}
}

/* The scheme layer still contains conservative migration-era fallbacks. The responsive owner
   resolves the actual current behaviour at compact-laptop width: preserve the Home-derived
   horizontal relationship while readable space remains. */
@media(min-width:901px) and (max-width:1100px){
  [data-ledra-scheme="editorial-split"],
  .content-split[data-ledra-scheme="editorial-split"]{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  /* Legacy programme media carried an intrinsic/fixed width beyond its grid track. Let the current
     editorial media occupy, but never exceed, the track at compact-laptop widths. */
  [data-ledra-scheme="editorial-split"]>.content-image,
  .content-split[data-ledra-scheme="editorial-split"]>.content-image{
    width:100%!important;
    max-width:100%!important;
    justify-self:stretch!important;
  }
  [data-ledra-scheme="discovery-controls"]{
    grid-template-columns:minmax(18rem,24rem) minmax(0,1fr)!important;
    align-items:end!important;
  }
  [data-ledra-scheme="discovery-controls"] .directory-filter-groups{
    width:min(100%,32rem)!important;
    max-width:32rem!important;
    justify-self:end!important;
  }
  .contact-hub[data-ledra-scheme="conversion-split"]{
    grid-template-columns:minmax(300px,.82fr) minmax(0,1.18fr)!important;
  }
}

/* Recompose closer to tablet rather than at compact-laptop width. */
@media(max-width:900px){
  [data-ledra-scheme="editorial-split"],
  .content-split[data-ledra-scheme="editorial-split"]{
    grid-template-columns:minmax(0,1fr)!important;
    gap:34px!important;
  }
  [data-ledra-scheme="editorial-split"] figure,
  .content-split[data-ledra-scheme="editorial-split"] figure{
    width:100%!important;
    max-width:none!important;
  }

  [data-ledra-scheme="discovery-controls"]{
    grid-template-columns:minmax(0,1fr)!important;
    align-items:start!important;
  }
  [data-ledra-scheme="discovery-controls"] .directory-filter-groups{
    width:100%!important;
    max-width:none!important;
    justify-self:stretch!important;
  }

  .contact-hub[data-ledra-scheme="conversion-split"]{
    grid-template-columns:minmax(0,1fr)!important;
    gap:42px!important;
  }
  .contact-hub[data-ledra-scheme="conversion-split"] .contact-hub-intro,
  .contact-hub[data-ledra-scheme="conversion-split"] .contact-hub-card{min-width:0!important;width:100%!important}

  .rollout-hero-with-media,
  .institution-family-hero.rollout-hero-with-media,
  .student-family-hero.rollout-hero-with-media,
  .conversion-family-hero.rollout-hero-with-media{
    grid-template-columns:minmax(0,1fr)!important;
    gap:34px!important;
  }
}

@media(max-width:760px){
  .home-page .edu-news-grid{grid-template-columns:minmax(0,1fr)!important}

  [data-ledra-scheme="programme-cards"],
  [data-ledra-scheme="route-cards"],
  [data-ledra-scheme="information-cards"],
  [data-ledra-scheme="process-steps"]{
    grid-template-columns:minmax(0,1fr)!important;
  }

  [data-ledra-scheme="programme-cards"]>*,
  [data-ledra-scheme="route-cards"]>*,
  [data-ledra-scheme="information-cards"]>*,
  [data-ledra-scheme="process-steps"]>*{
    min-height:0!important;
    height:auto!important;
  }

  [data-ledra-scheme="editorial-split"],
  .contact-hub[data-ledra-scheme="conversion-split"]{gap:26px!important}

  .filter-bar{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
  .directory-filter-groups{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  .filter-separator{display:none!important}
  .filter-buttons{grid-template-columns:minmax(0,1fr)!important}
  .filter-button{width:100%!important;min-height:44px!important}
  .search-field input{width:100%!important;min-height:44px!important}

  .form-grid,
  .form-grid-two{grid-template-columns:minmax(0,1fr)!important}
  .form-span-two{grid-column:auto!important}
  .contact-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .contact-tabs button{min-height:52px!important}

  .core-image-grid-four,
  .student-life-gallery-grid,
  .campus-gallery-grid{grid-template-columns:minmax(0,1fr)!important}

  .programme-directory-cta-image,
  .institution-contact-image,
  .student-contact-image,
  .apply-contact-image{width:100%!important;max-width:none!important}

  .button,
  .button-primary,
  .button-secondary{min-height:44px!important}

  img{height:auto}
}

@media(max-width:520px){
  .contact-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .breadcrumbs.section-shell{align-items:flex-start!important}
}
