/* Hand-written overrides for this migration — client-checkmatecarpetcleaning.
 *
 * 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 (client-ftmheatingandcoolingservices) had every
 * count belonging to that client or to one before it — its blog table, its slider
 * census, its band arithmetic and its accordion measurements were all that site's.
 * The RULES were sound and are kept; the arithmetic around them is re-derived.
 *
 * Population: 300 captures (100 pages x 3 bands), all 100 raw served desktop
 * documents and all 100 served under a phone UA.
 *
 * 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 either of this site's two
 * forms, so this is ours and must cost nothing.
 *
 * /migration phase 8 specifies exactly this and one fleet repo shipped the spec
 * unimplemented — its honeypot rendered as an ordinary 40px text field and read as a
 * 46px layout defect. */
.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 (1,2,1) and it is `!important`. A hide written as a plain
 * `.mg-only-t { display:none !important }` is (0,1,0), so with `!important` on both
 * sides 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 SHAPE ON THIS SITE, AND IT IS ON TWENTY-ONE PAGES.
 *
 * Censused on the raw served html of all 100 pages and confirmed by driving live's
 * own control (generated/blog-widgets.json — 63 records, 0 incomplete, identity
 * assertion PASS):
 *
 *   /blog             declared 20, visible 10   NUMBERED PAGER, steps [10,10]
 *   20 blog posts     declared 19, visible  9   NUMBERED PAGER, steps [9,9,2]
 *
 *   <nav class="pagination-nav"> with data-action="paginate", POSTing
 *   /_dm/s/rt/scripts/ajax_widj_refresh.jsp with a 0-BASED pageNumber, and SWAPPING
 *   the card set rather than appending to it.
 *
 * There is NO more-posts-text-container anywhere on this site; the "Show More /
 * appends" shape this driver also handles has no instance here.
 *
 * blog.rss independently declares 20 items, which is the cross-check that cannot
 * agree with our own capture by construction.
 *
 * A post's widget declares 19 because it excludes the post being read — but on SOME
 * posts live's AJAX backend returns that post ITSELF on a later page, so those
 * legitimately yield 20 distinct aliases against a declared 19. That is Duda's own
 * inconsistency and is reproduced rather than reconciled.
 *
 * 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 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 swapped instead of pinning the initial state;
 * runtime.js does not have to re-stamp anything. */
#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 PER PAGE over 300 subjects: the
 * tablet document is BYTE-IDENTICAL to the desktop one on 100 of 100 pages (dEqT
 * true for every page in generated/served-fork.json, derived from the served bytes
 * rather than copied down from a site-level claim), and only the phone document
 * differs (dmtemplateid mobileHamburgerLayout against Hamburger, on 100/100). The
 * template is ResponsiveDesktopTopTabletHamburger — the named template gotcha 62
 * records for the two-way case. 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 AND WERE MEASURED TWO INDEPENDENT WAYS ON THIS
 * SITE, not carried forward:
 *
 *   (a) the media queries the ported cascade actually contains, counted over
 *       site/public/styles/: 767px x317, 768px x239, 1024px x186, 1025px x166 —
 *       so the breakpoints are Duda's own 767/768 and 1024/1025 pair.
 *
 *   (b) behaviour, by sweeping 19 viewport widths on live with a desktop UA and
 *       reading the drawer's painted width (tools/measure-bands.mjs):
 *          320 -> 156.8   375 -> 183.8   767 -> 375.8   768 -> 376.3
 *          1023 -> 501.3  1024 -> 501.8  1025 -> 0      1440 -> 0
 *       i.e. the drawer is 49vw up to 1024 and gone from 1025. The two agree
 *       exactly, so 1025 is the desktop edge on evidence rather than by assuming
 *       1024+1.
 *
 * So: mobile <=767, tablet 768-1024, desktop >=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 — hiding
 * all three and restoring one with `display: revert` reverts past the author cascade
 * to the UA default and replaces 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;
  }
}

