/**
 * EasyBuild — public page-builder stylesheet.
 *
 * Resolves the editor's component style-scale classes (eb-sc-<key>-<value>, emitted by
 * Module::style_to_classes / EBBuilderDnD.styleToClasses) to real CSS on the published FLAT-HTML
 * page. Design-token driven only — every colour is var(--eb-*), so this file contains NO hex.
 * Mirrors the editor's injectStyleScaleCss so the front end renders exactly what was previewed.
 */

/* Flat page scaffold (no iframes — Kartra's published page is flat HTML). */
.eb-pb-page { color: var(--eb-text); font-family: var(--eb-font, inherit); }

/* --- BASE, and why it is here: a published page now renders inside whatever theme the site
 *     runs, and a theme's element rules (`h1 {}`, `img {}`, `ul {}`) would otherwise restyle
 *     components that were designed against nothing of the sort. These give every element the
 *     builder can emit its own value at `.eb-pb-page <el>` — one class more specific than any
 *     bare element rule, and than the `:where()`-wrapped selectors block themes compile to.
 *
 *     It sits BEFORE the .eb-pb-comp rules below on purpose: those are equally specific and
 *     must keep winning, because they are where the eb-sc-* style tokens land. Anything a
 *     component tokenises is therefore unchanged by this block; anything it does not falls back
 *     here instead of to the host page. Token / rem values only, 0 hex. --- */
.eb-pb-page, .eb-pb-page *, .eb-pb-page *::before, .eb-pb-page *::after { box-sizing: border-box; }
.eb-pb-page h1, .eb-pb-page h2, .eb-pb-page h3,
.eb-pb-page h4, .eb-pb-page h5, .eb-pb-page h6 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; font-family: inherit; color: inherit; }
.eb-pb-page h1 { font-size: 2.25rem; }
.eb-pb-page h2 { font-size: 1.75rem; }
.eb-pb-page h3 { font-size: 1.375rem; }
.eb-pb-page h4 { font-size: 1.125rem; }
.eb-pb-page h5 { font-size: 1rem; }
.eb-pb-page h6 { font-size: .875rem; }
.eb-pb-page p { margin: 0 0 1em; }
.eb-pb-page ul, .eb-pb-page ol { margin: 0 0 1em; padding-left: 1.4em; }
.eb-pb-page li { margin: 0 0 .35em; }
.eb-pb-page img { max-width: 100%; height: auto; }
/* The button IS an <a>; :not() keeps this off it so .eb-pb-btn below still paints. */
.eb-pb-page a:not(.eb-pb-btn) { color: var(--eb-primary-hover); text-decoration: underline; }
/* position:relative anchors the section-level background LAYERS (video, pattern ::before) added
   below. No offsets → a visual no-op for existing sections (no absolutely-positioned children today), so
   legacy pages are unchanged; only new layered backgrounds depend on it. */
.eb-pb-section { padding: 48px 24px; position: relative; }
.eb-pb-columns { display: flex; flex-wrap: wrap; gap: 12px; }
.eb-pb-boxed { max-width: 1120px; margin: 0 auto; } /* boxed-width section container */
.eb-pb-col { flex: 1 1 100%; max-width: 100%; }
.eb-pb-comp { margin: 0 0 12px; }
.eb-pb-comp:last-child { margin-bottom: 0; }
/* DETERMINISTIC base typography — one source for BOTH the builder canvas and the
   published page (both enqueue this file), so text no longer inherits the host's own defaults (WP
   admin heading styles in the editor vs the front-end theme on the page). Text SIZE + WEIGHT come
   only from the eb-sc-* tokens on the .eb-pb-comp wrapper (applied to the child via `inherit`);
   untokened text uses the wrapper base below. Closes the canvas↔public drift (H1 weight/color, H2
   size, button-label size). Token / inherit values only — 0 hex. */
.eb-pb-comp { font-size: 1rem; font-weight: 400; line-height: 1.55; color: var(--eb-text); font-family: var(--eb-font, inherit); }
.eb-pb-comp h1, .eb-pb-comp h2, .eb-pb-comp h3, .eb-pb-comp h4, .eb-pb-comp h5, .eb-pb-comp h6,
.eb-pb-comp p, .eb-pb-comp li, .eb-pb-comp blockquote, .eb-pb-comp figure {
  font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; font-family: inherit; margin: 0;
}
.eb-pb-comp h1, .eb-pb-comp h2, .eb-pb-comp h3, .eb-pb-comp h4 { line-height: 1.2; }
/* ...but an UNTOKENED heading is still a heading. The `inherit` rule above is what makes an
   eb-sc-size-* / eb-sc-weight-* token on the wrapper reach the child — and it also flattened every
   heading nobody had tokenised down to the wrapper's 1rem/400, so the shipped hero rendered
   <h1>Launch Landing</h1> at 16px in the same weight as its body copy. These give the heading its
   scale back WITHOUT taking the token away: the size rule is skipped the moment the wrapper carries
   any eb-sc-size-*, the weight rule the moment it carries any eb-sc-weight-*, so a tokenised
   component is byte-for-byte unchanged. Same file for the canvas and the published page, so the
   editor shows what the visitor gets. rem values only, 0 hex. */
