/* website-theme.css — PUBLIC website-builder pages only (html.ws-pub-html /
 * body.ws-pub). Design tokens the site's "shape" settings and presets write
 * to, a reading-size type scale (the admin app stays at 14px mono), header /
 * nav / button variants, and the full-bleed helpers layout blocks rely on.
 *
 * Tokens (overridden per site from WebsiteTheme::shapeCss):
 *   --ws-font-size   base size (15–19px)          --ws-radius   corner radius
 *   --ws-space       spacing multiplier (.8–1.3)  --ws-shadow   card/hero shadow
 *   --ws-gutter      side gutter                  --ws-content-max  column width
 */
html.ws-pub-html { font-size: var(--ws-font-size, 17px); }
@media (max-width: 640px) { html.ws-pub-html { font-size: calc(var(--ws-font-size, 17px) - 1px); } }

body.ws-pub {
    --ws-font-size: 17px;
    --ws-radius: 10px;
    --ws-btn-radius: var(--ws-radius);
    --ws-space: 1;
    --ws-shadow: 0 8px 24px rgba(0,0,0,0.08);
    --ws-gutter: 2em;
    --ws-content-max: 800px;
    line-height: 1.6;
}
body.ws-pub[data-ws-radius="sharp"] { --ws-radius: 2px; }
body.ws-pub[data-ws-radius="soft"]  { --ws-radius: 10px; }
body.ws-pub[data-ws-radius="round"] { --ws-radius: 20px; }
body.ws-pub[data-ws-density="compact"] { --ws-space: 0.8; }
body.ws-pub[data-ws-density="airy"]    { --ws-space: 1.3; }
body.ws-pub[data-ws-shadow="none"]   { --ws-shadow: none; }
body.ws-pub[data-ws-shadow="strong"] { --ws-shadow: 0 16px 40px rgba(0,0,0,0.18); }
body.ws-pub[data-ws-buttons="pill"]   { --ws-btn-radius: 999px; }
body.ws-pub[data-ws-buttons="square"] { --ws-btn-radius: 3px; }
@media (max-width: 640px) { body.ws-pub { --ws-gutter: 0.55em; } }
@media (max-width: 400px) { body.ws-pub { --ws-gutter: 0.35em; } }

/* ── Type scale for public content ─────────────────────────────────── */
.ws-pub .ws-pub-content { line-height: 1.65; }
.ws-pub .ws-pub-content h1 { font-size: 2rem;   line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.6em; }
.ws-pub .ws-pub-content h2 { font-size: 1.45rem; line-height: 1.25; margin: calc(1.6em * var(--ws-space)) 0 0.5em; }
.ws-pub .ws-pub-content h3 { font-size: 1.15rem; line-height: 1.3;  margin: calc(1.3em * var(--ws-space)) 0 0.4em; }
.ws-pub .ws-pub-content h4 { font-size: 1rem; margin: 1.2em 0 0.3em; }
.ws-pub .ws-pub-content p, .ws-pub .ws-pub-content li { font-size: 1rem; }
.ws-pub .ws-pub-content p { margin: 0 0 1em; }
.ws-pub .ws-pub-content > p:first-child { margin-top: 0; }
.ws-pub .ws-pub-content blockquote { font-size: 1.05rem; }
.ws-pub .ws-pub-content img { border-radius: var(--ws-radius); }
.ws-pub .ws-pub-content table { font-size: 0.92rem; }
.ws-pub .site-nav a { font-size: 0.92rem; }
.ws-pub .site-logo { font-size: 1.15rem; }
.ws-pub .theme-toggle, .ws-pub .ws-nav-search input[type="search"] { font-family: inherit; }

