/* ==========================================================================
   BKD.UI: shared Be Kind Donations design system.
   Served at /_content/BKD.UI/css/bkd.css. Sites add their own page styles after it.
   Brand: green and white. Logos are the green and white versions only.
   ========================================================================== */

:root {
    --green: #17a338;
    --green-600: #14803a;
    --green-700: #0f6630;
    --green-900: #0b2e1a;
    --green-50: #ecf8ef;
    --orange: #f27a43;
    --orange-50: #fef1ea;
    --blue: #2856e6;
    --blue-50: #eaf0fe;
    --focus: #1d3fae;

    --ink: #12261a;
    --ink-2: #3f5246;
    --muted: #55665b;
    --line-strong: #7d8a81;   /* form field borders: 3:1 against white (WCAG 1.4.11) */
    --line: #e2e8e3;
    --bg: #fbfaf6;
    --surface: #ffffff;
    --tint: #f2f6ef;
    --danger: #c23434;

    --radius: 18px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 40, 24, .06), 0 8px 24px rgba(16, 40, 24, .08);
    --shadow-lg: 0 2px 6px rgba(16, 40, 24, .08), 0 24px 60px rgba(16, 40, 24, .16);

    --header-height: 72px;
    --font-display: "Fraunces", "Cooper Black", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 12px); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
/* Component display rules must never override the hidden attribute. */
[hidden] { display: none !important; }
a { color: var(--green-600); }
a:hover { color: var(--green-700); }

