/* Human Earth Lab v28 — conservative layout correction.
   Keeps v26 section rhythm, fixes only the cramped Publications section scroller
   and the broken static Field Notes gallery/detail presentation. */

:root{
  --hel-v28-line: rgba(22,26,29,.14);
  --hel-v28-muted: #656a6d;
  --hel-v28-paper: #f6f5f1;
  --hel-v28-ink: #17191a;
}

/* Publications: section scroller only. No extra content-section spacing. */
body.hel-publications-page .hel-section-nav{
  margin:0!important;
  border-top:0!important;
  border-bottom:1px solid var(--hel-v28-line)!important;
  background:rgba(255,255,255,.96)!important;
}
body.hel-publications-page .hel-section-nav > .container{
  display:flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:clamp(1.75rem,4vw,3.25rem)!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding-top:.78rem!important;
  padding-bottom:.78rem!important;
  scroll-snap-type:x proximity;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch;
}
body.hel-publications-page .hel-section-nav > .container::-webkit-scrollbar{display:none!important}
body.hel-publications-page .hel-section-nav a{
  position:relative;
  flex:0 0 auto!important;
  min-height:36px;
  display:inline-flex!important;
  align-items:center;
  padding:.38rem .08rem .48rem!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#5d6062!important;
  font-size:.86rem!important;
  font-weight:700!important;
  line-height:1.15;
  white-space:nowrap;
  text-decoration:none!important;
  scroll-snap-align:start;
}
body.hel-publications-page .hel-section-nav a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:.13rem;
  height:2px;
  background:transparent;
}
body.hel-publications-page .hel-section-nav a:hover,
body.hel-publications-page .hel-section-nav a:focus-visible{color:var(--hel-v28-ink)!important}
body.hel-publications-page .hel-section-nav a.is-active,
body.hel-publications-page .hel-section-nav a[aria-current="location"]{
  color:var(--hel-v28-ink)!important;
  background:transparent!important;
}
body.hel-publications-page .hel-section-nav a.is-active::after,
body.hel-publications-page .hel-section-nav a[aria-current="location"]::after{background:var(--hel-v28-ink)}

/* Static Field Notes: preserve v26 text/section rhythm; fix gallery only. */
body.hel-static-field-note{overflow-x:hidden}
body.hel-static-field-note .hel-article-nav .container{scrollbar-width:none}
body.hel-static-field-note .hel-article-nav .container::-webkit-scrollbar{display:none}
body.hel-static-field-note #gallery > .container{max-width:1180px!important}
body.hel-static-field-note .hel-field-gallery-shell{min-width:0;width:100%}
body.hel-static-field-note .hel-field-gallery{
  display:flex!important;
  grid-template-columns:none!important;
  gap:clamp(.9rem,1.5vw,1.2rem)!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0 0 .45rem!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scroll-snap-type:x mandatory!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-inline:contain;
  touch-action:pan-x pan-y;
  direction:ltr;
}
body.hel-static-field-note .hel-field-gallery::-webkit-scrollbar{display:none!important}
body.hel-static-field-note .hel-field-photo{
  display:flex!important;
  flex-direction:column;
  flex:0 0 min(78vw,760px)!important;
  width:min(78vw,760px)!important;
  max-width:760px!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.hel-static-field-note .hel-field-photo > a{
  display:grid!important;
  place-items:center;
  width:100%!important;
  height:clamp(340px,50vw,560px)!important;
  min-height:0!important;
  padding:0!important;
  overflow:hidden;
  background:var(--hel-v28-paper)!important;
  border:0!important;
  border-radius:5px!important;
  cursor:zoom-in;
}
body.hel-static-field-note .hel-field-photo img,
body.hel-static-field-note .hel-field-gallery > [class*="col-"] img,
body.hel-static-field-note .hel-field-gallery > [class*="col-"]:first-child img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center!important;
  border-radius:0!important;
  transform:none!important;
}
body.hel-static-field-note .hel-field-photo figcaption{
  display:block!important;
  flex:0 0 auto;
  max-width:72ch!important;
  min-height:0!important;
  margin:0!important;
  padding:.72rem .05rem 0!important;
  color:#54595c!important;
  font-size:.86rem!important;
  line-height:1.48!important;
  background:#fff!important;
  border:0!important;
}
html[dir="rtl"] body.hel-static-field-note .hel-field-photo figcaption{direction:rtl;text-align:right}
body.hel-static-field-note .hel-figure-no{
  display:inline-block;
  margin-inline-end:.5rem;
  color:#252829;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.045em;
  text-transform:uppercase;
}
body.hel-static-field-note .hel-field-gallery-controls{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:.7rem;
  margin-top:.85rem;
}
body.hel-static-field-note .hel-field-gallery-count{
  min-width:4rem;
  color:var(--hel-v28-muted);
  font-size:.8rem;
  font-variant-numeric:tabular-nums;
  text-align:end;
}
body.hel-static-field-note .hel-field-gallery-buttons{display:flex;gap:.45rem}
body.hel-static-field-note .hel-field-gallery-prev,
body.hel-static-field-note .hel-field-gallery-next{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  padding:0;
  border:1px solid rgba(22,26,29,.18);
  border-radius:50%;
  background:#fff;
  color:#1a1c1d;
  font:500 1.3rem/1 Arial,sans-serif;
  cursor:pointer;
}
body.hel-static-field-note .hel-field-gallery-prev:hover:not(:disabled),
body.hel-static-field-note .hel-field-gallery-next:hover:not(:disabled),
body.hel-static-field-note .hel-field-gallery-prev:focus-visible,
body.hel-static-field-note .hel-field-gallery-next:focus-visible{
  border-color:rgba(143,22,32,.5);
  outline:none;
  background:#faf7f5;
}
body.hel-static-field-note .hel-field-gallery-prev:disabled,
body.hel-static-field-note .hel-field-gallery-next:disabled{opacity:.28;cursor:default}

