/*
 * Shared primitives established by the approved designs. Page sections and blocks are
 * built on top of these in later phases; nothing page-specific belongs here.
 */

/* ---- Container ---------------------------------------------------------------------
 * Content spans 1280px at 1440px wide (80px gutters); gutters shrink to 24px on mobile.
 * Backgrounds stay full-bleed because the container sits inside the section.
 */

.pw-container {
	width: 100%;
	max-width: calc(var(--content-width) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.pw-container--wide {
	max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
}

.pw-container--narrow {
	max-width: calc(var(--content-width-narrow) + 2 * var(--gutter));
}

/* ---- Section ----------------------------------------------------------------------- */

.pw-section {
	padding-block: var(--section-pad);
	background-color: var(--colour-white);
}

.pw-section--compact {
	padding-block: var(--section-pad-compact);
}

.pw-section--paper {
	background-color: var(--colour-surface-paper);
}

.pw-section--surface {
	background-color: var(--colour-surface);
}

.pw-section--deep {
	background-color: var(--colour-surface-deep);
}

/* ---- Eyebrow rule: the short red bar above headings ---------------------------------- */

.pw-eyebrow-rule::before {
	content: "";
	display: block;
	width: 2.75rem;
	height: 2px;
	margin-bottom: var(--space-6);
	background-color: var(--colour-red);
}

/* ---- Button: the one solid button style, used for genuine primary actions ----------- */

.pw-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: 3.25rem; /* 52 */
	padding: 0 var(--space-5);
	border: 0;
	border-radius: var(--radius);
	background-color: var(--colour-red);
	color: var(--colour-white);
	font-family: var(--font-body);
	font-size-adjust: var(--font-adjust-body);
	font-size: var(--text-small);
	font-weight: var(--weight-semibold);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--transition-fast);
}

.pw-button:hover {
	background-color: var(--colour-red-hover);
	color: var(--colour-white);
}

.pw-button:focus-visible {
	outline-color: var(--colour-charcoal);
}

/* ---- Text link with arrow: the standard navigation/secondary action ------------------
 * The arrow is a CSS mask so it takes currentColor and needs no markup.
 * Modifier --down points the arrow down (hero "View our services").
 */

.pw-link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	min-height: 2.75rem;
	color: var(--colour-text);
	font-weight: var(--weight-regular);
	text-decoration: none;
}

.pw-link::after {
	content: "";
	flex: none;
	width: 1em;
	height: 1em;
	background-color: currentColor;
	-webkit-mask: var(--pw-arrow) center / contain no-repeat;
	mask: var(--pw-arrow) center / contain no-repeat;

	/* Right arrow, 24px grid, 1.5px stroke. */
	--pw-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
	@media (prefers-reduced-motion: no-preference) {
		transition: transform var(--transition-fast);
	}
}

.pw-link--down::after {
	--pw-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v16M6 14l6 6 6-6'/%3E%3C/svg%3E");
}

.pw-link:hover {
	color: var(--colour-red-text);
}

.pw-link:hover::after {
	transform: translateX(2px);
}

.pw-link--down:hover::after {
	transform: translateY(2px);
}

/* ---- Card foundation: white, 1px border, no shadow ---------------------------------- */

.pw-card {
	display: flex;
	flex-direction: column;
	border: var(--border);
	border-radius: var(--radius);
	background-color: var(--colour-white);
}

.pw-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: var(--card-padding);
}

/* ---- Logo and accreditation marks --------------------------------------------------- */

.pw-logo {
	display: block;
	width: var(--logo-width-mobile);
}

.pw-logo img {
	display: block;
	width: 100%;
	height: auto;
}

.pw-accreditation {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-5);
}

.pw-accreditation img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ---- Icons (see inc/helpers.php pw_icon) --------------------------------------------- */

.pw-icon {
	display: inline-block;
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	vertical-align: middle;
}

@media (min-width: 56.25em) {
	.pw-logo {
		width: var(--logo-width);
	}
}

/* ---- Legal pages (long-form text) ---------------------------------------------------- */

.pw-legal__head {
	padding-block: var(--space-9);
}

.pw-legal__head h1 {
	margin: 0;
}

.pw-legal__body h2 {
	margin-top: var(--space-8);
	font-size: var(--text-h3);
}

.pw-legal__body h2:first-child {
	margin-top: 0;
}

/* ---- Interaction details shared by linked cards and rows ------------------------------ */

.pw-card {
	transition: border-color var(--transition-fast);
}

a.pw-button:active,
button.pw-button:active {
	background-color: var(--colour-red-hover);
}

/* ---- Service availability: notice on a service page, status label, enquiry-form message ------------------ */

.pw-availability {
	padding-block: var(--space-5);
	border-bottom: var(--border);
	background-color: var(--colour-surface-deep);
	color: var(--colour-text);
}

.pw-availability__notice {
	padding-left: var(--space-5);
	border-left: 4px solid var(--colour-charcoal);
}

.pw-availability-inline:not(:empty) {
	padding: var(--space-5) var(--space-6);
	border: var(--border);
	border-left: 4px solid var(--colour-charcoal);
	border-radius: var(--radius);
	background-color: var(--colour-surface-paper);
	color: var(--colour-text);
}

.pw-availability__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size-adjust: var(--font-adjust-heading);
	font-size: var(--text-h4);
	font-weight: var(--weight-semibold);
	line-height: var(--lh-snug);
}

.pw-availability__text {
	margin: var(--space-2) 0 0;
	color: var(--colour-text);
}

.pw-availability-inline:not(:empty) {
	margin-block: var(--space-4);
	padding: var(--space-4) var(--space-5);
	font-size: var(--text-body);
	line-height: var(--lh-snug);
}

.pw-status {
	display: inline-block;
	align-self: flex-start;
	width: fit-content;
	margin: 0 0 var(--space-3);
	padding: var(--space-1) var(--space-2);
	border: 1px solid var(--colour-text-secondary);
	border-radius: var(--radius);
	color: var(--colour-text-secondary);
	font-family: var(--font-body);
	font-size-adjust: var(--font-adjust-body);
	font-size: var(--text-label);
	font-weight: var(--weight-semibold);
	line-height: var(--lh-snug);
}

.pw-status--menu {
	margin: var(--space-2) 0 0;
}

@media (max-width: 30em) {
	.pw-availability__notice {
		padding-left: var(--space-4);
	}
}

/* Photo captions (the media library caption), shown under photos in Content section and Sequence blocks. */
.pw-content__media--photo,
.pw-sequence__media {
	margin: 0;
}

.pw-caption {
	margin: var(--space-3) 0 0;
	color: var(--colour-text-secondary);
	font-size: var(--text-small);
	line-height: var(--lh-snug);
}
