/* Shared tenant controls. Styles are confined to their own components. */
:root {
    --native-consent-ink: #111827;
    --native-consent-pale: #f3f4f6;
    --native-consent-panel: #1e293b;
    --native-consent-shadow: #0f172a;
}
.wt-form-result[data-state="success"] {
    --native-result-bg: #f0fdf4;
    --native-result-ink: #166534;
    --native-result-line: #bbf7d0;
    --brand-result-bg: var(--brand-accent-soft);
    --brand-result-ink: var(--brand-accent);
}
.wt-form-result[data-state="error"] {
    --native-result-bg: #fef2f2;
    --native-result-ink: #991b1b;
    --native-result-line: #fecaca;
    --brand-result-bg: var(--brand-secondary-soft);
    --brand-result-ink: var(--brand-secondary-accent);
}
.dark .wt-form-result[data-state="success"] {
    --native-result-bg: #143729;
    --native-result-ink: #bbf7d0;
    --native-result-line: #36704e;
}
.dark .wt-form-result[data-state="error"] {
    --native-result-bg: #46232a;
    --native-result-ink: #fecaca;
    --native-result-line: #914952;
}
.wt-newsletter,
.wt-cookie {
    --wt-accent: var(--brand-accent, var(--color-primary, var(--c-primary, var(--d3-primary, #2563eb))));
    box-sizing: border-box;
    font: inherit;
    line-height: 1.5;
}

.wt-newsletter *,
.wt-cookie * {
    box-sizing: border-box;
}

.wt-newsletter[hidden],
.wt-cookie[hidden],
.wt-form-result[hidden] {
    display: none;
}

.wt-newsletter button,
.wt-cookie button {
    margin: 0;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.wt-newsletter svg,
.wt-cookie svg {
    display: block;
    flex: none;
}

.wt-newsletter :focus-visible,
.wt-cookie :focus-visible,
.wt-language:focus-visible,
.wt-social:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Newsletter dialog */
.wt-newsletter {
    --wt-card: var(--brand-surface, white);
    --wt-field: var(--brand-paper, white);
    --wt-badge: var(--brand-tint, #f3f4f6);
    --wt-border: var(--brand-line, #d1d5db);
    --wt-text: var(--brand-ink, #111827);
    --wt-muted: var(--brand-muted, #4b5563);
    position: fixed;
    z-index: 110;
    inset: 0;
    overflow-y: auto;
    display: flex;
    padding: 1rem;
    background: rgb(0 0 0 / 40%);
    backdrop-filter: blur(4px);
}

.dark .wt-newsletter {
    --wt-card: var(--brand-surface, #1e293b);
    --wt-field: var(--brand-paper, #0f172a);
    --wt-badge: var(--brand-tint, #334155);
    --wt-border: var(--brand-line, #64748b);
    --wt-text: var(--brand-ink, #f8fafc);
    --wt-muted: var(--brand-muted, #cbd5e1);
}

body.wt-newsletter-open {
    overflow: hidden;
}

.wt-newsletter__card {
    position: relative;
    width: 100%;
    max-width: 28rem;
    margin: auto;
    padding: clamp(1.25rem, 5vw, 2rem);
    border-radius: 1rem;
    background: var(--wt-card);
    color: var(--wt-text);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 22%);
    text-align: center;
}

.wt-newsletter__close,
.wt-newsletter__badge {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--wt-badge);
}

.wt-newsletter__close {
    position: absolute;
    inset-block-start: .75rem;
    inset-inline-end: .75rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    color: var(--wt-muted);
}

.wt-newsletter__close:hover,
.wt-newsletter__skip:hover {
    color: var(--wt-text);
}

.wt-newsletter__badge {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    color: var(--wt-accent);
}

.wt-newsletter__icon {
    width: 2rem;
    height: 2rem;
}

.wt-newsletter__title {
    margin: 0 0 .75rem;
    color: var(--wt-text);
    font-size: 1.5rem;
    font-weight: 700;
}

.wt-newsletter__description {
    margin: 0 0 1.5rem;
    color: var(--wt-muted);
    line-height: 1.65;
}

.wt-newsletter__form {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.wt-newsletter__input {
    width: 100%;
    min-width: 0;
    padding: .75rem 1rem;
    border: 1px solid var(--wt-border);
    border-radius: .5rem;
    background: var(--wt-field);
    color: var(--wt-text);
    font: inherit;
    text-align: center;
}

.wt-newsletter__input:focus-visible {
    outline-color: var(--wt-accent);
}

.wt-newsletter__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: var(--brand-primary-surface, color-mix(in srgb, var(--wt-accent) 70%, var(--native-consent-shadow)));
    color: var(--brand-on-primary, white);
}

.wt-newsletter .wt-newsletter__submit { font-weight: 600; }
.wt-newsletter .wt-newsletter__submit:disabled { opacity: .55; cursor: wait; }

.wt-newsletter .wt-newsletter__skip {
    margin-top: 1rem;
    padding: .25rem .75rem;
    background: transparent;
    color: var(--wt-muted);
    font-size: .875rem;
}

.wt-newsletter__privacy {
    margin: 1rem 0 0;
    color: var(--wt-muted);
    font-size: .75rem;
}

/* Cookie preference bar */
.wt-cookie {
    position: fixed;
    z-index: 100;
    inset-block-end: 0;
    inset-inline: 0;
    padding: .5rem clamp(.5rem, 3vw, 2rem) max(.5rem, env(safe-area-inset-bottom));
    pointer-events: none;
}

.wt-cookie__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 76rem;
    margin-inline: auto;
    padding: 1rem;
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.25rem rgb(0 0 0 / 18%);
    background: var(--native-consent-panel);
    background: var(--brand-primary-surface, color-mix(in srgb, var(--wt-accent) 60%, var(--native-consent-shadow)));
    color: var(--brand-on-primary, white);
    pointer-events: auto;
}

.wt-cookie__message,
.wt-cookie__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.wt-cookie__message {
    flex: 1 1 20rem;
    min-width: 0;
}

.wt-cookie__badge {
    display: grid;
    flex: none;
    place-items: center;
    padding: .5rem;
    border-radius: .5rem;
    background: rgb(0 0 0 / 14%);
}

.wt-cookie__icon {
    width: 1.5rem;
    height: 1.5rem;
}

.wt-cookie__text {
    margin: 0;
    color: inherit;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.wt-cookie__actions { flex-wrap: wrap; }
.wt-cookie__actions button {
    padding: .5rem 1rem;
    border-radius: .375rem;
    font-size: .875rem;
    font-weight: 600;
}

.wt-cookie__accept { background: var(--brand-surface, white); color: var(--brand-ink, var(--native-consent-ink)); }
.wt-cookie__accept:hover { background: var(--brand-tint, var(--native-consent-pale)); }
.wt-cookie__reject { background: transparent; color: var(--brand-on-primary, white); }
.wt-cookie__reject:hover { background: rgb(0 0 0 / 20%); }

@media (min-width: 640px) {
    .wt-cookie { padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: no-preference) {
    .wt-cookie { transition: transform .3s ease, opacity .3s ease; }
    .wt-newsletter__card { animation: wt-newsletter-enter .25s ease-out; }
    @keyframes wt-newsletter-enter {
        from { opacity: 0; transform: translateY(12px); }
    }
}

/* Form feedback in the newsletter and in builder pages */
.wt-form-result {
    margin: 0;
    padding: .75rem;
    border: 1px solid;
    border-radius: .5rem;
    font-size: .875rem;
}

.wt-form-result[data-state] {
    background: var(--brand-result-bg, var(--native-result-bg));
    color: var(--brand-result-ink, var(--native-result-ink));
    border-color: var(--brand-line, var(--native-result-line));
}

/* Header language link and the three utility-based footer link variants */
.wt-language {
    color: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
}

.wt-language:hover { text-decoration: underline; }
.wt-social__icon { font-size: 1.25rem; }
.wt-social--glass,
.wt-social--framed {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.wt-social--glass {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
    color: var(--text);
}

.wt-social--glass:hover { color: var(--heading); transform: translateY(-2px); }
.wt-social--editorial { color: inherit; font-size: 1.25rem; text-decoration: none; }
.wt-social--editorial:hover { color: var(--ink); }
.dark .wt-social--editorial:hover { color: white; }
.wt-social--framed { width: 2.75rem; height: 2.75rem; border: 2px solid currentColor; color: inherit; }
.wt-social--framed:hover { background: var(--c-primary); color: white; transform: translateY(-.25rem); }


.wt-pagination, .wt-article-share { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-block: 1.5rem; }
.wt-pagination { justify-content: space-between; color: var(--ink); }
.wt-pagination__pages { display: flex; flex-wrap: wrap; gap: .25rem; }
.wt-pagination__pages > * { display: grid; place-items: center; padding: .35rem .7rem; min-inline-size: 2.25rem; min-block-size: 2.25rem; border: 1px solid var(--line); }
.wt-pagination__pages [aria-current], .wt-pagination__pages a:hover { background: var(--ink); color: var(--paper); }
.wt-pagination__summary, .wt-article-share { font-size: max(.9rem, 14px); }
.wt-article-share a { text-decoration: underline; text-underline-offset: .25em; }
.wt-page-content > [data-block-type] { max-inline-size: 100%; margin-block: 1.4rem; }
.wt-page-content [data-block-type="hero-section"], .wt-page-content [data-block-type="custom-form"], .wt-page-content [data-block-type="statistics"] { padding: clamp(1rem, 4vw, 3rem); background: var(--tint); color: var(--ink); }
.wt-page-content [data-block-type] form { display: grid; gap: 1rem; }
.wt-page-content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select) { display: block; inline-size: 100%; padding: .65rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font: inherit; }
.wt-page-content label { display: block; }
.wt-page-content [type=submit] { padding: .7rem 1rem; background: var(--primary); color: var(--on-primary); }
.wt-page-content .faq-answer.hidden { display: none; }
.wt-page-content .faq-icon.rotated { transform: rotate(180deg); }
.wt-page-content .grid { display: grid; gap: 1.25rem; }
.wt-page-content img { max-inline-size: 100%; height: auto; }
/* Saved builder blocks can contain inline light-mode colours alongside their dark utility classes. */
.wt-site[data-theme=dark] .wt-page-content :is([class~="dark:bg-gray-800"], [class~="dark:bg-primary-900"]) { background-color: var(--surface) !important; }
.wt-site[data-theme=dark] .wt-page-content :is([class~="dark:text-white"], [class~="dark:text-gray-100"], [class~="dark:text-gray-200"]) { color: var(--ink) !important; }
.wt-site[data-theme=dark] .wt-page-content :is(h2,h3,h4)[class*="dark:text-"][style*="background-color"]:not([class*="dark:bg-"]) { background-color: transparent !important; }
.wt-site[data-theme=dark] .wt-page-content :is([class~="dark:text-gray-300"], [class~="dark:text-gray-400"]) { color: var(--muted) !important; }
.wt-site[data-theme=dark] .wt-page-content [class~="dark:text-primary-400"] { color: var(--accent-ink) !important; }
.wt-site[data-theme=dark] .wt-page-content [class~="dark:border-gray-700"] { border-color: var(--line) !important; }
@media (min-width: 768px) {
    .wt-page-content [class~="md:grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wt-page-content [class~="md:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wt-page-content [class~="md:grid-cols-4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .wt-pagination__summary, .wt-pagination__number { display: none; }
    .wt-pagination__pages { inline-size: 100%; justify-content: space-between; }
}
