/*
 * Frelim Care components and signature shapes.
 *
 * Pseudo-element budget, so classes can be combined on one section:
 *   .fc-texture   uses ::before (dot lattice)
 *   .fc-arcs      uses ::after  (corner arcs)
 *   .fc-wave-band uses ::before and ::after (wave edge); its arcs are drawn in its background,
 *                 so do not add .fc-arcs to a wave band.
 * Every decorative shape is a pseudo-element or a background, so it never reaches assistive tech.
 */

/* Templates whose first section is a full-bleed band start flush under the breadcrumbs. */
.fc-main--flush {
	padding-block: 0;
}

/* ---------- Page intro and sections: full-bleed, own gutter, content column inside ---------- */

.fc-page-intro,
.fc-page-section {
	padding-inline: var(--fc-gutter);
}

.fc-page-intro__inner,
.fc-page-section__inner {
	width: 100%;
	max-width: var(--fc-content);
	margin-inline: auto;
}

/* Empty post content (a home or job without a body) leaves no gap. */
.fc-page-section:not(:has(> .wp-block-post-content > *)):has(> .wp-block-post-content) {
	display: none;
}

/* ---------- Page intro (the page's own content: eyebrow, H1, lead) ---------- */

.fc-page-intro {
	padding-bottom: var(--fc-space-50);
}

.fc-page-intro__inner > * {
	margin-block: 0;
}

.fc-page-intro__inner h1 {
	margin-block: 0 var(--fc-space-20);
}

.fc-page-intro__inner > * + :not(h1) {
	margin-top: var(--fc-space-20);
}

.fc-page-intro__lead {
	max-width: var(--fc-prose);
	font-size: var(--wp--preset--font-size--large);
}

.fc-page-intro__list {
	display: grid;
	gap: var(--fc-space-10);
	max-width: var(--fc-prose);
	padding-left: 1.2em;
}

/* ---------- Page sections ---------- */

.fc-page-section {
	padding-block: var(--fc-space-50);
}

.fc-page-section--band {
	background-color: var(--fc-cream);
}

.fc-page-section__inner > :first-child {
	margin-top: 0;
}

.fc-page-section__inner > :last-child {
	margin-bottom: 0;
}

.fc-page-section__lead {
	max-width: var(--fc-prose);
	color: var(--fc-ink);
}

@media (min-width: 900px) {
	.fc-page-section {
		padding-block: var(--fc-space-60);
	}
}

/* ---------- Icons ---------- */

.fc-icon {
	display: inline-block;
	flex: none;
	width: var(--fc-icon-size, 1.5em);
	height: var(--fc-icon-size, 1.5em);
	vertical-align: -0.3em;
	fill: currentColor;
}

.wp-block-frelim-icon {
	display: inline-flex;
	line-height: 0;
	color: var(--fc-indigo);
	--fc-icon-size: 1.75em;
}

/* ---------- Buttons ---------- */

.wp-block-button__link,
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 48px;
	text-align: center;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wp-block-button.is-style-secondary .wp-block-button__link {
	background-color: var(--fc-white);
	border-color: var(--fc-indigo);
	color: var(--fc-indigo);
}

.wp-block-button.is-style-secondary .wp-block-button__link:hover {
	background-color: var(--fc-cream);
	border-color: var(--fc-indigo-deep);
	color: var(--fc-indigo-deep);
}

.wp-block-button.is-style-call .wp-block-button__link,
.fc-call-button {
	background-color: var(--fc-ember-text);
	border-color: var(--fc-ember-text);
	color: var(--fc-white);
	font-variant-numeric: tabular-nums;
}

.wp-block-button.is-style-call .wp-block-button__link:hover,
.fc-call-button:hover {
	background-color: color-mix(in srgb, var(--fc-ember-text) 82%, black);
	border-color: color-mix(in srgb, var(--fc-ember-text) 82%, black);
	color: var(--fc-white);
}

