/*
 * Helpers Grant Recipients — front end.
 * Colors come from Astra's global palette (Customizer → Global → Colors), so a
 * palette change there updates these pages too. Fallbacks match the Helpers dev site.
 */
.hgr-recipient,
.hgr-stats, .hgr-feature, .hgr-directory, .hgr-awards {
	--hgr-blue: var(--ast-global-color-0, #1778bd);
	--hgr-sky: var(--ast-global-color-1, #4ac9f6);
	--hgr-ink: var(--ast-global-color-3, #2b2b2b);
	--hgr-cream: var(--ast-global-color-4, #faf7f2);
	--hgr-white: var(--ast-global-color-5, #ffffff);
	--hgr-accent: var(--ast-global-color-8, #f59a0f);
	--hgr-heading-font: "Poppins", var(--hgr-heading-fallback, system-ui, -apple-system, "Segoe UI", sans-serif);
	--hgr-body-font: "Lora", Georgia, serif;
	--hgr-radius: 5px;
	--hgr-gap: clamp(1.25rem, 3vw, 2rem);
	color: var(--hgr-ink);
	font-family: var(--hgr-body-font);
}

/* ---------- Layout ---------- */
/* Astra's .ast-container is a flex row; make the page fill it so content centers. */
.hgr-recipient { width: 100%; flex: 1 1 100%; min-width: 0; }
.hgr-wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.hgr-wrap--narrow { max-width: 920px; }
@media (max-width: 767px) { .hgr-wrap { padding: 0 20px; } }
.hgr-section { padding: clamp(2rem, 5vw, 4rem) 0; }
.hgr-section--cream { background: var(--hgr-cream); }
.hgr-recipient__header { padding-bottom: 1rem; }
.hgr-recipient__hero { padding-top: 0; padding-bottom: 0; }

/* ---------- Type ---------- */
.hgr-recipient h1, .hgr-recipient h2, .hgr-recipient h3,
.hgr-h2, .hgr-card__title, .hgr-feature__title, .hgr-stats__heading,
.hgr-awards__heading, .hgr-kicker, .hgr-button, .hgr-chip,
.hgr-timeline__year, .hgr-stat-card__value, .hgr-card__year {
	font-family: var(--hgr-heading-font);
}
.hgr-recipient__title { color: var(--hgr-blue); font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 600; line-height: 1.05; letter-spacing: -1px; margin: 0 0 .35em; }
.hgr-recipient__location { font-size: 1rem; margin: 0; }
.hgr-h2 { color: var(--hgr-blue); font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 600; line-height: 1.3; margin: 0 0 .75em; }
.hgr-lead { color: var(--hgr-blue); font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.5; margin: 0 0 1.5em; }
.hgr-kicker { color: var(--hgr-accent); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .5em; }
.hgr-prose { font-size: 1rem; line-height: 1.65; }
.hgr-prose p { margin: 0 0 1em; }
.hgr-backlink { margin: 0 0 1.5rem; font-size: .9375rem; }
.hgr-backlink a { color: var(--hgr-blue); text-decoration: none; }
.hgr-backlink a:hover, .hgr-backlink a:focus { text-decoration: underline; }

/* ---------- Buttons ---------- */
.hgr-buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.hgr-button {
	display: inline-block; font-size: 1rem; font-weight: 600; line-height: 1.3; text-decoration: none;
	padding: 10px 20px; border-radius: var(--hgr-radius); border: 1px solid var(--hgr-blue);
	transition: background-color .2s, color .2s;
}
.hgr-button--solid { background: var(--hgr-blue); color: var(--hgr-white); }
.hgr-button--solid:hover, .hgr-button--solid:focus { background: var(--hgr-ink); border-color: var(--hgr-ink); color: var(--hgr-white); }
.hgr-button--outline { background: transparent; color: var(--hgr-blue); }
.hgr-button--outline:hover, .hgr-button--outline:focus { background: var(--hgr-blue); color: var(--hgr-white); }
.hgr-recipient a:focus-visible, .hgr-directory a:focus-visible, .hgr-feature a:focus-visible,
.hgr-chip:focus-visible, .hgr-button:focus-visible, .hgr-awards summary:focus-visible {
	outline: 3px solid var(--hgr-sky); outline-offset: 2px;
}

/* ---------- Images (5:3, never stretched) ---------- */
.hgr-hero__img, .hgr-card__img, .hgr-feature__img {
	display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; border-radius: var(--hgr-radius);
}
.hgr-card__img--empty { background: var(--hgr-cream); }

/* ---------- Impact card / quote ---------- */
.hgr-impact-card { border-left: 4px solid var(--hgr-sky); padding: .25rem 0 .25rem 1.5rem; margin: 0 0 2rem; }
.hgr-impact-card__title { color: var(--hgr-blue); font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 600; line-height: 1.3; margin: 0 0 .4em; }
.hgr-impact-card__summary { color: var(--hgr-blue); font-size: clamp(1.1rem, 2vw, 1.5rem); line-height: 1.5; margin: 0 0 1em; }
.hgr-quote { margin: 2.5rem 0 0; padding: 2rem; background: var(--hgr-cream); border-radius: var(--hgr-radius); }
.hgr-quote blockquote { margin: 0; padding: 0; border: 0; font-size: clamp(1.15rem, 2vw, 1.4rem); font-style: italic; color: var(--hgr-blue); }
.hgr-quote blockquote p { margin: 0; }
.hgr-quote figcaption { margin-top: .75rem; font-size: .9375rem; }

/* ---------- Artist extras ---------- */
.hgr-recipient__location a { color: var(--hgr-blue); }
.hgr-tags { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.hgr-tags li { font-family: var(--hgr-heading-font); font-size: .8125rem; font-weight: 500; padding: 4px 12px; border-radius: 999px; background: var(--hgr-cream); color: var(--hgr-blue); }
.hgr-buttons--after { margin-top: 2rem; }
.hgr-video--file video, .hgr-video--file .wp-video { width: 100% !important; height: auto; }
.hgr-video--file { aspect-ratio: auto; }
.hgr-section--cream .hgr-quote { background: var(--hgr-white); }

/* ---------- Grant history timeline ---------- */
.hgr-timeline { list-style: none; margin: 0; padding: 0; }
.hgr-timeline__item { display: grid; grid-template-columns: 6rem 1fr; gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid rgba(23, 120, 189, .2); }
.hgr-timeline__item:first-child { border-top: 0; padding-top: 0; }
.hgr-timeline__year { color: var(--hgr-blue); font-size: 1.75rem; font-weight: 600; line-height: 1; margin: 0; }
.hgr-timeline__project { color: var(--hgr-ink); font-size: 1.2rem; font-weight: 600; margin: 0 0 .35em; }
.hgr-timeline__body p { margin: 0 0 .4em; }
.hgr-timeline__location { font-size: .875rem; opacity: .8; }
@media (max-width: 600px) { .hgr-timeline__item { grid-template-columns: 1fr; gap: .4rem; } }

/* ---------- Gallery / video ---------- */
.hgr-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.hgr-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--hgr-radius); }
.hgr-gallery__caption { font-size: .875rem; line-height: 1.4; margin: .5rem 0 0; }
.hgr-video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 2rem; }
.hgr-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--hgr-radius); }

/* ---------- Cards ---------- */
.hgr-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hgr-gap); }
@media (max-width: 1024px) { .hgr-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .hgr-cards { grid-template-columns: 1fr; } }
.hgr-card[hidden] { display: none; }
.hgr-card__inner { height: 100%; display: flex; flex-direction: column; background: var(--hgr-white); }
.hgr-card__media { display: block; }
.hgr-card__body { display: flex; flex-direction: column; flex: 1; padding: 1rem 0 0; }
.hgr-card__year { color: var(--hgr-accent); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .4em; }
.hgr-card__title { font-size: 1.375rem; font-weight: 600; line-height: 1.3; margin: 0 0 .25em; }
.hgr-card__title a { color: var(--hgr-blue); text-decoration: none; }
.hgr-card__title a:hover, .hgr-card__title a:focus { text-decoration: underline; }
.hgr-card__location { font-size: .9375rem; margin: 0 0 .75em; opacity: .85; }
.hgr-card__excerpt { font-size: 1rem; line-height: 1.6; margin: 0 0 1em; }
.hgr-card__more { margin: auto 0 0; }

