/* KhabarThali 6.30 — integration QA hardening.
   Design-lock rule: behavior, overflow, typography inheritance and state fixes only.
   No homepage composition, headline alignment or section-layout redesign lives here. */

/* Keep the selected publication font consistent across controls and editorial surfaces. */
body.kbt6,
body.kbt6 :where(button,input,textarea,select,option),
body.kbt6 :where(h1,h2,h3,h4,h5,h6),
body.kbt6 :where(.kt-meta,.kt-category,.kt-eyebrow,.kt-button,.kt-text-link,.kt-text-button),
body.kbt6 :where(.kt615-masthead,.kt615-nav-wrap,.kt615-footer,.kt-drawer,.kt-search-dialog){
  font-family:var(--kt-font-family,"Mukta","Noto Sans Devanagari","Nirmala UI",sans-serif);
}

/* Defensive width rules for long Nepali/English strings, embeds and user content. */
html,body{max-width:100%}
body.kbt6{overflow-x:hidden}
@supports(overflow:clip){body.kbt6{overflow-x:clip}}
body.kbt6 :where(main,section,article,aside,header,footer,nav,div){min-width:0}
body.kbt6 :where(.entry-content,.kt-article-body,.kt-page-content,.kt-ref-article-body){overflow-wrap:anywhere;word-break:normal}
body.kbt6 :where(.entry-content,.kt-article-body,.kt-page-content,.kt-ref-article-body) table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
body.kbt6 :where(.entry-content,.kt-article-body,.kt-page-content,.kt-ref-article-body) :where(img,video,iframe){max-width:100%;height:auto}

/* Category rail state: WordPress current classes and JS path fallback share one visual rule. */
.kt615-main-nav .kt-menu>li>a.is-current-link,
.kt615-main-nav .kt-menu>li.current-menu-item>a,
.kt615-main-nav .kt-menu>li.current-menu-ancestor>a,
.kt615-main-nav .kt-menu>li.current-category-ancestor>a,
.kt615-main-nav .kt-menu>li>a[aria-current="page"]{
  color:var(--kt-red,var(--kt618-red,#e6002c))!important;
  font-weight:800!important;
}
.kt615-main-nav .kt-menu>li>a.is-current-link::after,
.kt615-main-nav .kt-menu>li.current-menu-item>a::after,
.kt615-main-nav .kt-menu>li>a[aria-current="page"]::after{
  opacity:1!important;
  transform:scaleX(1)!important;
}

/* Headline read-state coverage for components added after the original tracker. */
body.kbt6 :is(.kt627-related-card,.kt629-recovery__stories,.kt629-search-recovery__stories,.kt628-author-lead,.kt628-author-item,.kt618-archive,.kt-card) :is(h2,h3,h4) a.is-read-headline{
  color:var(--kt-headline-visited,#c61f2f)!important;
}

/* Keep touch targets usable without changing approved visual composition. */
.kt615-main-nav .kt-menu>li>a,.kt625-breaking-stage a,.kt629-footer-menu a{touch-action:manipulation}
.kt615-main-nav{overscroll-behavior-inline:contain}

/* Mobile menu icon is on the left, so its drawer opens from the same side. */
@media(max-width:1100px){
  .kt-drawer{
    position:fixed!important;
    inset:0 auto 0 0!important;
    margin:0!important;
    width:min(390px,92vw)!important;
    max-width:92vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    border-left:0!important;
    border-right:1px solid var(--kt-line,var(--kt618-line,#dfe4e8))!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* A real flow spacer prevents fixed sticky header overlap even when Breaking is disabled. */
  html.kt625-stuck .kt615-topic-wrap{
    display:block!important;
    visibility:hidden!important;
    pointer-events:none!important;
    height:var(--kt625-stick-h,90px)!important;
    min-height:var(--kt625-stick-h,90px)!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:hidden!important;
  }
  html.kt625-stuck .kt615-topic-wrap>*{display:none!important}
  html.kt625-stuck .kt625-breaking-wrap{margin-top:0!important}

  .kt615-main-nav.is-scrollable{scroll-snap-type:x proximity}
  .kt615-main-nav.is-scrollable .kt-menu>li{scroll-snap-align:start}

  body.kt-has-bottom-nav .kt-toast{bottom:calc(76px + env(safe-area-inset-bottom))}
}

@media(max-width:430px){
  .kt-drawer{width:min(360px,94vw)!important;max-width:94vw!important;padding:18px!important}
}

@media(prefers-reduced-motion:reduce){
  .kt615-main-nav{scroll-behavior:auto!important}
}
