/* =========================================================================
   Block patterns and the District blocks. Loads on the front end and in the
   block editor so patterns look the same in both.
   ========================================================================= */


.zd4t-eyebrow {
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: var(--zd4t-text-sm);
	font-weight: 700;
	color: var(--zd4t-primary);
	margin: 0 0 8px;
}
.zd4t-on-dark .zd4t-eyebrow { color: var(--zd4t-accent-text); }
.zd4t-eyebrow + :is(h1, h2, h3), .zd4t-prose .zd4t-eyebrow + :is(h1, h2, h3) { margin-top: 0; }

/* Top-level blocks in page content sit outside any layout container. */
.zd4t-prose > :is(.wp-block-group, .wp-block-zd4t-stats, .zd4t-stories) { margin-block: var(--zd4t-space-7); }
.zd4t-prose > .wp-block-buttons { margin-bottom: 1em; }

/* ---------- Card (Group block style) ---------- */
.is-style-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--zd4t-space-5);
	background: #ffffff;
	color: var(--zd4t-fg);
	border: 1px solid var(--zd4t-border);
	border-top: 4px solid var(--zd4t-mahogany);
	border-radius: var(--zd4t-radius-lg);
	transition: transform .2s ease, box-shadow .2s ease;
}
.is-style-card > * { margin-top: 0; margin-bottom: var(--zd4t-space-3); }
.is-style-card > *:last-child { margin-bottom: 0; }
.is-style-card .wp-block-image { margin: calc(-1 * var(--zd4t-space-5)) calc(-1 * var(--zd4t-space-5)) var(--zd4t-space-4); }
.is-style-card .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.is-style-card :is(h2, h3, h4) { font-size: var(--zd4t-text-xl); }
.is-style-card :is(h2, h3, h4) a { color: var(--zd4t-fg); text-decoration: none; }
/* The heading link covers the card, so the whole card is one click target. */
.is-style-card :is(h2, h3, h4) a::after { content: ""; position: absolute; inset: 0; }
.is-style-card:has(:is(h2, h3, h4) a):hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .08); }
.is-style-card:has(:is(h2, h3, h4) a):hover :is(h2, h3, h4) a { color: var(--zd4t-primary); text-decoration: underline; }
.is-style-card:has(:is(h2, h3, h4) a:focus-visible) { outline: 3px solid var(--zd4t-focus); outline-offset: 2px; }
.is-style-card :is(h2, h3, h4) a:focus-visible { outline: none; }

.zd4t-card__icon, .wp-block-zd4t-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: var(--zd4t-space-4); border-radius: 50%; background: var(--zd4t-gold-40); color: var(--zd4t-mahogany); }
.is-style-card .wp-block-zd4t-icon { margin-bottom: var(--zd4t-space-4); }

/* ---------- Call-to-action band ---------- */
.zd4t-cta-band { padding: var(--zd4t-space-7) var(--zd4t-space-6); border-radius: var(--zd4t-radius-lg); }
.zd4t-cta-band > :first-child { margin-top: 0; }
.zd4t-cta-band > :last-child { margin-bottom: 0; }
.zd4t-cta-band h2 { color: inherit; }

/* ---------- "More" link with an arrow ---------- */
.zd4t-more { display: inline-flex; align-items: center; gap: var(--zd4t-space-2); font-weight: 700; }
.zd4t-more svg { transition: transform .2s ease; }
.zd4t-more:hover svg { transform: translateX(3px); }

/* ---------- Latest Stories ---------- */
.zd4t-stories > h2 { margin-top: 0; }
.zd4t-stories__more { margin: var(--zd4t-space-5) 0 0; }

