/* Veltrix: opt-in dark styling. The light palette remains controlled by existing CSS. */
:root {
    color-scheme: light;
}

/* Keep the original switch's position in .header-actions. */
.header-actions .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #f8f4f2;
    color: #242025;
    padding: 0;
    transition: background-color .2s ease, color .2s ease;
}
.header-actions .theme-toggle:focus-visible {
    outline: 2px solid #b87b83;
    outline-offset: 3px;
}
.theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

/* Explicit dark palette: preserve the existing rose/gold brand and hero photos. */
html[data-theme="dark"] {
    color-scheme: dark;
    --veltrix-bg: #18181d;
    --veltrix-surface: #23232a;
    --veltrix-text: #f4f1f1;
    --veltrix-muted: #c9c2c7;
    --veltrix-line: #39353d;
    /* For theme templates already relying on custom variables. */
    --background-color: var(--veltrix-bg);
    --text-color: var(--veltrix-text);
    --border-color: var(--veltrix-line);
}
html[data-theme="dark"] body {
    background-color: var(--veltrix-bg);
    color: var(--veltrix-text);
}
html[data-theme="dark"] .site-header {
    background: var(--veltrix-surface);
    border-bottom-color: var(--veltrix-line);
}
html[data-theme="dark"] .site-header .site-name,
html[data-theme="dark"] .site-header .primary-menu > li > a,
html[data-theme="dark"] .site-header .header-action-menu > li > a:not(.button):not(.btn) {
    color: var(--veltrix-text);
}
html[data-theme="dark"] .site-header .theme-toggle {
    background: #37323b;
    color: #f8e5db;
}
html[data-theme="dark"] .site-footer {
    background: var(--veltrix-surface);
    color: var(--veltrix-text);
    border-color: var(--veltrix-line);
}
html[data-theme="dark"] .site-footer a { color: var(--veltrix-text); }
/* Content surface utilities: add these classes to theme templates where needed. */
html[data-theme="dark"] .theme-surface { background: var(--veltrix-surface); color: var(--veltrix-text); }
html[data-theme="dark"] .theme-muted { color: var(--veltrix-muted); }
html[data-theme="dark"] .theme-border { border-color: var(--veltrix-line); }
/* Intentionally do not recolor hero overlays, images, promotional CTA buttons or logos. */
@media (prefers-reduced-motion: reduce) {
    .header-actions .theme-toggle { transition: none; }
}