.wp-block-button.is-style-call .wp-block-button__link::before,
.fc-call-button::before {
	content: "";
	flex: none;
	width: 1.2em;
	height: 1.2em;
	background-color: currentColor;
	mask: url(../svg/icons/phone.svg) center / contain no-repeat;
}

/* ---------- Separator: hairline with a short gradient lead, as on the brand posts ---------- */

hr.wp-block-separator {
	height: 3px;
	border: 0;
	opacity: 1;
	background:
		var(--fc-ember-amber) 0 0 / 96px 3px no-repeat,
		linear-gradient(var(--fc-line), var(--fc-line)) 0 2px / 100% 1px no-repeat;
}

/* ---------- Circle photo frame ---------- */

.fc-circle {
	--fc-ring: 6px;
	--fc-circle-gap: 6px;
	display: grid;
	gap: var(--fc-circle-gap);
	width: 100%;
	max-width: var(--fc-circle-size, 480px);
	aspect-ratio: 1;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: var(--fc-ring) solid transparent;
	border-radius: 50%;
	/* White shows through the gaps between split photos; the ring is the border box. */
	background:
		linear-gradient(var(--fc-white), var(--fc-white)) padding-box,
		linear-gradient(135deg, var(--fc-ember), var(--fc-amber)) border-box;
}

.fc-circle > * {
	min-width: 0;
	min-height: 0;
	margin: 0;
}

.fc-circle > img,
.fc-circle > figure > img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.fc-circle > figure {
	height: 100%;
}

.fc-circle--half-v {
	grid-template-columns: 1fr 1fr;
}

.fc-circle--half-h {
	grid-template-rows: 1fr 1fr;
}

.fc-circle--quarters {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

/* Three photos: two on top, one across the bottom. */
.fc-circle--quarters > :nth-child(3):last-child {
	grid-column: 1 / -1;
}

.fc-circle--half-angled > * {
	grid-area: 1 / 1;
}

.fc-circle--half-angled > :first-child {
	clip-path: polygon(0 0, calc(62% - var(--fc-circle-gap) / 2) 0, calc(38% - var(--fc-circle-gap) / 2) 100%, 0 100%);
}

.fc-circle--half-angled > :nth-child(2) {
	clip-path: polygon(calc(62% + var(--fc-circle-gap) / 2) 0, 100% 0, 100% 100%, calc(38% + var(--fc-circle-gap) / 2) 100%);
}

/* ---------- Corner arcs: three concentric Ember to Amber arcs ---------- */

/*
 * The arcs hang off the section's top corner: about 35% of them sits outside the top and
 * side edge and is clipped away, so only the inner sweep shows. The gradient must never sit
 * behind text, so the top padding always clears the visible part. !important because block
 * padding supports write inline styles, and this guarantee has to hold whatever padding a
 * block sets. overflow: clip (not hidden) so the section never becomes a scroll container.
 */
.fc-arcs {
	--fc-arcs-size: clamp(72px, 10vw, 136px);
	--fc-arcs-hang: calc(var(--fc-arcs-size) * -0.35);
	position: relative;
	isolation: isolate;
	overflow: clip;
	padding-top: calc(var(--fc-arcs-size) * 0.65 + var(--fc-space-20)) !important;
}

.fc-arcs::after {
	content: "";
	position: absolute;
	top: var(--fc-arcs-hang);
	left: var(--fc-arcs-hang);
	z-index: -1;
	width: var(--fc-arcs-size);
	aspect-ratio: 1;
	pointer-events: none;
	background: linear-gradient(135deg, var(--fc-ember), var(--fc-amber));
	mask: url(../svg/arcs.svg) 0 0 / 100% 100% no-repeat;
}

.fc-arcs--right::after {
	right: var(--fc-arcs-hang);
	left: auto;
	transform: scaleX(-1);
}

/* ---------- Navy wave band ---------- */

.fc-wave-band {
	--fc-wave-h: clamp(20px, 3.5vw, 48px);
	--fc-wave-line: 4px;
	--fc-ring-ink: color-mix(in srgb, var(--fc-white) 9%, transparent);
	position: relative;
	isolation: isolate;
	margin-top: calc(var(--fc-wave-h) + var(--fc-wave-line));
	color: var(--fc-white);
	background-color: var(--fc-indigo);
	/* Faint concentric rings rising from the bottom-left corner. */
	background-image: radial-gradient(
		circle at 0 100%,
		transparent 0 160px,
		var(--fc-ring-ink) 160px 162px,
		transparent 162px 204px,
		var(--fc-ring-ink) 204px 206px,
		transparent 206px 248px,
		var(--fc-ring-ink) 248px 250px,
		transparent 250px
	);
}

.fc-wave-band::before,
.fc-wave-band::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	pointer-events: none;
	mask: url(../svg/wave.svg) 0 0 / 100% var(--fc-wave-h) no-repeat;
}