.eb-pb-comp:not([class*="eb-sc-size-"]) h1 { font-size: 2.25rem; }
.eb-pb-comp:not([class*="eb-sc-size-"]) h2 { font-size: 1.75rem; }
.eb-pb-comp:not([class*="eb-sc-size-"]) h3 { font-size: 1.375rem; }
.eb-pb-comp:not([class*="eb-sc-size-"]) h4 { font-size: 1.125rem; }
.eb-pb-comp:not([class*="eb-sc-weight-"]) h1,
.eb-pb-comp:not([class*="eb-sc-weight-"]) h2,
.eb-pb-comp:not([class*="eb-sc-weight-"]) h3,
.eb-pb-comp:not([class*="eb-sc-weight-"]) h4 { font-weight: 700; }
/* Let a divider's hr take the wrapper's colour token (UA sets hr{color:gray} directly,
   which otherwise beats the inherited eb-sc-color-* on the wrapper). currentColor then tints it. */
.eb-pb-comp hr { color: inherit; }
/* The SINGLE, token-driven .eb-pb-btn. Label --eb-navy on the --eb-cta fill =
   8.53:1 (mirrors admin .eb-btn-cta; --eb-on-primary #fff would be 2.07:1). The theme's hardcoded
   duplicate (theme.css) is REMOVED, so THIS rule now actually paints on every served /eb-page/ —
   overriding --eb-cta/--eb-navy changes the button (that override was dead before, masked by the theme). Keeps
   the theme's currently-live pill look (inline-flex, --eb-radius-pill, weight 700), now tokenized. One
   implementation for both the button and the popup CTA. */
/* A control on a section BAND has no contrast guarantee from its fill alone — a --eb-cta
   (green) button on a --eb-cta band is 1.0000:1 boundary (invisible). The navy border gives a >=3:1
   boundary (WCAG 1.4.11) against EVERY band token: navy vs cta/primary/muted/surface bands is high, and on
   a navy band the green fill itself separates. Label stays navy-on-cta = 8.53:1. */
.eb-pb-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border-radius: var(--eb-radius-pill); background: var(--eb-cta); color: var(--eb-navy); border: 1px solid var(--eb-navy); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.2; font-family: inherit; }
.eb-pb-nav span { margin-right: 16px; }

/* --- Style-scale classes: 1:1 with STYLE_SCALES. Token/rem values only, 0 hex. --- */
.eb-sc-align-left { text-align: left; }
.eb-sc-align-center { text-align: center; }
.eb-sc-align-right { text-align: right; }

.eb-sc-size-tiny { font-size: .75rem; }
.eb-sc-size-small { font-size: .875rem; }
.eb-sc-size-medium { font-size: 1rem; }
.eb-sc-size-large { font-size: 1.375rem; }
.eb-sc-size-giant { font-size: 2rem; }
.eb-sc-size-full { font-size: 2.75rem; }

.eb-sc-margin-none { margin: 0; }
.eb-sc-margin-small { margin: var(--eb-space-2); }
.eb-sc-margin-medium { margin: var(--eb-space-4); }
.eb-sc-margin-large { margin: var(--eb-space-6); }

.eb-sc-shadow-none { box-shadow: none; }
.eb-sc-shadow-small { box-shadow: var(--eb-shadow-sm); }
.eb-sc-shadow-medium { box-shadow: var(--eb-shadow-md); }
.eb-sc-shadow-large { box-shadow: var(--eb-shadow-lg); }

/* S07-O7 — the inline toolbar's two block-level typography scales. Mirror of
   Page_Styles::style_scales() and of builder-dom.js's canvas copy. */
.eb-sc-lineheight-tight { line-height: 1.2; }
.eb-sc-lineheight-normal { line-height: 1.4; }
.eb-sc-lineheight-relaxed { line-height: 1.6; }
.eb-sc-lineheight-loose { line-height: 1.8; }

