/*
Theme Name: Havenscourt
Theme URI: https://havenscourt.org/
Author: WXMW
Author URI: https://westxmw.com/
Description: A warm, simple theme for the Havenscourt Neighborhood Association in East Oakland. Pages, a monthly-meeting box, The Events Calendar (or Google Calendar) support, and a newsletter signup area. No blog. Inspired by the 1912 Havenscourt entrance pergola and the Key System "A" line.
Version: 1.2.5
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: havenscourt
Tags: one-column, custom-logo, custom-menu, block-styles, wide-blocks, accessibility-ready
*/

/* ===== Tokens ===== */
:root {
	--ink: #1E2B38;          /* logo ink */
	--ink-2: #2A3A4A;
	--green: #2F7A4D;        /* Havenscourt green (logo train) */
	--green-dark: #245F3C;
	--green-light: #7CC79A;
	--stone: #F6F1E7;        /* pergola stone */
	--stone-2: #ECE3D2;
	--line: #DCD0BB;
	--gold: #E2B04A;
	--text: #26323D;
	--muted: #5A6570;
	--white: #FFFFFF;

	--font-head: "Roboto Slab", Rockwell, Georgia, serif;
	--font-body: "PT Sans", "Trebuchet MS", system-ui, sans-serif;

	--wrap: 1160px;
	--textw: 760px;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(30, 43, 56, .06), 0 10px 28px rgba(30, 43, 56, .09);

	/* Pergola motifs, drawn as tiny inline SVGs. */
	--rafters: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='14'%3E%3Crect x='14' y='0' width='6' height='7' rx='1' fill='%231E2B38'/%3E%3Crect x='0' y='7' width='34' height='7' fill='%231E2B38'/%3E%3C/svg%3E");
	--rafters-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='14'%3E%3Crect x='14' y='0' width='6' height='7' rx='1' fill='%23F6F1E7'/%3E%3Crect x='0' y='7' width='34' height='7' fill='%23F6F1E7'/%3E%3C/svg%3E");
	--colonnade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='30'%3E%3Cg fill='%232F7A4D'%3E%3Crect x='0' y='0' width='44' height='4'/%3E%3Crect x='14' y='6' width='16' height='3'/%3E%3Cpath d='M16 9h12l-2 3h-8z'/%3E%3Crect x='19' y='12' width='6' height='12'/%3E%3Crect x='16' y='24' width='12' height='2'/%3E%3Crect x='14' y='26' width='16' height='4'/%3E%3C/g%3E%3C/svg%3E");
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--stone);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.6;
	overflow-x: hidden;
}
img, iframe, video { max-width: 100%; }
img { height: auto; }
a { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 {
	font-family: var(--font-head);
	font-weight: 500;
	line-height: 1.15;
	color: var(--ink);
	margin: 1.6em 0 .5em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: .6em 1em; }
.skip-link:focus { left: 1rem; top: 1rem; }

.hna-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .hna-wrap { padding: 0 28px; } }
.hna-wrap--text { max-width: calc(var(--textw) + 56px); }