/* The gradient wave sits one line-width higher, so a gradient edge shows above the Indigo. */
.fc-wave-band::before {
	height: calc(var(--fc-wave-h) + var(--fc-wave-line));
	background: var(--fc-ember-amber);
}

.fc-wave-band::after {
	height: var(--fc-wave-h);
	background: var(--fc-indigo);
}

.fc-wave-band :where(h1, h2, h3, h4, h5, h6, p, li, a:not(.wp-element-button)) {
	color: inherit;
}

.fc-wave-band .fc-eyebrow {
	color: var(--fc-cream);
}

.fc-wave-band .wp-block-button:not([class*="is-style-"]) .wp-block-button__link {
	background-color: var(--fc-white);
	border-color: var(--fc-white);
	color: var(--fc-indigo);
}

.fc-wave-band .wp-block-button:not([class*="is-style-"]) .wp-block-button__link:hover {
	background-color: var(--fc-cream);
	border-color: var(--fc-cream);
	color: var(--fc-indigo-deep);
}

/* ---------- Background texture: dot lattice and soft circles on cream ---------- */

.fc-texture {
	position: relative;
	isolation: isolate;
	background-color: var(--fc-cream);
	background-image:
		radial-gradient(circle 300px at 90% 8%, color-mix(in srgb, var(--fc-amber) 9%, transparent) 99.5%, transparent 100%),
		radial-gradient(circle 220px at 4% 96%, color-mix(in srgb, var(--fc-white) 60%, transparent) 99.5%, transparent 100%);
}

.fc-texture::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: var(--fc-indigo);
	opacity: 0.2;
	mask-image: url(../svg/dot-lattice.svg), radial-gradient(ellipse 45% 70% at 100% 40%, black, transparent);
	mask-size: 22px 22px, 100% 100%;
	mask-repeat: repeat, no-repeat;
	mask-composite: intersect;
}

/* ---------- Pills ---------- */

.fc-pill {
	display: flex;
	align-items: center;
	gap: 0.4em;
	width: fit-content;
	min-height: 32px;
	padding: 4px 16px;
	border-radius: var(--fc-radius-pill);
	font-size: 0.8333rem; /* 15px */
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--fc-white);
	background-color: var(--fc-ember-text);
}

/* Indigo text on a cream pill. */
.fc-pill--on-cream {
	color: var(--fc-indigo);
	background-color: var(--fc-cream);
}

/* White text on an Indigo pill. */
.fc-pill--on-indigo {
	color: var(--fc-white);
	background-color: var(--fc-indigo);
}

/* ---------- Card ---------- */

.fc-card {
	position: relative;
	padding: var(--fc-space-40);
	color: var(--fc-ink);
	background-color: var(--fc-white);
	border: 1px solid var(--fc-line);
	border-radius: var(--fc-radius-card);
	box-shadow: var(--fc-shadow-card);
}

.fc-card > :first-child {
	margin-top: 0;
}

.fc-card > :last-child {
	margin-bottom: 0;
}