h1, h2, h3 {
    font-family: var(--font-display);
    font-variation-settings: "SOFT" 100;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.01em;
    margin: 0 0 .5em;
    color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; color: #fff; }

/* Focus: dark blue ring plus a white halo, visible on light and dark backgrounds. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px #fff; border-radius: 6px; }

/* ---------- Type helpers ---------- */
.eyebrow {
    display: inline-block; margin: 0 0 1rem;
    font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--green-700); background: var(--green-50); padding: .4em .9em; border-radius: 999px;
}
.eyebrow-light { color: #d8f5df; background: rgba(255, 255, 255, .12); }
.accent { color: var(--green-600); }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; }
.lead-sm { font-size: 1.1rem; color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .85em 1.4em; border-radius: 999px; border: 2px solid transparent;
    font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; min-height: 44px;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 6px 18px rgba(20, 128, 58, .28); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: #b42323; color: #fff; }
.btn-danger:hover { background: #8f1c1c; color: #fff; }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-700); background: var(--surface); }
.btn-sm { padding: .6em 1.1em; font-size: .95rem; min-height: 40px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(251, 250, 246, .85);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(16, 40, 24, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand-name { font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--green-600); }
.brand:hover { color: var(--ink); }
.brand-light, .brand-light:hover { color: #fff; }
.brand-light img { border-radius: 0; }
.brand-light .brand-name em { color: #6fdc8a; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .98rem; white-space: nowrap; }
.site-nav .btn { white-space: nowrap; }
.site-nav a:not(.btn):hover { color: var(--green-700); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
.nav-toggle .icon { width: 28px; height: 28px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-tint { background: var(--tint); }
.section-dark {
    background: radial-gradient(800px 400px at 100% 0%, rgba(23, 163, 56, .35), transparent 60%), var(--green-900);
    color: #d5eadb;
}
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head p:not(.eyebrow) { color: var(--ink-2); font-size: 1.1rem; }

/* ---------- Icon tiles and tick lists ---------- */
.module-icon {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
    background: var(--green-50); color: var(--green-600); margin-bottom: 18px;
}
.module-icon .icon { width: 24px; height: 24px; }
.icon-orange { background: var(--orange-50); color: #c2521d; }
.icon-blue { background: var(--blue-50); color: var(--blue); }

.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
    content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
    background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314803a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.ticks-light li::before {
    background-color: rgba(255, 255, 255, .18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.ticks-2col { grid-template-columns: 1fr 1fr; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); text-align: center; }
.card .module-icon { margin: 0 auto 18px; }

/* ---------- Tabs (WAI-ARIA, driven by bkd.js via [data-tabs]) ---------- */
.tab-list {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 40px;
    background: var(--surface); padding: 6px; border-radius: 999px; border: 1px solid var(--line); width: fit-content;
}
.tab {
    display: inline-flex; align-items: center; gap: .5em;
    border: 0; background: transparent; padding: .7em 1.2em; border-radius: 999px;
    font: 600 .95rem var(--font-body); color: var(--ink-2); cursor: pointer;
}
.tab:hover { color: var(--green-700); }
.tab[aria-selected="true"] { background: var(--green-600); color: #fff; }
.tab-panel[hidden] { display: none; }

/* ---------- Zoomable screenshots ([data-zoom] opens the lightbox) ---------- */
.shot {
    position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); cursor: zoom-in;
    background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.shot img { width: 100%; }
.shot-zoom {
    position: absolute; right: 10px; top: 10px; display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px; background: rgba(18, 38, 26, .7); color: #fff;
    opacity: 0; transition: opacity .2s ease;
}
.shot:hover .shot-zoom, .shot:focus-visible .shot-zoom { opacity: 1; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(8, 20, 12, .82); backdrop-filter: blur(4px); }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox-caption { text-align: center; color: #fff; margin: 12px 0 0; font-weight: 500; }
.lightbox-close {
    position: absolute; right: -12px; top: -12px; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 50%; border: 0; background: #fff; color: var(--ink); cursor: pointer; box-shadow: var(--shadow);
}

/* ---------- Forms ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field label small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
    width: 100%; font: 400 1rem var(--font-body); color: var(--ink);
    padding: .75em .9em; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
/* Fields keep the same strong focus ring as everything else (a faint glow alone fails WCAG 2.4.11/1.4.11). */
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); box-shadow: 0 0 0 6px #fff; }
.field .input-validation-error, .field [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.field-error { color: var(--danger); font-size: .85rem; }
.field-error:empty { display: none; }
.form-note { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; margin-bottom: 18px; }
.form-status p { margin: .2em 0 0; }
.form-status-ok { background: var(--green-50); color: var(--green-700); margin: 0; }
.form-status-ok .icon { width: 28px; height: 28px; }
.form-status-err { background: #fdeeee; color: #8f2525; }

/* ---------- Footer ---------- */
.site-footer { background: #0a1f12; color: #a9c2b1; padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-tagline { margin-top: 16px; max-width: 28em; }
.footer-tagline strong { color: #fff; }
.footer-heading { font-family: var(--font-body); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { color: #a9c2b1; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .88rem; }
.footer-bottom p { margin: 0; }

/* ---------- Simple content pages ---------- */
.page { padding: 72px 0 96px; }
.page .container { max-width: 800px; }
.page h2 { font-size: 1.5rem; margin-top: 2em; }
.page p, .page li { color: var(--ink-2); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: var(--header-height);
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        padding: 8px 24px 20px; display: none;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .site-nav .btn { margin-top: 16px; }

    .section { padding: 72px 0; }
    .tab-list { border-radius: var(--radius); width: 100%; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .container { padding: 0 16px; }
    .field-row, .ticks-2col { grid-template-columns: 1fr; }
    .tab { flex: 1 1 45%; justify-content: center; padding: .7em .6em; font-size: .88rem; }
    .card { padding: 24px; }
}

/* Headers with many or long nav items (BkdHeaderModel.WideNav) collapse to the menu button earlier. */
@media (min-width: 901px) and (max-width: 1200px) {
    .site-header-wide .nav-toggle { display: block; }
    .site-header-wide .site-nav {
        position: absolute; left: 0; right: 0; top: var(--header-height);
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        padding: 8px 24px 20px; display: none;
    }
    .site-header-wide .site-nav.is-open { display: flex; }
    .site-header-wide .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .site-header-wide .site-nav .btn { margin-top: 16px; }
}

/* ==========================================================================
   Accessibility (WCAG 2.2 AA): text size, high contrast, OS contrast modes.
   html[data-text-size] and html[data-contrast] are set by bkd-init.js from the
   viewer's saved choice (the _BkdDisplaySettings control), before first paint.
   ========================================================================== */

/* Text size: everything is rem-based, so scaling the root scales the page. */
html[data-text-size="lg"] { font-size: 112.5%; }
html[data-text-size="xl"] { font-size: 125%; }

/* Links inside text are underlined, so they don't rely on color alone (WCAG 1.4.1). */
main p a:not(.btn), main li a:not(.btn), main dd a:not(.btn), main td a:not(.btn), .form-status a { text-decoration: underline; text-underline-offset: 3px; }

/* High contrast: the viewer's toggle, or the OS "increase contrast" setting. */
html[data-contrast="high"] {
    --ink: #000;
    --ink-2: #1a1a1a;
    --muted: #2b2b2b;
    --line: #6b6b6b;
    --line-strong: #1a1a1a;
    --bg: #fff;
    --tint: #fff;
    --green-600: #0a5c27;
    --green-700: #08471e;
    --green-50: #e6f2ea;
    --shadow: none;
    --shadow-lg: none;
}
html[data-contrast="high"] body { background: #fff; }
html[data-contrast="high"] .card,
html[data-contrast="high"] .site-header,
html[data-contrast="high"] .btn-ghost { border-color: #1a1a1a; }
html[data-contrast="high"] .btn-primary { box-shadow: none; outline: 2px solid #000; outline-offset: -4px; }
html[data-contrast="high"] .site-header { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 2px solid #000; }

@media (prefers-contrast: more) {
    :root:not([data-contrast="standard"]) { --muted: #2b2b2b; --ink-2: #1a1a1a; --line: #6b6b6b; --line-strong: #1a1a1a; }
}

/* Windows High Contrast / forced colors: keep component edges and state visible. */
@media (forced-colors: active) {
    .btn, .card, .tab, .field input, .field select, .field textarea, .form-status, .module-icon { border: 1px solid CanvasText; }
    .tab[aria-selected="true"], [aria-current="page"], [aria-current="true"], [aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: 1px; }
    :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
    .icon { forced-color-adjust: auto; }
}

/* ---------- Display settings control (_BkdDisplaySettings) ---------- */
.display-settings { position: relative; }
.display-settings-toggle {
    display: inline-flex; align-items: center; gap: .4em; min-height: 40px; padding: .45em .9em;
    border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface);
    font: 600 .9rem var(--font-body); color: var(--ink); cursor: pointer;
}
.display-settings-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 290px;
    background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-lg);
}
.display-settings-panel fieldset { border: 0; margin: 0 0 14px; padding: 0; }
.display-settings-panel legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.display-settings-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.display-settings-options label {
    display: grid; place-items: center; min-height: 44px; border: 1.5px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-weight: 700;
}
.display-settings-options label span[aria-hidden] { line-height: 1; }
.display-settings-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.display-settings-options input:checked + label { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.display-settings-options input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.display-settings-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.display-settings-switch input { width: 22px; height: 22px; accent-color: var(--green-600); }
.display-settings-note { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 1200px) {
    .site-header-wide .display-settings-panel { position: static; width: 100%; margin-top: 10px; box-shadow: none; }
}
@media (max-width: 900px) {
    .display-settings-panel { position: static; width: 100%; margin-top: 10px; box-shadow: none; }
}
.ds-a-1 { font-size: .9rem; }
.ds-a-2 { font-size: 1.15rem; }
.ds-a-3 { font-size: 1.4rem; }
