/* Shared sticky filter zone + date-nav row for News, Drilling, and Movers.
   Pattern lifted from the SEDAR Filings page so all four feed-style surfaces
   behave the same way:
     - Filter section sticks just under the fixed nav.
     - Background matches the page so result rows scrolling under aren't
       visible through the sticky.
     - Mobile-only: scrolling down past a small threshold slides the zone out
       of view; any upward scroll brings it back. Maximises reading area on
       small screens without burying the controls.

   Each page wraps its filter block (and any results-count / date label that
   should also stay pinned) in <div class="mh-sticky-zone">…</div>. Page CSS
   provides the inner card styling; this file owns only the stick + slide
   mechanics and the date-nav row. */

/* Disable scroll anchoring on the document. Without this, collapsing the
   sticky zone (which removes ~140px from document flow) triggers the
   browser's anchor adjustment — it sees the content below the zone jump up
   and "helpfully" reduces scrollY to compensate. If the user only scrolled
   ~100px to cross the collapse threshold, scrollY clamps to 0, the sentinel
   re-enters view, the zone expands again, and the page bounces back to the
   top mid-scroll. This file only loads on the three feed pages (News,
   Drilling, Movers), all of which are tabular surfaces where anchoring
   wasn't doing meaningful work anyway. */
html, body {
  overflow-anchor: none;
}

.mh-sticky-zone {
  position: sticky;
  top: 65px;                  /* clears the fixed desktop nav */
  z-index: 50;
  background-color: #f7f7f7;
  padding-top: 8px;
  padding-bottom: 4px;
  margin: -8px 0 0;
  transition: transform 0.2s ease;
}
.mh-sticky-zone.is-hidden {
  transform: translateY(-120%);
}
@media (max-width: 1023px) {
  .mh-sticky-zone {
    top: 56px;                /* mobile nav is shorter */
  }
}

/* Date navigation row — Previous Day | Current Date | Next Day.
   Rendered beneath Active Filters. The prev/next chevrons are only meaningful
   for single-day date filters (Today / Yesterday); pages should hide them via
   the .is-range modifier on a multi-day range (this week, last 30 days, etc.)
   and show only the centred range label. */
.mh-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 0 10px;
  font-family: 'Roboto', sans-serif;
}
.mh-date-nav-btn {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1f2937;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  padding: 0;
  font-size: 0;
  flex-shrink: 0;
}
.mh-date-nav-btn:hover:not([disabled]) {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}
.mh-date-nav-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.mh-date-nav-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.mh-date-nav-label {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  min-width: 140px;
  text-align: center;
  line-height: 32px;
}
.mh-date-nav.is-range .mh-date-nav-btn {
  /* Hidden for multi-day ranges where prev/next has no obvious unit. The
     range label still renders, centred. */
  display: none;
}

@media (max-width: 600px) {
  .mh-date-nav {
    gap: 10px;
    padding: 4px 0 8px;
  }
  .mh-date-nav-label {
    font-size: 13px;
    min-width: 110px;
  }
}

/* Sticky table column headers for grid-based tables (Movers, Drilling). The
   filter zone above is sticky at top:65px; the column headers sit immediately
   under it. Each page's header element opts in by adding .mh-sticky-table-header.
   IMPORTANT: no ancestor between the header and <body> may set overflow other
   than visible, or sticky stops working. */
.mh-sticky-table-header {
  position: sticky;
  /* nav (65) + measured filter sticky-zone height (published by
     /js/sticky-filters.js as --mh-sticky-zone-h). Pages can override. */
  top: calc(65px + var(--mh-sticky-zone-h, 220px));
  z-index: 40;
  background-color: #ffffff;
}
@media (max-width: 1023px) {
  .mh-sticky-table-header {
    top: 56px;                /* below mobile nav. Filters auto-hide on scroll-down. */
  }
}