/* ---------------------------------------------------------------------------
 * SLIDERS: THIS SITE HAS 184 OF THEM AND NOT ONE MOVES. NO RULE IS NEEDED HERE,
 * AND NOTHING IS EXCLUDED FROM THE PIXEL GATE ON ROTATION GROUNDS.
 *
 * Censused over all 100 raw served desktop documents:
 *
 *     .flexslider / .dmImageSlider / dSliderId    184 widgets on 94 of 100 pages
 *     ssrimageslider                                1 page
 *     .bgGallerySlide / [data-gallery-bg]           0
 *     <video autoplay>                              0
 *
 * EVERY ONE OF THE 184 HAS EXACTLY ONE SLIDE. The slides-per-<ul class=slides>
 * distribution over the corpus is {1: 184} — not a single multi-slide instance
 * anywhere — so autoplay has nothing to advance to. 166 declare isAutoPlay:false
 * and 18 declare isAutoPlay:true; all 184 are single-slide regardless.
 *
 * VERIFIED ON LIVE rather than reasoned about (tools/scratch/probe-slider-live.mjs):
 * two pages, sliders first scrolled into view because Duda widgets lazy-init on
 * intersection (gotcha 89), then watched for 16 SECONDS — more than two full 7000ms
 * slideshow intervals — with slide count, active index, every <li> class list, every
 * computed opacity and the film-role transform all unchanged. NO CHANGE on both.
 *
 * Consequences, and both matter:
 *   * NOTHING IS EXCLUDED FROM THE PIXEL GATE on rotation grounds, so these 184
 *     widgets keep FULL pixel coverage. An exclusion that is not needed is not free.
 *   * check-slider.mjs correspondingly reports its motion assertion as SKIP —
 *     "1 real slide, nothing to advance" — which is honest: it produced no evidence
 *     about motion, and it did not need to, because there is none on live either.
 *
 * `ed-version` IS LOAD-BEARING and lives in the PORTED cascade, not here: the slides
 * carry Duda's untouched "Slide title" (16 pages), "Write your caption here" (16) and
 * "Button" (18) placeholders, and the ported sheet hides them with rules scoped
 * `.flexslider.ed-version …` (measured present in site/public/styles/). Dropping that
 * class from a class list would paint all three on those pages.
 * ------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
 * ACCORDION OPEN STATE — recovering a rule the live CSS read cannot see.
 *
 * The FAQ-style accordion is a styled-component driven by Duda's runtime, which is
 * correctly not ported. The markup and the ported cascade both arrive intact, so 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): `ssraccordion`
 * is on 55 of 100 pages, 68 widgets — 42 pages carry one and 13 carry two. UNLIKE the
 * previous client, /faq DOES have one here (14 items), so a probe that checks only
 * /faq would find a real subject on this site; it would still miss the other 54.
 * Measured per widget on live (generated/accordion-reveal.json): 48 auto-open on
 * reveal and 20 stay closed, and 26 widget configs declare closeOthers.
 *
 * 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. The served
 * <style data-styled> is EMPTY and 20 rules are injected at runtime. Measured on live:
 *
 *     closed  .dygwmn  { overflow:hidden; transition:max-height .3s ease-out;
 *                        height:auto; max-height:0px }   <- shared by ALL THREE bands
 *     open    .gnWefg  { … max-height:96px  }   desktop @1440
 *     open    .sLYgM   { … max-height:128px }   tablet  @768
 *     open    .blymzF  { … max-height:152px }   mobile  @375
 *
 * THE OPEN CLASS IS MINTED PER DISTINCT PIXEL HEIGHT, so items sharing a height share
 * a class. 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. The generous ceiling
 * below reproduces the SETTLED states exactly — closed is max-height:0 from the ported
 * cascade, open is "tall enough" — which is what the gate compares. It does NOT
 * reproduce live's per-item easing curve, and that is recorded as a deviation rather
 * than hidden: the 96/128/152 values are viewport- and font-dependent and were
 * measured on one page at three widths, so pinning them site-wide would be a
 * fabricated precision, not a faithful one. The panel renders at its CONTENT height
 * under a generous ceiling, and on live content height == max-height for the open
 * item at every band (96/96, 128/128, 152/152), so the settled paint is reproduced
 * exactly.
 *
 * 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;
}
