/* Bind the native Ethereal accent to the active site or visitor HEX value. */
:root[data-theme-color] {
    --primary: var(--theme-hex, #D5EAF7);
    --p-hex: var(--primary);
    --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent);
    --theme-surface: color-mix(in srgb, var(--primary) 16%, white);
}

@supports (color: oklch(from white max(l, 0.92) min(c, 0.045) h)) {
    :root[data-theme-color] {
        --theme-surface: oklch(from var(--primary) max(l, 0.92) min(c, 0.045) h);
    }
}

:root[data-theme-color]:not(.dark) {
    --page-bg: var(--theme-surface);
}

:root[data-theme-color].dark {
    --primary-soft: color-mix(in srgb, var(--primary) 22%, transparent);
}

/* Keep labels legible on elements whose background is the solid accent. */
:root[data-theme-color] [class~="bg-(--primary)"][class~="text-white"],
:root[data-theme-color] [class~="hover:bg-(--primary)"][class~="hover:text-white"]:hover,
:root[data-theme-color].dark [class~="dark:bg-(--primary)"][class~="dark:text-(--deep-text)"],
:root[data-theme-color] .form-inner button[type="submit"] .btn-hover-content,
:root[data-theme-color] .form-inner input[type="submit"]:hover,
:root[data-theme-color] .form-inner .form-input-group button:hover {
    color: var(--theme-on-accent, #161616);
}

/* Give the mixed-script navbar name a little space at its native font size. */
:root[data-theme-color] .site-title > span:last-child {
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-shadow: none;
}

@media (max-width: 767px) {
    :root[data-theme-color] .site-title > span:last-child {
        letter-spacing: 0.015em;
    }
}

@media (max-width: 380px) {
    #navbar a.btn-plain:has(> .site-title) {
        padding-inline: 0.35rem;
        flex: none;
    }

    #navbar .site-title > img {
        margin-inline-end: 0.35rem;
        height: 2.1rem;
        width: auto;
    }
}

@media (max-width: 350px) {
    #navbar .btn-plain.h-11.w-11 {
        width: 2rem;
    }
}