/*
 * Whole-card link: one link (".fc-card__link", e.g. "Learn more about <service>") whose
 * ::after covers the card. The focus ring moves from the link's own box to the card.
 */
.fc-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.fc-card__link {
	font-weight: 600;
}

.fc-card:has(.fc-card__link):hover .fc-card__link {
	color: var(--fc-indigo-deep);
	text-decoration-thickness: 2px;
}

.fc-card .fc-card__link:focus-visible {
	outline: none;
	box-shadow: none;
}

.fc-card:has(.fc-card__link:focus-visible) {
	outline: 3px solid var(--fc-focus-ring);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--fc-focus-gap), 0 0 0 11px var(--fc-focus-halo);
}

/* ---------- Alerts: icon and words, never colour alone ---------- */

.fc-alert {
	--fc-alert-accent: var(--fc-indigo);
	display: flex;
	align-items: flex-start;
	gap: var(--fc-space-20);
	padding: var(--fc-space-20) var(--fc-space-30);
	color: var(--fc-ink);
	background-color: color-mix(in srgb, var(--fc-alert-accent) 6%, var(--fc-white));
	border: 1px solid color-mix(in srgb, var(--fc-alert-accent) 28%, var(--fc-white));
	border-radius: var(--fc-radius-card);
}

.fc-alert > * {
	margin: 0;
}

.fc-alert .wp-block-frelim-icon,
.fc-alert > .fc-icon {
	color: var(--fc-alert-accent);
	--fc-icon-size: 28px;
}

.fc-alert--success {
	--fc-alert-accent: var(--fc-success);
}

.fc-alert--error {
	--fc-alert-accent: var(--fc-error);
}

/* ---------- Acknowledgement of Country: the three flags and the text ---------- */

.fc-acknowledgement {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--fc-space-10) var(--fc-space-20);
}

.fc-acknowledgement p {
	flex: 1 1 32ch;
	margin: 0;
}

.fc-acknowledgement__flags {
	display: flex;
	flex: none;
	gap: 8px;
}

.fc-acknowledgement__flags img {
	display: block;
	width: auto;
	height: 24px;
	border-radius: 2px;
}

/* ---------- Accordion (core/details or plain details) ---------- */

details.fc-accordion {
	border-bottom: 1px solid var(--fc-line);
}

:not(details.fc-accordion) + details.fc-accordion,
details.fc-accordion:first-child {
	border-top: 1px solid var(--fc-line);
}

details.fc-accordion > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--fc-space-20);
	min-height: 48px;
	padding-block: var(--fc-space-20);
	font-size: 1.1111rem; /* 20px */
	font-weight: 600;
	line-height: 1.3;
	color: var(--fc-indigo);
	list-style: none;
	cursor: pointer;
}

details.fc-accordion > summary::-webkit-details-marker {
	display: none;
}

details.fc-accordion > summary::after {
	content: "";
	flex: none;
	width: 24px;
	height: 24px;
	background-color: var(--fc-ember-text);
	mask: url(../svg/icons/plus.svg) center / contain no-repeat;
}

details.fc-accordion[open] > summary::after {
	mask-image: url(../svg/icons/minus.svg);
}

details.fc-accordion > summary:hover {
	color: var(--fc-indigo-deep);
}

details.fc-accordion > :not(summary) {
	margin-top: 0;
	margin-bottom: var(--fc-space-30);
}

/* ---------- Editor-only approval notice (frelim-core, wp_body_open) ---------- */

.fc-approval-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px var(--fc-gutter);
	font-size: 0.8889rem; /* 16px */
	line-height: 1.5;
	color: var(--fc-ink);
	background-color: var(--fc-cream);
	border-bottom: 1px solid var(--fc-line);
}

.fc-approval-banner::before {
	content: "";
	flex: none;
	width: 24px;
	height: 24px;
	background-color: var(--fc-indigo);
	mask: url(../svg/icons/clock.svg) center / contain no-repeat;
}

/* ---------- Style guide review page (templates/page-style-guide.html) ---------- */

