/* =========================================================
   HealthBuzz — compact sticky header
   Hidden at the top of the page; slides down after the main
   header has scrolled away (see /js/sticky-header.js).
   ========================================================= */
.hb-sticky{
  position:fixed;top:0;left:0;right:0;z-index:60;
  background:color-mix(in srgb,var(--card) 95%,transparent);
  -webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--line);
  box-shadow:0 4px 18px rgba(17,17,17,.10);
  transform:translateY(-110%);visibility:hidden;
  transition:transform .32s cubic-bezier(.2,.8,.2,1),visibility 0s linear .32s;
}
@supports not (background:color-mix(in srgb,red 50%,transparent)){.hb-sticky{background:var(--card)}}
[data-theme="dark"] .hb-sticky{box-shadow:0 4px 18px rgba(0,0,0,.45)}
.hb-sticky.is-visible{transform:translateY(0);visibility:visible;transition:transform .32s cubic-bezier(.2,.8,.2,1),visibility 0s}

/* avoid two stacked sticky bars while the compact header is shown */
body.hb-sticky-on .nav{position:relative}
body.hb-sticky-on .mast{position:relative}

.hb-sticky__bar{display:flex;align-items:center;gap:18px;height:56px}

/* logo */
.hb-sticky__logo{display:flex;align-items:center;flex:none}
.hb-sticky__logo img{height:30px;width:auto;max-width:170px;object-fit:contain}
.hb-sticky__logo--dark{display:none}
[data-theme="dark"] .hb-sticky__logo--light{display:none}
[data-theme="dark"] .hb-sticky__logo--dark{display:block}

/* quick links (desktop) */
.hb-sticky__links{flex:1;min-width:0;overflow:hidden}
.hb-sticky__links.is-overflow{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.hb-sticky__links ul{display:flex;list-style:none;margin:0;padding:0;gap:2px;white-space:nowrap}
.hb-sticky__links a{display:block;position:relative;padding:18px 9px;font-family:var(--fh);font-weight:700;font-size:.74rem;text-transform:uppercase;letter-spacing:.03em;color:var(--text);white-space:nowrap}
.hb-sticky__links a:after{content:"";position:absolute;left:9px;right:9px;bottom:10px;height:3px;border-radius:3px;background:var(--brand);transform:scaleX(0);transform-origin:left;transition:transform .25s}
.hb-sticky__links a:hover{color:var(--brand)}
.hb-sticky__links a:hover:after,.hb-sticky__links a.is-active:after{transform:scaleX(1)}
.hb-sticky__links a.is-active{color:var(--brand)}

/* right-hand actions */
.hb-sticky__actions{display:flex;align-items:center;gap:6px;flex:none;margin-left:auto}
.hb-sticky__icon{background:none;border:0;cursor:pointer;color:var(--text);width:38px;height:38px;border-radius:50%;display:inline-grid;place-items:center;position:relative;font-size:1rem;transition:background .2s,color .2s}
.hb-sticky__icon:hover{background:var(--bg-2);color:var(--brand)}
.hb-sticky__plusdot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 2px var(--card)}
.hb-sticky__theme .hb-sun{display:none}
[data-theme="dark"] .hb-sticky__theme .hb-sun{display:inline}
[data-theme="dark"] .hb-sticky__theme .hb-moon{display:none}
.hb-sticky__epaper{display:inline-flex;align-items:center;gap:7px;font-family:var(--fh);font-weight:800;font-size:.78rem;border:1.5px solid var(--dark);border-radius:999px;padding:.42em .9em;color:var(--text);white-space:nowrap;margin:0 2px}
.hb-sticky__epaper i{color:var(--brand)}
.hb-sticky__epaper:hover{border-color:var(--brand)}
[data-theme="dark"] .hb-sticky__epaper{border-color:#555}
.hb-sticky__plus{display:inline-flex;align-items:center;gap:7px;background:var(--brand);color:#fff;border-radius:999px;padding:.5em 1.05em;font-weight:700;font-size:.8rem;white-space:nowrap;margin-left:4px;transition:box-shadow .2s,transform .15s}
.hb-sticky__plus:hover{color:#fff;transform:translateY(-1px);box-shadow:0 6px 16px rgba(255,102,0,.35)}
.hb-sticky__burger{display:none}

/* focus */
.hb-sticky a:focus-visible,.hb-sticky button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.hb-sticky__form input:focus-visible{outline:none}

/* slim search bar */
.hb-sticky__search{border-top:1px solid var(--line);background:var(--card);animation:hbStickyDrop .22s ease-out}
.hb-sticky__search[hidden]{display:none}
.hb-sticky__form{position:relative;display:flex;align-items:center;gap:10px;height:58px}
.hb-sticky__form>i{color:var(--muted)}
.hb-sticky__form input{flex:1;min-width:0;border:1.5px solid var(--line);background:var(--bg-2);border-radius:999px;padding:.6em 1.1em;outline:none;transition:border .2s,box-shadow .2s}
.hb-sticky__form input:focus{border-color:var(--brand);box-shadow:0 0 0 4px rgba(255,102,0,.12);background:var(--bg)}
.hb-sticky__go{border:0;background:var(--brand);color:#fff;font-weight:700;border-radius:999px;padding:.6em 1.2em;cursor:pointer;font-size:.85rem}
.hb-sticky__form .suggest{top:calc(100% - 2px);left:26px;right:96px}
@keyframes hbStickyDrop{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

/* reading progress (article pages) */
.hb-sticky__progress{position:absolute;left:0;right:0;bottom:-1px;height:3px;display:none;pointer-events:none}
.hb-sticky.has-progress .hb-sticky__progress{display:block}
.hb-sticky__progress span{display:block;height:100%;width:100%;transform:scaleX(0);transform-origin:left;background:linear-gradient(90deg,var(--brand),#ffb347)}

/* tablet / mobile */
@media (max-width:1023px){
  .hb-sticky__links,.hb-desk{display:none!important}
  .hb-sticky__bar{justify-content:space-between;gap:10px}
  .hb-sticky__burger{display:inline-grid}
  .hb-sticky__epaper span{display:none}
  .hb-sticky__epaper{border:0;padding:0;width:38px;height:38px;justify-content:center;font-size:1rem;margin:0}
  .hb-sticky__logo img{height:28px;max-width:150px}
  .hb-sticky__form .suggest{left:0;right:0}
}
@media (max-width:480px){
  .hb-sticky__go{display:none}
  .hb-sticky__actions{gap:2px}
}

@media (prefers-reduced-motion:reduce){
  .hb-sticky,.hb-sticky.is-visible{transition:none}
  .hb-sticky__search{animation:none}
}
@media print{.hb-sticky{display:none!important}}
