/* Hand-written overrides for this migration — client-hhwt.
 *
 * DELIBERATELY OUTSIDE site/public/styles/ (gotcha 49): tools/port-css.mjs owns
 * that directory and clears its own hashed outputs on every run, so a hand-written
 * sheet placed there is deleted by the next port with no error anywhere — on one
 * site that silently removed the sheet that hides the inactive device bands, and
 * all three headers then rendered at every width.
 *
 * EVERY NUMBER BELOW WAS CENSUSED ON THIS SITE. That sentence is here because the
 * file this was carried forward from was byte-identical to client-naturescapelawn's
 * and every count in its prose belonged to that client or to one before it — a blog
 * declaring 29 with 10 visible, ".flexslider on 6 of 31 pages", "27 of 31 pages"
 * carry an accordion, "93 captures", and a paragraph about a slider on
 * insulationspecialistusa.net. None of that is true here. The RULES were sound and
 * are kept; the arithmetic around them is re-derived.
 *
 * Population: 342 captures (114 pages x 3 bands) plus all 114 raw served documents.
 *
 * Keep this file minimal. Anything that can come from the ported cascade should.
 */

/* The honeypot. Positioned off-screen rather than display:none — bots skip
 * obviously-hidden fields, and taking it out of flow means it costs no layout,
 * which the pixel gate would otherwise measure. Live has NO honeypot on this
 * site's ONE form (/contact — censused at 1 of 114 in both the export and the raw
 * served html), so this is ours and must cost nothing. */
.mg-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* SPECIFICITY NOTE — read before editing any rule below.
 *
 * Duda emits a per-widget rule for EVERY widget on the site, shaped
 *
 *     #dm .dmBody div.u_1213107879 { display: block !important }
 *
 * That is specificity (1,2,1) and it is `!important`. A hide written as a plain
 * `.mg-only-t { display:none !important }` is (0,1,0), so `!important` on both
 * sides means SPECIFICITY decides and Duda's rule wins — the element stays visible
 * and nothing in the console says so.
 *
 * So every gate below repeats its class three times behind `#dm`, giving (1,3,0),
 * which outranks (1,2,1) on class count without relying on source order. Do not
 * "tidy" the repetition away.
 */

/* ---------------------------------------------------------------------------
 * BLOG PAGINATION — ONE CONTROL SHAPE HERE, NOT BOTH.
 *
 * The copied version of this block described a site carrying BOTH of Duda's
 * controls at once. Censused on the raw served html of all 114 pages, this site is
 * uniformly the NUMBERED PAGER — there is no show-more control anywhere:
 *
 *   /blog            declared 20, visible 10  NUMBERED PAGER, REPLACES
 *                    <nav class="pagination-nav"> with data-action="paginate",
 *                    POSTing /_dm/s/rt/scripts/ajax_widj_refresh.jsp and SWAPPING
 *                    the card set. more-posts x0, pagination-nav x1.
 *
 *   20 blog posts    declared 19, visible 10  the SAME numbered pager, one per post
 *                    ("related articles"). more-posts x0, pagination-nav x1 on all 20.
 *
 * 21 pages carry a paginated blog widget in total. blog.rss independently declares
 * 20 items, which is the cross-check gotcha 83 requires — a source that cannot agree
 * with our own capture by construction. Driving the pager on live recovered 63 of 63
 * records (21 pages x 3 devices) with 0 incomplete and the identity assertion PASS.
 *
 * A static build has no Duda backend, so every card ships and the ones past the
 * first page are stamped mg-blog-hidden with data-mg-blog-page; runtime.js reveals
 * or swaps them in live's own step size. This rule is what hides them initially.
 * ------------------------------------------------------------------------- */
#dm .mg-blog-hidden.mg-blog-hidden.mg-blog-hidden {
  display: none !important;
}

/* display:none DOES NOT CHANGE CHILD INDICES, so shipping the withheld cards
 * silently moves which card is :last-child — gotcha 69.
 *
 * Duda's own rule is `.postArticle:not(:last-child){padding-bottom:Npx}`. On live
 * the last VISIBLE card is genuinely :last-child and takes none of it. In our build
 * it is followed by hidden siblings, so it stops matching and GAINS that padding,
 * pushing the control and the whole footer down by a constant amount at every width
 * — the signature of one shared element rather than a per-page fault.
 *
 * Keyed on `:has(+ .mg-blog-hidden)` rather than on a stamped class, because that
 * tracks the SEQUENCE as batches are revealed instead of pinning the initial state;
 * runtime.js does not have to re-stamp anything as cards appear. */
#dm .postArticle:not(.mg-blog-hidden):has(+ .postArticle.mg-blog-hidden) {
  padding-bottom: 0;
}