/* ── Header variants ────────────────────────────────────────────────── */
.ws-pub[data-ws-header="stacked"] .site-header { flex-direction: column; justify-content: center; text-align: center; gap: 0.7em; padding-top: 1.4em; padding-bottom: 1em; }
.ws-pub[data-ws-header="stacked"] .site-nav { justify-content: center; }
.ws-pub[data-ws-header="stacked"] .ws-logo-img { height: 64px; }
.ws-pub[data-ws-header="stacked"] .site-logo-app.has-logo-text { flex-direction: column; gap: 0.3em; }
.ws-pub[data-ws-header="stacked"] .ws-logo-text { font-size: 1.4rem; }
.ws-pub[data-ws-header="transparent"] .site-header { position: absolute; top: 0; left: 0; right: 0; background: transparent !important; border-bottom: none; z-index: 10; }
.ws-pub[data-ws-header="transparent"] .ws-pub-main { padding-top: 0; }
.ws-pub[data-ws-header="transparent"] .ws-pub-content > .cmp-hero:first-child { margin-top: 0; }
.ws-pub[data-ws-header="transparent"] .ws-pub-content > .cmp-hero:first-child .cmp-hero-inner { padding-top: 7em; }
.ws-pub[data-ws-header="transparent"] .site-nav a, .ws-pub[data-ws-header="transparent"] .site-logo a { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.45); }
.ws-pub[data-ws-header="transparent"] .theme-toggle, .ws-pub[data-ws-header="transparent"] .ws-nav-search input { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(0,0,0,0.2); }
@media (max-width: 640px) {
    .ws-pub[data-ws-header="transparent"] .site-header { position: sticky; background: var(--bg) !important; border-bottom: 1px solid var(--border-mid); }
    .ws-pub[data-ws-header="transparent"] .site-nav a, .ws-pub[data-ws-header="transparent"] .site-logo a { color: var(--text-muted); text-shadow: none; }
    .ws-pub[data-ws-header="transparent"] .site-logo a { color: var(--text-bright); }
    .ws-pub[data-ws-header="transparent"] .ws-pub-content > .cmp-hero:first-child .cmp-hero-inner { padding-top: 2.5em; }
}