/* ---------- Upcoming events (homepage and the Upcoming Events block) ---------- */
.zd4t-events-list { list-style: none; margin: 0 0 var(--zd4t-space-6); padding: 0; display: grid; gap: var(--zd4t-space-3); }
.zd4t-events-list__item { display: grid; grid-template-columns: 64px 1fr; gap: var(--zd4t-space-4); align-items: start; padding: var(--zd4t-space-4); background: #ffffff; border-left: 6px solid var(--zd4t-pillar, var(--zd4t-mahogany)); border-radius: var(--zd4t-radius); }
.zd4t-events-list__date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.zd4t-events-list__month { font-size: var(--zd4t-text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--zd4t-primary); }
.zd4t-events-list__day { font-size: var(--zd4t-text-2xl); font-weight: 700; }
.zd4t-events-list__title { font-size: var(--zd4t-text-lg); margin: 0 0 var(--zd4t-space-1); }
.zd4t-events-list__title a { color: inherit; text-decoration: none; }
.zd4t-events-list__title a:hover { color: var(--zd4t-mahogany); text-decoration: underline; }
.zd4t-events-list__meta, .zd4t-events-list__pillar { margin: 0; font-size: var(--zd4t-text-sm); color: var(--zd4t-muted); }
.zd4t-events-list__pillar { margin-top: var(--zd4t-space-1); font-weight: 700; }
.zd4t-events-list__register { margin: var(--zd4t-space-2) 0 0; font-size: var(--zd4t-text-sm); font-weight: 700; }
.zd4t-events__more { margin: 0; }

/* ---------- Stats ---------- */
.zd4t-stats__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--zd4t-space-5); }
.zd4t-stats__item { display: flex; flex-direction: column; gap: var(--zd4t-space-1); padding-top: var(--zd4t-space-3); border-top: 4px solid var(--zd4t-gold); }
.zd4t-stats__value { font-size: var(--zd4t-text-3xl); font-weight: 700; line-height: 1.1; color: var(--zd4t-primary); font-variant-numeric: tabular-nums; }
.zd4t-stats__label { color: var(--zd4t-muted); }
.zd4t-stats__note { margin: var(--zd4t-space-4) 0 0; font-size: var(--zd4t-text-sm); color: var(--zd4t-muted); }
:is(.zd4t-on-dark, .has-mahogany-background-color, .has-cyan-background-color) :is(.zd4t-stats__value, .zd4t-stats__label, .zd4t-stats__note) { color: #ffffff; }

/* ---------- FAQ (Details blocks) ---------- */
.wp-block-details { border-bottom: 1px solid var(--zd4t-border); padding: 0; margin: 0; }
.wp-block-details:first-of-type { border-top: 1px solid var(--zd4t-border); }
.wp-block-details summary { display: flex; justify-content: space-between; gap: var(--zd4t-space-4); padding: var(--zd4t-space-4) 0; font-weight: 700; cursor: pointer; list-style: none; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 1.4em; line-height: 1; color: var(--zd4t-primary); }
.wp-block-details[open] summary::after { content: "−"; }
.wp-block-details > :not(summary) { margin-top: 0; padding-bottom: var(--zd4t-space-3); }

/* ---------- Downloads (File blocks) ---------- */
.wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--zd4t-space-2) var(--zd4t-space-4); padding: var(--zd4t-space-3) 0; margin: 0; border-bottom: 1px solid var(--zd4t-border); }
.wp-block-file > a:first-child { font-weight: 700; }
.zd4t-file__meta { color: var(--zd4t-muted); font-size: var(--zd4t-text-sm); }
.wp-block-file .wp-block-file__button { margin-left: auto; min-height: 36px; padding: .4em 1em; font-size: var(--zd4t-text-sm); font-weight: 700; color: var(--zd4t-primary); background: transparent; border: 2px solid currentColor; border-radius: var(--zd4t-radius); text-decoration: none; }
.wp-block-file .wp-block-file__button:hover { color: #ffffff; background: var(--zd4t-primary); border-color: var(--zd4t-primary); }

/* ---------- Cards (archives, listings, the Subpages block) ---------- */
.zd4t-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--zd4t-space-6); }
.zd4t-card-grid--fit { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.zd4t-card { position: relative; display: flex; flex-direction: column; background: #fff; color: var(--zd4t-fg); border: 1px solid var(--zd4t-border); border-top: 4px solid var(--zd4t-mahogany); border-radius: var(--zd4t-radius-lg); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.zd4t-card:hover, .zd4t-card:focus-within { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31, 26, 26, .12); }
.zd4t-card__media { aspect-ratio: 3 / 2; background: var(--zd4t-bg-soft); }
.zd4t-card__media img { width: 100%; height: 100%; object-fit: cover; }
.zd4t-card__body { padding: var(--zd4t-space-5); }
.zd4t-card--icon { padding: var(--zd4t-space-5); }
.zd4t-card__meta { font-size: var(--zd4t-text-sm); color: var(--zd4t-muted); margin: 0 0 var(--zd4t-space-2); }
.zd4t-card__title, .zd4t-prose .zd4t-card__title { font-size: var(--zd4t-text-xl); margin: 0 0 var(--zd4t-space-2); }
.zd4t-card__link { color: inherit; text-decoration: none; }
.zd4t-card__link:hover { color: var(--zd4t-mahogany); text-decoration: underline; }
/* The title link covers the card, so the whole card is one click target. */
.zd4t-card__link::after { content: ""; position: absolute; inset: 0; }
.zd4t-card__link:focus-visible { outline: none; }
.zd4t-card:has(.zd4t-card__link:focus-visible) { outline: 3px solid var(--zd4t-focus); outline-offset: 2px; }
.zd4t-card__excerpt { color: var(--zd4t-muted); margin: 0; }


/* ---------- Placeholder (copy waiting on the District) ---------- */
.is-style-placeholder { position: relative; padding: var(--zd4t-space-6) var(--zd4t-space-5) var(--zd4t-space-5); color: #000000; background: var(--zd4t-gold-40); border: 2px dashed var(--zd4t-orange); border-radius: var(--zd4t-radius); }
.is-style-placeholder::before { content: "Placeholder"; position: absolute; top: var(--zd4t-space-2); left: var(--zd4t-space-5); font-size: var(--zd4t-text-sm); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.is-style-placeholder > :last-child { margin-bottom: 0; }

/* ---------- Roster list (role, name, role address) ---------- */
.is-style-roster { list-style: none; margin: 0 0 var(--zd4t-space-6); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--zd4t-space-4); }
.is-style-roster li { margin: 0; padding: var(--zd4t-space-4); background: var(--zd4t-bg-soft); border-left: 4px solid var(--zd4t-gold); border-radius: var(--zd4t-radius); line-height: 1.5; overflow-wrap: anywhere; }
.is-style-roster strong { color: var(--zd4t-primary); }
.is-style-roster a { font-size: var(--zd4t-text-sm); }

/* ---------- Steps (numbered links to the headings below) ---------- */
.is-style-steps { list-style: none; counter-reset: zd4t-step; margin: 0 0 var(--zd4t-space-7); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--zd4t-space-3); }
.is-style-steps li { counter-increment: zd4t-step; margin: 0; }
.is-style-steps a { display: flex; align-items: center; gap: var(--zd4t-space-3); min-height: 44px; height: 100%; box-sizing: border-box; padding: var(--zd4t-space-3) var(--zd4t-space-4); font-weight: 700; text-decoration: none; background: var(--zd4t-bg-soft); border-radius: var(--zd4t-radius); }
.is-style-steps a::before { content: counter(zd4t-step); flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #000000; background: var(--zd4t-gold); }
.is-style-steps a:hover { text-decoration: underline; }

/* ---------- Timeline (date in bold, then what happens) ---------- */
.is-style-timeline { list-style: none; margin: 0 0 var(--zd4t-space-6); padding: 0; }
.is-style-timeline li { position: relative; margin: 0; padding: 0 0 var(--zd4t-space-5) var(--zd4t-space-6); border-left: 2px solid var(--zd4t-border); }
.is-style-timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.is-style-timeline li::before { content: ""; position: absolute; left: -9px; top: .3em; width: 12px; height: 12px; border: 2px solid var(--zd4t-mahogany); border-radius: 50%; background: var(--zd4t-gold); }
.is-style-timeline strong:first-child { display: block; color: var(--zd4t-primary); }

/* ---------- Award card ---------- */
.zd4t-award { display: flex; flex-direction: column; }
.zd4t-award > .wp-block-buttons { margin-top: auto; padding-top: var(--zd4t-space-4); }
.zd4t-award__facts { list-style: none; margin: 0; padding: 0; font-size: var(--zd4t-text-sm); }
.zd4t-award__facts li { margin: 0 0 var(--zd4t-space-1); }

/* ---------- Sticky on mobile (the page's last Buttons block) ---------- */
@media (max-width: 880px) {
	html:has(.is-style-sticky-mobile) { scroll-padding-bottom: 6rem; }
	.wp-block-buttons.is-style-sticky-mobile { position: sticky; bottom: 0; z-index: 40; flex-wrap: nowrap; gap: var(--zd4t-space-3); margin-inline: calc(-1 * var(--zd4t-gutter)); padding: var(--zd4t-space-3) var(--zd4t-gutter); background: #ffffff; border-top: 1px solid var(--zd4t-border); box-shadow: 0 -4px 12px rgb(0 0 0 / .08); }
	.is-style-sticky-mobile > .wp-block-button { flex: 1 1 0; }
	.is-style-sticky-mobile .wp-block-button__link { width: 100%; box-sizing: border-box; text-align: center; padding-inline: var(--zd4t-space-3); }
}
