/* Msingi site tools — cookie consent + accessibility menu (msingi.ke, farajimarijani.ke).
   Each site sets --st-accent / --st-accent-dark / --st-ink before this file. */
:root {
    --st-accent: #085b72;
    --st-accent-dark: #064253;
    --st-ink: #1f2937;
    --st-muted: #55666e;
    --st-line: #d7e4e8;
    --st-font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

/* skip link (visible on keyboard focus) */
.st-skip {
    position: fixed; left: 12px; top: -80px; z-index: 100001;
    padding: 12px 18px; background: var(--st-accent); color: #fff !important;
    font: 600 15px/1 var(--st-font); text-decoration: none; border-radius: 3px;
    transition: top .2s ease;
}
.st-skip:focus { top: 12px; outline: 3px solid #ffbf47; outline-offset: 2px; }

.st-ui, .st-ui * { box-sizing: border-box; }
.st-ui { font: 400 15px/1.55 var(--st-font); color: var(--st-ink); letter-spacing: 0; text-transform: none; }
.st-ui button { font: inherit; cursor: pointer; }
.st-ui :focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.st-ui [hidden] { display: none !important; }

.st-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 18px; border: 1px solid var(--st-accent); border-radius: 3px;
    background: var(--st-accent); color: #fff; font-weight: 600 !important; font-size: 14.5px;
}
.st-btn:hover { background: var(--st-accent-dark); border-color: var(--st-accent-dark); }
.st-btn--line { background: #fff; color: var(--st-accent); }
.st-btn--line:hover { background: #f1f5f6; color: var(--st-accent-dark); }
.st-link { background: none; border: 0; padding: 6px 2px; color: var(--st-accent); font-weight: 600 !important; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cookie banner ---------- */
.st-consent {
    position: fixed; z-index: 100000; left: 16px; bottom: 16px;
    width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 20px 20px 16px; background: #fff;
    border: 1px solid var(--st-line); border-radius: 6px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45);
}
.st-consent__title { margin: 0 0 6px; font-weight: 700; font-size: 16.5px; color: var(--st-ink); }
.st-consent__text { margin: 0 0 14px; font-size: 14.5px; color: var(--st-ink); }
.st-consent__text a { color: var(--st-accent); text-decoration: underline; text-underline-offset: 3px; }
.st-consent__prefs { display: grid; gap: 10px; margin: 0 0 14px; }
.st-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 4px; cursor: pointer; }
.st-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--st-accent); }
.st-check b { display: block; font-size: 14.5px; }
.st-check span { font-size: 13.5px; color: var(--st-muted); }
.st-consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-consent__actions .st-btn { flex: 1 1 140px; }
.st-consent__actions .st-link { margin-left: auto; }

/* step aside while a form or viewer is open (tags stay off until a choice is made) */
html:has(.qmodal.is-open, .qualifier.is-open, .lb.open) .st-consent { display: none; }

/* ---------- accessibility menu ---------- */
.st-a11y-btn {
    position: fixed; z-index: 99990; right: 0; top: 50%; transform: translateY(-50%);
    width: 46px; height: 50px; display: grid; place-items: center;
    border: 0; border-radius: 6px 0 0 6px; background: var(--st-accent); color: #fff;
    box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .5);
}
.st-a11y-btn:hover { background: var(--st-accent-dark); }
.st-a11y-btn svg { width: 26px; height: 26px; }
.st-a11y {
    position: fixed; z-index: 99995; right: 54px; top: 50%; transform: translateY(-50%);
    width: min(340px, calc(100vw - 70px)); max-height: calc(100vh - 24px); overflow-y: auto;
    padding: 16px; background: #fff; border: 1px solid var(--st-line); border-radius: 6px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45);
}
.st-a11y__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.st-a11y__title { margin: 0; font-weight: 700; font-size: 16.5px; }
.st-a11y__close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f5f6; color: var(--st-ink); font-size: 22px !important; line-height: 1; }
.st-size { display: grid; grid-template-columns: 1fr 44px 58px 44px; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--st-line); border-bottom: 1px solid var(--st-line); }
.st-size span { font-weight: 600; font-size: 14.5px; }
.st-size button { height: 40px; border: 1px solid var(--st-line); border-radius: 4px; background: #fff; color: var(--st-ink); font-weight: 700 !important; }
.st-size button:disabled { opacity: .4; cursor: default; }
.st-size output { text-align: center; font-weight: 600; font-size: 14px; }
.st-toggles { display: grid; gap: 6px; margin: 10px 0; }
.st-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 44px; padding: 0 12px; border: 1px solid var(--st-line); border-radius: 4px;
    background: #fff; color: var(--st-ink); text-align: left; font-size: 14.5px !important;
}
.st-toggle i { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: #c9d3d7; transition: background .2s ease; }
.st-toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.st-toggle[aria-pressed="true"] { border-color: var(--st-accent); }
.st-toggle[aria-pressed="true"] i { background: var(--st-accent); }
.st-toggle[aria-pressed="true"] i::after { transform: translateX(16px); }
.st-a11y__foot { display: flex; justify-content: space-between; gap: 10px; }
.st-a11y__foot a.st-link { color: var(--st-accent) !important; }

/* click-to-load embeds */
[data-st-embed] { position: relative; display: grid; place-items: center; min-height: 280px; background: #e9eff1; text-align: center; }
[data-st-embed] iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.st-embed__inner { max-width: 360px; padding: 20px; font: 400 14.5px/1.5 var(--st-font); color: var(--st-ink); }
.st-embed__inner p { margin: 0 0 12px; }

/* ---------- the settings themselves ---------- */
html.st-contrast { filter: contrast(1.35) saturate(1.1); }
html.st-links a:not(.st-ui a):not(.st-skip) {
    text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
    background-color: #ffe066 !important; color: #111 !important;
}
html.st-spacing body *:not(svg):not(svg *):not(.st-ui):not(.st-ui *) { line-height: 1.9 !important; letter-spacing: .03em !important; word-spacing: .12em !important; }
html.st-font body *:not(svg):not(svg *):not(i):not([class*="icon"]):not([class*="fa-"]):not(.st-ui):not(.st-ui *) { font-family: 'Atkinson Hyperlegible', Verdana, Arial, sans-serif !important; }
html.st-still *, html.st-still *::before, html.st-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.st-cursor, html.st-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M6 3l28 16-12 3-6 13z' fill='%23111' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

@media (max-width: 720px) {
    .st-consent { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 16px 16px 12px; }
    .st-consent__actions .st-btn { flex: 1 1 120px; }
    .st-a11y-btn { top: auto; bottom: 140px; transform: none; width: 42px; height: 46px; }
    .st-a11y { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; transform: none; max-height: calc(100vh - 80px); }
}
@media print { .st-ui, .st-skip { display: none !important; } }
