/*
 * Nakveti Theme — Stage 7 / Production hardening
 * Accessibility, resilience and responsive edge-case protection only.
 * No Core business rules live in this layer.
 */


/* Native controls follow the active appearance without importing WordPress blue. */
html{color-scheme:light}
html[data-nk-theme="dark"]{color-scheme:dark}
:where(input[type="checkbox"],input[type="radio"],input[type="range"],progress){accent-color:var(--nk-green)}

/* Keyboard and long-content resilience. */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid color-mix(in srgb,var(--nk-green) 72%,#fff)!important;
  outline-offset:3px!important;
}
:where(.nk-entry,.nk-site-footer,.snw-card,.snw-work-panel,.snw-portal-card,.woocommerce){min-width:0}
:where(.nk-entry,.nk-site-footer,.snw-card,.snw-work-panel,.snw-portal-card,.woocommerce) :is(a,p,li,td,th,dd){overflow-wrap:anywhere}
:where(.nk-entry,.nk-page-head,.snw-card,.snw-service-card,.snw-work-panel,.woocommerce) :is(h1,h2,h3,h4,h5,h6){overflow-wrap:normal;word-break:normal}

/* Do not let embedded media or tables escape the viewport. */
.nk-entry :is(iframe,video,canvas,svg:not([class*="icon"])){max-width:100%}
.nk-entry table,.woocommerce table{max-width:100%}
.nk-entry .wp-caption{max-width:100%}

/* Stable tap targets across header/tools/forms. */
:where(.nk-menu-toggle,.nk-submenu-toggle,.nk-account-toggle,.nk-tool,.nk-tool-close,.nk-theme-tool,.nk-to-top){min-width:44px;min-height:44px}
:where(button,input,select,textarea){font:inherit}

/* Compact header: logo size never expands the header canvas. */
@media(min-width:981px){
  .nk-header-inner{height:72px!important;min-height:72px!important;max-height:72px;padding-block:6px}
  .nk-site-header.is-scrolled .nk-header-inner{height:68px!important;min-height:68px!important;max-height:68px}
  .nk-site-header .nk-brand-logo,.nk-site-header .nk-brand-logo>span{display:flex;max-height:56px;align-items:center}
  .nk-site-header.is-scrolled .nk-brand-logo,.nk-site-header.is-scrolled .nk-brand-logo>span{max-height:52px}
  .nk-site-header .nk-brand-logo img{max-height:none!important}
  .nk-site-header.is-scrolled .nk-brand-logo img{max-height:none!important}
}

/* Footer: four balanced content panels with a quiet premium surface. */
.nk-footer-main{
  grid-template-columns:minmax(0,1.15fr) repeat(3,minmax(0,1fr))!important;
  gap:16px!important;
  padding:48px 0!important;
  align-items:stretch;
}
.nk-footer-main>div,.nk-footer-main>nav{
  min-width:0;
  padding:26px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}
.nk-footer-main :where(h3,h4){margin-top:0}
.nk-footer-main ul{display:grid;gap:8px}
.nk-footer-main li{margin:0!important}
.nk-footer-about{display:flex;flex-direction:column;align-items:flex-start;gap:20px}
.nk-footer-about>p{margin:0;line-height:1.75}
.nk-footer-logo,.nk-site-footer .nk-brand-logo{flex:0 0 auto}
.nk-footer-bottom{padding:20px 0!important}

@media(max-width:1100px){.nk-footer-main{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Mobile overlay panels remain usable on short screens and notches. */
@media(max-width:980px){
  .nk-header-inner{height:68px!important;min-height:68px!important;max-height:68px;padding-block:5px}
  .nk-site-header .nk-brand-logo,.nk-site-header .nk-brand-logo>span{display:flex;max-height:52px;align-items:center}
  .nk-site-header .nk-brand-logo img{max-height:none!important}
  .nk-nav{overscroll-behavior:contain;padding-bottom:max(14px,env(safe-area-inset-bottom))}
  .nk-account-dropdown{max-height:calc(100dvh - 110px);overflow:auto;overscroll-behavior:contain}
  .nk-tools-rail{max-height:calc(100dvh - 24px)}
}
@media(max-width:640px){
  .nk-wrap{width:min(calc(100% - 28px),var(--nk-layout-width,1180px))}
  .nk-site-footer :is(a,p,li){overflow-wrap:anywhere}
  .woocommerce table.shop_table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .nk-header-inner{height:64px!important;min-height:64px!important;max-height:64px;padding-block:4px}
  .nk-site-header .nk-brand-logo,.nk-site-header .nk-brand-logo>span{display:flex;max-height:48px;align-items:center}
  .nk-site-header .nk-brand-logo img{max-height:none!important}
  .nk-footer-main{grid-template-columns:1fr!important;gap:12px!important;padding:34px 0!important}
  .nk-footer-main>div,.nk-footer-main>nav{padding:22px}
}

/* System accessibility preferences: no decorative motion, no fixed background work. */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    transition-delay:0s!important;
  }
  body{background-attachment:scroll!important}
}

/* Native high-contrast mode keeps controls and focus discoverable. */
@media(forced-colors:active){
  :where(.nk-button,.nk-header-cta,.nk-mobile-nav-cta,.nk-tool,.nk-account-link,.snw-primary,.snw-secondary,.woocommerce a.button,.woocommerce button.button){border:1px solid ButtonText!important}
  :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid Highlight!important}
  .nk-nav-backdrop{backdrop-filter:none}
}

/* Print: remove interactive chrome and keep documents/contracts legible. */
@media print{
  .nk-site-header,.nk-tools-rail,.nk-to-top,.nk-nav-backdrop,.nk-footer-cta,.nk-hub-lightbox{display:none!important}
  body{background:#fff!important;color:#111!important;background-image:none!important}
  .nk-content,.nk-entry{width:100%!important;max-width:none!important}
  .nk-site-footer{background:#fff!important;color:#111!important;border-top:1px solid #bbb}
  .nk-site-footer *{color:#111!important}
  a{text-decoration:underline;text-underline-offset:2px}
}
