/* THC Core 1.6.0 — site fixes from the 2026-09-29 audit.
   Every block is gated by a word in <html data-thc-fx="…">, printed server-side from the switches on
   THC → Traffic sources → Settings, so each fix can be turned off on its own:
     scaffold  hide [IMAGE SLOT] figures (only printed for people who cannot edit posts)
     tutordark THC colours in Dark for the mini-cart, select boxes, light-green THC buttons and the home hero
               caption, and a cream mini-cart in Light (the switch keeps its old name)
     cls       lazy images without a set width keep their shape
     contrast  status badges at 4.5:1 or better
     print     clean printouts
   1.12.49 (thc-workboard WB-092 batch 24 part b): every Tutor LMS rule is gone with Tutor (its colour tokens, course
   page, lesson player, dashboard, tooltips, course picture, Q&A editor and print rules), and with them the overflow
   block. Core 1.12.48 has them if Tutor is ever reactivated.
   Dark colours reuse the Display & reading palette (assets/thc-display.css): canvas #1b1915, raised #25221d,
   muted #302c26, border #4a443a, text #efe8da, leaf #93b587, deep leaf #b4cfa8. */

/* ---------- scaffold (belt and braces for the server-side strip) ---------- */
html[data-thc-fx~="scaffold"] .lws-image-slot { display: none !important; }

/* ---------- tutordark (pop-ups, mini-cart, THC buttons, hero caption) ---------- */
/* WooCommerce's mini-cart drawer is white with inherited (now light) text in Dark. */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] :is(.wc-block-mini-cart__drawer, .wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents, .wc-block-mini-cart__drawer .wc-block-mini-cart__title) { background-color: #25221d !important; color: #efe8da; }
/* Home hero caption: its light card kept light text in dark (unreadable). */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] .thc-home-hero__media figcaption { background: rgba(27, 25, 21, .9); color: #efe8da; }
/* THC 2026-10-24 (1.12.29): what a contrast scan of 116 pages in dark found (first shipped as Additional CSS).
   Checkout's white Country box kept light text. */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] body .wc-blocks-components-select__container { background-color: #25221d; }
/* Light-green THC buttons and badges kept white text (2.3:1); dark text is 8.1:1. Ghost buttons have no fill and keep theirs. */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] :is(.thc-search-form__submit, .thc-key__btn, .thc-rf__go, .thc-rf__btn, .thc-ftp__btn, .thc-nd__btn, .thc-lib__btn, .thc-pwa-banner, .thc-app__yours, .thc-lib__tag--region):not([class*="--ghost"]) { color: #15130f; }
/* Buttons that inherit the theme's default button text (dark brown) with no fill of their own. */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] .thc-gear__mode[aria-pressed="false"] { color: #efe8da; }
/* Brown links on the ID keys and the Library's out-of-print note were 2.4:1; orange is 8.0:1. */
html[data-thc-theme="dark"][data-thc-fx~="tutordark"] :is(.thc-key__link, .thc-lib__oop) { color: #e4a96a; }
/* WooCommerce copies the page colour onto the mini-cart drawer when the page loads; keep it cream after a switch from Dark. */
html[data-thc-fx~="tutordark"]:not([data-thc-theme="dark"]) :is(.wc-block-mini-cart__drawer, .wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents, .wc-block-mini-cart__drawer .wc-block-mini-cart__title) { background-color: #fcf8ef !important; }

/* ---------- cls ---------- */
html[data-thc-fx~="cls"] :where(img[loading="lazy"]:not([width])) { height: auto; }

/* ---------- contrast (light) ---------- */
/* "Free / Open for enrollment / Coming soon": #3f5c3b on #a8b79a was 3.53:1; #2b4228 is 5.18:1.
   (THC Search's white-on-green "in course" badge keeps its own colours.) */
/* 1.12.41: Field Tools' filled Nonnative (#5a4a12 on #f1e2b3, 6.7:1) and "calling some" badges keep their own text colour; the dark rule below had painted the Nonnative pill near-white on pale yellow (Micha, 2026-11-01, phone screenshot). */
html[data-thc-fx~="contrast"]:not([data-thc-theme="dark"]) .thc-badge:not(.thc-badge--in-course):not(.thc-badge--exotic):not(.thc-badge--calling-some) { color: #2b4228; }
/* Same badge in dark (#b4cfa8 on #5d6d55 was 3.28:1): 5.12:1. */
html[data-thc-fx~="contrast"][data-thc-theme="dark"] .thc-badge:not(.thc-badge--in-course):not(.thc-badge--exotic):not(.thc-badge--calling-some) { color: #f3f7ef; }

/* ---------- cart drawer above the CookieYes banner (banner is z-index 9999999; the drawer stopped at 100000) ---------- */
html[data-thc-fx~="cartz"] .wc-block-components-drawer__screen-overlay { z-index: 10000001 !important; }

/* ---------- print ---------- */
/* 1.12.42: a primary button among plain buttons in .thc-actions (the preselected $25 on /support/) carries
   wp-element-button, whose global size (0.95rem) made it smaller and shorter than its neighbours, which inherit the
   text size outside .thc-page. It now takes the same size as they do; its filled colour stays the "suggested" cue (WB-063 A8). */
/* 1.12.43: and the same line height (the global button rule's tighter one left it 48 px tall beside 55 px). */
.thc-actions > .thc-button-primary.wp-element-button { font-size: inherit; line-height: inherit; }
:is(.thc-home, .thc-page) .thc-actions > .thc-button-primary.wp-element-button { font-size: 0.95rem; }

@media print {
  html[data-thc-fx~="print"] :is(.thc-bar-header, .thc-bar, .thc-display__panel, .thc-display__button, .thc-site-header, .thc-site-footer, header.wp-block-template-part, footer.wp-block-template-part, #wp-skip-link, .skip-link, .cky-consent-container, .cky-btn-revisit-wrapper, .cky-modal, .cky-overlay, .wc-block-mini-cart, .wc-block-components-drawer__screen-overlay, .wc-block-components-notices__snackbar, .thc-share, .thc-lesson-share, .thc-share-bar, #wpadminbar, .grecaptcha-badge) { display: none !important; }
  html[data-thc-fx~="print"], html[data-thc-fx~="print"] body { background: #fff !important; color: #000 !important; padding-top: 0 !important; margin-top: 0 !important; }
  html[data-thc-fx~="print"] body *:not(img):not(svg):not(svg *):not(video) { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  /* Page content full width, flowing onto every page. */
  html[data-thc-fx~="print"] :is(.wp-site-blocks, main, .entry-content, .wp-block-post-content) {
    width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important;
    height: auto !important; max-height: none !important; overflow: visible !important; position: static !important; flex: none !important; float: none !important;
  }
  html[data-thc-fx~="print"] img { max-width: 100% !important; filter: none !important; break-inside: avoid; }
  html[data-thc-fx~="print"] :is(h1, h2, h3, h4) { break-after: avoid; }
  html[data-thc-fx~="print"] a { text-decoration: underline; }
  /* Show where off-site links go. */
  html[data-thc-fx~="print"] :is(main, article, .entry-content, .wp-block-post-content) a[href^="http"]:not([href*="herpcollective.org"])::after {
    content: " (" attr(href) ")"; font-size: .85em; word-break: break-all;
  }
}
