/* MUI Subang PRD 0.4.8 — short landscape viewports.
 * Scoped to the isolated staging install by PHP enqueue guard.
 * No global overflow clipping and no edits to FSE template parts.
 * Core/navigation controls remain native WordPress UI. */
@media screen and (orientation:landscape) and (min-width:600px) and (max-width:1024px) and (max-height:560px) {
  /* Make short-screen landscape resemble a readable tablet, not a stretched phone. */
  body .muisubang-prd-v3--active {
    max-width:calc(100% - 20px) !important;
    margin-bottom:20px;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero {
    padding:24px clamp(20px,3vw,30px);
    gap:18px;
    align-items:start;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero :is(h1,h2) {
    font-size:clamp(1.65rem,3.5vw,2.4rem);
    line-height:1.17;
    margin-bottom:12px;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-eyebrow {margin-bottom:8px !important;}
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-desc {
    font-size:1rem !important;line-height:1.55 !important;margin-bottom:15px !important;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-side {
    padding:18px 20px;
    max-width:none;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-side :is(h3,p) {margin-bottom:8px;}
  body .muisubang-prd-v3--active .muisubang-prd {
    padding:clamp(22px,3vw,32px) 24px;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__section-head {margin-bottom:18px;}
  body .muisubang-prd-v3--active .muisubang-prd-v3__services {gap:12px;}
  body .muisubang-prd-v3--active .muisubang-prd-v3__service {
    min-height:142px;
    padding:15px 14px;
    gap:7px;
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__service strong {font-size:1rem;}
  body .muisubang-prd-v3--active .muisubang-prd-v3__article-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__article-card {padding:18px;}
  body .muisubang-prd-v3--active .muisubang-prd-v3__midgrid {gap:12px;}
  body footer.wp-block-template-part .mui-footer-v2 {
    padding:28px 24px calc(48px + env(safe-area-inset-bottom,0px));
  }
  body footer.wp-block-template-part .mui-footer-v2 .mui-footer-v2__grid {
    gap:18px;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  /* Chat remains accessible; constrain the existing modal to short viewport. */
  body #muiChatTrigger.mui-chat-trigger-btn {
    right:calc(14px + env(safe-area-inset-right,0px)) !important;
    bottom:calc(10px + env(safe-area-inset-bottom,0px) + var(--mui-prd-chat-lift,0px)) !important;
  }
  body #muiChatModal.mui-chat-modal {
    width:min(430px,calc(100vw - 40px)) !important;
    height:calc(100dvh - 12px - env(safe-area-inset-bottom,0px)) !important;
    max-height:calc(100dvh - 12px - env(safe-area-inset-bottom,0px)) !important;
    bottom:calc(6px + env(safe-area-inset-bottom,0px)) !important;
    border-radius:12px !important;
  }
  body #muiChatModal :is(.mui-chat-content,.mui-chat-messages,.mui-chat-body,.chat-messages) {
    min-height:0;overflow-y:auto;overscroll-behavior:contain;
  }
  /* Menu is scrollable on low-height screens: original focus / ESC is untouched. */
  body .wp-block-navigation__responsive-container.is-menu-open {
    max-height:100dvh;
    overflow-y:auto;
  }
  body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top:44px !important;
    padding-bottom:calc(12px + env(safe-area-inset-bottom,0px)) !important;
  }
  body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    min-height:44px !important;
    padding-block:8px !important;
  }
}
@media screen and (orientation:landscape) and (min-width:800px) and (max-width:1024px) and (max-height:560px) {
  /* Wider landscape has sufficient width for a compact two-column hero. */
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero {
    grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);
  }
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-side {max-width:none;}
}
@media screen and (orientation:landscape) and (min-width:600px) and (max-width:799px) and (max-height:560px) {
  /* At 724x375 two equal columns make the H1 unreadably narrow. */
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero {grid-template-columns:minmax(0,1fr);}
  body .muisubang-prd-v3--active .muisubang-prd-v3__hero-side {width:100%;}
}
@media screen and (orientation:landscape) and (max-height:430px) and (min-width:600px) {
  body #muiChatModal .muisubang-prd-chat-note {font-size:11px;line-height:1.35;padding:5px 11px;}
}
@media(prefers-reduced-motion:reduce) {
  body .muisubang-prd-v3--active * {scroll-behavior:auto!important;}
}

/* v0.4.9: avoid a two-line header in low-height narrow-landscape.
 * Uses existing WordPress core/navigation responsive controls, not a duplicate menu.
 * Native modal handling (focus/ESC) remains owned by WordPress. */
@media screen and (orientation:landscape) and (min-width:600px) and (max-width:799px) and (max-height:430px) {
  body header.wp-block-template-part .wp-block-navigation { min-width:0 !important; flex-wrap:nowrap !important; }
  body header.wp-block-template-part .wp-block-navigation__responsive-container:not(.is-menu-open) { display:none !important; }
  body header.wp-block-template-part .wp-block-navigation__responsive-container-open { display:inline-flex !important; align-items:center !important; justify-content:center !important; min-width:44px; min-height:44px; }
  body header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open { display:flex !important; }
  body header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {padding-top:52px !important;}
}
