/* Stable desktop and iPad navigation */
.desktop-nav a,
.nav-check-cta,
.nav-account,
.nav-user-toggle{
  white-space:nowrap;
}
.desktop-nav,
.desktop-actions,
.nav-user{
  flex-shrink:0;
}
.nav-user{
  position:relative;
}
.nav-user-toggle{
  min-height:42px;
  padding:10px 13px;
  border:1px solid #dfe5ee;
  border-radius:9px;
  background:#fff;
  color:#152a49;
  font:700 .85rem/1.2 'Noto Sans Thai',system-ui,sans-serif;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:7px;
}
.nav-user-toggle:hover,
.nav-user-toggle[aria-expanded="true"]{
  border-color:#b9c7d8;
  background:#f6f8fb;
}
.nav-user-toggle span{
  font-size:1rem;
  line-height:1;
}
.nav-user-dropdown{
  display:none;
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  z-index:140;
  width:190px;
  padding:7px;
  border:1px solid #dfe5ee;
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 38px rgba(17,38,68,.16);
}
.nav-user-dropdown.open{
  display:grid;
}
.nav-user-dropdown a{
  padding:11px 12px;
  border-radius:8px;
  color:#152a49;
  font-size:.88rem;
  font-weight:700;
  white-space:nowrap;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown a:focus-visible{
  background:#eef3f8;
  color:#b4232d;
}

/* iPad and compact laptop: retain a horizontal menu without squeezing Thai words. */
@media (min-width:1041px) and (max-width:1400px){
  .premium-nav{
    width:100%;
    max-width:none!important;
    padding-left:20px!important;
    padding-right:20px!important;
    gap:10px!important;
  }
  .brand-lockup{
    gap:9px!important;
    flex-shrink:1;
  }
  .brand-logo{
    width:50px!important;
    height:50px!important;
    min-width:50px!important;
  }
  .brand-copy strong{
    font-size:1rem!important;
  }
  .brand-copy small{
    display:none!important;
  }
  .desktop-nav{
    gap:11px!important;
  }
  .desktop-nav a{
    font-size:.82rem!important;
  }
  .desktop-actions{
    gap:6px!important;
  }
  .nav-check-cta{
    padding:10px 12px!important;
    font-size:.82rem!important;
  }
  .nav-user-toggle{
    padding:9px 11px;
    font-size:.82rem;
  }
}

@media (max-width:1040px){
  .nav-user-dropdown{
    display:none!important;
  }
}

/* iPad landscape: use the compact menu before navigation starts to overlap. */
@media (max-width:1250px){
  .desktop-nav,.desktop-actions,.language-menu{display:none!important}
  .menu-toggle{display:flex!important;margin-left:auto;flex-direction:column;justify-content:center}
  .brand-lockup{max-width:calc(100% - 72px)!important}
}


/* iPad navigation repair: keep the compact menu visible and restore the three lines. */
@media (min-width:701px) and (max-width:1250px){
  .premium-nav{
    min-height:94px!important;
  }
  .menu-toggle{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    padding:14px!important;
    margin-left:auto!important;
    border:1px solid #dbe2ec!important;
    border-radius:10px!important;
    background:#fff!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:center!important;
    gap:6px!important;
  }
  .menu-toggle span{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:100%!important;
    height:2px!important;
    min-height:2px!important;
    margin:0!important;
    border-radius:2px!important;
    background:#172b46!important;
  }
  .mobile-menu.open{
    display:block!important;
  }
}


/* iPad controls: separate language picker and a clearly labelled contents button. */
.menu-toggle .menu-label,
.menu-toggle .menu-lines{
  display:none;
}
@media (min-width:701px) and (max-width:1250px){
  .language-menu{
    display:block!important;
    order:8;
    margin-left:auto!important;
  }
  .language-menu summary{
    width:52px!important;
    height:52px!important;
    border-radius:10px!important;
    font-size:0!important;
  }
  .language-menu summary::before{
    content:"ภาษา";
    color:#172b46;
    font:700 13px/1.1 'Noto Sans Thai',system-ui,sans-serif;
  }
  .language-menu-panel{
    top:60px!important;
    min-width:190px!important;
  }
  .menu-toggle{
    order:9;
    width:auto!important;
    min-width:104px!important;
    height:52px!important;
    padding:0 14px!important;
    margin-left:8px!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:10px!important;
  }
  .menu-toggle > span{
    display:none!important;
  }
  .menu-toggle .menu-label{
    display:block!important;
    color:#172b46;
    font:700 14px/1.1 'Noto Sans Thai',system-ui,sans-serif;
  }
  .menu-toggle .menu-lines{
    display:flex!important;
    width:24px;
    flex-direction:column;
    gap:5px;
  }
  .menu-toggle .menu-lines span{
    display:block!important;
    width:24px!important;
    height:2px!important;
    min-height:2px!important;
    margin:0!important;
    border-radius:2px!important;
    background:#172b46!important;
  }
  .mobile-language-switcher{
    display:none!important;
  }
  .brand-lockup{
    margin-right:auto;
  }
}
@media (max-width:700px){
  .menu-toggle .menu-lines{
    display:flex;
    flex-direction:column;
    width:100%;
    gap:5px;
  }
  .menu-toggle .menu-lines span{
    display:block;
    width:100%;
    height:2px;
    margin:0;
    background:#172b46;
  }
}


/* Final iPad header choice: browser translation stays external; show only hamburger. */
@media (min-width:701px) and (max-width:1250px){
  .language-menu{
    display:none!important;
  }
  .menu-toggle{
    width:56px!important;
    min-width:56px!important;
    height:56px!important;
    padding:14px!important;
    margin-left:auto!important;
    flex-direction:column!important;
    gap:5px!important;
  }
  .menu-toggle .menu-label{
    display:none!important;
  }
  .menu-toggle .menu-lines{
    display:flex!important;
    width:100%!important;
    flex-direction:column!important;
    gap:5px!important;
  }
  .menu-toggle .menu-lines span{
    width:100%!important;
  }
  .mobile-language-switcher{
    display:none!important;
  }
}


/* Do not duplicate language choices inside the contents menu on any device. */
.mobile-language-switcher{
  display:none!important;
}


/* Refined hamburger: compact, balanced and consistent on phones and tablets. */
@media (max-width:1250px){
  .menu-toggle{
    width:50px!important;
    min-width:50px!important;
    height:50px!important;
    padding:0!important;
    border-radius:12px!important;
    align-items:center!important;
    justify-content:center!important;
    gap:0!important;
  }
  .menu-toggle .menu-lines{
    display:flex!important;
    width:22px!important;
    flex:0 0 22px!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
  }
  .menu-toggle .menu-lines span{
    display:block!important;
    width:22px!important;
    height:2px!important;
    min-height:2px!important;
    margin:0!important;
    border-radius:999px!important;
    background:#172b46!important;
  }
}


/* Keep the approved site description visible in the iPad header. */
@media (min-width:701px) and (max-width:1250px){
  .brand-copy small{
    display:block!important;
    max-width:360px!important;
    white-space:normal!important;
    line-height:1.25!important;
  }
}

/* Mobile menu: compact two-column contents with full-width priority actions */
@media (max-width:1040px){
  .mobile-menu-inner.mobile-menu-two-column{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:14px;align-items:stretch}
  .mobile-menu-two-column>a{display:flex;align-items:center;min-width:0;line-height:1.35;padding:13px 8px}
  .mobile-menu-two-column>.mobile-start,
  .mobile-menu-two-column>.mobile-admin-entry,
  .mobile-menu-two-column>.mobile-login-entry,
  .mobile-menu-two-column>[href*="help-domestic-violence"],
  .mobile-menu-two-column>div{grid-column:1/-1}
}
@media (max-width:390px){
  .mobile-menu-inner.mobile-menu-two-column{column-gap:8px}
  .mobile-menu-two-column>a{font-size:.92rem;padding-left:5px;padding-right:5px}
}


/* Main reading routes inside the compact contents menu */
@media (max-width:1250px){
  .mobile-reading-panel{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin:10px 0 4px;
    padding:12px;
    border-radius:12px;
    background:#0B1F3A;
    border-left:3px solid #C9A24B;
  }
  .mobile-reading-label{
    grid-column:1/-1;
    color:#C9A24B;
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.05em;
  }
  .mobile-reading-panel a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-width:0;
    padding:11px 12px;
    border:1px solid #263D5D;
    border-radius:8px;
    color:#fff!important;
    -webkit-text-fill-color:#fff;
    font-weight:750;
    line-height:1.35;
    background:#102746;
  }
  .mobile-reading-panel a:visited{color:#fff!important;-webkit-text-fill-color:#fff}
  .mobile-reading-panel a b{color:#C9A24B!important;-webkit-text-fill-color:#C9A24B;font-weight:700}
  .mobile-reading-panel a:hover,
  .mobile-reading-panel a:focus-visible,
  .mobile-reading-panel a:active{
    background:#C9A24B;
    border-color:#C9A24B;
    color:#0B1F3A!important;
    -webkit-text-fill-color:#0B1F3A;
  }
  .mobile-reading-panel a:hover b,
  .mobile-reading-panel a:focus-visible b,
  .mobile-reading-panel a:active b{color:#0B1F3A!important;-webkit-text-fill-color:#0B1F3A}
}
@media (max-width:700px){
  .mobile-reading-panel{grid-template-columns:1fr}
  .mobile-reading-panel a{padding:10px 12px}
}


/* Compact reading index: top placement, no nested cards */
@media (max-width:1250px){
  .mobile-reading-panel{
    grid-template-columns:1fr!important;
    gap:0!important;
    margin:8px 0 10px!important;
    padding:10px 16px 4px!important;
    border:0!important;
    border-top:3px solid #C9A24B!important;
    border-radius:10px!important;
    background:#0B1F3A!important;
  }
  .mobile-reading-label{
    padding:0 0 5px!important;
    color:#C9A24B!important;
  }
  .mobile-reading-panel a,
  .mobile-reading-panel a:visited{
    min-height:0!important;
    padding:10px 0!important;
    border:0!important;
    border-bottom:1px solid #29405E!important;
    border-radius:0!important;
    background:transparent!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
  }
  .mobile-reading-panel a:last-child{border-bottom:0!important}
  .mobile-reading-panel a:hover,
  .mobile-reading-panel a:focus-visible,
  .mobile-reading-panel a:active{
    padding-left:8px!important;
    padding-right:8px!important;
    background:#C9A24B!important;
    color:#0B1F3A!important;
    -webkit-text-fill-color:#0B1F3A!important;
  }
}


/* Full navy contents drawer */
@media (max-width:1250px){
  .mobile-menu,
  .mobile-menu.open{
    background:#0B1F3A!important;
    border-top:1px solid #263D5D!important;
  }
  .mobile-menu-inner.mobile-menu-two-column{
    background:#0B1F3A!important;
  }
  .mobile-menu-inner a,
  .mobile-menu-two-column>a,
  .mobile-menu-inner button{
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
    border-bottom-color:#263D5D!important;
  }
  .mobile-menu-inner a:hover,
  .mobile-menu-inner a:focus-visible,
  .mobile-menu-inner a:active,
  .mobile-menu-inner button:hover,
  .mobile-menu-inner button:focus-visible{
    background:#132B4B!important;
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
  }
  .mobile-start{
    color:#C9A24B!important;
    -webkit-text-fill-color:#C9A24B!important;
  }
  .mobile-reading-panel{
    background:#102746!important;
    border-top-color:#C9A24B!important;
  }
  .mobile-menu-two-column>div:not(.mobile-reading-panel){
    color:#AEBBD0!important;
    border-top-color:#314866!important;
  }
  .mobile-menu-two-column>.mobile-login-entry{
    color:#F0C96B!important;
    -webkit-text-fill-color:#F0C96B!important;
  }
  .mobile-menu-two-column>[href*="help-domestic-violence"]{
    color:#FF8A8A!important;
    -webkit-text-fill-color:#FF8A8A!important;
  }
  .mobile-menu-inner a[href*="facebook"] span{
    color:#67A9FF!important;
    -webkit-text-fill-color:#67A9FF!important;
  }
  .mobile-menu-inner a[href*="lin.ee"] span{
    color:#55E69A!important;
    -webkit-text-fill-color:#55E69A!important;
  }
}
