/*
Theme Name: NSHCalculator.org — Blocksy Child
Theme URI: https://nshcalculator.org/
Description: Header, footer, page frame and branding for NSHCalculator.org on the Blocksy theme. Requires the NSHCalculator.org Health Calculators plugin, which supplies the home page and the calculators; this theme does not modify them.
Author: NSHCalculator.org
Template: blocksy
Version: 1.11.0
Text Domain: nshcalculator
*/

:root{
  --nsh-navy:#142F71; --nsh-sky:#2AA8F2; --nsh-bg:#F5F5F7; --nsh-card:#FFFFFF;
  --nsh-line:#E5E5EA; --nsh-text:#1D1D1F; --nsh-muted:#636366; --nsh-chip:#EAF1FF; --nsh-soft:#F2F2F7;
  --nsh-font:-apple-system,BlinkMacSystemFont,'SF Pro Text',system-ui,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
}
body{background:var(--nsh-bg);color:var(--nsh-text);font-family:var(--nsh-font)}
.nsh-brandbar,.ct-header,.ct-footer{display:none!important}

/* ---------- Header ----------
   One <nav>. Desktop (1024px and up): inline bar with drop-downs.
   Tablet and mobile (below 1024px): menu button + slide-in panel. */
.nsh-header{position:sticky;top:0;z-index:100;font-family:var(--nsh-font);color:var(--nsh-text);--nsh-top:64px}
.admin-bar .nsh-header{top:32px}
@media (max-width:782px){.admin-bar .nsh-header{top:46px}}
@media (max-width:600px){.admin-bar .nsh-header{top:0}}
.nsh-header__bar{height:64px;background:#fff;border-bottom:1px solid var(--nsh-line);box-sizing:border-box}
.nsh-wrap{max-width:1080px;margin:0 auto;padding:0 clamp(16px,4vw,32px);box-sizing:border-box}
.nsh-header__inner{height:100%;display:flex;align-items:center;gap:clamp(16px,2.4vw,32px)}
.nsh-logo{display:flex;align-items:center;text-decoration:none;flex:0 0 auto}
.nsh-logo img{height:clamp(24px,6.6vw,34px);width:auto;display:block}
.nsh-header a,.nsh-header button{-webkit-tap-highlight-color:transparent}

/* Menu button (tablet and mobile) */
.nsh-menu-btn{margin-left:auto;width:46px;height:46px;border:1px solid var(--nsh-line);background:var(--nsh-soft);border-radius:14px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--nsh-text);padding:0;transition:background .15s}
.nsh-menu-btn:hover{background:#E8E8ED}
.nsh-menu-btn:focus-visible,.nsh-link:focus-visible,.nsh-sub a:focus-visible{outline:2px solid var(--nsh-sky);outline-offset:2px}
.nsh-burger{position:relative;display:block;width:20px;height:14px}
.nsh-burger i{position:absolute;left:0;width:100%;height:2px;border-radius:2px;background:currentColor;transition:transform .25s ease,opacity .2s ease,top .25s ease}
.nsh-burger i:nth-child(1){top:0}.nsh-burger i:nth-child(2){top:6px}.nsh-burger i:nth-child(3){top:12px}
.nsh-header.is-open .nsh-burger i:nth-child(1){top:6px;transform:rotate(45deg)}
.nsh-header.is-open .nsh-burger i:nth-child(2){opacity:0}
.nsh-header.is-open .nsh-burger i:nth-child(3){top:6px;transform:rotate(-45deg)}

/* Menu items (shared) */
.nsh-menu{list-style:none;margin:0;padding:0}
.nsh-menu li,.nsh-sub li{margin:0;padding:0;list-style:none}
.nsh-link{display:flex;align-items:center;font:inherit;color:var(--nsh-text);text-decoration:none;cursor:pointer;background:transparent;border:0;box-sizing:border-box;text-align:left}
.nsh-lbl{flex:1 1 auto;min-width:0}
.nsh-chev{flex:0 0 auto;color:#8E8E93;transition:transform .2s ease}
.nsh-has-sub.is-open>.nsh-sub-btn .nsh-chev{transform:rotate(180deg)}
.nsh-ico{flex:0 0 auto;display:grid;place-items:center;border-radius:12px;background:var(--nsh-chip);color:var(--nsh-navy)}
.nsh-sub{list-style:none;margin:0;padding:0;display:none}
.nsh-has-sub.is-open>.nsh-sub{display:block}
.nsh-sub a,.nsh-soon{display:flex;align-items:center;color:var(--nsh-text);text-decoration:none;box-sizing:border-box}
.nsh-dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:transparent;margin-right:12px}
.nsh-sub .is-active>a{color:var(--nsh-navy);font-weight:600;background:#F2F6FF}
.nsh-sub .is-active .nsh-dot{background:var(--nsh-sky)}
.nsh-sub a:hover{background:var(--nsh-soft)}
.nsh-sub .is-active>a:hover{background:#E8F0FF}
.nsh-soon{color:#8E8E93;cursor:default}
.nsh-badge{flex:0 0 auto;margin-left:10px;font-size:12px;font-weight:600;line-height:1;color:var(--nsh-muted);background:var(--nsh-soft);border-radius:999px;padding:5px 10px}

/* ---------- Tablet and mobile: slide-in panel ---------- */
@media (max-width:1023.98px){
  .nsh-nav{position:fixed;top:var(--nsh-top);right:0;bottom:0;z-index:2;width:min(100%,420px);box-sizing:border-box;background:#fff;
    padding:14px 16px calc(28px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    border-left:1px solid var(--nsh-line);border-top-left-radius:26px;box-shadow:-24px 0 60px rgba(15,23,42,.16);
    transform:translateX(104%);visibility:hidden;transition:transform .3s cubic-bezier(.22,.9,.3,1),visibility 0s linear .3s}
  .nsh-header.is-open .nsh-nav{transform:none;visibility:visible;transition-delay:0s}
  .nsh-backdrop{position:fixed;left:0;right:0;bottom:0;top:var(--nsh-top);z-index:1;background:rgba(15,23,42,.42);opacity:0;visibility:hidden;transition:opacity .25s ease,visibility 0s linear .25s}
  .nsh-header.is-open .nsh-backdrop{opacity:1;visibility:visible;transition-delay:0s}
  html.nsh-lock{overflow:hidden}

  .nsh-menu{display:flex;flex-direction:column;gap:6px}
  .nsh-link{width:100%;min-height:58px;padding:0 14px 0 10px;gap:14px;font-size:18px;font-weight:500;border-radius:16px}
  .nsh-link:hover{background:var(--nsh-soft)}
  .nsh-ico{width:38px;height:38px}
  .nsh-item.is-active>.nsh-link{background:#F2F6FF;color:var(--nsh-navy);font-weight:600}
  .nsh-item.is-active>.nsh-link .nsh-ico{background:var(--nsh-navy);color:#fff}
  .nsh-item.is-soon>.nsh-link{color:#8E8E93;cursor:default}
  .nsh-item.is-soon>.nsh-link:hover{background:transparent}

  /* Calculators accordion */
  .nsh-sub{margin:2px 0 8px 29px;padding:2px 0 2px 10px;border-left:2px solid var(--nsh-line)}
  .nsh-sub a,.nsh-soon{min-height:50px;padding:0 14px;font-size:17px;border-radius:12px}
  .nsh-sub li+li{margin-top:2px}

  /* Methodology: quieter row under a divider */
  .nsh-more{margin-top:8px;padding-top:10px;border-top:1px solid var(--nsh-line)}
  .nsh-more .nsh-link{min-height:50px;font-size:16px;color:var(--nsh-muted)}
  .nsh-more .nsh-ico{width:32px;height:32px;background:var(--nsh-soft);color:var(--nsh-muted)}

  /* Phones: the panel fills the screen width */
  @media (max-width:599.98px){
    .nsh-nav{width:100%;border-left:0;border-top-left-radius:0;box-shadow:none}
  }
}

/* ---------- Desktop: inline bar ---------- */
@media (min-width:1024px){
  .nsh-menu-btn,.nsh-backdrop{display:none}
  .nsh-nav{flex:1 1 auto;min-width:0}
  .nsh-menu{display:flex;align-items:center;justify-content:flex-end;gap:4px;height:64px;margin-right:-14px}
  .nsh-menu>li{position:relative;display:flex;align-items:center;height:64px}
  .nsh-menu>li.nsh-more{display:none}
  .nsh-link{height:40px;padding:0 14px;gap:6px;font-size:15px;font-weight:500;border-radius:999px;white-space:nowrap;transition:background .15s,color .15s}
  .nsh-link:hover{background:var(--nsh-soft)}
  .nsh-ico,.nsh-chev--r{display:none}
  .nsh-lbl{flex:0 1 auto}
  .nsh-item.is-active>.nsh-link{background:var(--nsh-chip);color:var(--nsh-navy);font-weight:600}
  .nsh-item.is-soon>.nsh-link{color:#8E8E93;cursor:default}
  .nsh-item.is-soon>.nsh-link:hover{background:transparent}
  .nsh-has-sub.is-open>.nsh-sub-btn{background:var(--nsh-soft)}
  .nsh-has-sub.is-active.is-open>.nsh-sub-btn{background:#DDE8FF}

  /* Drop-down panel */
  .nsh-sub{position:absolute;top:calc(100% + 4px);left:0;z-index:5;min-width:260px;padding:8px;background:#fff;border:1px solid var(--nsh-line);border-radius:16px;box-shadow:0 18px 48px rgba(15,23,42,.14)}
  .nsh-sub::before{content:"";position:absolute;left:0;right:0;top:-10px;height:10px}   /* keeps hover alive across the gap */
  .nsh-sub a,.nsh-soon{min-height:42px;padding:0 12px;font-size:15px;border-radius:10px;white-space:nowrap}
  .nsh-sub li+li{margin-top:2px}
  html:not(.nsh-js) .nsh-has-sub:hover>.nsh-sub,html:not(.nsh-js) .nsh-has-sub:focus-within>.nsh-sub{display:block}
}

/* Without JavaScript the panel simply stays open under the bar */
@media (max-width:1023.98px){
  html:not(.nsh-js) .nsh-menu-btn,html:not(.nsh-js) .nsh-backdrop{display:none}
  html:not(.nsh-js) .nsh-header__inner{flex-wrap:wrap;height:auto}
  html:not(.nsh-js) .nsh-header__bar{height:auto;padding-bottom:12px}
  html:not(.nsh-js) .nsh-nav{position:static;width:100%;transform:none;visibility:visible;box-shadow:none;border:0;border-radius:0;padding:0;overflow:visible}
  html:not(.nsh-js) .nsh-sub{display:block}
}
@media (prefers-reduced-motion:reduce){
  .nsh-nav,.nsh-backdrop,.nsh-burger i,.nsh-chev{transition:none!important}
}

/* Keep menu colours independent of the parent theme's own link styles */
.nsh-header a.nsh-link,.nsh-header .nsh-sub a{color:var(--nsh-text);text-decoration:none}
.nsh-header a.nsh-link:hover,.nsh-header .nsh-sub a:hover{color:var(--nsh-text)}
.nsh-header .nsh-item.is-active>.nsh-link,.nsh-header .nsh-sub .is-active>a{color:var(--nsh-navy)}
.nsh-header .nsh-item.is-soon>.nsh-link{color:#8E8E93}
@media (max-width:1023.98px){
  .nsh-header .nsh-more a.nsh-link{color:var(--nsh-muted)}
}

/* Footer */
.nsh-footer{background:#fff;border-top:1px solid var(--nsh-line);font-family:var(--nsh-font);color:var(--nsh-muted)}
.nsh-footer__inner{padding-top:40px;padding-bottom:48px;display:flex;flex-direction:column;align-items:center;gap:20px;text-align:center}
.nsh-footer img{height:24px;width:auto;display:block}
.nsh-footer__links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 24px;font-size:14px}
.nsh-footer a{color:#3C3C43;text-decoration:none}.nsh-footer a:hover{color:var(--nsh-navy)}
.nsh-footer p{margin:0;font-size:13px;line-height:1.55;color:var(--nsh-muted)}
.nsh-footer p.nsh-disc{max-width:640px}

/* Pages (calculator pages and any other page) */
.nsh-page{background:var(--nsh-bg);font-family:var(--nsh-font);color:var(--nsh-text)}
.nsh-page__inner{max-width:900px;padding-top:clamp(32px,6vw,64px);padding-bottom:clamp(48px,8vw,96px)}
.nsh-page__title{margin:0 0 16px;font-size:clamp(30px,5vw,44px);line-height:1.1;font-weight:700;letter-spacing:-.02em;color:var(--nsh-text)}
.nsh-home{min-height:50vh}

/* Text pages (Methodology, Disclaimer, Privacy, Contact, About and any other block-editor page) */
.nsh-page--text .nsh-page__inner{max-width:860px}
.nsh-page--text .nsh-page__content{background:var(--nsh-card);border:1px solid var(--nsh-line);border-radius:22px;padding:clamp(22px,4vw,44px);font-size:17px;line-height:1.7;color:var(--nsh-text);overflow-wrap:break-word;word-break:normal}
.nsh-page--text .nsh-page__content>:first-child{margin-top:0}
.nsh-page--text .nsh-page__content>:last-child{margin-bottom:0}
.nsh-page--text .nsh-page__content h2{margin:2em 0 .55em;padding-top:.2em;font-size:clamp(22px,3.2vw,28px);line-height:1.2;font-weight:700;letter-spacing:-.015em;color:var(--nsh-navy)}
.nsh-page--text .nsh-page__content h3{margin:1.6em 0 .45em;font-size:clamp(18px,2.4vw,21px);line-height:1.3;font-weight:650;color:var(--nsh-text)}
.nsh-page--text .nsh-page__content p{margin:0 0 1em}
.nsh-page--text .nsh-page__content ul,.nsh-page--text .nsh-page__content ol{margin:0 0 1.1em;padding-left:1.4em}
.nsh-page--text .nsh-page__content li{margin:0 0 .45em;padding-left:.15em}
.nsh-page--text .nsh-page__content a{color:var(--nsh-navy);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.nsh-page--text .nsh-page__content a:hover{color:#0B5BC4}
.nsh-page--text .nsh-page__content a:focus-visible{outline:2px solid var(--nsh-sky);outline-offset:2px;border-radius:4px}
.nsh-page--text .nsh-page__content .wp-block-table{margin:1.2em 0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.nsh-page--text .nsh-page__content table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.5;min-width:480px}
.nsh-page--text .nsh-page__content th,.nsh-page--text .nsh-page__content td{overflow-wrap:break-word;word-break:normal;hyphens:manual;padding:10px 12px;border:1px solid var(--nsh-line);text-align:left;vertical-align:top}
.nsh-page--text .nsh-page__content th{background:var(--nsh-soft);font-weight:650}
.nsh-page--text .nsh-page__content .wp-block-buttons{display:flex;flex-wrap:wrap;gap:12px;margin:1.4em 0}
.nsh-page--text .nsh-page__content .wp-block-button{max-width:100%;box-sizing:border-box}.nsh-page--text .nsh-page__content .wp-block-button__link{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 26px;border-radius:999px;background:var(--nsh-navy);color:#fff;font-weight:600;font-size:16px;line-height:1.2;text-decoration:none}
.nsh-page--text .nsh-page__content .wp-block-button__link:hover{background:#0F2358;color:#fff}
.nsh-page--text .nsh-page__content .wp-block-button__link:focus-visible{outline:2px solid var(--nsh-sky);outline-offset:3px}
@media (max-width:599.98px){.nsh-page--text .nsh-page__content{border-radius:16px;font-size:16px}.nsh-page--text .nsh-page__content .wp-block-button{width:100%}.nsh-page--text .nsh-page__content .wp-block-button__link{width:100%}}

/* Wide tables (3+ columns) become stacked cards on phones; nsh.js adds .nsh-stack and the data-label texts. */
@media (max-width:700px){
.nsh-page--text .nsh-page__content .wp-block-table:has(table.nsh-stack){overflow:visible}
.nsh-page--text .nsh-page__content table.nsh-stack{display:block;min-width:0;width:100%;border:0}
.nsh-page--text .nsh-page__content table.nsh-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.nsh-page--text .nsh-page__content table.nsh-stack tbody{display:block}
.nsh-page--text .nsh-page__content table.nsh-stack tr{display:block;margin:0 0 12px;padding:6px 0;border:1px solid var(--nsh-line);border-radius:14px;background:#fff}
.nsh-page--text .nsh-page__content table.nsh-stack td{display:block;border:0;padding:8px 14px;font-size:15px;line-height:1.55}
.nsh-page--text .nsh-page__content table.nsh-stack td+td{border-top:1px solid var(--nsh-line)}
.nsh-page--text .nsh-page__content table.nsh-stack td[data-label]::before{content:attr(data-label);display:block;margin:0 0 2px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--nsh-muted)}
}

/* v1.11.0: articles */
.nsh-page__crumb{margin:0 0 10px;font-size:14px;font-weight:600}.nsh-page__crumb a{color:var(--nsh-navy);text-decoration:none}.nsh-page__crumb a:hover{text-decoration:underline}
