NGU-Web/src/index.css
Zaldimmar b816203c0c Accessibility: reading and color blind modes, audit fixes, calendar window
- Accessibility panel: the switch knob stays in its track; the panel
  follows its button in the Tab order and opens on its first switch.
- Reading mode is the page as plain text: one column, no colors,
  pictures, cards or motion; descriptions stay in place.
- Color blind mode (protanopia, deuteranopia, tritanopia, monochrome):
  palette swaps chosen by simulation, applied to code, data and CSS
  colors on public pages only. The newsletter uses the stored palette.
- Audit fixes: focus not hidden by the header, focus on page change
  and in-page jumps, focus return for the menu, day list and people
  details, labelled admin fields and dialogs, keyboard map tiles,
  scrollable tables, and more.
- Calendar asks /events for its six weeks only (?from=&to=); carousels
  take their 12 most recent past events (?past=12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 14:33:09 -05:00

598 lines
18 KiB
CSS

@import '@fontsource/montserrat/400.css';
@import '@fontsource/montserrat/600.css';
@import '@fontsource/montserrat/700.css';
@import '@fontsource/poppins/400.css';
@import '@fontsource/poppins/600.css';
@import '@fontsource/poppins/700.css';
@import '@fontsource/poppins/800.css'; /* the front page's stat numbers only */
@import '@fontsource/opendyslexic/400.css'; /* the accessibility panel's font, */
@import '@fontsource/opendyslexic/700.css'; /* only downloaded when chosen */
@import 'tailwindcss';
@theme {
--font-display: 'Poppins', sans-serif;
--font-body: 'Montserrat', sans-serif;
/* ── Color tokens ─────────────────────────────────────────────
Named for what they do, not what they look like, because dark
mode (below) swaps the values. Use them as utilities
(text-muted, bg-surface, border-brand/20) or, in a style prop,
as var(--color-muted). Every text color passes WCAG AA (4.5:1)
on surface, tint and tint-soft in both modes.
A color that must stay the same in both modes (white text on
a dark band, a platform's own color) stays a literal. Colors
that arrive as data (page accents, event and region colors) go
through withAlpha() and accentText() in src/lib/color.ts. */
--color-ink: #001011; /* headings */
--color-body: #003a45; /* body text */
--color-muted: #3b5456; /* secondary text, quiet borders */
--color-link: #00748a; /* links and teal text */
--color-brand: #00748a; /* decoration: borders, rings, rules */
--color-action: #00748a; /* button fills, under white text */
--color-action-hover: #003a45;
--color-surface: #f5f9f8; /* page and cards */
--color-tint: #d6f5fa; /* tinted sections and panels */
--color-tint-soft: #e8f5f6; /* hover rows, faint panels */
--color-danger: #b3261e;
--color-danger-tint: #fdf3f2;
/* Cards: a step off the page so they read as sitting on it (white
here; a touch of tint in dark mode, below). Derived rather than
an admin token, so it follows the palette. With a shadow. */
--color-raised: #ffffff;
/* Tailwind's shadows, tinted with the site's deep ink instead of
black, so a card's shadow belongs to the page. */
--shadow-2xs: 0 1px rgb(0 16 17 / 0.05);
--shadow-xs: 0 1px 2px 0 rgb(0 16 17 / 0.05);
--shadow-sm: 0 1px 3px 0 rgb(0 16 17 / 0.1), 0 1px 2px -1px rgb(0 16 17 / 0.1);
--shadow-md: 0 4px 6px -1px rgb(0 16 17 / 0.1), 0 2px 4px -2px rgb(0 16 17 / 0.1);
--shadow-lg: 0 10px 15px -3px rgb(0 16 17 / 0.12), 0 4px 6px -4px rgb(0 16 17 / 0.1);
--shadow-xl: 0 20px 25px -5px rgb(0 16 17 / 0.12), 0 8px 10px -6px rgb(0 16 17 / 0.1);
--shadow-2xl: 0 25px 50px -12px rgb(0 16 17 / 0.3);
}
/* How much of an accent color its text keeps (src/lib/color.ts,
accentText): all of it on light, half (the rest white) on dark. */
:root {
--accent-text-mix: 100%;
}
/* Dark mode: the visitor's system setting, unless the header toggle
chose (data-theme on <html>, set before first paint in index.html
and by ThemeToggle). */
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
@layer base {
:root[data-theme="dark"] {
--color-ink: #f5f9f8;
--color-body: #d6f5fa;
--color-muted: #a3b8b9;
--color-link: #5cd3e6;
--color-brand: #00748a;
--color-action: #00748a;
--color-action-hover: #003a45;
--color-surface: #001011;
--color-tint: #003a45;
--color-tint-soft: #00222a;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
--accent-text-mix: 50%;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-ink: #f5f9f8;
--color-body: #d6f5fa;
--color-muted: #a3b8b9;
--color-link: #5cd3e6;
--color-brand: #00748a;
--color-action: #00748a;
--color-action-hover: #003a45;
--color-surface: #001011;
--color-tint: #003a45;
--color-tint-soft: #00222a;
--color-danger: #ff8a80;
--color-danger-tint: #3b1714;
--color-raised: color-mix(in srgb, var(--color-tint) 35%, var(--color-surface));
--accent-text-mix: 50%;
color-scheme: dark;
}
}
}
* {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
/* Clear of the fixed header (Layout.tsx measures it): anything
scrolled to, by an anchor or by keyboard focus, lands below it. */
scroll-padding-top: calc(var(--header-h, 0px) + 1rem);
}
/* An email address is one long word: let it break anywhere rather
than push a button or card past a phone's edge. */
a[href^="mailto:"] {
overflow-wrap: anywhere;
max-width: 100%;
}
/* One visible focus ring for keyboard users, wherever a component
doesn't draw its own. */
:focus-visible {
outline: 2px solid var(--color-link);
outline-offset: 2px;
}
/* Not on things focused only to move the reader there (the page's
content on a new page, a section jumped to; motion.ts, jumpTo):
they aren't controls, and a ring round a whole section is noise. */
[tabindex="-1"]:focus {
outline: none;
}
/* Visitors who ask for less motion get no smooth scrolling, slides
or hover zooms. */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
body {
font-family: 'Montserrat', sans-serif;
background-color: var(--color-surface);
color: var(--color-ink);
-webkit-font-smoothing: antialiased;
}
/* Type: Poppins Bold for titles, headings and buttons (the btn
utility), Poppins at regular weight for subheadings, Montserrat
for everything else. */
h1, h2, h3, h4, h5, h6 {
font-family: 'Poppins', sans-serif;
font-weight: bold;
}
/* A logo on a dark page: many are drawn for white paper (dark marks,
transparent background) and would vanish. .logo-plate gives them
a small light backing in dark mode only. */
:root[data-theme="dark"] .logo-plate {
background: #f5f9f8;
padding: 0.25rem;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .logo-plate {
background: #f5f9f8;
padding: 0.25rem;
}
}
/* Printing (a blog post's Download PDF, or any page): the light
palette whatever the screen shows, since paper is white and dark
mode's pale text would barely print; and backgrounds kept, so the
tinted panels and table rows come out as on screen. */
@media print {
:root,
:root[data-theme="dark"] {
--color-ink: #001011;
--color-body: #003a45;
--color-muted: #3b5456;
--color-link: #00748a;
--color-brand: #00748a;
--color-surface: #f5f9f8;
--color-tint: #d6f5fa;
--color-tint-soft: #e8f5f6;
--color-danger: #b3261e;
--color-danger-tint: #fdf3f2;
--accent-text-mix: 100%;
color-scheme: light;
print-color-adjust: exact;
}
.logo-plate {
background: none !important;
padding: 0 !important;
}
}
@page {
margin: 1.5cm;
}
/* Church Center's giving modal (Giving.tsx) is a transparent iframe
over the whole page, drawn for light pages. On a dark page the
browser sees the iframe's scheme differ from ours and paints its
background opaque, so the page behind goes solid white. Telling it
the iframe is light keeps the backdrop see-through. */
iframe[src*="churchcenter"] {
color-scheme: light;
}
/* Corners, one rule for the site: none. Everything is square except
buttons (the btn utility below, or var(--btn-radius) in plain CSS)
and video players, which get a small radius, and things that are
round by nature: dots, radio marks, the play button. */
:root {
--btn-radius: 0.5rem;
}
/* ── Accessibility choices (AccessibilityPanel.tsx) ──────────────
Set on <html> before the first paint (index.html) and by the
panel. */
/* Dyslexia-friendly font: every typeface, headings and buttons too. */
:root[data-font="dyslexic"] {
--font-display: 'OpenDyslexic', sans-serif;
--font-body: 'OpenDyslexic', sans-serif;
}
:root[data-font="dyslexic"] body,
:root[data-font="dyslexic"] h1,
:root[data-font="dyslexic"] h2,
:root[data-font="dyslexic"] h3,
:root[data-font="dyslexic"] h4,
:root[data-font="dyslexic"] h5,
:root[data-font="dyslexic"] h6,
:root[data-font="dyslexic"] button,
:root[data-font="dyslexic"] input,
:root[data-font="dyslexic"] textarea,
:root[data-font="dyslexic"] select {
font-family: 'OpenDyslexic', sans-serif;
}
/* Reading mode: the page as plain text. One narrow column of ink on
white (or the reverse in dark mode): no colors, backgrounds,
cards, shadows, borders, pictures, motion or decoration, larger
type and underlined links. A picture or video with a description
leaves it in its place (AccessibilityPanel.tsx copies it to
data-reading-alt on its parent). Unlayered, so it wins over the
admin's colors (theme.js, in layers). */
:root[data-reading="on"] {
--color-ink: #111111;
--color-body: #111111;
--color-muted: #444444;
--color-link: #111111;
--color-brand: #111111;
--color-action: #111111;
--color-action-hover: #444444;
--color-surface: #ffffff;
--color-tint: #ffffff;
--color-tint-soft: #ffffff;
--color-raised: #ffffff;
--color-danger: #111111;
--color-danger-tint: #ffffff;
--accent-text-mix: 100%;
font-size: 112.5%;
scroll-behavior: auto;
}
:root[data-reading="on"][data-theme="dark"] {
--color-ink: #eeeeee;
--color-body: #eeeeee;
--color-muted: #bbbbbb;
--color-link: #eeeeee;
--color-brand: #eeeeee;
--color-action: #eeeeee;
--color-action-hover: #bbbbbb;
--color-surface: #111111;
--color-tint: #111111;
--color-tint-soft: #111111;
--color-raised: #111111;
--color-danger: #eeeeee;
--color-danger-tint: #111111;
}
@media (prefers-color-scheme: dark) {
:root[data-reading="on"]:not([data-theme="light"]) {
--color-ink: #eeeeee;
--color-body: #eeeeee;
--color-muted: #bbbbbb;
--color-link: #eeeeee;
--color-brand: #eeeeee;
--color-action: #eeeeee;
--color-action-hover: #bbbbbb;
--color-surface: #111111;
--color-tint: #111111;
--color-tint-soft: #111111;
--color-raised: #111111;
--color-danger: #eeeeee;
--color-danger-tint: #111111;
}
}
/* Everything takes the page's two colors, inline styles included. */
:root[data-reading="on"] body * {
color: var(--color-ink) !important;
background-color: transparent !important;
background-image: none !important;
border-color: transparent !important;
box-shadow: none !important;
text-shadow: none !important;
filter: none !important;
mask-image: none !important;
-webkit-mask-image: none !important;
}
:root[data-reading="on"] body,
:root[data-reading="on"] header,
:root[data-reading="on"] .reading-solid {
background-color: var(--color-surface) !important;
}
:root[data-reading="on"] header {
border-bottom: 1px solid var(--color-muted) !important;
}
:root[data-reading="on"] *,
:root[data-reading="on"] *::before,
:root[data-reading="on"] *::after {
animation: none !important;
transition: none !important;
}
/* Pictures, video, maps and drawings go; the icons inside links and
buttons stay, in the text color, so an icon-only button keeps
its face. */
:root[data-reading="on"] main :is(img, picture, video, iframe, canvas, object),
:root[data-reading="on"] main svg:not(:is(a, button, label) svg),
:root[data-reading="on"] .page-backdrop,
:root[data-reading="on"] .notice::before,
:root[data-reading="on"] .notice::after {
display: none !important;
}
:root[data-reading="on"] [data-reading-alt]::after {
content: attr(data-reading-alt);
display: block;
margin-block: 0.5rem;
font-style: italic;
}
/* Controls keep an outline so they still read as controls. */
:root[data-reading="on"] :is(button, input, select, textarea, .btn) {
border: 1px solid var(--color-ink) !important;
}
:root[data-reading="on"] main {
max-width: 42rem;
margin-inline: auto;
padding-inline: 1rem;
}
:root[data-reading="on"] main .grid {
grid-template-columns: minmax(0, 1fr) !important;
}
:root[data-reading="on"] main :is(p, li, dd) {
line-height: 1.75;
}
:root[data-reading="on"] a {
text-decoration: underline !important;
text-underline-offset: 0.2em;
}
/* Color blind modes (data-vision, color.ts has the reasoning and the
same swap for colors set from code). The palette's green family
as variables, so CSS that uses it swaps too. */
:root {
--green-0: #4a7431;
--green-1: #23361a;
--green-2: #9cc47c;
--green-3: #e6f0dd;
}
:root:is([data-vision="protanopia"], [data-vision="tritanopia"]) {
--green-0: #9839dc;
--green-1: #4d1575;
--green-2: #c9a5e3;
--green-3: #f4eef9;
}
/* Monochrome: the whole page in grays. On the root element a filter
leaves fixed elements (the header, the panel) where they were. */
:root[data-vision="monochrome"] {
filter: grayscale(1);
}
/* A notice where content would be (an empty section, a form's
note, "coming soon"): no box and no fill, just two thick brackets
at opposite corners, top left and bottom right, like a
viewfinder. Padding stays with each use; the brackets sit in its
corners, so give it some. */
@utility notice {
position: relative;
&::before,
&::after {
content: '';
position: absolute;
width: 1.75rem;
height: 1.75rem;
border: 0 solid var(--color-brand);
pointer-events: none;
}
&::before {
top: 0;
left: 0;
border-top-width: 4px;
border-left-width: 4px;
}
&::after {
right: 0;
bottom: 0;
border-right-width: 4px;
border-bottom-width: 4px;
}
}
/* A video's play button (VideoPlayer.tsx) waits for a hover or
keyboard focus where the device can hover; on a touch screen it
always shows, since there is nothing to hover with. */
@media (hover: hover) {
.video-play:not(.video-play--always) > span {
opacity: 0;
transition: opacity 160ms ease, transform 160ms ease;
}
.group:hover .video-play > span,
.group:focus-visible .video-play > span {
opacity: 1;
}
}
/* Buttons, and links drawn as buttons: Poppins Bold, small rounded
corners. Color, size and border stay with each button. */
@utility btn {
font-family: var(--font-display);
font-weight: 700;
border-radius: var(--btn-radius);
}
/* Scrollbar hide */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--color-brand) 40%, transparent); }
.ig-icon { fill: currentColor; transition: fill 200ms ease; }
.ig-link:hover .ig-icon { fill: var(--ig-fill); }
.footer-icons:hover .ig-icon { fill: var(--ig-fill); }
.fb-icon:hover { fill: #0862f7; }
.ds-icon:hover { fill: #5865f1; }
/* Event Card Section */
.ev-card {
container-type: inline-size;
}
.ev-grid {
display: grid;
gap: 0.25rem 1.5rem;
grid-template-columns: 2fr 1fr;
grid-template-areas:
"org image"
"info image"
"desc desc";
}
.ev-org {
grid-area: org;
}
.ev-info {
grid-area: info;
}
.ev-image {
grid-area: image;
justify-self: stretch;
align-self: center;
max-height: 11rem;
}
.ev-desc {
grid-area: desc;
margin-top: 1rem;
}
@container (max-width: 30rem) {
.ev-grid {
grid-template-columns: 1fr;
/* The logo gets its own row: without one, grid-area: image made
an extra column beside the text. */
grid-template-areas:
"image"
"org"
"info"
"desc";
}
.ev-grid .ev-image {
justify-self: start;
width: auto;
max-height: 7rem;
margin-bottom: 0.5rem;
}
}
/* ═══════════════════════════════════════════════════════════════
SKELETON
Holds roughly a card's height so the page doesn't jump when the
data arrives. The shimmer is decoration, so it goes away for
anyone who has asked for less motion.
═══════════════════════════════════════════════════════════════ */
.skeleton {
min-height: 22rem;
background: linear-gradient(
100deg,
color-mix(in srgb, var(--color-muted) 8%, transparent) 30%,
color-mix(in srgb, var(--color-muted) 16%, transparent) 50%,
color-mix(in srgb, var(--color-muted) 8%, transparent) 70%
);
background-size: 200% 100%;
animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
from {
background-position: 200% 0;
}
to {
background-position: -200% 0;
}
}
@media (prefers-reduced-motion: reduce) {
.skeleton {
animation: none;
}
}
/* ═══════════════════════════════════════════════════════════════
UNITY REGIONS
Append to index.css. Scoped to .ur- so nothing here reaches the
rest of the site.
═══════════════════════════════════════════════════════════════ */
/* The 0fr → 1fr grid row animates to the panel's real height, so
nobody has to guess a max-height that's wrong the moment a
region's description grows. The inline style sets the value;
this sets how it moves. */
.ur-panel {
display: grid;
transition: grid-template-rows 300ms ease;
}
.ur-chevron {
transition: transform 200ms ease;
}
@media (prefers-reduced-motion: reduce) {
.ur-panel,
.ur-chevron {
transition: none;
}
}
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION LIST
Append to index.css. Scoped to .ol- so nothing here reaches the
rest of the site.
═══════════════════════════════════════════════════════════════ */
/* The 0fr → 1fr grid row animates to the panel's real height, so
nobody has to guess a max-height that's wrong the moment a
description grows. The inline style sets the value; this sets
how it moves. */
.ol-panel {
display: grid;
transition: grid-template-rows 300ms ease;
}
.ol-chevron {
transition: transform 200ms ease;
}
@media (prefers-reduced-motion: reduce) {
.ol-panel,
.ol-chevron {
transition: none;
}
}