.eb-sc-textshadow-none { text-shadow: none; }
.eb-sc-textshadow-small { text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.eb-sc-textshadow-medium { text-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.eb-sc-textshadow-large { text-shadow: 0 4px 10px rgba(0, 0, 0, .35); }

.eb-sc-corners-none { border-radius: 0; }
.eb-sc-corners-small { border-radius: var(--eb-radius-sm); }
.eb-sc-corners-medium { border-radius: var(--eb-radius); }
.eb-sc-corners-large { border-radius: var(--eb-radius-lg); }
.eb-sc-corners-round { border-radius: var(--eb-radius-pill); }

.eb-sc-weight-regular { font-weight: 400; }
.eb-sc-weight-medium { font-weight: 500; }
.eb-sc-weight-bold { font-weight: 700; }
.eb-sc-weight-black { font-weight: 900; }

.eb-sc-bg-none { background: transparent; }
/* The builder's bg swatches carried white on primary/cta = 3.70 / 2.07. --eb-navy clears
   AA on both fills (4.78 / 8.53) in both palettes. --eb-on-navy (white) is correct on the dark navy fill.
   EVERY bg pick now pairs its OWN text AND resets --eb-text at its scope — a bg pick
   creates a new ground, so text chosen for the band's ground (the section's --eb-text override) must not
   ride in. muted/surface pair --eb-text-base (the un-overridable palette-text alias): on a navy band the
   section sets --eb-text to white, and white-on-white (1.0000, the falsifier's two-click screenshot) is
   exactly what the base alias exists to prevent. ONE pair table: PHP Module::pair_tables() is the source;
   this block and the canvas's generated copy (builders.js EB_SC_BG_PAIRS) are its mirrors, suite-locked. */
/* A ground is a GROUND — every pick carries the FULL ground-scoped token set
   (text + muted + field-edge; the missing field-edge left an invisible 1.0000 border on a field
   inside a muted pick). One source: pair_tables().bg_pick 4-tuples; the canvas generates from the
   same table; the emitter LOCK in test-p98-furniture iterates ground_scoped_tokens over both. */
.eb-sc-bg-primary { background: var(--eb-primary); color: var(--eb-navy); --eb-text: var(--eb-navy); --eb-text-muted: var(--eb-navy); --eb-field-edge: var(--eb-navy); }
.eb-sc-bg-navy { background: var(--eb-navy); color: var(--eb-on-navy); --eb-text: var(--eb-on-navy); --eb-text-muted: var(--eb-on-navy); --eb-field-edge: var(--eb-on-navy); }
.eb-sc-bg-cta { background: var(--eb-cta); color: var(--eb-navy); --eb-text: var(--eb-navy); --eb-text-muted: var(--eb-navy); --eb-field-edge: var(--eb-ink); }
.eb-sc-bg-muted { background: var(--eb-surface-2); color: var(--eb-text-base); --eb-text: var(--eb-text-base); --eb-text-muted: var(--eb-text-muted-base); --eb-field-edge: var(--eb-band-edge); }
.eb-sc-bg-surface { background: var(--eb-surface); color: var(--eb-text-base); --eb-text: var(--eb-text-base); --eb-text-muted: var(--eb-text-muted-base); --eb-field-edge: var(--eb-band-edge); }

/* The builder-selectable "primary" TEXT swatch was --eb-primary = 3.61:1 on the light
   surface (and 1.0000:1 if a user also picks a primary BAND — an inherent same-colour conflict a per-swatch
   value cannot solve; disclosed). --eb-primary-hover is 4.59:1 on the default light surface, legible in dark. */
/* The DEFAULT ground joined the pair system. These base rules ARE the
   default-ground resolution (bands/bg-picks override them with their own pairs); each swatch now
   resolves through a per-palette SWATCH-TEXT token guaranteed ≥4.5 on the palette surface — the
   old direct tokens gave surface 1.0000 both themes, navy 1.03 dark, cta 2.02 light with one
   picker click on a plain section. One source: pair_tables().swatch_text; mirrored in the canvas. */
.eb-sc-color-primary { color: var(--eb-primary-hover); }
.eb-sc-color-navy { color: var(--eb-navy-text); }
.eb-sc-color-cta { color: var(--eb-cta-text); }
.eb-sc-color-muted { color: var(--eb-text-muted); }
.eb-sc-color-surface { color: var(--eb-surface-text); }
/* Within a band section, the band's paired text colour WINS over a component's
   .eb-sc-color-* pick (the section knows its band; the component colour does not). Specificity (0,2,0)
   beats the single-class .eb-sc-color-* (0,1,0).
   `inherit` is GONE — it resolved from the parent chain, not the band, so any
   intermediate element that set a colour (an anchor, a muted container, an inline style in an html
   component's author markup) carried its own colour through: measured 1.47–4.24:1 on served pixels.
   `var(--eb-text)` instead rides CUSTOM-PROPERTY inheritance, which pierces intermediate `color`
   settings: it resolves from the nearest scope that DEFINES --eb-text — the band section (its pair)
   or a bg-pick component (its pair, which also resets --eb-text above). No shipped rule defines
   --eb-text on any intermediate container (verified: zero `--eb-text:` declarations outside section
   inline styles and the bg-pick block), so the pair always wins at any DOM depth.
   Ships in both places the rule lives — this sheet and the canvas's injected copy (builders.js). */
.eb-pb-band [class*="eb-sc-color-"] { color: var(--eb-text); }
/* The same band principle one level down — a bg PICK knows its ground; a colour
   pick does not. On the pick's own element the bg rules above already reset --eb-text, so this
   resolves to the bg pair; it also covers a colour pick NESTED anywhere under a bg-picked component
   (html-component markup included) and applies outside bands too, where the band rule cannot reach. */
[class*="eb-sc-bg-"]:not(.eb-sc-bg-none)[class*="eb-sc-color-"],
[class*="eb-sc-bg-"]:not(.eb-sc-bg-none) [class*="eb-sc-color-"] { color: var(--eb-text); }

/* LINKS JOIN THE PAIR SYSTEM. A bare anchor rendered the UA default — blue on a
   navy band 1.8836 light, light-blue on the green band 1.1519 dark, no author hand anywhere. The
   link colour is the GROUND'S OWN text pair: `var(--eb-text)` resolves to the band pair inside
   bands (the band machinery above), the bg-pick pair under bg-picks, and the palette text on the default
   ground — every value already >= 4.5 by the standing matrices. DISTINGUISHABILITY (WCAG 1.4.1) is
   carried by the UNDERLINE, not colour (recorded choice: a per-ground accent colour cannot be
   guaranteed legible on every band; the underline can). Hover thickens the underline from the same
   row; visited keeps the same colour (recorded). .eb-pb-btn is a BUTTON, not body-copy — excluded. */
.eb-pb-page a:not(.eb-pb-btn) { color: var(--eb-text); text-decoration: underline; }
.eb-pb-page a:not(.eb-pb-btn):hover { text-decoration-thickness: 2px; }
.eb-pb-page a:not(.eb-pb-btn):visited { color: var(--eb-text); }

/* The double-ring reaches the focusables that EXIST on served builder
   pages — .eb-pb-btn, content anchors, and the form controls (the first ring was wired to .eb-btn
   only, a class absent from every served /eb-page/: 0 of its 37 focusables). The ring's inner-vs-
   outer contrast (5.9207) is ground-independent — the pair is visible on any band by geometry. */
/* Coverage derives from the RENDER SPACE, not from classes a fixture happened to
   use — radio/checkbox/rating inputs render CLASS-LESS (renderField), so the earlier class list left
   50 focusables on one page under the UA default. The element-scoped :is() covers EVERY control
   the form component can mint, whatever renderField emits. The honeypot (.eb-public-hp,
   tabindex=-1) is inert BY DESIGN — unreachable by Tab, its exclusion is intentional. */
/* The render space does not stop at the form — public.js mints interactive
   controls OUTSIDE every .eb-public-form wrapper: the calendar's .eb-cal-slot buttons (a SIBLING
   of the booking form) and the gallery lightbox's three buttons (appended to document.body).
   Both matched NO ring rule (UA default — the exact invisible-ring bug, one mount over). And the SERVER
   renderer mints buttons outside forms too (.eb-pb-popup-close, .eb-pb-upsell-accept/-decline) —
   `.eb-pb-page button` covers every button inside the page container (the theme's <main
   class="eb-pb-page"> wraps all served render output), present AND future; the lightbox trio is
   listed BY NAME because document.body mounts outside that container. test-p98-furniture derives
   the census from public.js's own emissions (`<button` included) and REDs on any unlisted class. */
.eb-pb-btn:focus-visible,
.eb-pb-page a:focus-visible,
.eb-pb-page button:focus-visible,
.eb-cal-slot:focus-visible,
.eb-lightbox-close:focus-visible,
.eb-lightbox-prev:focus-visible,
.eb-lightbox-next:focus-visible,
.eb-public-form :is(input, select, textarea, button):focus-visible { outline: none; box-shadow: var(--eb-focus); }

/* Give a coloured background component a little breathing room so the swatch reads. */
.eb-pb-comp[class*="eb-sc-bg-"]:not(.eb-sc-bg-none) { padding: 16px; }

/* ============================================================================
 * SECTION GEAR: background video/pattern, reveal delay, per-device hide.
 * Token-driven only (var(--eb-*)) — 0 hex. Mirrors the editor canvas.
 * ==========================================================================*/

/* --- Background VIDEO layer (behind the section's content, over its fallback bg). --- */
.eb-sec-bgvideo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; border: 0; pointer-events: none;
}
/* Keep the columns above both the video and the pattern overlay. */
.eb-pb-section > .eb-pb-columns, .eb-pb-section > .eb-pb-boxed { position: relative; z-index: 1; }

/* --- Background PATTERN overlays (::before, token colours only). Painted over the base background,
 *     under the content. `none` emits no class. --- */
.eb-secpat-dots::before, .eb-secpat-grid::before,
.eb-secpat-diagonal::before, .eb-secpat-checks::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
}
.eb-secpat-dots::before {
  background-image: radial-gradient(var(--eb-border) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
}
.eb-secpat-grid::before {
  background-image: linear-gradient(var(--eb-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--eb-border) 1px, transparent 1px);
  background-size: 24px 24px;
}
.eb-secpat-diagonal::before {
  background-image: repeating-linear-gradient(45deg, var(--eb-border) 0, var(--eb-border) 1px, transparent 1px, transparent 10px);
}
.eb-secpat-checks::before {
  background-image: linear-gradient(45deg, var(--eb-border) 25%, transparent 25%, transparent 75%, var(--eb-border) 75%),
                    linear-gradient(45deg, var(--eb-border) 25%, transparent 25%, transparent 75%, var(--eb-border) 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px; opacity: .25;
}

/* --- Reveal DELAY. 100% CSS: runs without JS, and DEGRADES TO VISIBLE — no animation support leaves the
 *     element at its normal opacity, and reduced-motion disables it entirely. The section always occupies
 *     layout space (no reflow jump); only its opacity/translate animate. --- */
@keyframes ebSecReveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eb-secdelay-short  { animation: ebSecReveal .5s ease both; animation-delay: .3s; }
.eb-secdelay-medium { animation: ebSecReveal .5s ease both; animation-delay: .8s; }
.eb-secdelay-long   { animation: ebSecReveal .5s ease both; animation-delay: 1.5s; }
@media (prefers-reduced-motion: reduce) {
  .eb-secdelay-short, .eb-secdelay-medium, .eb-secdelay-long { animation: none; opacity: 1; transform: none; }
}

/* --- Per-device HIDE moved to public-pagebuilder-responsive.css (S07-O8). The three classes are
 *     unchanged and so are their breakpoints (mobile ≤640px · tablet 641–1024px · desktop ≥1025px);
 *     what changed is that they are now CONTAINER queries against the page's own width, so the
 *     builder's 390px canvas sheet hides a mobile-hidden element exactly as a phone does. No
 *     device rule may live in THIS file — the suite asserts that. --- */

/* --- S07-O6 property panels: the Effects tab's animation trigger. -------------------------
 * Four values, three of them animated ON LOAD. There is no scroll trigger in this pass — a
 * component's effect plays when the page paints, and `prefers-reduced-motion` turns it off
 * without leaving the component invisible (opacity/transform reset, never `display:none`). */
@keyframes ebFxFade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ebFxSlide { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ebFxZoom  { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.eb-fx-fade  { animation: ebFxFade  .55s ease both; }
.eb-fx-slide { animation: ebFxSlide .55s ease both; }
.eb-fx-zoom  { animation: ebFxZoom  .55s ease both; }
@media (prefers-reduced-motion: reduce) {
  .eb-fx-fade, .eb-fx-slide, .eb-fx-zoom { animation: none; opacity: 1; transform: none; }
}

/* The Button panel's Icon tab: one glyph beside the label, never instead of it. */
.eb-pb-btn-icon { font-size: 1.1em; line-height: 1; }
.eb-pb-btn-icon:first-child { margin-right: .5em; }
.eb-pb-btn-icon:last-child  { margin-left: .5em; }
/* A "Pop an opt-in form" button's mount host is a marker, not a box — the modal shell it
   fetches is moved to <body> by form-embed.js and positioned there. */
.eb-form-pop-host { display: none; }
