Mobile: menu, page titles, hero, retreat carousel, people tiles

- The mobile menu centers when it fits and starts at the top when
  it's taller than the screen (safe center), so its top is
  reachable; its close button is a 44px target.
- Page titles and the hero headline start a size smaller on phones
  and break long words instead of being cut off.
- Hero: the split buttons stack on a phone (the slash from sm); the
  slide dots and pause button are 40px targets and wrap; photo heroes
  leave room for the caption above the buttons.
- Retreat carousel: phone-sized padding and type; on a phone the
  arrows sit beside the dots instead of over the text, dots are 40px
  targets, and a swipe turns it. The narrow event card layout gives
  the logo its own row (it had made a stray column).
- People tiles: the details panel slides to stay on screen with its
  notch under the tile; a third column only when tiles keep 60% of
  their width; a 40px close button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-30 22:42:20 -05:00
parent 2a926971f7
commit a907a47c24
8 changed files with 145 additions and 76 deletions

View file

@ -296,7 +296,7 @@ export default function Layout() {
{/* Mobile menu */}
{mobileMenuOpen && (
<div
className="fixed inset-0 z-[60] flex flex-col items-center justify-center overflow-y-auto py-16"
className="fixed inset-0 z-[60] flex flex-col items-center [justify-content:safe_center] overflow-y-auto py-16"
style={{ background: "rgba(0, 58, 69, 0.97)" }}
role="dialog"
aria-modal="true"
@ -304,7 +304,7 @@ export default function Layout() {
>
<button
ref={closeMenuRef}
className="absolute top-5 right-6 text-white text-3xl"
className="absolute top-3 right-4 p-2 text-white text-3xl"
aria-label="Close menu"
onClick={() => setMobileMenuOpen(false)}
>

View file

@ -102,7 +102,7 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
{/* Page header */}
<div className="pt-24 pb-12 px-6">
<div className="max-w-6xl mx-auto">
<h1 className="text-5xl md:text-6xl font-bold" style={{ color: accentText(BRAND) }}>
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold [overflow-wrap:anywhere] hyphens-auto" style={{ color: accentText(BRAND) }}>
{title}
</h1>
{intro && <p className="mt-3 text-lg text-muted max-w-2xl">{intro}</p>}

View file

@ -314,27 +314,17 @@
box-shadow: var(--shadow-lg);
}
.pl__bio--anchored[data-align="end"] {
left: auto;
right: 0;
}
.pl__bio--anchored::before {
content: '';
position: absolute;
top: -11px;
left: calc(var(--pl-w) / 2 - 8px);
left: var(--pl-notch, calc(var(--pl-w) / 2 - 8px));
width: 16px;
height: 8px;
background: var(--pl-accent);
clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.pl__bio--anchored[data-align="end"]::before {
left: auto;
right: calc(var(--pl-w) / 2 - 8px);
}
.pl__bio {
display: flex;
flex-direction: column;
@ -366,8 +356,8 @@
.pl__close {
flex: 0 0 auto;
width: 1.75rem;
height: 1.75rem;
width: 2.5rem;
height: 2.5rem;
border: 1px solid var(--pl-frame-edge);
border-radius: var(--btn-radius);
background: var(--color-surface);

View file

@ -748,15 +748,23 @@ function DetailPanel({
onClose: () => void;
}) {
const panelRef = useRef<HTMLDivElement>(null);
const [alignEnd, setAlignEnd] = useState(false);
// How far the panel shifts from the tile's left edge, and where the
// notch sits on it, in px.
const [place, setPlace] = useState<{ shift: number; notch: number } | null>(null);
// Under the tile, starting at its left edge unless that would run
// off the right of the screen; then ending at its right edge.
// Under the tile, starting at its left edge, slid left just enough
// to stay 8px inside the screen on either side (a narrow phone
// included), with the notch kept under the tile's middle.
useLayoutEffect(() => {
if (!anchored || !panelRef.current) return;
const tile = panelRef.current.parentElement?.getBoundingClientRect();
if (!tile) return;
const width = panelRef.current.offsetWidth;
if (tile) setAlignEnd(tile.left + width > document.documentElement.clientWidth - 16);
const screen = document.documentElement.clientWidth;
let shift = Math.min(0, screen - 8 - (tile.left + width));
shift = Math.max(shift, 8 - tile.left);
const notch = Math.min(Math.max(tile.width / 2 - shift - 8, 8), width - 24);
setPlace({ shift, notch });
}, [anchored]);
const org = resolveOrg(person.org);
@ -770,10 +778,14 @@ function DetailPanel({
ref={panelRef}
id={id}
className={anchored ? "pl__bio pl__bio--anchored" : "pl__bio"}
data-align={alignEnd ? "end" : "start"}
style={
{
...(tint ? { "--pl-accent": tint } : null),
...(place ? { left: `${place.shift}px`, "--pl-notch": `${place.notch}px` } : null),
} as CSSProperties
}
role="region"
aria-label={`About ${person.name}`}
style={tint ? ({ "--pl-accent": tint } as CSSProperties) : undefined}
>
<div className="pl__bio-head">
<div>
@ -865,13 +877,17 @@ export function fitsOneRow(counts: number[], width: number, tile: number, gap: n
(never more than there are). If that would leave one tile alone on
the last row, one fewer across, so the last row has two: 7 that fit
6 across go 5 and 2. With only 2 across, a third, narrower column
takes the odd one instead (3 tiles on a phone go 3 across). */
takes the odd one instead, if tiles stay at least 60% of full
width; on a narrow phone a lone last tile beats three unreadable
ones. */
export function balancedColumns(count: number, width: number, tile: number, gap: number): number {
if (count <= 1) return 1;
const fit = Math.floor((width + gap) / (tile + gap));
const cols = Math.min(count, 10, Math.max(2, fit));
if (count % cols !== 1) return cols;
return cols > 2 ? cols - 1 : Math.min(count, 3);
if (cols > 2) return cols - 1;
const third = (width - 2 * gap) / 3;
return count >= 3 && third >= tile * 0.6 ? 3 : 2;
}
/* A string id is a people slug; a numeric or missing one is a

View file

@ -371,7 +371,10 @@ iframe[src*="churchcenter"] {
@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";

View file

@ -190,25 +190,25 @@ export function Card({
// past event) keeps its links out of the tab order too.
inert={!interactive}
>
<div className={`flex-1 flex flex-col ${compact ? "p-8" : "p-10"}`}>
<div className={`flex-1 flex flex-col ${compact ? "p-6 sm:p-8" : "p-6 sm:p-10"}`}>
{compact ? (
/* ── GRID CARD: layout driven by .ev-grid container queries ── */
<div className="ev-grid mb-2">
<Logo src={orgLogo} className="ev-org h-11 w-auto mb-4" />
<div className="ev-info">
{typeBadge}
<h3 className="text-3xl font-bold leading-tight">
<h3 className="text-2xl sm:text-3xl font-bold leading-tight [overflow-wrap:anywhere]">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-xl font-normal font-bold">"{ev.theme}"</p>
<p className="text-lg sm:text-xl font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-xl">{ev.date_label}</p>}
{schedule && <p className="text-xl">{schedule}</p>}
{ev.date_label && <p className="text-lg sm:text-xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-xl">{schedule}</p>}
{ev.location_label && (
<p className="text-xl">{ev.location_label}</p>
<p className="text-lg sm:text-xl">{ev.location_label}</p>
)}
</div>
<Logo
@ -225,18 +225,18 @@ export function Card({
<div className="md:col-span-2">
<Logo src={orgLogo} className="h-15 w-auto mb-6" />
{typeBadge}
<h3 className="text-4xl font-bold">
<h3 className="text-2xl sm:text-4xl font-bold [overflow-wrap:anywhere]">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-2xl font-normal font-bold">"{ev.theme}"</p>
<p className="text-lg sm:text-2xl font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-2xl">{schedule}</p>}
{ev.date_label && <p className="text-lg sm:text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-lg sm:text-2xl">{schedule}</p>}
{ev.location_label && (
<p className="text-2xl">{ev.location_label}</p>
<p className="text-lg sm:text-2xl">{ev.location_label}</p>
)}
</div>
<div className="md:col-span-1 flex items-center justify-end">
@ -496,6 +496,18 @@ export default function EventListCards({
const prev = () => setIndex(i => Math.max(0, i - 1));
const next = () => setIndex(i => Math.min(events.length - 1, i + 1));
// A sideways swipe of 40px or more on a touch screen turns the carousel.
const swipeFrom = useRef<number | null>(null);
const onTouchStart = (e: React.TouchEvent) => { swipeFrom.current = e.touches[0]?.clientX ?? null; };
const onTouchEnd = (e: React.TouchEvent) => {
const from = swipeFrom.current;
swipeFrom.current = null;
const to = e.changedTouches[0]?.clientX;
if (from == null || to == null || Math.abs(to - from) < 40) return;
if (to < from) next();
else prev();
};
// Arrows and dots follow the section accent, not the active card.
const arrowStyle = enabled => ({
border: `1px solid ${accent}`,
@ -616,7 +628,7 @@ export default function EventListCards({
<button
onClick={() => setShowPast(v => !v)}
aria-expanded={showPast}
className="flex items-center gap-2 py-2.5 px-6 font-bold transition-all duration-200 hover:scale-105"
className="btn flex items-center gap-2 py-2.5 px-6 transition-all duration-200 hover:scale-105"
style={{ border: `1px solid ${accent}`, color: accentText(accent) }}
>
{showPast
@ -631,7 +643,7 @@ export default function EventListCards({
) : (
/* ── CAROUSEL VIEW ── */
<>
<div className="relative mb-6">
<div className="relative mb-6" onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>
<div
className="overflow-hidden"
style={{ maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE }}
@ -673,7 +685,7 @@ export default function EventListCards({
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index > 0)}
>
<CaretLeft size={20} weight="bold" aria-hidden="true" />
@ -682,7 +694,7 @@ export default function EventListCards({
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 btn hidden sm:flex items-center justify-center text-2xl shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index < events.length - 1)}
>
<CaretRight size={20} weight="bold" aria-hidden="true" />
@ -692,20 +704,45 @@ export default function EventListCards({
</div>
{events.length > 1 && (
<div className="flex justify-center gap-2">
<div className="flex flex-wrap items-center justify-center">
{/* On a phone the side arrows would sit on the card's text,
so they move down here, beside the dots. */}
<button
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index > 0)}
>
<CaretLeft size={18} weight="bold" aria-hidden="true" />
</button>
{events.map((e, i) => (
<button
key={e.id}
onClick={() => setIndex(i)}
aria-label={`Go to ${e.title}`}
aria-current={i === index ? "true" : undefined}
className="h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
// A 40px tap target around the small dot it draws.
className="flex h-10 items-center px-1"
>
<span
className="block h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",
background: i === index ? accent : withAlpha("var(--color-muted)", 40),
}}
/>
</button>
))}
<button
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="btn flex h-10 w-10 items-center justify-center sm:hidden"
style={arrowStyle(index < events.length - 1)}
>
<CaretRight size={18} weight="bold" aria-hidden="true" />
</button>
</div>
)}
</>

View file

@ -74,7 +74,9 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
return (
<section
id="hero"
className="relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 pb-16"
className={`relative isolate flex min-h-[92dvh] items-center overflow-hidden pt-24 ${
backdrop === 'photos' ? 'pb-36 sm:pb-28' : 'pb-16'
}`}
style={{ background: DEEP }}
>
{backdrop === 'photos' ? (
@ -157,8 +159,8 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
about two lines. */}
<h1
className={`hp-rise font-display font-bold leading-[1.02] tracking-tight ${
beside ? 'text-4xl md:text-5xl' : 'text-5xl md:text-6xl lg:text-7xl'
}`}
beside ? 'text-4xl md:text-5xl' : 'text-4xl sm:text-5xl md:text-6xl lg:text-7xl'
} [overflow-wrap:anywhere]`}
style={{ animationDelay: '60ms' }}
>
{hero.headline}
@ -186,12 +188,13 @@ function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
Both set: one cell in two halves, the primary filled on the left
and the secondary clear on the right, split by a slash (the
filled half's slanted edge, which the clear half tucks under).
One set: that one alone, in its own style. */
On a phone the halves stack instead, filled on top, since two
labels side by side don't fit; the slash starts at sm (home.css,
.hp-split). One set: that one alone, in its own style. */
const SLANT = '1.75rem'
const PRIMARY_FILL = '#f0bd4f'
const PRIMARY_TEXT = '#001011'
const HALF = 'relative flex items-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]'
const HALF = 'relative flex items-center justify-center gap-2 px-8 py-4 text-lg transition-colors duration-200 focus-visible:outline-offset-[-6px]'
type HeroLink = Hero['primary']
@ -200,24 +203,15 @@ function HeroActions({ primary, secondary }: { primary: HeroLink; secondary: Her
if (primary && secondary) {
return (
<div className="btn inline-flex max-w-full overflow-hidden border border-white/35">
<div className="hp-split btn max-w-full overflow-hidden border border-white/35">
<HomeLink
url={primary.url}
className={`${HALF} z-10 hover:brightness-95`}
style={{
background: PRIMARY_FILL,
color: PRIMARY_TEXT,
paddingRight: `calc(2rem + ${SLANT})`,
clipPath: `polygon(0 0, 100% 0, calc(100% - ${SLANT}) 100%, 0 100%)`,
}}
className={`hp-split__primary ${HALF} z-10 hover:brightness-95`}
style={{ background: PRIMARY_FILL, color: PRIMARY_TEXT }}
>
{primary.label}
</HomeLink>
<HomeLink
url={secondary.url}
className={`${HALF} text-white hover:bg-white/10`}
style={{ marginLeft: `-${SLANT}`, paddingLeft: `calc(2rem + ${SLANT})` }}
>
<HomeLink url={secondary.url} className={`hp-split__secondary ${HALF} text-white hover:bg-white/10`}>
{secondary.label} {arrow}
</HomeLink>
</div>
@ -323,8 +317,8 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
)}
{slides.length > 1 && (
<div className="ml-auto flex items-center gap-3">
<div className="flex gap-1.5">
<div className="ml-auto flex flex-wrap items-center justify-end gap-x-1 gap-y-0">
<div className="flex flex-wrap justify-end">
{slides.map((slide, i) => (
<button
key={`${slide.media}-${i}`}
@ -332,15 +326,18 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
onClick={() => setIndex(i)}
aria-label={`Show photo ${i + 1} of ${slides.length}`}
aria-current={i === index}
className="h-1.5 w-10 overflow-hidden bg-white/25"
// A 40px tap target around the thin bar it draws.
className="flex h-10 w-11 items-center px-0.5"
>
<span
// Re-keyed per index so the fill restarts on every change.
key={`${index}-${i}`}
className={`hp-progress block h-full bg-white ${
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
} ${paused ? 'hp-progress--paused' : ''}`}
/>
<span className="block h-1.5 w-full overflow-hidden bg-white/25">
<span
// Re-keyed per index so the fill restarts on every change.
key={`${index}-${i}`}
className={`hp-progress block h-full bg-white ${
i < index ? 'hp-progress--done' : i === index ? 'hp-progress--run' : ''
} ${paused ? 'hp-progress--paused' : ''}`}
/>
</span>
</button>
))}
</div>
@ -348,7 +345,7 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
type="button"
onClick={() => setPaused((p) => !p)}
aria-label={paused ? 'Play slideshow' : 'Pause slideshow'}
className="flex h-8 w-8 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10"
className="ml-2 flex h-10 w-10 items-center justify-center btn border border-white/40 text-xs text-white hover:bg-white/10"
>
{paused ? <Play size={14} weight="fill" aria-hidden="true" /> : <Pause size={14} weight="fill" aria-hidden="true" />}
</button>

View file

@ -19,6 +19,32 @@
to { opacity: 1; transform: none; }
}
/* ── Hero: the split button cell (HeroStage.tsx, HeroActions) ────
Stacked on a phone; from sm, side by side and cut by a slash:
the filled half's slanted right edge, the clear half tucked under
it by the slant's width. */
.hp-split {
display: flex;
flex-direction: column;
}
@media (min-width: 40rem) {
.hp-split {
display: inline-flex;
flex-direction: row;
--hp-slant: 1.75rem;
}
.hp-split__primary {
padding-right: calc(2rem + var(--hp-slant));
clip-path: polygon(0 0, 100% 0, calc(100% - var(--hp-slant)) 100%, 0 100%);
}
.hp-split__secondary {
margin-left: calc(var(--hp-slant) * -1);
padding-left: calc(2rem + var(--hp-slant));
}
}
/* ── Hero: photos ────────────────────────────────────────────── */
.hp-slide {