/* ==========================================================================
   Inner templates: page header band, breadcrumb, archives, job/community
   detail pages. Loaded on every page except the homepage (inc/templates.php).
   ========================================================================== */

/* Full-width shell for templates that draw their own bands */
.hapi-template .site-content {
	display: block;
}

.hapi-template .content-area,
.hapi-template .site-main {
	margin: 0;
	width: 100%;
}

/* Page header band */

.hapi-page-header {
	padding: clamp(40px, 6vw, 64px) var(--hapi-gutter);
	background: var(--hapi-charcoal);
	color: #ffffff;
}

.hapi-page-header__inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 1184px;
	margin: 0 auto;
}

.hapi-page-header__inner > * {
	margin: 0;
}

.hapi-page-title {
	max-width: 900px;
	color: #ffffff;
	font-size: clamp(34px, 4.5vw, 52px);
	line-height: 1.05;
	text-wrap: balance;
}

.hapi-page-intro {
	max-width: 780px;
	color: #e6e6e6;
	font-size: clamp(17px, 1.5vw, 20px);
	line-height: 1.5;
}

.hapi-page-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	color: #cfcfcf;
	font-size: 16px;
}

/* Breadcrumb */

.hapi-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	color: #bdbdbd;
	font-size: 14px;
	list-style: none;
}

.hapi-breadcrumb li {
	margin: 0;
}

.hapi-breadcrumb li + li::before {
	content: "/";
	margin-right: 10px;
	color: #8f8f8f;
}

.hapi-breadcrumb a {
	color: #bdbdbd;
	text-decoration: none;
}

.hapi-breadcrumb a:hover {
	color: #ffffff;
	text-decoration: underline;
}

.hapi-breadcrumb li:last-child a {
	color: var(--hapi-amber);
}


.hapi-toc {
	padding: 24px;
	background: var(--hapi-cream);
}