/* ---------- Filters ---------- */
.hgr-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 2rem; }
.hgr-filters__years, .hgr-filters__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.hgr-chip {
	font-size: .9375rem; font-weight: 500; line-height: 1.2; cursor: pointer;
	padding: 8px 16px; border-radius: 999px; border: 1px solid var(--hgr-blue);
	background: transparent; color: var(--hgr-blue);
}
.hgr-chip:hover { background: var(--hgr-cream); }
.hgr-chip[aria-pressed="true"] { background: var(--hgr-blue); color: var(--hgr-white); }
.hgr-filters__select { display: flex; align-items: center; gap: .5rem; }
.hgr-filters__select label { font-family: var(--hgr-heading-font); font-size: .9375rem; font-weight: 500; }
.hgr-filters__select select { min-width: 14rem; padding: 8px 12px; border: 1px solid var(--hgr-blue); border-radius: var(--hgr-radius); background: var(--hgr-white); color: var(--hgr-ink); }
.hgr-directory__more { text-align: center; margin: 2.5rem 0 0; }
.hgr-directory__empty { margin: 1rem 0; }

/* ---------- Impact at a Glance band ---------- */
.hgr-stats { background: var(--hgr-blue); color: var(--hgr-cream); padding: clamp(2rem, 5vw, 3.5rem) 40px; border-radius: var(--hgr-radius); }
.hgr-stats__inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--hgr-gap); align-items: center; }
@media (max-width: 900px) { .hgr-stats__inner { grid-template-columns: 1fr; } }
.hgr-stats__heading { color: var(--hgr-white); font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 600; line-height: 1.3; margin: 0 0 1rem; }
.hgr-stats .hgr-button--outline { color: var(--hgr-white); border-color: var(--hgr-white); }
.hgr-stats .hgr-button--outline:hover, .hgr-stats .hgr-button--outline:focus { background: var(--hgr-white); color: var(--hgr-blue); }
.hgr-stats__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--hgr-gap); }
.hgr-stats--with-image .hgr-stats__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 2.4fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
@media (max-width: 1024px) { .hgr-stats--with-image .hgr-stats__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } .hgr-stats--with-image .hgr-stats__list { grid-column: 1 / -1; } }
@media (max-width: 640px) { .hgr-stats--with-image .hgr-stats__inner { grid-template-columns: 1fr; } }
.hgr-stats__media { min-width: 0; }
.hgr-stats__media img, .hgr-stats__img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border: 2px solid var(--hgr-white); border-radius: 8px; }
.hgr-stats--full { border-radius: 0; width: 100vw; position: relative; left: 50%; margin-left: -50vw; box-sizing: border-box; }
.hgr-stat-card { display: flex; flex-direction: column; gap: .35rem; }
.hgr-stat-card__value { color: var(--hgr-sky); font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 600; line-height: 1.2; }
.hgr-stat-card__label { font-size: 1rem; line-height: 1.5; }