body.hel-v28-lightbox-open{overflow:hidden!important}
.hel-v28-lightbox[hidden]{display:none!important}
.hel-v28-lightbox{
  position:fixed;inset:0;z-index:30000;display:grid;
  grid-template-columns:58px minmax(0,1fr) 58px;align-items:center;gap:.75rem;
  padding:clamp(.8rem,2vw,1.5rem);background:rgba(10,11,11,.95);backdrop-filter:blur(10px)
}
.hel-v28-lightbox-stage{min-width:0;max-height:94svh;display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center}
.hel-v28-lightbox-stage img{display:block;max-width:100%;max-height:78svh;width:auto;height:auto;object-fit:contain}
.hel-v28-lightbox-caption{max-width:920px;margin:.85rem auto 0;color:rgba(255,255,255,.84);font-size:.91rem;line-height:1.48;text-align:center}
.hel-v28-lightbox-count{margin-top:.35rem;color:rgba(255,255,255,.56);font-size:.78rem;font-variant-numeric:tabular-nums}
.hel-v28-lightbox-close,.hel-v28-lightbox-prev,.hel-v28-lightbox-next{
  display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid rgba(255,255,255,.22);
  border-radius:50%;background:rgba(255,255,255,.07);color:#fff;cursor:pointer;font:500 1.45rem/1 Arial,sans-serif
}
.hel-v28-lightbox-close{position:absolute;top:1rem;right:1rem;z-index:2}
html[dir="rtl"] .hel-v28-lightbox-close{right:auto;left:1rem}

@media(max-width:900px){
  body.hel-static-field-note .hel-field-photo{flex-basis:86vw!important;width:86vw!important}
  body.hel-static-field-note .hel-field-photo > a{height:min(61svh,520px)!important}
}
@media(max-width:575.98px){
  body.hel-publications-page .hel-section-nav > .container{
    gap:1.65rem!important;padding-top:.68rem!important;padding-bottom:.68rem!important;padding-inline:.9rem!important
  }
  body.hel-publications-page .hel-section-nav a{min-height:34px;font-size:.84rem!important}
  body.hel-static-field-note .hel-field-photo{flex:0 0 90vw!important;width:90vw!important}
  body.hel-static-field-note .hel-field-photo > a{height:min(60svh,480px)!important}
  body.hel-static-field-note .hel-field-gallery-controls{justify-content:space-between}
  .hel-v28-lightbox{grid-template-columns:1fr;padding:.65rem}
  .hel-v28-lightbox-stage{grid-column:1;grid-row:1;align-self:center}
  .hel-v28-lightbox-prev,.hel-v28-lightbox-next{position:absolute;top:50%;transform:translateY(-50%);z-index:2}
  .hel-v28-lightbox-prev{left:.55rem}.hel-v28-lightbox-next{right:.55rem}
  .hel-v28-lightbox-stage img{max-height:72svh}
  .hel-v28-lightbox-caption{padding:0 2.4rem;font-size:.82rem}
}
@media(prefers-reduced-motion:reduce){body.hel-static-field-note .hel-field-gallery{scroll-behavior:auto!important}}
