/* PHIMAI HEALTH | ผู้พัฒนาระบบ : นายวิษณุ เสาะสาย | ตำแหน่ง : เจ้าพนักงานธุรการ */
/* Mobile/tablet only: desktop geometry remains controlled by the original theme. */
@media screen and (max-width:1199.98px){
 .homepage .hero-header.hero-unified[data-president-layout]{display:flex!important;flex-direction:column!important;align-items:center;min-height:0;gap:20px;padding-bottom:24px!important}
 .homepage [data-president-layout]>.hero-circuit__content{order:1;width:100%;flex:none;padding-bottom:0!important}
 .homepage [data-president-layout]>.hero-president-panel{order:2;position:relative;inset:auto;bottom:auto;top:auto;left:auto;right:auto;width:calc(100% - 32px);max-width:520px;margin:0 auto;flex:none;transform:none}
 .homepage .hero-header.hero-unified[data-president-layout] .hero-president-panel>.hero-president{width:100%!important;height:clamp(320px,58vw,var(--president-mobile-size,420px))!important;object-fit:contain;object-position:center bottom}
 .homepage .hero-header[data-president-layout]>.hero-promotions{order:3;position:relative;inset:auto;left:auto;bottom:auto;flex:none;align-self:center;width:min(680px,100%);max-width:100%;margin:8px auto 0;padding:0 16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;z-index:7;transform:none}
 .homepage .hero-promotions .hero-promotion{min-width:0;max-width:100%}
 .homepage .hero-promotions img{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:3/2;object-fit:contain}
 /* Common layouts retain their original data and menus; contain wide content. */
 .phimai-app .shell-main,.phimai-app #mainContent,.phimai-app #main-content{min-width:0;max-width:100%}
 .phimai-app :is(.management-switcher-links,.settings-jump,.pa-tools){max-width:100%;flex-wrap:wrap}
 .phimai-app :is(.table-responsive,.table-wrap){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .phimai-app :is(input,select,textarea){max-width:100%;min-width:0}
 .phimai-app :is(.card,.settings-panel){min-width:0}
 .phimai-app :is(.header-title,.card p,.card h2,.card h3){overflow-wrap:anywhere}
}
@media screen and (max-width:575.98px){
 .homepage .hero-header.hero-unified[data-president-layout]{gap:16px;padding-bottom:20px!important}
 .homepage [data-president-layout]>.hero-president-panel{width:100%;max-width:420px}
 .homepage .hero-header[data-president-layout]>.hero-promotions{gap:8px;padding:0 12px;margin-top:4px}
 .phimai-app .settings-jump{overflow-x:auto}
}

/* Seamless cutout images on all devices; retain keyboard focus outlines. */
.homepage .hero-header .hero-promotions,
.homepage .hero-header .hero-promotions .hero-promotion,
.homepage .hero-header .hero-promotions .hero-promotion a,
.homepage .hero-header .hero-promotions .hero-promotion img{
 background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
}
/* Keep promotional images in normal flow below the CTA row on desktop. */
@media screen and (min-width:1200px){
 .homepage .hero-header.hero-unified[data-president-layout]:has(>.hero-promotions){display:flex!important;flex-direction:column!important;align-items:stretch;justify-content:center;padding-bottom:18px!important;gap:0}
 .homepage .hero-header.hero-unified[data-president-layout]:has(>.hero-promotions)>.hero-circuit__content{flex:none;width:100%;padding-bottom:22px!important}
 .homepage .hero-header.hero-unified[data-president-layout]>.hero-promotions{position:relative!important;inset:auto!important;left:auto!important;bottom:auto!important;order:3;flex:none;align-self:flex-start;width:min(50%,680px);max-width:calc(100% - 48px);margin:0 0 0 max(24px,calc((100% - 1320px)/2 + 12px));padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;z-index:5;transform:none}
 .homepage .hero-header .hero-promotions img{height:clamp(150px,13vw,190px);width:100%;object-fit:contain;object-position:center bottom;aspect-ratio:auto}
}
