/**
 * HCA Coverpage
 *
 * Renders inside whatever theme is active, so everything is namespaced under
 * .hca-cp and every property the layout depends on is stated explicitly
 * rather than inherited from a theme's content styles. Typography is the one
 * deliberate exception: the font family is inherited so the page reads as part
 * of the site it sits on.
 *
 * Colours come from custom properties printed inline by Renderer::inline_css().
 */

.hca-cp {
	/* Fallbacks; the brand palette overrides these inline. */
	--hca-cp-hero-bg: #294127;
	--hca-cp-hero-text: #ffffff;
	--hca-cp-btn-bg: #ffffff;
	--hca-cp-btn-text: #294127;
	--hca-cp-card-bg: #294127;
	--hca-cp-card-title: #ffffff;
	--hca-cp-card-text: #ffffff;
	--hca-cp-heading: #294127;

	--hca-cp-max: 1200px;
	--hca-cp-gap: 24px;
	--hca-cp-radius: 12px;
	--hca-cp-pad: 20px;

	box-sizing: border-box;
	display: block;
	margin: 32px auto 64px;
	max-width: var(--hca-cp-max);
	width: 100%;
	color: inherit;
	font-family: inherit;
	text-align: left;
}

.hca-cp *,
.hca-cp *::before,
.hca-cp *::after {
	box-sizing: border-box;
}

/* Themes vary wildly in what they put around the content; reset the pieces
   this layout actually relies on. */
.hca-cp p,
.hca-cp h1,
.hca-cp h2,
.hca-cp h3,
.hca-cp ul,
.hca-cp li {
	margin: 0;
	padding: 0;
	list-style: none;
	text-transform: none;
	letter-spacing: normal;
}

.hca-cp h1::before,
.hca-cp h2::before,
.hca-cp h3::before,
.hca-cp h1::after,
.hca-cp h2::after,
.hca-cp h3::after,
.hca-cp li::before,
.hca-cp li::after {
	content: none;
}

.hca-cp img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Hide the page title the theme would otherwise print. `the_title` is already
   blanked in PHP; these cover themes that print a wrapper regardless. */
.hca-coverpage-hide-title .entry-title,
.hca-coverpage-hide-title .page-title,
.hca-coverpage-hide-title .entry-header .entry-title {
	display: none;
}

/* -------------------------------------------------------------------------
   Full-bleed
   ---------------------------------------------------------------------- */

/* Escapes the theme's content container. Uses the viewport width rather than
   negative margins so it does not depend on the wrapper's own padding. */
.hca-cp--bleed .hca-cp__hero {
	position: relative;
	left: 50%;
	width: 100vw;
	max-width: 100vw;
	margin-left: -50vw;
	border-radius: 0;
}

/* -------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */

.hca-cp__hero {
	position: relative;
	display: block;
	overflow: hidden;
	background-color: var(--hca-cp-hero-bg);
	border-radius: var(--hca-cp-radius);
	color: var(--hca-cp-hero-text);
}

.hca-cp__hero-media {
	display: block;
	line-height: 0;
}

.hca-cp__hero-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.hca-cp__hero-panel {
	display: flex;
	align-items: center;
	background-color: var(--hca-cp-hero-bg);
	padding: 32px var(--hca-cp-pad);
}

.hca-cp__hero-copy {
	width: 100%;
}

.hca-cp__title {
	margin: 0 0 20px;
	color: var(--hca-cp-hero-text);
	font-size: clamp(2rem, 5.5vw, 3.25rem);
	font-weight: 700;
	line-height: 1.1;
}

.hca-cp__lede {
	color: var(--hca-cp-hero-text);
	font-size: 1rem;
	line-height: 1.55;
  margin: 1em 0;
}

.hca-cp__lede p {
	margin: 0 0 1em;
	color: inherit;
	line-height: 1.55em;
}

.hca-cp__lede p:last-child {
	margin-bottom: 0;
}

.hca-cp__cta-wrap {
	margin: 24px 0 0;
}

.hca-cp__cta,
.hca-cp .hca-cp__cta:visited {
	display: inline-block;
	padding: 14px 26px;
	border: 0;
	border-radius: 999px;
	background-color: var(--hca-cp-btn-bg);
	color: var(--hca-cp-btn-text);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: opacity 0.15s ease-in-out;
}

.hca-cp .hca-cp__cta:hover,
.hca-cp .hca-cp__cta:focus {
	background-color: var(--hca-cp-btn-bg);
	color: var(--hca-cp-btn-text);
	text-decoration: none;
	opacity: 0.85;
}