.fc-sg-section {
	padding-block: var(--fc-space-50);
}

@media (min-width: 768px) {
	.fc-sg-section {
		padding-block: var(--fc-space-60);
	}
}

.fc-sg-hero {
	gap: var(--fc-space-50);
}

.fc-sg-hero-media {
	display: flex;
	justify-content: center;
}

.fc-sg-lead {
	font-size: 20px;
	max-width: 46ch;
}

.fc-sg-note {
	--fc-prose: 60ch;
	color: var(--fc-muted);
}

.fc-sg-swatches,
.fc-sg-icons,
.fc-sg-circles,
.fc-sg-cards {
	display: grid;
	gap: var(--fc-space-30);
}

.fc-sg-swatches > *,
.fc-sg-icons > *,
.fc-sg-circles > *,
.fc-sg-cards > *,
.fc-sg-row > * {
	margin: 0;
}

.fc-sg-swatches {
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: var(--fc-space-20);
}

.fc-sg-swatch {
	overflow: hidden;
	border: 1px solid var(--fc-line);
	border-radius: var(--fc-radius-card);
}

.fc-sg-swatch__chip {
	height: 72px;
}

.fc-sg-swatch p {
	margin: 0;
	padding: var(--fc-space-10) 12px 12px;
	font-size: 15px;
	line-height: 1.4;
}

.fc-sg-swatch code {
	color: var(--fc-muted);
}

.fc-sg-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fc-space-20);
	margin-top: var(--fc-space-30);
}

.fc-sg-icons {
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: var(--fc-space-20);
}

.fc-sg-icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--fc-space-10);
	padding: var(--fc-space-20) var(--fc-space-10);
	border-radius: var(--fc-radius-card);
	background-color: var(--fc-cream-soft);
}

.fc-sg-icon > * {
	margin: 0;
}

.fc-sg-icon p {
	font-size: 15px;
	color: var(--fc-muted);
}

.fc-sg-circles {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--fc-space-40);
}

.fc-sg-frame {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--fc-space-20);
}

.fc-sg-frame > * {
	margin: 0;
}

.fc-sg-frame p {
	font-weight: 600;
	color: var(--fc-indigo);
}

.fc-sg-cards {
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.fc-sg-cards .wp-block-frelim-icon {
	color: var(--fc-ember);
}

/* ---------- Cookie banner ---------- */

/*
 * Non-modal, fixed to the bottom. While it is open the page keeps room for it and scrolls a
 * focused element clear of it, so it never hides what has focus (WCAG 2.4.11). Accept and
 * Reject use the same style. --fc-consent-h is set by analytics.js from the banner's height.
 */
.fc-consent {
	position: fixed;
	inset: auto 0 0;
	z-index: 100;
	background: var(--fc-white);
	color: var(--fc-ink);
	border-top: 3px solid var(--fc-indigo);
	box-shadow: var(--fc-shadow-card);
	/* At 400% zoom (320 x 256) the banner scrolls inside itself rather than filling the screen (1.4.10, 2.4.11). */
	max-height: 50dvh;
	overflow-y: auto;
}

.fc-consent[hidden] {
	display: none;
}

.fc-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--fc-space-20) var(--fc-space-40);
	max-width: var(--fc-content);
	margin-inline: auto;
	padding: var(--fc-space-20) var(--fc-gutter);
}

.fc-consent__text {
	flex: 1 1 28rem;
	max-width: var(--fc-prose);
	margin: 0;
	font-size: 0.9444rem;
}

.fc-consent__text a {
	color: var(--fc-indigo);
}

.fc-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fc-space-10);
}

.fc-consent__button {
	flex: 1 1 12rem;
	cursor: pointer;
}

html.fc-consent-open {
	scroll-padding-bottom: calc(var(--fc-consent-h, 0px) + var(--fc-space-20));
}

html.fc-consent-open body {
	padding-bottom: var(--fc-consent-h, 0px);
}