/* ---------------------------------------------------------------------------
 * PER-DEVICE WIDGET FORKS.
 *
 * THE DEVICE FORK ON THIS SITE IS TWO-WAY, MEASURED: the tablet document is
 * BYTE-IDENTICAL to the desktop one on 8 of 8 pages sampled, and only the phone
 * document differs (dmtemplateid mobileHamburgerLayout against Hamburger). The
 * `mg-only-t` gate is therefore expected to be unused or to carry a copy identical
 * to `mg-only-d`; it is kept because build-pages.py emits three pieces wherever the
 * captures disagree, and a gate that is present and unused costs nothing while a
 * missing one is silent.
 *
 * The band boundaries are Duda's own, read out of the ported cascade and confirmed
 * against the hamburger sweep: mobile <=767, tablet 768-1024, desktop >=1025. Note
 * 1025 rather than 1024+1 by assumption — the horizontal nav has width 0 up to 1024
 * and first paints at 1025, and the hamburger button is display:flex up to 1024 and
 * none from 1025.
 *
 * These hide rather than remove, deliberately — the elements stay in the document
 * so the runtime can still address them, and display:none costs no layout.
 *
 * Only the INACTIVE bands are hidden, inside the media queries. The active band is
 * never touched, so it keeps whatever `display` the ported cascade gives it — an
 * earlier version hid all three and restored one with `display: revert`, which
 * reverts past the author cascade to the UA default and would have replaced the
 * widget's real display value with a plain `block`.
 * ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  #dm .mg-only-d.mg-only-d.mg-only-d,
  #dm .mg-only-t.mg-only-t.mg-only-t {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #dm .mg-only-d.mg-only-d.mg-only-d,
  #dm .mg-only-m.mg-only-m.mg-only-m {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  #dm .mg-only-t.mg-only-t.mg-only-t,
  #dm .mg-only-m.mg-only-m.mg-only-m {
    display: none !important;
  }
}

/* ---------------------------------------------------------------------------
 * NO SLIDER RULES — BUT FOR A DIFFERENT REASON THAN ON THE SITE THIS FILE CAME
 * FROM, AND THE INHERITED TEXT WAS FALSE HERE.
 *
 * The copied version of this block read ".flexslider 0, ssrimageslider 0" and
 * concluded there was nothing to rule on. THIS SITE HAS BOTH. Censused over all
 * 114 raw served documents and all 342 captures:
 *     .flexslider            87 of 114 pages  (1 slider on 64, 2 on 23)
 *     ssrimageslider          1 of 114 pages  (the home page)
 *     .bgGallerySlide         0
 *     [data-gallery-bg]       0
 *     <video autoplay>        0
 *
 * No rule is needed anyway, and THAT is the measurement. Every .flexslider here
 * declares, in its own sliderscriptparams:
 *     isAutoPlay:false  directionNav:false  controlNav:false  isFade:true
 * and carries EXACTLY ONE <li> with zero clones. A single-slide fade slider with
 * autoplay off has nothing to advance to and no control to advance it, so the
 * ported cascade renders it correctly at rest. It also means these sliders need no
 * gate --hide: the usual "a carousel never diffs to zero" reasoning does not apply,
 * and excluding them would give up pixel coverage for nothing.
 *
 * `ed-version` stays on every .flexslider (gotcha 28) — it reads like editor
 * metadata and is load-bearing.
 *
 * The ssrimageslider on the home page is a DIFFERENT widget: 7 slide slots, and it
 * CAN advance under a scrolling capture (gotcha 46). Decided from the captures.
 *
 * the widget PAINTS in its settled state and the pixel gate scores the page 0.000%
 * — while every click is inert.
 *
 * CENSUSED HERE, on data-element-type rather than on a class token (styled
 * components generate their class names, so a class regex finds nothing on these):
 * an ssraccordion is on 58 of 114 pages, across 76 DISTINCT widget ids. Unlike the
 * site this file came from, pages here carry MORE THAN ONE: 34 pages have a single
 * root, 11 have 2, 9 have 3, and two pages each have 4 and 5. Items per page run
 * from 2 to 19, most commonly 5 (24 pages); /faq carries 15 in one root and the home
 * page three roots of 5, 2 and 5.
 *
 * LIVE'S ACCORDION WORKS, so ours must too — NOT gotcha 91's inert case. Measured on
 * live at 1440 with a REAL hit-tested click (elementFromPoint at the title's centre
 * returns SPAN.sc-eqUAAy, so the click demonstrably lands): every panel is 0/0 at
 * rest, and clicking item 1 opens it to 96/96 on /faq and 64/64 on home, leaving its
 * siblings closed.
 *
 * THE CLOSED RULE IS IN THE PORT AND THE OPEN RULE IS NOT, AND THAT IS NOT A
 * PORTING MISTAKE. styled-components insert through the CSSOM, so a class exists in
 * a document's sheet only if that component actually RENDERED with it. Measured:
 * the closed state
 *
 *     .dygwmn { overflow:hidden; transition:max-height .3s ease-out;
 *               height:auto; max-height:0px; }
 *
 * appears 537 times across the captures, while the OPEN class is minted per render
 * — ELEVEN distinct names seen (ctGkua, iWTYns, jrXmxD, lkQkcT, hVjNUn, jCZtbv,
 * cpMcTW, gqFKNX, CoQjN, lbMDqK and more), differing by page AND by device. So no
 * open-state name can be hardcoded, and restoring the rule under OUR OWN class is
 * recovering a sheet the live read could not reach.
 *
 * The transition runs on MAX-HEIGHT, so opening means raising it.
 *
 * Repeated behind #dm to clear Duda's own per-widget !important display rules.
 * ------------------------------------------------------------------------- */
#dm .mg-acc-open.mg-acc-open.mg-acc-open {
  max-height: 2000px;
}