.hca-cp .hca-cp__cta:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

/* Split: colour panel beside the photo (Gippsland Care Services, HNG). */
@media (min-width: 782px) {
	.hca-cp--hero-split .hca-cp__hero {
		display: grid;
		grid-template-columns: 1fr 1fr;
		align-items: stretch;
	}

	.hca-cp--hero-split .hca-cp__hero-media {
		grid-column: 2;
		grid-row: 1;
		height: 100%;
	}

	.hca-cp--hero-split .hca-cp__hero-panel {
		grid-column: 1;
		grid-row: 1;
		padding: 56px 48px;
	}

	.hca-cp--hero-split .hca-cp__hero-copy {
		max-width: 30em;
	}
}

/* Overlay: photo fills the band, copy sits on a floating panel (My Care
   Solution). */
@media (min-width: 782px) {
	.hca-cp--hero-overlay .hca-cp__hero {
		display: grid;
	}

	.hca-cp--hero-overlay .hca-cp__hero-media {
		grid-area: 1 / 1;
		height: 100%;
		min-height: 480px;
	}

	/* Keep the band a readable height on wide screens rather than letting a
	   large photo dictate it. */
	.hca-cp--hero-overlay .hca-cp__hero-image {
		max-height: 560px;
	}

	.hca-cp--hero-overlay .hca-cp__hero-panel {
		grid-area: 1 / 1;
		align-items: center;
		justify-content: flex-start;
		padding: 48px;
		background-color: transparent;
	}

	.hca-cp--hero-overlay .hca-cp__hero-copy {
		max-width: 30em;
		padding: 44px 40px;
		background-color: var(--hca-cp-hero-bg);
		border-radius: var(--hca-cp-radius);
	}

	/* Without a photo there is nothing to overlay, so fall back to the panel. */
	.hca-cp--hero-overlay .hca-cp__hero:not(:has(.hca-cp__hero-media)) .hca-cp__hero-panel {
		background-color: var(--hca-cp-hero-bg);
	}
}

@media (max-width: 781px) {
	.hca-cp__hero-media {
		max-height: 320px;
		overflow: hidden;
	}
}

/* -------------------------------------------------------------------------
   Services
   ---------------------------------------------------------------------- */

.hca-cp__services {
	display: block;
	padding: 56px var(--hca-cp-pad) 24px;
}

.hca-cp__heading {
	margin: 0 0 32px !important;
	color: var(--hca-cp-heading);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
}

.hca-cp__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--hca-cp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.hca-cp__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.hca-cp__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.hca-cp__item {
	display: flex;
	margin: 0;
	padding: 0;
}

.hca-cp__card,
.hca-cp a.hca-cp__card {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 28px 24px 32px;
	background-color: var(--hca-cp-card-bg);
	border-radius: var(--hca-cp-radius);
	color: var(--hca-cp-card-text);
	text-align: center;
	text-decoration: none;
}

.hca-cp a.hca-cp__card {
	transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.hca-cp a.hca-cp__card:hover,
.hca-cp a.hca-cp__card:focus {
	color: var(--hca-cp-card-text);
	text-decoration: none;
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hca-cp a.hca-cp__card:focus-visible {
	outline: 3px solid var(--hca-cp-card-title);
	outline-offset: 3px;
}

.hca-cp__card-icon {
	display: block;
	color: var(--hca-cp-card-text);
	line-height: 0;
}

.hca-cp__icon {
	display: block;
	width: 64px;
	height: 64px;
	fill: currentColor;
}

.hca-cp__card-title {
	display: block;
	color: var(--hca-cp-card-title);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
}

.hca-cp__card-text {
	display: block;
	max-width: 30em;
	color: var(--hca-cp-card-text);
	font-size: 0.9375rem;
	line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
	.hca-cp a.hca-cp__card,
	.hca-cp__cta {
		transition: none;
	}

	.hca-cp a.hca-cp__card:hover,
	.hca-cp a.hca-cp__card:focus {
		transform: none;
	}
}

/* HNG brand palette (was printed inline by the hca-coverpage plugin) */
.hca-cp{--hca-cp-hero-bg:#00a551;--hca-cp-hero-text:#ffffff;--hca-cp-btn-bg:#ffffff;--hca-cp-btn-text:#00a551;--hca-cp-card-bg:#4d2178;--hca-cp-card-title:#ffffff;--hca-cp-card-text:#ffffff;--hca-cp-heading:#294227}