/* ---------- Featured story ---------- */
.hgr-feature__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--hgr-gap); align-items: center; }
@media (max-width: 800px) { .hgr-feature__grid { grid-template-columns: 1fr; } }
.hgr-feature__title { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 600; line-height: 1.3; margin: 0 0 .25em; }
.hgr-feature__title a { color: var(--hgr-blue); text-decoration: none; }
.hgr-feature__text { color: var(--hgr-blue); font-size: clamp(1.1rem, 2vw, 1.5rem); line-height: 1.5; margin: 0 0 1.25em; }

/* ---------- Awards by year ---------- */
.hgr-awards__year { border-top: 1px solid rgba(23, 120, 189, .25); }
.hgr-awards__year:last-child { border-bottom: 1px solid rgba(23, 120, 189, .25); }
.hgr-awards summary.hgr-awards__heading,
.hgr-awards h3.hgr-awards__heading {
	color: var(--hgr-blue); font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-weight: 600; padding: 1.1rem 2.5rem 1.1rem 0; margin: 0;
	cursor: pointer; list-style: none; position: relative;
}
.hgr-awards summary::-webkit-details-marker { display: none; }
.hgr-awards summary::after { content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; }
.hgr-awards details[open] > summary::after { content: "\2013"; }
.hgr-awards__intro { color: var(--hgr-blue); font-size: 1.15rem; margin: 0 0 .5em; }
.hgr-awards__totals { font-weight: 600; margin: 0 0 1.25em; }
.hgr-awards__list { list-style: none; margin: 0 0 1.5rem; padding: 0; columns: 2 22rem; column-gap: 3rem; }
.hgr-award { break-inside: avoid; margin: 0 0 1rem; line-height: 1.5; }
.hgr-award__org a { color: var(--hgr-blue); }
.hgr-award__project, .hgr-award__amount { display: block; }

/* ---------- Grant history shortcode (used outside the built-in page) ---------- */
.hgr-history { list-style: none; margin: 0; padding: 0; }
.hgr-history__item { margin: 0 0 1.5em; }

/* Lightweight fallback for themes without a screen-reader-text class. */
.hgr-recipient .screen-reader-text, .hgr-directory .screen-reader-text, .hgr-feature .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
