/* =========================================================
   MUGR homepage — responsive layer (2026-11-30)
   Loaded last. One section per screen range; tested at
   1920×1080, 1366×768, 1024×768, 768×1024, 390×844, 360×800,
   375×667 and phones in landscape.
   ========================================================= */

/* ---------- Small desktop / iPad landscape: 992–1199px ----------
   Bootstrap's col-lg-* only sit side by side from 1200px, so the
   hero and "Who are you?" stacked and pushed the finder off-screen. */
@media (min-width:992px) and (max-width:1199px){
  body.body-index-page .scrollable-home .intro>.row>[class*="col-lg-"]{float:left;position:relative;min-height:1px}
  body.body-index-page .scrollable-home .intro>.row>.col-lg-1{width:4%}
  body.body-index-page .scrollable-home .intro>.row>.col-lg-6{width:54%}
  body.body-index-page .scrollable-home .intro>.row>.col-lg-5{width:42%}
}
@media (min-width:992px) and (max-width:1199px){
  /* Scale the desktop type down so both columns fit.
     "html body…body-fullpage" outranks the per-language font rules in style-css-custom-index-68.css. */
  html body.body-index-page.body-fullpage .scrollable-home .vertical-centred{padding-top:72px!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero{top:0!important}
  html body.body-index-page.body-fullpage .intro .navbar-brand-main .brand-img-white{width:170px!important;max-width:170px!important}
  html body.body-index-page.body-fullpage .intro .title-intro-page,
  html body.body-index-page.body-fullpage .intro .title-intro-page .sub-title-intro-page,
  html body.body-index-page.body-fullpage #whoAreYouTitle{font-size:34px!important;line-height:1.12!important}
  html body.body-index-page.body-fullpage .intro .h3{font-size:24px!important}
  html body.body-index-page.body-fullpage .intro .h5{font-size:17px!important;line-height:1.35!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul li a{font-size:27px!important;line-height:1.2!important;min-height:0!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u .faculty-staff-subtitle{font-size:13px!important}
  html body.body-index-page.body-fullpage .desktop-home-nav .navbar-nav>li>a{font-size:17px!important;padding-left:8px!important;padding-right:8px!important}
  html body.body-index-page.body-fullpage .navbar-main-custom li.homepage-language-pills{margin-left:8px!important}
}

/* ---------- All desktop sizes (>=992px) ---------- */
@media (min-width:992px){
  /* Keep the bottom of the hero clear of the cookie bar (height set by mugr-cookie.js). */
  body.body-index-page .pp-scrollable.scrollable-home{height:calc(100% - var(--mugr-cookie-h,0px))!important}
  /* Right edge: contact buttons + accessibility button form one column;
     the programme card sits left of that column instead of under it. */
  body.body-index-page .sbuttons{bottom:calc(110px + var(--mugr-cookie-h,0px))!important}
  body.body-index-page #sdgsAccessibilityWidget{right:20px!important;bottom:calc(24px + var(--mugr-cookie-h,0px))!important}
  body.body-index-page .mugr-discovery{right:100px!important}
  /* The copyright row is positioned from the full screen height, not the shortened hero: lift it too. */
  body.body-index-page .scrollable-home .copy-bottom{transform:translateY(calc(-1 * max(0px, var(--mugr-cookie-h,0px) - 34px * var(--mugr-zoom,1)) / var(--mugr-zoom,1)))}
}
@media (min-width:992px) and (max-width:1199px){
  html body.body-index-page.body-fullpage .mugr-discovery-title{font-size:15px!important}
  html body.body-index-page.body-fullpage .mugr-discovery-card{padding:11px 13px!important}
}

/* ---------- Tablet portrait + phones (<=991px) ---------- */
@media (max-width:991px){
  /* Hero: one clear hierarchy instead of four equal-size lines. */
  html body.body-index-page.body-fullpage .intro .title-intro-page,
  html body.body-index-page.body-fullpage .intro .title-intro-page .sub-title-intro-page{font-size:clamp(34px,9vw,48px)!important;line-height:1.15!important}
  html body.body-index-page.body-fullpage #mugr-main-content .intro .title-intro-page .mugr-admission-year-mobile{display:none!important} /* the next line already says ปีการศึกษา 1/2570 */
  html body.body-index-page.body-fullpage .intro .h3{font-size:clamp(25px,6.6vw,32px)!important;line-height:1.2!important;margin-top:4px!important}
  html body.body-index-page.body-fullpage .intro .h5{font-size:clamp(17.5px,4.6vw,21px)!important;line-height:1.45!important}
  /* "สมัครเรียน": same outlined gold capsule as desktop, sized to its label. */
  html body.body-index-page.body-fullpage #applyBtn{
    display:inline-flex!important;align-items:center;justify-content:center;gap:10px;
    width:auto!important;max-width:none;min-height:50px;margin:16px 0 0!important;padding:0 24px!important;
    border:1px solid rgba(255,213,68,.72);border-radius:999px;
    background:linear-gradient(135deg,rgba(246,199,70,.18),rgba(246,199,70,.05));color:#ffe46b!important;
    font-size:24px!important;font-weight:700!important;line-height:1!important;
    text-shadow:0 1px 12px rgba(0,0,0,.55)!important;
    box-shadow:0 8px 28px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.12);
    -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
  html body.body-index-page.body-fullpage #applyBtn i{font-size:26px!important;line-height:1!important;color:inherit!important}
  html body.body-index-page.body-fullpage #applyBtn:active{background:#f6c746;color:#172449!important;text-shadow:none!important}
  /* "Who are you?" list: readable, not poster-size. */
  html body.body-index-page.body-fullpage #whoAreYouTitle{font-size:clamp(31px,8vw,40px)!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul{margin-bottom:6px!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul li{margin:0!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul li a{font-size:clamp(23px,6.1vw,29px)!important;line-height:1.25!important;min-height:0!important;padding:9px 0!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u .mugr-audience-link>img{top:2px!important;width:26px;height:26px}
  html body.body-index-page.body-fullpage .wrapper-who-r-u .faculty-staff-subtitle{font-size:13.5px!important;margin-top:3px!important}

  /* Mobile drawer: hide the cookie bar while the menu is open (it covered the menu),
     and keep the language pills off the logo on narrow phones. */
  body.body-index-page:has(#navbar-collapse-custom.mugr-home-mobile-drawer.in) #mugrCookieBar{display:none!important}
  #navbar-collapse-custom .mugr-mobile-brand{max-width:calc(100% - 150px)!important}
  #navbar-collapse-custom .mugr-mobile-brand img{max-width:100%!important}

  /* Quick contact row in the drawer (the floating contact buttons are desktop-only). */
  #navbar-collapse-custom .mugr-mobile-contact{display:grid!important;grid-template-columns:repeat(3,1fr);gap:8px;padding:4px 20px 24px;background:#fff}
  #navbar-collapse-custom.mugr-home-mobile-drawer .mugr-mobile-contact a{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border-radius:10px;background:#f0f4fb;color:#16233a!important;font-size:14px!important;font-weight:700;text-decoration:none!important;background:#f0f4fb!important}
  #navbar-collapse-custom .mugr-mobile-contact .mugr-ico{width:24px;height:24px;color:#1677d2}
  #navbar-collapse-custom .mugr-mobile-contact-title{grid-column:1/-1;margin:0 0 2px;color:#16233a;font-size:16px;font-weight:700}
}

/* ---------- Phones in landscape (short screens) ---------- */
@media (max-width:991px) and (max-height:500px) and (orientation:landscape){
  body.body-index-page{--mugr-mobile-header-h:52px}
  html body.body-index-page.body-fullpage .scrollable-home .vertical-centred{padding-top:72px!important}
  html body.body-index-page.body-fullpage .intro .title-intro-page,
  html body.body-index-page.body-fullpage .intro .title-intro-page .sub-title-intro-page{font-size:26px!important}
  html body.body-index-page.body-fullpage .intro .h3{font-size:20px!important}
  html body.body-index-page.body-fullpage .intro .h5{font-size:15px!important}
  html body.body-index-page.body-fullpage #applyBtn{min-height:44px;font-size:21px!important}
  /* Use the empty right half: headline on the left, "Online Application" + Apply on the right. */
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero{
    display:grid!important;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:6vw;align-items:start;
    width:100%!important;float:none!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>.navbar-brand-main,
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>br{display:none!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>h1{grid-column:1;grid-row:1/span 2;margin:0!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>.h3{grid-column:2;grid-row:1;align-self:start;display:block;margin:0!important;line-height:1.15!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p{grid-column:2;grid-row:2;align-self:start;margin:6px 0 0!important}
  html body.body-index-page.body-fullpage .intro .title-intro-page,
  html body.body-index-page.body-fullpage .intro .title-intro-page .sub-title-intro-page{font-size:clamp(26px,4.4vw,34px)!important}
  html body.body-index-page.body-fullpage .intro .h3{font-size:clamp(20px,3vw,24px)!important}
  html body.body-index-page.body-fullpage .intro .h5{font-size:clamp(14.5px,2.1vw,17px)!important}
  html body.body-index-page.body-fullpage .scrollable-home .vertical-centred{padding-top:84px!important}
  /* Both columns now sit on the photo: darken it evenly so white text stays readable. */
  body.body-index-page .scrollable-home .mugr-discovery-bg::after{background:rgba(7,19,45,.62)!important}
}

/* ---------- Cookie bar on phones: compact (it covered ~20% of the screen) ---------- */
@media (max-width:767px), (max-height:500px){
  body.body-index-page #mugrCookieBar .mugr-cookie-mu__inner{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 12px!important;padding:8px 12px!important}
  body.body-index-page #mugrCookieBar .mugr-cookie-mu__text{flex:1 1 100%;font-size:14px!important;line-height:1.35!important}
  body.body-index-page #mugrCookieBar .mugr-cookie-mu__actions{flex:1 1 100%;margin:0!important;justify-content:flex-end;gap:8px!important}
  body.body-index-page #mugrCookieBar .mugr-cookie-accept,
  body.body-index-page #mugrCookieBar .mugr-cookie-linkbtn{min-height:34px!important;padding:6px 14px!important;font-size:13px!important}
}
@media (max-height:500px) and (orientation:landscape){
  body.body-index-page #mugrCookieBar .mugr-cookie-mu__text{flex:1 1 0}
  body.body-index-page #mugrCookieBar .mugr-cookie-mu__actions{flex:0 0 auto}
}

/* ---------- Right edge on desktop: accessibility button pinned to the bottom ----------
   homepage-accessibility.css places it at top:calc(50% + 230–290px), which lands on the
   contact buttons on tall screens (e.g. 2560×1440). Pin it to the bottom instead. */
@media (min-width:992px){
  body.body-index-page #sdgsAccessibilityWidget{top:auto!important}
}

/* ---------- Large screens: scale the homepage proportionally ----------
   The layout is tuned for ~1366–1600px. On bigger screens the same
   design is enlarged with CSS zoom, in steps, only when the screen is
   also tall enough for the larger content. --mugr-zoom is read by
   mugr-home.js so its alignment maths stays correct. */
@media (min-width:1680px) and (min-height:900px){ body.body-index-page{--mugr-zoom:1.1} }
@media (min-width:1900px) and (min-height:1000px){ body.body-index-page{--mugr-zoom:1.2} }
@media (min-width:2200px) and (min-height:1150px){ body.body-index-page{--mugr-zoom:1.4} }
@media (min-width:2500px) and (min-height:1350px){ body.body-index-page{--mugr-zoom:1.6} }
@media (min-width:3200px) and (min-height:1700px){ body.body-index-page{--mugr-zoom:2} }
@media (min-width:3700px) and (min-height:2000px){ body.body-index-page{--mugr-zoom:2.3} }
@media (min-width:1680px) and (min-height:900px){
  body.body-index-page .scrollable-home .intro,
  body.body-index-page .scrollable-home .mugr-discovery-finder,
  body.body-index-page .scrollable-home .mugr-discovery,
  body.body-index-page .scrollable-home .copy-bottom,
  body.body-index-page #navbar-collapse-desktop,
  body.body-index-page .sbuttons,
  body.body-index-page #sdgsAccessibilityWidget,
  body.body-index-page #mugrCookieBar{zoom:var(--mugr-zoom,1)}
}

/* ---------- Tablets held upright ----------
   The phone layout looked small with a large empty area below it on
   iPad / Galaxy Tab in portrait. Enlarge it the same way as large desktops. */
@media (min-width:700px) and (max-width:991px) and (orientation:portrait){
  body.body-index-page{--mugr-tab-zoom:1.25}
  body.body-index-page .scrollable-home .intro,
  body.body-index-page .scrollable-home .mugr-discovery-finder,
  body.body-index-page .scrollable-home .mugr-discovery{zoom:var(--mugr-tab-zoom)}
  html body.body-index-page.body-fullpage .scrollable-home .vertical-centred{padding-top:9vh!important}
  html body.body-index-page.body-fullpage .scrollable-home .wrapper-who-r-u{margin-top:3vh!important}
}
@media (min-width:790px) and (max-width:991px) and (min-height:1150px) and (orientation:portrait){
  body.body-index-page{--mugr-tab-zoom:1.35}
}
/* iPad Pro 12.9" upright (1024×1366): keep the two-column desktop layout (zooming it
   made the menu and finder wrap) but use larger type so it fills the taller screen. */
@media (min-width:992px) and (max-width:1199px) and (min-height:1200px) and (orientation:portrait){
  html body.body-index-page.body-fullpage .intro .title-intro-page,
  html body.body-index-page.body-fullpage .intro .title-intro-page .sub-title-intro-page,
  html body.body-index-page.body-fullpage #whoAreYouTitle{font-size:42px!important}
  html body.body-index-page.body-fullpage .intro .h3{font-size:28px!important}
  html body.body-index-page.body-fullpage .intro .h5{font-size:20px!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul li a{font-size:32px!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u .faculty-staff-subtitle{font-size:15px!important}
  html body.body-index-page.body-fullpage .intro .navbar-brand-main .brand-img-white{width:210px!important;max-width:210px!important}
  html body.body-index-page.body-fullpage #applyBtn{font-size:22px!important;height:48px!important;line-height:48px!important}
}

/* Phones upright: less empty space between the header and the headline. */
@media (max-width:767px) and (orientation:portrait){
  html body.body-index-page.body-fullpage .scrollable-home .vertical-centred{padding-top:78px!important}
  html body.body-index-page.body-fullpage .scrollable-home .intro>.row>.mugr-admissions-hero{padding-top:6px!important}
}

/* Phones / tablets upright: Apply button sits to the right of the "สมัครออนไลน์" text,
   so the "คุณคือใคร?" block moves up (request from งานรับเข้าศึกษา). */
@media (max-width:991px) and (orientation:portrait){
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5{display:flex!important;align-items:center;gap:12px}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5>.mugr-apply-copy{flex:1 1 auto;min-width:0}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5>.mugr-apply-copy>br:last-child{display:none}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5 #applyBtn{
    flex:0 0 auto;margin:0!important;min-height:46px;padding:0 16px!important;font-size:21px!important;white-space:nowrap}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5 #applyBtn i{font-size:22px!important}
}

/* Stop Android Chrome "font boosting" from enlarging hero text beyond the design
   (it made "หลักสูตรนานาชาติ & หลักสูตรไทย" wrap on real phones). */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

@media (max-width:767px) and (orientation:portrait){
  /* Each line of the "สมัครออนไลน์" copy stays on one line. */
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5>.mugr-apply-copy{white-space:nowrap;font-size:clamp(14px,4.1vw,17px)!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>p.h5 #applyBtn{padding:0 14px!important;font-size:clamp(18px,5vw,21px)!important;gap:8px}
  /* Pull "คุณคือใคร?" up: tighter gaps between headline, online-application block and the card. */
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>h1+br{display:none!important}
  html body.body-index-page.body-fullpage .scrollable-home .mugr-admissions-hero>.h3{display:block;margin-top:14px!important}
  html body.body-index-page.body-fullpage .scrollable-home .intro>.row>.mugr-admissions-hero{padding-bottom:14px!important}
  html body.body-index-page.body-fullpage .scrollable-home .wrapper-who-r-u{padding-top:12px!important}
  html body.body-index-page.body-fullpage .wrapper-who-r-u ul li a{padding:7px 0!important}
}