/* ── Nav variants ───────────────────────────────────────────────────── */
.ws-pub[data-ws-nav="pills"] .site-nav .sep, .ws-pub[data-ws-nav="underline"] .site-nav .sep { display: none; }
.ws-pub[data-ws-nav="pills"] .site-nav > a, .ws-pub[data-ws-nav="pills"] .ws-nav-dd-toggle { padding: 0.35em 0.85em; border-radius: 999px; transition: background 0.15s, color 0.15s; }
.ws-pub[data-ws-nav="pills"] .site-nav > a:hover, .ws-pub[data-ws-nav="pills"] .site-nav > a.active, .ws-pub[data-ws-nav="pills"] .ws-nav-dd:hover .ws-nav-dd-toggle { background: var(--bg-surface); color: var(--text-bright); }
.ws-pub[data-ws-nav="underline"] .site-nav > a, .ws-pub[data-ws-nav="underline"] .ws-nav-dd-toggle { padding: 0.3em 0.1em; border-bottom: 2px solid transparent; }
.ws-pub[data-ws-nav="underline"] .site-nav > a:hover, .ws-pub[data-ws-nav="underline"] .site-nav > a.active, .ws-pub[data-ws-nav="underline"] .ws-nav-dd:hover .ws-nav-dd-toggle { border-bottom-color: var(--info); color: var(--text-bright); }
.ws-pub[data-ws-nav="solid"] .site-nav .sep { display: none; }
.ws-pub[data-ws-nav="solid"] .site-nav > a, .ws-pub[data-ws-nav="solid"] .ws-nav-dd-toggle { padding: 0.4em 0.9em; border-radius: var(--ws-btn-radius); font-weight: 600; }
.ws-pub[data-ws-nav="solid"] .site-nav > a.active, .ws-pub[data-ws-nav="solid"] .site-nav > a:hover { background: var(--info); color: #fff; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.ws-btn { display: inline-block; background: var(--info); color: #fff !important; border: 2px solid var(--info); border-radius: var(--ws-btn-radius); padding: 0.65em 1.35em; font-weight: 600; font-size: 0.95rem; line-height: 1.2; text-decoration: none !important; cursor: pointer; transition: filter 0.15s, transform 0.15s, background 0.15s, color 0.15s; }
.ws-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ws-btn-outline { background: transparent; color: var(--info) !important; }
.ws-btn-outline:hover { background: var(--info); color: #fff !important; }
.ws-btn-ghost { background: transparent; border-color: transparent; color: var(--info) !important; padding-left: 0.6em; padding-right: 0.6em; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 0.6em; align-items: center; margin: 1.2em 0 0.4em; }
.cmp-actions[data-align="center"] { justify-content: center; }
.cmp-actions[data-align="right"] { justify-content: flex-end; }
.cmp-actions[data-size="sm"] .ws-btn { padding: 0.45em 1em; font-size: 0.85rem; }
.cmp-actions[data-size="lg"] .ws-btn { padding: 0.85em 1.8em; font-size: 1.05rem; }
[data-align="center"] > .cmp-section-inner .cmp-actions, .cmp-hero[data-align="center"] .cmp-actions, .cmp-cta[data-align="center"] .cmp-actions { justify-content: center; }
.cmp-hero[data-align="right"] .cmp-actions { justify-content: flex-end; }
/* Buttons on coloured / dark / image backgrounds */
[data-bg="accent"] .ws-btn { background: #fff; color: var(--info) !important; border-color: #fff; }
[data-bg="accent"] .ws-btn-outline, [data-text="light"] .ws-btn-outline, [data-bg="dark"] .ws-btn-outline, [data-bg="image"] .ws-btn-outline { background: transparent; color: #fff !important; border-color: rgba(255,255,255,0.85); }
[data-bg="accent"] .ws-btn-outline:hover, [data-text="light"] .ws-btn-outline:hover, [data-bg="dark"] .ws-btn-outline:hover, [data-bg="image"] .ws-btn-outline:hover { background: #fff; color: var(--info) !important; }

/* ── Shared background treatments (section / hero / cta) ───────────── */
.cmp-section[data-bg="alt"], .cmp-cta[data-bg="alt"], .cmp-hero[data-bg="alt"] { background: var(--bg-surface); }
.cmp-section[data-bg="accent"], .cmp-cta[data-bg="accent"], .cmp-hero[data-bg="accent"] { background: var(--info); }
.cmp-section[data-bg="dark"], .cmp-cta[data-bg="dark"], .cmp-hero[data-bg="dark"] { background: #171a21; }
.cmp-section[data-bg="light"], .cmp-cta[data-bg="light"], .cmp-hero[data-bg="light"] { background: #ffffff; }
.cmp-section[data-bg="image"], .cmp-hero[data-bg="image"] { background-size: cover; background-position: center; position: relative; isolation: isolate; }
.cmp-section[data-bg="image"]::before, .cmp-hero[data-bg="image"]::before { content: ''; position: absolute; inset: 0; background: rgba(8,10,14, var(--cmp-overlay, 0.6)); z-index: 0; }
.cmp-section[data-bg="image"] > *, .cmp-hero[data-bg="image"] > * { position: relative; z-index: 1; }
/* text colour on coloured backgrounds */
[data-bg="accent"], [data-bg="dark"], [data-bg="image"], [data-text="light"] {
    --text: #f4f6fa; --text-bright: #ffffff; --text-glow: #ffffff; --text-dim: rgba(255,255,255,0.85); --text-muted: rgba(255,255,255,0.75); --text-faint: rgba(255,255,255,0.6);
    --border: rgba(255,255,255,0.25); --border-faint: rgba(255,255,255,0.15); --bg-surface: rgba(255,255,255,0.1);
    color: var(--text);
}
[data-bg="light"], [data-text="dark"] {
    --text: #2a2f3a; --text-bright: #11141b; --text-glow: #11141b; --text-dim: #566072; --text-muted: #6f7889; --text-faint: #9aa2b1;
    --border: rgba(0,0,0,0.12); --border-faint: rgba(0,0,0,0.07); --bg-surface: rgba(0,0,0,0.04);
    color: var(--text);
}
[data-bg="accent"] a:not(.ws-btn), [data-bg="dark"] a:not(.ws-btn), [data-bg="image"] a:not(.ws-btn), [data-text="light"] a:not(.ws-btn) { color: #fff; }
.cmp-section h1, .cmp-section h2, .cmp-section h3, .cmp-hero h1, .cmp-hero h2, .cmp-cta h1, .cmp-cta h2, .cmp-cta h3 { border: none !important; padding-bottom: 0; color: var(--text-bright); }

/* ── Full-bleed helpers ─────────────────────────────────────────────── */
.cmp-section[data-width="full"], .cmp-hero[data-width="full"] { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; border-left: 0; border-right: 0; }
.cmp-section-inner, .cmp-hero[data-width="full"] .cmp-hero-inner { max-width: var(--ws-content-max); margin: 0 auto; padding-left: var(--ws-gutter); padding-right: var(--ws-gutter); }

/* ── Native form controls follow the theme ──────────────────────────── */
/* color-scheme makes the browser draw its own popups (select option lists,
   date pickers, scrollbars) in the right scheme; the opaque background stops
   translucent surface colours turning the option list white-on-white. */
html.ws-pub-html[data-theme="dark"], html.ws-pub-html[data-theme="dark"] body { color-scheme: dark; }
html.ws-pub-html[data-theme="light"], html.ws-pub-html[data-theme="light"] body { color-scheme: light; }
.ws-pub select, .ws-pub .cmp-table-filter { background-color: var(--bg); background-image: linear-gradient(var(--bg-surface), var(--bg-surface)); color: var(--text); }
.ws-pub select option { background-color: var(--bg); color: var(--text); }