/* ===== Buttons ===== */
.hna-btn {
	display: inline-block;
	background: var(--green); color: #fff;
	font-family: var(--font-body); font-weight: 700; font-size: 1.05rem;
	text-decoration: none; line-height: 1.2;
	padding: .7em 1.2em; border-radius: 999px; border: 2px solid var(--green);
	transition: background .15s, color .15s, border-color .15s;
}
.hna-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.hna-btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.hna-btn--ghost:hover { background: var(--ink); color: #fff; }
.hna-btn--light { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.hna-btn--light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.hna-btn--big { font-size: 1.15rem; padding: .8em 1.45em; }
.hna-btn--small { font-size: .95rem; padding: .5em 1em; }

/* ===== Announcement bar ===== */
.hna-announce { background: var(--green); color: #fff; font-size: 1rem; text-align: center; padding: .55em 0; }
.hna-announce a { color: #fff; font-weight: 700; text-decoration: none; }
.hna-announce a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header { background: var(--white); position: relative; z-index: 20; box-shadow: 0 1px 0 var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: 88px; }
.site-brand { margin-right: auto; min-width: 0; }
.site-brand .custom-logo { display: block; width: auto; height: 58px; max-width: 100%; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav li { position: relative; }
.site-nav a:not(.hna-btn) {
	display: block; padding: .55em .8em; border-radius: 8px;
	font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none;
}
.site-nav a:not(.hna-btn):hover { background: var(--stone); }
.site-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a, .site-nav .current-menu-ancestor > a { color: var(--green-dark); box-shadow: inset 0 -3px 0 var(--green); border-radius: 0; }
.site-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; flex-direction: column; background: #fff; box-shadow: var(--shadow); border-radius: 10px; padding: 8px; min-width: 230px; border-top: 4px solid var(--green); }
.site-nav .sub-menu a { font-weight: 400; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: flex; }
.hna-btn--nav { margin-left: 8px; }

.nav-toggle { display: none; }

@media (max-width: 1020px) {
	.site-header__inner { min-height: 74px; }
	.site-brand .custom-logo { height: 46px; }
	.nav-toggle {
		display: inline-flex; align-items: center; gap: 8px;
		background: none; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink);
		font-family: var(--font-body); font-weight: 700; font-size: 1rem;
		padding: .45em .9em; cursor: pointer;
	}
	.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: ""; }
	.nav-toggle__bars::before { position: absolute; top: -6px; }
	.nav-toggle__bars::after { position: absolute; top: 6px; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 0;
		background: #fff; padding: 8px 16px 18px; box-shadow: var(--shadow); border-top: 1px solid var(--line);
	}
	.nav-open .site-nav { display: flex; }
	.site-nav ul { flex-direction: column; }
	.site-nav a:not(.hna-btn) { padding: .8em .5em; border-bottom: 1px solid var(--line); border-radius: 0; }
	.site-nav .menu-item-has-children > a::after { display: none; }
	.site-nav .current-menu-item > a, .site-nav .current_page_item > a, .site-nav .current-menu-ancestor > a { box-shadow: inset 4px 0 0 var(--green); padding-left: .9em; }
	.site-nav .sub-menu { display: flex; position: static; box-shadow: none; padding: 0 0 0 1.1em; border-top: 0; min-width: 0; }
	.hna-btn--nav { margin: 14px 0 0; text-align: center; }
}
@media (max-width: 420px) {
	.site-brand .custom-logo { height: 38px; }
}

/* ===== Hero ===== */
.hna-hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hna-hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(60% 80% at 85% 40%, rgba(124, 199, 154, .16), transparent 70%);
}
.hna-hero__inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(84px, 9vw, 120px); }
.hna-hero__eyebrow { font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; color: var(--green-light); margin: 0 0 14px; }
.hna-hero__title { color: #fff; margin: 0 0 18px; font-size: clamp(2.4rem, 5.4vw, 4rem); line-height: 1.05; font-weight: 500; }
.hna-hero__lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); color: #DCE3EA; max-width: 30em; margin-bottom: 28px; }
.hna-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.hna-hero__art img { display: block; width: 100%; max-width: 460px; margin-left: auto; }
.hna-hero__art .hna-hero__photo { border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hna-hero__rafters { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--rafters-light) repeat-x bottom left / 34px 14px; }
@media (max-width: 820px) {
	.hna-hero__inner { grid-template-columns: 1fr; gap: 8px; }
	.hna-hero__art { order: -1; }
	.hna-hero__art img { max-width: 240px; margin: 0 auto 0 -10px; }
}

/* ===== Next-meeting card ===== */
.hna-meeting-band { margin-top: -54px; position: relative; z-index: 2; }
.hna-meeting {
	display: flex; gap: 22px; align-items: center;
	background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
	border-top: 6px solid var(--green);
	padding: 22px 26px; margin: 1.5em 0;
}
.hna-meeting-band .hna-meeting { margin: 0; }
.hna-meeting__date {
	flex: none; width: 96px; text-align: center;
	background: var(--stone); color: var(--ink); border: 2px solid var(--line); border-radius: 10px; padding: 10px 0 12px; line-height: 1;
}
.hna-meeting__month { display: block; font-weight: 700; color: var(--green-dark); font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; }
.hna-meeting__day { display: block; font-family: var(--font-head); font-weight: 500; font-size: 2.8rem; margin: 4px 0; }
.hna-meeting__dow { display: block; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hna-meeting__body p { margin: 0; }
.hna-eyebrow { font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--green-dark); font-size: .85rem; }
.hna-meeting__when { font-family: var(--font-head); font-weight: 500; font-size: 1.5rem; color: var(--ink); line-height: 1.25; margin: 2px 0 4px !important; }
.hna-meeting__where { color: var(--muted); }
.hna-sep { margin: 0 .35em; }
.hna-meeting__note { margin-top: 6px !important; font-weight: 700; color: var(--ink); }
.hna-meeting__actions { margin-top: 12px !important; }
@media (max-width: 560px) {
	.hna-meeting { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
	.hna-meeting__date { width: auto; display: flex; gap: 10px; align-items: baseline; padding: 8px 14px; }
	.hna-meeting__day { font-size: 1.6rem; margin: 0; }
}

/* ===== Page header ===== */
.hna-page-head { background: var(--stone-2); padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 56px); position: relative; }
.hna-page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--rafters) repeat-x bottom left / 34px 14px; }
.hna-page-head__title { margin: 0; }