.hapi-toc__title,
.hapi-aside-title {
	margin: 0 0 12px;
	color: var(--hapi-muted);
	font-family: var(--hapi-font-body);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.hapi-toc ol {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-toc li {
	display: grid;
	grid-template-columns: 28px 1fr;
	gap: 8px;
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
}

.hapi-toc__num {
	color: var(--hapi-link);
	font-family: var(--hapi-font-mono);
}

.hapi-toc a {
	color: #222222;
	font-weight: 600;
	text-decoration: none;
}

.hapi-toc a:hover {
	color: var(--hapi-link-hover);
	text-decoration: underline;
}


.hapi-toc ul {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-toc ul li {
	display: block;
}

/* Archive container */

.hapi-archive {
	max-width: calc(1184px + 2 * var(--hapi-gutter));
	margin: 0 auto;
	padding: 40px var(--hapi-gutter) 72px;
}

.hapi-archive--narrow {
	max-width: calc(900px + 2 * var(--hapi-gutter));
}

.hapi-empty {
	padding: 32px 0;
	color: var(--hapi-muted);
	font-size: 18px;
}

/* Category filter */

.hapi-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-bottom: 32px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--hapi-border);
}

.hapi-filter__label {
	color: var(--hapi-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hapi-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-filter li {
	margin: 0;
}

.hapi-filter__chip {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid #8c877e;
	border-radius: var(--hapi-pill);
	color: var(--hapi-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.hapi-filter__chip:hover {
	border-color: var(--hapi-text);
	color: var(--hapi-text);
}

.hapi-filter__chip[aria-current="page"] {
	border-color: var(--hapi-amber);
	background: var(--hapi-amber);
	color: #222222;
}

/* News grid */

.hapi-news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-news-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.hapi-news-card__img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	object-position: center top;
}

.hapi-news-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hapi-news-card__body > * {
	margin: 0;
}

.hapi-news-card__title {
	font-family: var(--hapi-font-body);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.hapi-news-card__title a {
	color: var(--hapi-text);
	text-decoration: none;
}

.hapi-news-card__title a:hover {
	color: var(--hapi-link-hover);
	text-decoration: underline;
}

.hapi-news-card__excerpt {
	color: #444444;
	font-size: 15px;
	line-height: 1.5;
}

.hapi-news-card__date {
	color: var(--hapi-muted);
	font-size: 13px;
}

/* Pagination */

.hapi-pagination {
	margin-top: 48px;
}

.hapi-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.hapi-pagination .page-numbers {
	display: inline-block;
	min-width: 44px;
	padding: 10px 14px;
	border: 1px solid #8c877e;
	border-radius: var(--hapi-pill);
	color: var(--hapi-text);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.hapi-pagination a.page-numbers:hover {
	border-color: var(--hapi-text);
}

.hapi-pagination .page-numbers.current {
	border-color: var(--hapi-amber);
	background: var(--hapi-amber);
	color: #222222;
}

.hapi-pagination .page-numbers.dots {
	border: 0;
}

/* Job rows */

.hapi-job-rows {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-job-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 24px;
	margin: 0;
	padding: 18px 22px;
	background: var(--hapi-cream);
	border-left: 5px solid var(--hapi-amber);
}

.hapi-job-row__main,
.hapi-job-row__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hapi-job-row__meta {
	align-items: flex-end;
	text-align: right;
}

.hapi-job-row__title {
	margin: 0;
	font-family: var(--hapi-font-body);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.3;
}

.hapi-job-row__title a {
	color: var(--hapi-text);
	text-decoration: none;
}

.hapi-job-row__title a:hover {
	color: var(--hapi-link-hover);
	text-decoration: underline;
}

.hapi-job-row__employer,
.hapi-job-row__closes {
	color: var(--hapi-muted);
	font-size: 14px;
}

.hapi-job-row__location {
	font-weight: 600;
}

/* Detail pages (job, community) */

.hapi-detail {
	display: flex;
	flex-wrap: wrap;
	gap: 64px;
	align-items: flex-start;
	max-width: calc(1184px + 2 * var(--hapi-gutter));
	margin: 0 auto;
	padding: 48px var(--hapi-gutter) 72px;
}

.hapi-detail__content {
	flex: 1 1 480px;
	min-width: 0;
	max-width: 740px;
	font-size: 18px;
	line-height: 1.7;
}

.hapi-detail__aside {
	flex: 1 1 280px;
	max-width: 360px;
}

.hapi-fact-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 24px;
	background: var(--hapi-cream);
}

.hapi-fact-card dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 16px;
	margin: 0;
	font-size: 15px;
}

.hapi-fact-card dt {
	color: var(--hapi-muted);
	font-weight: 600;
}

.hapi-fact-card dd {
	margin: 0;
	font-weight: 600;
}

.hapi-fact-card .wp-block-button__link {
	display: block;
	text-align: center;
}

.hapi-fact-card .hapi-more-link {
	font-size: 15px;
}

.hapi-notice {
	padding: 14px 18px;
	border-left: 5px solid var(--hapi-ochre);
	background: var(--hapi-cream);
	font-size: 16px;
}

/* Communities index */

.hapi-community-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-community-grid .hapi-community-card {
	margin: 0;
	background: var(--hapi-card-dark);
}

.hapi-community-grid .hapi-community-card__title {
	font-size: 20px;
}

@media (max-width: 960px) {
	.hapi-news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.hapi-news-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hapi-job-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.hapi-job-row__meta {
		align-items: flex-start;
		text-align: left;
	}

	.hapi-detail__aside {
		max-width: none;
	}
}

/* ==========================================================================
   Standard pages, 404, search
   ========================================================================== */

.hapi-template .hapi-page-content {
	max-width: calc(1184px + 2 * var(--hapi-gutter));
	margin: 0 auto;
	padding: 48px var(--hapi-gutter) 72px;
	font-size: 18px;
	line-height: 1.7;
}

.hapi-page-content > * {
	max-width: 740px;
	margin-top: 0;
	margin-bottom: 22px;
}

.hapi-page-content > .alignwide,
.hapi-page-content > .alignfull {
	max-width: none;
}

.hapi-page-content h2 {
	margin-top: 40px;
	margin-bottom: 12px;
	font-size: 30px;
}

.hapi-page-content h3 {
	margin-top: 28px;
	margin-bottom: 8px;
	font-size: 22px;
}

.hapi-page-content a:not(.wp-element-button) {
	color: var(--hapi-link-hover);
}

.hapi-template .hapi-page-content--full {
	max-width: none;
	margin: 0;
	padding: 0;
}

.hapi-template .hapi-page-content--full > .alignfull {
	margin-top: 0;
	margin-bottom: 0;
}

.hapi-subhead {
	margin: 0 0 14px;
	font-size: 22px;
}

.hapi-not-found .search-form,
.hapi-search-again .search-form {
	margin-bottom: 40px;
}

/* Search form (GeneratePress markup) */

.search-form {
	display: flex;
	gap: 8px;
	max-width: 560px;
}

.search-form label {
	flex: 1 1 auto;
	margin: 0;
}

.search-form .search-field {
	width: 100%;
	padding: 12px 18px;
	border: 1px solid #8c877e;
	border-radius: var(--hapi-pill);
	background: #ffffff;
	color: var(--hapi-text);
	font-size: 16px;
}

.search-form .search-field:focus {
	border-color: var(--hapi-text);
}

.search-form .search-submit {
	flex-shrink: 0;
	padding: 12px 20px;
	border-radius: var(--hapi-pill);
	background: var(--hapi-amber);
	color: #222222;
	line-height: 1;
}

.search-form .search-submit:hover,
.search-form .search-submit:focus-visible {
	background: var(--hapi-gold);
	color: #222222;
}

/* Section links on the 404 page */

.hapi-link-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-link-pills li {
	margin: 0;
}

.hapi-link-pills a {
	display: inline-block;
	padding: 10px 18px;
	border: 1px solid #8c877e;
	border-radius: var(--hapi-pill);
	color: var(--hapi-text);
	font-weight: 600;
	text-decoration: none;
}

.hapi-link-pills a:hover {
	border-color: var(--hapi-amber);
	background: var(--hapi-amber);
	color: #222222;
}

/* Search results */

.hapi-results {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hapi-result {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 22px 0;
	border-top: 1px solid var(--hapi-border);
}

.hapi-result > * {
	margin: 0;
}

.hapi-result__title {
	font-family: var(--hapi-font-body);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.hapi-result__title a {
	color: var(--hapi-text);
	text-decoration: none;
}

.hapi-result__title a:hover {
	color: var(--hapi-link-hover);
	text-decoration: underline;
}

.hapi-result__excerpt {
	color: #444444;
	font-size: 15px;
	line-height: 1.5;
}

/* ==========================================================================
   Events list on light backgrounds (e.g. Training page)
   ========================================================================== */

.hapi-event-list--light .hapi-event__title {
	color: var(--hapi-text);
	font-size: 17px;
}

.hapi-event-list--light .hapi-event__title:hover {
	color: var(--hapi-link-hover);
}

.hapi-event-list--light .hapi-event__place {
	color: var(--hapi-muted);
	font-size: 14px;
}

/* ==========================================================================
   Contact page + Contact Form 7
   ========================================================================== */

.hapi-template .hapi-page-content > .hapi-contact-cols {
	max-width: none;
	gap: 48px;
}

.hapi-contact-card {
	padding: 24px;
	font-size: 16px;
	line-height: 1.6;
}

.hapi-contact-card > * {
	margin: 0 0 14px;
}

.hapi-contact-card h2 {
	margin-top: 0;
	font-size: 20px;
	line-height: 1.2;
}

.wpcf7-form > p {
	margin: 0 0 18px;
}

.wpcf7-form label {
	display: block;
	font-size: 15px;
	font-weight: 600;
}

.hapi-required,
.hapi-optional {
	color: var(--hapi-muted);
	font-weight: 400;
}

.wpcf7-form-control-wrap {
	display: block;
	margin-top: 6px;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form select,
.wpcf7-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #8c877e;
	border-radius: 0;
	background: #ffffff;
	color: var(--hapi-text);
	font-size: 16px;
}

.wpcf7-form textarea {
	height: 180px;
	resize: vertical;
}

.wpcf7-form input:focus,
.wpcf7-form select:focus,
.wpcf7-form textarea:focus {
	border-color: var(--hapi-text);
	outline: 3px solid var(--hapi-focus, #1d1d1d);
	outline-offset: 2px;
}

.wpcf7-form .wpcf7-submit {
	padding: 14px 28px;
	border: 0;
	border-radius: var(--hapi-pill);
	background: var(--hapi-amber);
	color: #222222;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.wpcf7-form .wpcf7-submit:hover,
.wpcf7-form .wpcf7-submit:focus-visible {
	background: var(--hapi-gold);
}

.wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #a1261b;
	font-size: 14px;
	font-weight: 600;
}

.wpcf7-form .wpcf7-not-valid {
	border-color: #a1261b;
}

.wpcf7 form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 14px 18px;
	border: 0;
	border-left: 5px solid var(--hapi-ochre);
	background: var(--hapi-cream);
	font-size: 16px;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-left-color: #2e7d32;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
	border-left-color: #a1261b;
}
