/*
Theme Name: Dunham House
Description: Custom theme for The Dunham House, a residential community for combat-wounded veterans in Omaha, NE. Built for beta-11.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dunham-house
*/

:root {
	--night: #0a2434;
	--night-deep: #081e2b;
	--steel: #144a6b;
	--mist: #eaf4fb;
	--sky: #bfdff3;
	--blue: #001f87;
	--brass: #ffd64f;
	--ink: #081e2b;
	--white: #fff;
	--rule: #cfdde8;

	--serif: "Newsreader", Georgia, "Times New Roman", serif;
	--sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

	--step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.95rem);
	--step-0: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
	--step-1: clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem);
	--step-2: clamp(1.65rem, 1.4rem + 1.1vw, 2.35rem);
	--step-3: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem);
	--step-hero: clamp(3rem, 1.6rem + 6.2vw, 7rem);

	--gutter: clamp(1.25rem, 4vw, 3rem);
	--measure: 65ch;
	--wide: 74rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font: 400 var(--step-0)/1.65 var(--sans);
	text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--steel); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.dh-band :focus-visible, .dh-header :focus-visible, .dh-footer :focus-visible, .dh-hero :focus-visible { outline-color: var(--brass); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.012em; margin: 0 0 0.5em; color: var(--night); }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1.1em; }
blockquote { margin: 1.6em 0; padding: 0 0 0 1.25rem; border-left: 4px solid var(--steel); font-family: var(--serif); font-size: var(--step-1); line-height: 1.4; color: var(--night); }
blockquote cite, blockquote footer { display: block; margin-top: 0.6em; font: 500 var(--step--1)/1.4 var(--sans); font-style: normal; color: var(--steel); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100; width: auto; height: auto; clip-path: none; background: var(--brass); color: var(--night); padding: 0.6rem 1rem; }

/* Buttons: the brass one is reserved for Donate. */
.dh-btn { display: inline-block; padding: 0.85em 1.6em; border-radius: 2px; font: 600 var(--step-0)/1.2 var(--sans); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.dh-btn--donate { background: var(--brass); color: var(--night); }
.dh-btn--donate:hover { background: var(--white); color: var(--night); }
.dh-btn--quiet { border-color: currentColor; color: inherit; background: transparent; }
.dh-btn--quiet:hover { background: var(--white); color: var(--night); border-color: var(--white); }
.dh-btn--blue { background: var(--blue); color: var(--white); }
.dh-btn--blue:hover { background: var(--steel); color: var(--white); }

/* Header */
.dh-header { background: var(--night); color: var(--white); }
.dh-header__inner { max-width: var(--wide); margin: 0 auto; padding: 0.9rem var(--gutter); display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.dh-brand { font: 500 1.5rem/1 var(--serif); color: var(--white); text-decoration: none; margin-right: auto; letter-spacing: -0.01em; }
.dh-brand:hover { color: var(--sky); }
.dh-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; }
.dh-nav a { color: var(--white); text-decoration: none; font: 500 var(--step--1)/1.3 var(--sans); padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.dh-nav a:hover, .dh-nav .current-menu-item > a { border-bottom-color: var(--brass); color: var(--white); }
.dh-header .dh-btn { padding: 0.6em 1.2em; font-size: var(--step--1); }

/* Hero */
.dh-hero { position: relative; background: var(--night) center / cover no-repeat; color: var(--white); isolation: isolate; }
.dh-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,30,43,0.94) 0%, rgba(8,30,43,0.72) 55%, rgba(8,30,43,0.35) 100%); }
.dh-hero__inner { max-width: var(--wide); margin: 0 auto; padding: clamp(4rem, 12vw, 9rem) var(--gutter); }
.dh-hero h1 { color: var(--white); font-size: var(--step-hero); line-height: 1.02; letter-spacing: -0.025em; max-width: 12ch; margin-bottom: 0.35em; }
.dh-hero p { font-size: var(--step-1); line-height: 1.45; max-width: 34ch; color: var(--mist); }
.dh-actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.4rem; align-items: center; margin-top: 2rem; }

/* Content */
.dh-main { display: block; }
.dh-wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.dh-prose { max-width: var(--measure); }
.dh-page { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.dh-page__title { margin-bottom: 1.2rem; }
.dh-page .entry > * { max-width: var(--measure); }
.dh-page .entry > .alignwide, .dh-page .entry > figure, .dh-page .entry > .dh-gallery, .dh-page .entry > .dh-contacts, .dh-page .entry > .dh-embed, .dh-page .entry > .wp-block-gallery, .dh-page .entry > .wp-block-columns { max-width: none; }
.dh-page .entry > p:has(> .dh-btn) { display: inline-block; max-width: none; margin: 0 1rem 1rem 0; }
.dh-page .entry > blockquote { font-size: var(--step-2); max-width: 46rem; margin: 3rem 0; border-left-width: 6px; }
.entry img { border-radius: 2px; }
.entry h2 { margin-top: 1.8em; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: 0.4em; }

/* Bands and galleries */
.dh-band { background: var(--night); color: var(--white); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.dh-band h2 { color: var(--white); }
.dh-band p { color: var(--mist); max-width: 46ch; }
.dh-band a:not(.dh-btn) { color: var(--sky); }
.dh-mist { background: var(--mist); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.dh-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.75rem; max-width: none; margin: 2rem 0; }
.dh-gallery figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist); }
.dh-gallery img { width: 100%; height: 100%; object-fit: cover; }
.entry figure { margin: 1.75rem 0; }
.entry figcaption { font-size: var(--step--1); color: var(--steel); margin-top: 0.5rem; }
.entry .dh-btn { margin: 0.25rem 0; }
.dh-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.dh-map iframe { aspect-ratio: 21 / 9; }

