/* Dementia League — base: tokens, resets, utilities, header, forms.
   Mobile first. Desktop rules live under @media (min-width: 900px). */
:root {
	--dl-radius-card: var(--wp--custom--radius--card, 12px);
	--dl-radius-button: var(--wp--custom--radius--button, 8px);
	--dl-radius-image: var(--wp--custom--radius--image, 12px);
	--dl-shadow-card: var(--wp--custom--shadow--card, 0 1px 2px rgba(26, 26, 26, .06), 0 8px 24px rgba(26, 26, 26, .06));
	--dl-measure: var(--wp--custom--measure, 70ch);
	--dl-focus: var(--wp--preset--color--focus, #1D4ED8);
}

/* Page gutter: 16px on phones (theme.json), 40px on desktop. */
@media (min-width: 900px) {
	html body { --wp--style--root--padding-left: 2.5rem; --wp--style--root--padding-right: 2.5rem; }
}

/* ---------- Resets ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; }
svg { height: auto; }

/* Header, main and footer sit flush; sections carry their own spacing. */
body .wp-site-blocks > * + * { margin-block-start: 0; }

/* ---------- Focus ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--dl-focus); outline-offset: 2px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) { outline: none; }

/* ---------- Skip link / screen reader ---------- */
.dl-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 1000;
	padding: 12px 20px;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--paper);
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--dl-radius-button);
}
.dl-skip-link:focus { position: fixed; top: 16px; color: var(--wp--preset--color--paper); outline-color: var(--dl-focus); }
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* ---------- Text utilities ---------- */
.dl-measure { max-width: var(--dl-measure); }
.dl-eyebrow, .wp-block-post-terms.dl-eyebrow {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .875rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blue);
}
.dl-eyebrow a { color: inherit; text-decoration: none; }
.dl-eyebrow a:hover, .dl-eyebrow a:focus-visible { text-decoration: underline; }
.dl-arrow-link, .wp-block-read-more.dl-arrow-link {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .875rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--blue);
	min-height: 44px;
}
.dl-arrow-link > span[aria-hidden] { display: inline-block; transition: transform .2s ease; }
.dl-arrow-link:hover, .dl-arrow-link:focus-visible { color: var(--wp--preset--color--navy-dark); text-decoration: underline; text-underline-offset: .2em; }
.dl-arrow-link:hover > span[aria-hidden], .dl-arrow-link:focus-visible > span[aria-hidden] { transform: translateX(4px); }
.dl-lead { color: var(--wp--preset--color--ink-soft); }

/* Line length is governed by the 720px content column (theme.json contentSize); no extra p/li cap,
   because a ch-based cap can exceed the column at large font sizes and misalign with headings. */

/* ---------- Sections ---------- */
.dl-section { padding-top: var(--wp--preset--spacing--40); padding-bottom: var(--wp--preset--spacing--40); }
.dl-section--sand, .dl-section--mist { background: var(--wp--preset--color--mist); }

/* Bands carry their own padding, so drop the layout gap before them. */
.is-layout-constrained > .dl-section, .is-layout-constrained > .dl-section + .dl-carousel { margin-block-start: 0; }
.wp-block-post-content > :first-child.dl-section { margin-block-start: 0; }

/* ---------- Buttons ---------- */
.wp-element-button, .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	line-height: 1.2;
	cursor: pointer;
}

/* ---------- Forms ---------- */
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="file"])),
textarea,
select,
.wp-block-search__input {
	font-family: inherit;
	font-size: 1.125rem;
	line-height: 1.4;
	padding: 12px 14px;
	min-height: 48px;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--dl-radius-button);
	max-width: 100%;
}
textarea { min-height: 8em; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--wp--preset--color--navy); }
.wp-block-search__button { min-height: 48px; cursor: pointer; }
.wp-block-search .wp-block-search__inside-wrapper { gap: 8px; }


/* ---------- Header ---------- */
.dl-header {
	position: sticky;
	top: 0;
	z-index: 50;
	padding-top: 10px;
	padding-bottom: 10px;
	background: var(--wp--preset--color--page);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
body.admin-bar .dl-header { top: 46px; }
@media (min-width: 783px) {
	body.admin-bar .dl-header { top: 32px; }
}
.dl-header__inner { min-height: 48px; }
.dl-header__brand { gap: 10px; flex: 0 1 auto; min-width: 0; margin-right: 12px; overflow: hidden; }
.dl-header__logo { margin: 0; flex: 0 0 auto; }
.dl-header__logo img, .dl-header__logo a { display: block; }
.dl-header__logo img { width: auto; height: 24px; border-radius: 0; }
.dl-header__title { margin: 0; font-family: var(--wp--preset--font-family--serif); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.dl-header__title a { color: var(--wp--preset--color--navy); text-decoration: none; }
.dl-header__title a:hover, .dl-header__title a:focus-visible { text-decoration: underline; text-underline-offset: .15em; }
.dl-header__actions { gap: 8px; flex: 0 0 auto; margin-left: auto; }
.dl-header__nav { margin: 0; }

/* Hamburger below 1280px (core switches at 600px; eight menu items need the room). */
.dl-header .wp-block-navigation__responsive-container-open,
.dl-header .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	color: var(--wp--preset--color--ink);
	background: transparent;
	border: 0;
	border-radius: var(--dl-radius-button);
	cursor: pointer;
}
.dl-header .wp-block-navigation__responsive-container-open svg,
.dl-header .wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}
@media (min-width: 600px) and (max-width: 1279px) {
	.dl-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.dl-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: inline-flex; }
}
@media (min-width: 1280px) {
	.dl-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; }
}
.dl-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px 20px; background: var(--wp--preset--color--page); }
.dl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { top: 12px; right: 12px; }
.dl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 48px; }
.dl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 4px; }
.dl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	padding: 12px 0;
	font-size: 1.25rem;
	letter-spacing: .04em;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.dl-header .wp-block-navigation .wp-block-navigation-item__content { text-decoration: none; }
.dl-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.dl-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--blue);
}
.dl-header__donate { margin: 0; }
.dl-header__donate .wp-block-button__link { padding: 0 14px; font-size: .8125rem; white-space: nowrap; }
@media (min-width: 900px) {
	.dl-header { padding-top: 12px; padding-bottom: 12px; }
	.dl-header__logo img { height: 28px; }
	.dl-header__actions { gap: 24px; }
	.dl-header .wp-block-navigation__container { gap: 14px; }
	.dl-header .wp-block-navigation .wp-block-navigation-item__content { font-size: .8125rem; letter-spacing: .04em; }
	.dl-header__title { font-size: 1.75rem; }
	.dl-header .wp-block-navigation .wp-block-navigation-item__content { padding: 12px 0; }
	.dl-header__donate .wp-block-button__link { padding: 0 22px; font-size: .9375rem; }
	.dl-section { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); }
}
@media (min-width: 1280px) {
	.dl-header .wp-block-navigation__container { gap: 18px; }
	.dl-header .wp-block-navigation .wp-block-navigation-item__content { font-size: .875rem; }
	.dl-header__title { font-size: 2rem; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

