/* Explain: Base reset, typography, background gradients, and accessibility styles. */
* {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

html {
    background: var(--background-color);
    color: var(--text-color);
    scroll-padding-top: 160px;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--background-color);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--sage-dark);
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(163, 177, 138, 0.25), transparent 26rem),
        radial-gradient(circle at 88% 8%, rgba(88, 129, 87, 0.15), transparent 24rem),
        var(--background-color);
    color: var(--text-color);
    font-family: var(--font-body);
    text-rendering: optimizeLegibility;
}

button,
a,
select {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    background: var(--accent-color);
    color: #ffffff;
}

.rich-text-content * {
    font-family: var(--font-body) !important;
    background-color: transparent !important;
    line-height: 1.8 !important;
}

.rich-text-content,
.rich-text-content p,
.rich-text-content span,
.rich-text-content div,
.rich-text-content font,
.rich-text-content a,
.rich-text-content li {
    font-size: 1.125rem !important;
    color: var(--text-color) !important;
    margin-top: 0 !important;
}

.rich-text-content p {
    margin-bottom: 1.25rem !important;
}

.rich-text-content strong,
.rich-text-content b {
    font-weight: 700 !important;
    color: var(--text-color) !important;
}

.rich-text-content h2,
.rich-text-content h3 {
    font-family: var(--font-heading) !important;
    color: var(--text-color) !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.rich-text-content h2 {
    font-size: 1.75rem !important;
}

.rich-text-content h3 {
    font-size: 1.5rem !important;
}

.rich-text-content ul,
.rich-text-content ol {
    padding-inline-start: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.rich-text-content ul {
    list-style-type: disc !important;
}

.rich-text-content ol {
    list-style-type: decimal !important;
}

.rich-text-content li {
    font-size: 1.125rem !important;
    color: var(--text-color) !important;
    margin-bottom: 0.5rem !important;
}

/* Accessibility Classes */
html.acc-large-text {
    font-size: 115% !important;
}

html.acc-readable-font, 
html.acc-readable-font *, 
html.acc-readable-font .rich-text-content * {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.acc-high-contrast {
    filter: invert(100%) hue-rotate(180deg) contrast(130%);
    background-color: #fff;
}

html.acc-high-contrast img, 
html.acc-high-contrast video, 
html.acc-high-contrast .lightbox-img,
html.acc-high-contrast [style*="background-image"] {
    filter: invert(100%) hue-rotate(180deg);
}

html.acc-highlight-links a, 
html.acc-highlight-links button {
    text-decoration: underline !important;
    text-decoration-color: #ff0000 !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
}
