/* Site chrome: opaque nav, one-row mobile menu, narrow card grids.
   Loaded after page styles. Does not change article copy. */

nav.nav,
nav[style*="sticky"]{
  background-color:var(--paper,#F3F8F5)!important;
  background-image:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  box-shadow:0 1px 0 var(--line-strong,#D4E2DB);
}

/* Review pages used a fixed bar plus a 100px hero offset. Keep the bar in flow
   so the article starts below an opaque row instead of sliding underneath it. */
nav.nav{
  position:sticky!important;
  top:0!important;
  left:auto!important;
  right:auto!important;
  z-index:50!important;
}
body:has(> nav.nav) > .hero{padding-top:24px!important}

.nav-check{
  position:absolute;
  width:1px;
  height:1px;
  margin:-1px;
  padding:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}
.nav-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:44px;
  min-height:44px;
  margin-left:auto;
  padding:0 12px;
  border:1px solid var(--line-strong,#B8CCC2);
  border-radius:10px;
  background:var(--paper-elevated,#fff);
  color:var(--ink,#173B33);
  font-family:Inter,system-ui,sans-serif;
  font-size:14px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
}
.nav-toggle-icon{
  width:16px;
  height:12px;
  background:
    linear-gradient(currentColor,currentColor) 0 0/100% 2px,
    linear-gradient(currentColor,currentColor) 0 50%/100% 2px,
    linear-gradient(currentColor,currentColor) 0 100%/100% 2px;
  background-repeat:no-repeat;
}
.nav-check:focus-visible + .nav-toggle{
  outline:3px solid #F0A89F;
  outline-offset:3px;
}
.nav-check:checked + .nav-toggle .nav-toggle-icon{
  background:none;
  position:relative;
}
.nav-check:checked + .nav-toggle .nav-toggle-icon::before,
.nav-check:checked + .nav-toggle .nav-toggle-icon::after{
  content:"";
  position:absolute;
  left:0;
  top:5px;
  width:16px;
  height:2px;
  background:currentColor;
}
.nav-check:checked + .nav-toggle .nav-toggle-icon::before{transform:rotate(45deg)}
.nav-check:checked + .nav-toggle .nav-toggle-icon::after{transform:rotate(-45deg)}

@media(max-width:760px){
  nav.nav,
  nav[style*="sticky"]{
    height:56px!important;
    min-height:56px!important;
    overflow:visible!important;
  }
  nav.nav > div,
  nav[style*="sticky"] > div{
    position:relative!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    height:56px!important;
    min-height:56px!important;
    gap:8px!important;
  }
  .nav-toggle{display:inline-flex!important}
  #primary-nav{
    display:none!important;
    position:absolute!important;
    top:calc(100% + 1px);
    left:0;
    right:0;
    z-index:60;
    width:auto!important;
    max-width:none!important;
    flex-direction:column!important;
    flex-wrap:nowrap!important;
    grid-template-columns:none!important;
    gap:2px!important;
    margin:0;
    padding:8px;
    overflow:visible!important;
    background:var(--paper,#F3F8F5)!important;
    border:1px solid var(--line-strong,#B8CCC2);
    border-radius:0 0 14px 14px;
    box-shadow:0 16px 32px rgba(23,59,51,.12);
  }
  .nav-check:checked ~ #primary-nav{display:flex!important}
  #primary-nav a{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    min-height:44px;
    width:100%;
    padding:10px 12px!important;
    font-size:15px!important;
    line-height:1.2!important;
    text-align:left!important;
    white-space:nowrap!important;
  }
}

/* Four- and five-column card rows must not squeeze at phone width. */
@media(max-width:480px){
  .decision-grid,
  .guide-sheet .evidence-ledger .decision-grid{
    grid-template-columns:1fr!important;
  }
  .grid-4,
  .grid-5,
  .spec-grid,
  .pros-cons,
  [style*="repeat(4,1fr)"],
  [style*="repeat(4, 1fr)"],
  [style*="repeat(5,1fr)"],
  [style*="repeat(5, 1fr)"]{
    grid-template-columns:1fr 1fr!important;
  }
  .spec-grid,
  .pros-cons{grid-template-columns:1fr!important}
}

/* Sticky inner pages already clear the bar. Drop the old fixed-bar spacer. */
[style*="padding-top:88px"],
[style*="padding:88px"]{padding-top:28px!important}

@media(prefers-reduced-motion:reduce){
  .nav-toggle-icon::before,
  .nav-toggle-icon::after{transition:none}
}