/* Contact */
.dh-contacts { display: grid; gap: 1.75rem; margin: 2rem 0; max-width: none; }
.dh-address { font-style: normal; font: 500 var(--step-1)/1.4 var(--serif); color: var(--night); }
.dh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; }
.dh-card { border-left: 4px solid var(--steel); background: var(--mist); padding: 1.1rem 1.4rem; }
.dh-card h3 { margin: 0 0 0.15em; }
.dh-card .dh-role { margin: 0 0 0.5em; color: var(--steel); font-size: var(--step--1); }
.dh-card p:last-child { margin: 0; }
.dh-form { max-width: 40rem; margin-top: 2.5rem; display: grid; gap: 1.1rem; }
.dh-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.dh-form input[type="text"], .dh-form input[type="email"], .dh-form textarea { width: 100%; font: inherit; padding: 0.7em 0.8em; border: 1.5px solid #7d94a6; border-radius: 2px; background: var(--white); color: var(--ink); }
.dh-form textarea { min-height: 9rem; }
.dh-form .dh-check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.dh-form .dh-check input { margin-top: 0.35em; }
.dh-form .dh-hp { position: absolute; left: -9999px; }
.dh-notice { padding: 0.9rem 1.1rem; border-left: 4px solid var(--steel); background: var(--mist); max-width: 40rem; margin-bottom: 1.5rem; }

/* News / posts */
.dh-post-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2.25rem; max-width: var(--measure); }
.dh-post-list h2 { font-size: var(--step-1); margin-bottom: 0.25em; }
.dh-post-list h2 a { color: var(--night); text-decoration: none; }
.dh-post-list h2 a:hover { color: var(--blue); text-decoration: underline; }
.dh-meta { font-size: var(--step--1); color: var(--steel); margin-bottom: 0.6em; }

/* Footer */
.dh-footer { background: var(--night-deep); color: var(--sky); padding: 3rem 0 2rem; font-size: var(--step--1); }
.dh-footer__inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr; }
.dh-footer a { color: var(--white); }
.dh-footer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 0.5rem 2.5rem; }
.dh-footer__brand { font: 500 1.4rem/1.2 var(--serif); color: var(--white); margin-bottom: 0.5rem; }
.dh-footer__legal { width: min(calc(100% - 2 * var(--gutter)), calc(var(--wide) - 2 * var(--gutter))); margin: 2rem auto 0; padding: 1.25rem 0 0; border-top: 1px solid rgba(191,223,243,0.25); }

@media (max-width: 720px) {
	.dh-footer__inner { grid-template-columns: 1fr; }
	.dh-hero::before { background: linear-gradient(180deg, rgba(8,30,43,0.9) 0%, rgba(8,30,43,0.8) 100%); }
	.dh-header .dh-btn { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .dh-header, .dh-footer, .dh-band, .dh-actions { display: none; } body { font-size: 12pt; } }

/* --- Elementor integration fixes (2026-09-25) --- */
/* The old .entry > * measure constraint was written for raw the_content()
   output; now that content is Elementor-built, .entry's only direct child
   is Elementor's own wrapper div, so that rule was squeezing the whole
   page down to reading-measure width instead of the wide/menu width. */
.dh-page .entry > .elementor { max-width: none; }

/* Elementor's own default heading color (dark grey) was beating the
   theme's plain `h2 { color: var(--night) }` rule on specificity; force
   content headings back to the same dark blue as the site header. */
.dh-page .entry .elementor-heading-title { color: var(--night); }

/* "Apply for residency" CTA band: anchored in the same dark navy as the
   header (not a lighter gradient), with a two-up photo diptych.
   NOTE: selectors here must out-specificity ".dh-page .entry .elementor-heading-title"
   (3 classes) or the global navy heading color wins and the white CTA
   heading becomes invisible against the navy background. */
.dh-page .entry .dh-apply { background: linear-gradient(155deg, var(--night) 0%, var(--night-deep) 55%, var(--steel) 100%); padding: clamp(3.5rem, 7vw, 6rem) var(--gutter); }
.dh-page .entry .dh-apply .elementor-container { max-width: var(--wide); margin: 0 auto; align-items: center; gap: clamp(2rem, 5vw, 4rem); }
.dh-page .entry .dh-apply .elementor-heading-title { color: var(--white); }
.dh-page .entry .dh-apply .elementor-widget-text-editor p { color: var(--mist); }
/* Elementor doesn't generate a per-element width rule for these inner
   columns (only the outer 52/48 split gets one), so the columns collapse
   to content size and the photos render tiny. Fixed with an explicit
   structural rule instead of relying on Elementor's own generated CSS. */
.dh-apply__photos .elementor-container { display: flex; gap: 1rem; }
.dh-apply__photos .elementor-column { width: 50%; flex: 0 0 50%; }
.dh-apply__photos .elementor-widget-image { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 4px; box-shadow: 0 16px 40px rgba(3,14,21,0.45); }
.dh-apply__photos .elementor-widget-image img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
	.dh-apply__photos .elementor-container { flex-direction: column; }
	.dh-apply__photos .elementor-column { width: 100%; flex: 0 0 100%; }
}