/* ===== Content ===== */
.site-main { min-height: 50vh; }
.entry-content { padding-top: 40px; padding-bottom: 72px; }
.entry-content > :first-child { margin-top: 0; }
.hna-lead { font-size: 1.3rem; line-height: 1.5; color: var(--ink); }
.hna-small { font-size: .95rem; color: var(--muted); }
.hna-subhead { margin-top: 1.4em; }
.wp-block-embed iframe { border-radius: var(--radius); box-shadow: var(--shadow); }
.wp-block-image img { border-radius: var(--radius); }
.hna-framed img { box-shadow: var(--shadow); }
.wp-element-caption { font-size: .92rem; color: var(--muted); text-align: left; margin-top: .6em; }

.hna-callout { background: #fff; border-radius: var(--radius); border-left: 6px solid var(--green); padding: 20px 26px 6px; margin: 1.8em 0; box-shadow: var(--shadow); }
.hna-callout h3 { margin-top: 0; }
.hna-callout .wp-block-columns { margin-bottom: 0; }
.hna-emergency { background: #FFF6E4; border: 1px solid #EDCF8E; border-radius: var(--radius); padding: 14px 20px 2px; margin: 1.6em 0; }
.hna-admin-hint { background: #EEF4FF; border: 1px dashed #7A93C7; border-radius: 8px; padding: 10px 14px; font-size: .95rem; }
.hna-empty { color: var(--muted); font-style: italic; }

/* Quotes */
.hna-quote { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px 32px; margin: 0 0 2em; }
.hna-quote .wp-block-quote { border: 0; margin: 0; padding: 0; }
.hna-quote p { font-family: var(--font-head); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.45; color: #fff; }
.hna-quote cite { color: var(--green-light); font-style: normal; font-weight: 700; font-size: 1rem; }
.wp-block-quote.hna-pull { border-left: 5px solid var(--green); margin: 1.5em 0; padding: 4px 0 4px 22px; font-family: var(--font-head); color: var(--ink); font-size: 1.15rem; }

/* Cards */
.hna-cards { gap: 22px !important; margin: 1.4em 0 !important; }
.hna-cards > .wp-block-column {
	background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 24px 24px 10px; border-top: 5px solid var(--green);
}
.hna-cards h3 { margin-top: 0; }
.hna-cards h3 + h3, .hna-cards ul + h3 { margin-top: 1.2em; }
.hna-cards ul { padding-left: 1.1em; margin: 0 0 1em; }
.hna-cards li { margin-bottom: .3em; }
.hna-cards a { font-weight: 700; }
.hna-cards h3 a { color: var(--ink); text-decoration: none; }
.hna-cards h3 a:hover { color: var(--green-dark); text-decoration: underline; }
.hna-cards--hats > .wp-block-column { border-top-color: var(--gold); }
.hna-cards--report .is-emergency { border-top-color: #C2412D; }
.hna-big-number { font-family: var(--font-head); font-size: 1.7rem; margin: 0 0 .4em; }
.hna-big-number a { color: var(--ink); text-decoration: none; font-weight: 500; }
.hna-cards--reps .hna-eyebrow { margin: 0 0 .3em; }

/* Home */
.hna-home-content { padding-top: 64px; }
.hna-intro { gap: 48px !important; align-items: center !important; }
.hna-intro h2 { margin-top: 0; }
.hna-section-title { margin-top: 2.4em !important; }
.hna-section-title::after { content: ""; display: block; width: 102px; height: 14px; margin: 14px auto 0; background: var(--rafters) repeat-x / 34px 14px; }
.hna-tiles { gap: 16px !important; margin-top: 1.4em; }
.hna-tiles p { margin: 0; height: 100%; }
.hna-tiles a {
	display: flex; flex-direction: column; gap: 6px; height: 100%;
	background: var(--ink); color: #DCE3EA; text-decoration: none; border-radius: var(--radius);
	padding: 22px 22px 24px; transition: transform .15s, background .15s;
}
.hna-tiles a strong { font-family: var(--font-head); font-weight: 500; color: #fff; font-size: 1.3rem; }
.hna-tiles a strong::after { content: " →"; color: var(--green-light); }
.hna-tiles a:hover { background: var(--green-dark); transform: translateY(-2px); color: #fff; }

.hna-upcoming { background: var(--stone-2); padding: 52px 0 60px; }
.hna-upcoming__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hna-upcoming__head h2 { margin: 0 0 16px; }
.hna-upcoming__head a { font-weight: 700; }

/* Upcoming events list */
.hna-events { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hna-event a { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--text); height: 100%; }
.hna-event a:hover { box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.hna-event__date { flex: none; width: 58px; text-align: center; background: var(--green); color: #fff; border-radius: 8px; padding: 6px 0 8px; line-height: 1; }
.hna-event__date span { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hna-event__date strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: 1.7rem; margin-top: 3px; }
.hna-event__title { display: block; font-family: var(--font-head); font-weight: 500; color: var(--ink); font-size: 1.1rem; line-height: 1.3; margin-bottom: 4px; }
.hna-event__meta { display: block; font-size: .95rem; color: var(--muted); }

/* History */
.hna-split { gap: 32px !important; }
.hna-then-now { gap: 22px !important; }

/* Calendar (Google) */
.hna-cal { margin: 1.5em 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.hna-cal iframe { display: block; width: 100%; border: 0; }
.hna-cal__agenda { display: none; }
@media (max-width: 700px) { .hna-cal__month { display: none; } .hna-cal__agenda { display: block; } }
.page .entry-content:has(.hna-cal) { max-width: var(--wrap); }
.hna-cal-empty { background: #fff; border-radius: var(--radius); border: 2px dashed var(--line); padding: 24px; margin: 1.5em 0; }
.hna-subscribe { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 24px 10px; margin: 1.5em 0; }
.hna-subscribe__label { font-weight: 700; }
.hna-subscribe .hna-btn { margin: 0 6px 10px 0; }
.hna-subscribe .hna-btn--ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.hna-subscribe .hna-btn--ghost:hover { background: #fff; color: var(--ink); }

/* The Events Calendar plugin: match the theme */
.tribe-common, .tribe-events, #tribe-events-pg-template {
	--tec-color-accent-primary: #2F7A4D;
	--tec-color-accent-primary-hover: #245F3C;
	--tec-color-accent-primary-active: #245F3C;
	--tec-color-button-primary: #2F7A4D;
	--tec-color-link-accent: #245F3C;
	--tec-color-text-primary: #1E2B38;
	--tec-font-family-sans-serif: "PT Sans", sans-serif;
	--tec-font-family-base: "PT Sans", sans-serif;
}
.tribe-common h1, .tribe-common h2, .tribe-common h3, .tribe-events-single-event-title, .tribe-events-calendar-list__event-title { font-family: var(--font-head) !important; font-weight: 500 !important; }
#tribe-events-pg-template, .tribe-events-pg-template { max-width: var(--wrap); margin: 0 auto; padding: 40px 16px 72px; }

/* Contact & newsletter */
.hna-contact { margin: 1.4em 0 2em; }
.hna-contact__addr { color: var(--muted); margin-top: .6em; }
.hna-newsletter { margin: .8em 0 1.6em; }
.hna-newsletter__widget > *:last-child { margin-bottom: 0; }

/* Details (meeting minutes pattern) */
.wp-block-details { background: #fff; border-radius: 10px; padding: 12px 18px; margin: 0 0 10px; box-shadow: var(--shadow); }
.wp-block-details summary { font-weight: 700; cursor: pointer; color: var(--ink); }

/* Blog fallback */
.hna-list-item { border-bottom: 1px solid var(--line); padding: 1em 0; }
.hna-list-item h2 { margin: 0 0 .2em; }
.hna-meta { color: var(--muted); font-size: .9rem; }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: #CFD7DF; font-size: 1rem; margin-top: 0; }
.hna-colonnade { height: 30px; background: var(--stone) var(--colonnade) repeat-x bottom left / 44px 30px; }
.hna-news-band { background: var(--green); color: #fff; padding: 34px 0; }
.hna-news-band__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.hna-news-band__title { color: #fff; margin: 0 0 .3em; font-size: 1.7rem; }
.hna-news-band p { margin: 0; }
.hna-news-band .hna-newsletter { margin: 0; }
.hna-news-band .hna-btn { background: #fff; color: var(--green-dark); border-color: #fff; }
.hna-news-band .hna-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.hna-news-band input[type="email"], .hna-news-band input[type="text"] { font: inherit; padding: .6em .8em; border-radius: 8px; border: 0; }
@media (max-width: 760px) { .hna-news-band__inner { grid-template-columns: 1fr; } }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 52px; padding-bottom: 36px; }
.site-footer .custom-logo { height: 54px; width: auto; display: block; margin-bottom: 18px; }
.site-footer__title { color: #fff; font-size: 1.2rem; margin: 0 0 .7em; }
.site-footer a { color: var(--green-light); }
.site-footer a:hover { color: #fff; }
.site-footer__list, .site-footer__menu { list-style: none; padding: 0; margin: 0 0 1em; }
.site-footer__list li { padding: .2em 0; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; padding-bottom: 22px; font-size: .9rem; color: #9FAAB5; }
.site-footer__legal p { margin: 0; }
.site-footer__credit a { color: #9FAAB5; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.site-footer__credit a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; gap: 28px; } }

/* WordPress helpers */
.alignwide { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.page .entry-content:has(.hna-cards--roles), .page .entry-content:has(.hna-cards--report), .page .entry-content:has(.hna-cards--reps) { max-width: calc(var(--wrap) - 120px); }

.site-footer a[href^="tel"], .hna-cards a[href^="tel"] { white-space: nowrap; }

/* Initiatives */
.hna-tag { display: inline-block; margin: 0 0 .7em !important; padding: .2em .7em; border-radius: 999px; background: var(--stone-2); color: var(--ink); font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hna-tag--done { background: var(--green); color: #fff; }
.hna-cards--projects h3 { margin-top: 0; }
.hna-cards--projects .wp-block-image { margin: -24px -24px 18px; }
.hna-cards--projects .wp-block-image img { border-radius: var(--radius) var(--radius) 0 0; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.page .entry-content:has(.hna-cards--projects), .page .entry-content:has(.hna-cards--people) { max-width: calc(var(--wrap) - 120px); }

/* History timeline */
.hna-timeline { list-style: none; padding: 0 0 0 26px !important; margin: 1em 0 2em; border-left: 3px solid var(--line); }
.hna-timeline li { position: relative; padding: .35em 0 .8em; }
.hna-timeline li::before { content: ""; position: absolute; left: -35px; top: .6em; width: 15px; height: 15px; border-radius: 50%; background: var(--stone); border: 3px solid var(--green); }
.hna-timeline strong { display: block; font-family: var(--font-head); font-weight: 500; color: var(--green-dark); font-size: 1.15rem; }
.hna-cards--people .hna-eyebrow { margin: 0 0 .3em; }

/* Residents-only password box */
.hna-resident-form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 6px solid var(--green); padding: 26px 28px 14px; max-width: 560px; }
.hna-resident-form h2 { margin: .2em 0 .4em; }
.hna-resident-form .hna-eyebrow { margin: 0; }
.hna-resident-form__row { display: flex; gap: 10px; flex-wrap: wrap; }
.hna-resident-form input[type="password"] { flex: 1 1 220px; font: inherit; padding: .65em .9em; border: 2px solid var(--line); border-radius: 999px; }
.hna-resident-form input[type="password"]:focus { border-color: var(--green); outline: none; }

/* ===== Havenscourt Wiki (residents-only pages) ===== */
.hna-page-head--wiki { background: var(--ink); color: #DCE3EA; }
.hna-page-head--wiki::after { background: var(--rafters-light) repeat-x bottom left / 34px 14px; }
.hna-page-head--wiki .hna-page-head__title { color: #fff; }
.hna-page-head__lede { margin: .6em 0 0; font-size: 1.2rem; color: #DCE3EA; max-width: 40em; }
.hna-wiki-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; font-weight: 700; }
.hna-wiki-crumb a { color: var(--green-light); text-decoration: none; }
.hna-wiki-crumb a:hover { color: #fff; text-decoration: underline; }
.hna-wiki-crumb > span:not(.hna-wiki-badge) { color: var(--green-light); }
.hna-wiki-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--green); color: #fff; border-radius: 999px; padding: .25em .8em; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.hna-wiki-badge::before { content: ""; width: 9px; height: 11px; border: 2px solid currentColor; border-radius: 2px; box-shadow: 0 -4px 0 -2px currentColor; }

/* Plain content brought over from the old site */
.hna-wiki-content h2 { font-size: 1.6rem; padding-bottom: 8px; border-bottom: 3px solid var(--green); }
.hna-wiki-content h3 { font-size: 1.25rem; }
.hna-wiki-content h2:first-child, .hna-wiki-content h3:first-child { margin-top: 0; }
.hna-wiki-content ul, .hna-wiki-content ol { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 22px 14px 42px; }
.hna-wiki-content li { padding: .35em 0; border-bottom: 1px solid var(--stone-2); }
.hna-wiki-content li:last-child { border-bottom: 0; }
.hna-wiki-content li::marker { color: var(--green); }
.hna-wiki-content a[href^="tel"] { font-weight: 700; white-space: nowrap; }
.hna-wiki-content hr { border: 0; height: 14px; margin: 2em 0; background: var(--rafters) repeat-x / 34px 14px; opacity: .35; }
.hna-wiki-content img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Tables anywhere in page content (e.g. Local Recommendations) */
.entry-content table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 1em 0 2em; font-size: 1rem; }
.entry-content th, .entry-content td { text-align: left; padding: .7em .9em; border-bottom: 1px solid var(--stone-2); vertical-align: top; }
.entry-content thead th, .entry-content tr:first-child th { background: var(--ink); color: #fff; font-family: var(--font-head); font-weight: 500; }
.entry-content tbody tr:nth-child(even) td { background: #FBF8F2; }
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content .wp-block-table { overflow-x: auto; }
@media (max-width: 700px) {
	.entry-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* "More in the Havenscourt Wiki" */
.hna-wiki-nav { background: var(--stone-2); padding: 44px 0 56px; }
.hna-wiki-nav h2 { margin: 0 0 18px; font-size: 1.5rem; }
.hna-wiki-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.hna-wiki-card a { display: flex; flex-direction: column; gap: 4px; height: 100%; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 18px; border-top: 5px solid var(--green); text-decoration: none; color: var(--text); transition: transform .15s; }
.hna-wiki-card a:hover { transform: translateY(-2px); }
.hna-wiki-card__title { font-family: var(--font-head); font-weight: 500; color: var(--ink); font-size: 1.15rem; }
.hna-wiki-card__title::after { content: " →"; color: var(--green); }
.hna-wiki-card__text { font-size: .97rem; color: var(--muted); }
.hna-wiki-card.is-urgent a { border-top-color: #C2412D; }
.hna-wiki-card.is-current a { background: var(--ink); border-top-color: var(--green-light); }
.hna-wiki-card.is-current .hna-wiki-card__title { color: #fff; }
.hna-wiki-card.is-current .hna-wiki-card__title::after { content: " · you’re here"; color: var(--green-light); font-family: var(--font-body); font-size: .85rem; }
.hna-wiki-card.is-current .hna-wiki-card__text { color: #CFD7DF; }
.hna-wiki-content .hna-resident-form h2 { border-bottom: 0; padding-bottom: 0; font-size: 1.6rem; }

/* ===== Wiki tables: full width, matching columns ===== */
/* Pages with tables use the full page width; paragraphs keep a comfortable line length. */
.hna-wiki-content:has(table) { max-width: calc(var(--wrap)); }
.hna-wiki-content:has(table) > p, .hna-wiki-content:has(table) .oer-sub { max-width: 48em; }
.hna-wiki-content table a[href^="tel"], .hna-wiki-content table a[href^="mailto"] { white-space: nowrap; }

/* Local Recommendations: every table shares the same column widths. */
.hna-page-local-recs .entry-content table { table-layout: fixed; }
.hna-page-local-recs .entry-content tr:first-child > :nth-child(1) { width: 27%; }
.hna-page-local-recs .entry-content tr:first-child > :nth-child(2) { width: 27%; }
.hna-page-local-recs .entry-content tr:first-child > :nth-child(3) { width: 30%; }
.hna-page-local-recs .entry-content tr:first-child > :nth-child(4) { width: 16%; }
.hna-page-local-recs .entry-content td:nth-child(4), .hna-page-local-recs .entry-content th:nth-child(4) { text-align: center; }

/* Election Resources: same idea for its 3-column tables. */
.oer table { table-layout: fixed; }
.oer tr:first-child > :nth-child(1) { width: 24%; }
.oer tr:first-child > :nth-child(2) { width: 26%; }
.oer tr:first-child > :nth-child(3) { width: 50%; }

@media (max-width: 700px) {
	.hna-page-local-recs .entry-content table, .oer table { table-layout: auto; }
}
.hna-wiki-content table a[href^="mailto"] { font-weight: 700; }
