/* =========================================================================
   Batley Pharmacy — components
   Reusable pieces: buttons, header and navigation, cards, ratings, forms.
   Layout that positions these on the page lives in sections.css.
   ========================================================================= */

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

.btn {
	--btn-bg: var(--color-primary);
	--btn-fg: var(--color-on-primary);
	--btn-border: transparent;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2xs);
	padding: 0.8125rem 1.75rem;
	background: var(--btn-bg);
	color: var(--btn-fg);
	border: 1px solid var(--btn-border);
	border-radius: var(--radius-pill);
	/* Button labels are the one place the design switches family: IBM Plex
	   Sans at 16px over a 20px line with 0.1px tracking. */
	font-family: var(--font-button);
	font-size: 1rem;
	font-weight: var(--fw-medium);
	line-height: 1.25;
	letter-spacing: var(--ls-button);
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color var(--dur) var(--ease),
		color var(--dur) var(--ease),
		border-color var(--dur) var(--ease),
		transform var(--dur) var(--ease),
		box-shadow var(--dur) var(--ease);
}

.btn:hover {
	color: var(--btn-fg);
	transform: translateY(-2px);
	box-shadow: var(--shadow-primary);
}

.btn:active {
	transform: translateY(0);
}

.btn--primary {
	--btn-bg: var(--color-primary);
	--btn-fg: var(--color-on-primary);
}

.btn--primary:hover {
	--btn-bg: var(--color-primary-hover);
}

.btn--secondary {
	--btn-bg: transparent;
	--btn-fg: var(--color-primary);
	--btn-border: var(--color-primary);
}

.btn--secondary:hover {
	--btn-bg: var(--color-primary);
	--btn-fg: var(--color-on-primary);
}

.btn--ghost {
	--btn-bg: transparent;
	--btn-fg: var(--color-heading);
	--btn-border: var(--color-border);
}

.btn--ghost:hover {
	--btn-bg: var(--color-surface-muted);
	--btn-fg: var(--color-heading);
	box-shadow: none;
}

/* On a coloured card the button inverts to white. */
.btn--on-color {
	--btn-bg: #ffffff;
	--btn-fg: var(--color-heading);
}

.btn--on-color:hover {
	--btn-bg: rgba(255, 255, 255, 0.88);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.btn--sm { padding: 0.5625rem 1.25rem; font-size: var(--fs-xs); }
.btn--lg { padding: 1rem 2.25rem; font-size: var(--fs-body); }
.btn--block { display: flex; width: 100%; }

.btn__icon {
	flex-shrink: 0;
	transition: transform var(--dur) var(--ease);
}

.btn:hover .btn__icon {
	transform: translateX(3px);
}

/* Circular icon-only action, as used on the reviews badge. */
.btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--color-surface-soft);
	color: var(--color-heading);
	transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.btn-icon:hover {
	background: var(--color-primary-100);
	color: var(--color-primary);
	transform: translateY(-2px);
}

/* -------------------------------------------------------------------------
   Site header
   ---------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	background: var(--color-surface);
	border-bottom: 1px solid transparent;
	transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* Toggled from main.js once the page scrolls: the bar takes the palest step
   of the brand blue scale, so the stuck state reads at a glance while the
   dark text and blue button keep their contrast. */
.site-header.is-stuck {
	background: var(--color-primary-50);
	border-bottom-color: var(--color-primary-100);
	box-shadow: var(--shadow-sm);
}

/* The grey pills would sink into the tint, so they turn white against it. */
/* The items are plain text since 2026-10-29, so nothing changes under them. */
.site-header.is-stuck .nav-pills__pill,
.site-header.is-stuck .nav-pills__pill:hover {
	background: none;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	min-height: 5rem;
}

.site-branding {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.site-branding img,
.custom-logo {
	width: auto;
	max-height: 2.75rem;
}

.site-title {
	font-size: var(--fs-h4);
	font-weight: var(--fw-bold);
	margin: 0;
}

.site-description {
	margin: 0;
	font-size: var(--fs-xs);
	color: var(--color-muted);
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Primary navigation
   ---------------------------------------------------------------------- */

.primary-nav .nav__list {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 0.4rem + 1.6vw, 2.25rem);
}

.primary-nav .nav__item {
	position: relative;
}

.primary-nav .nav__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3xs);
	padding: 0.5rem 0;
	color: var(--color-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	white-space: nowrap;
}

/* Underline grows from the left on hover and on the current page. */
.primary-nav .nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--color-primary);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--dur) var(--ease);
}

.primary-nav .nav__item:hover > .nav__link::after,
.primary-nav .nav__item:focus-within > .nav__link::after,
.primary-nav .current-menu-item > .nav__link::after,
.primary-nav .current-menu-ancestor > .nav__link::after {
	transform: scaleX(1);
}

.primary-nav .nav__link:hover,
.primary-nav .current-menu-item > .nav__link {
	color: var(--color-primary);
}

.primary-nav .nav__toggle-icon {
	transition: transform var(--dur) var(--ease);
}

.primary-nav .nav__item:hover > .nav__link .nav__toggle-icon,
.primary-nav .nav__item:focus-within > .nav__link .nav__toggle-icon {
	transform: rotate(180deg);
}

/* Dropdowns */
.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 14rem;
	margin: 0;
	padding: var(--space-2xs);
	list-style: none;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition:
		opacity var(--dur) var(--ease),
		transform var(--dur) var(--ease),
		visibility var(--dur) var(--ease);
}

.primary-nav .nav__item:hover > .sub-menu,
.primary-nav .nav__item:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.primary-nav .sub-menu a {
	display: block;
	padding: 0.625rem 0.875rem;
	border-radius: var(--radius-sm);
	color: var(--color-heading);
	font-size: var(--fs-sm);
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.primary-nav .sub-menu a:hover {
	background: var(--color-primary-50);
	color: var(--color-primary);
}

/* Third level opens to the side. */
.primary-nav .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	margin-left: var(--space-3xs);
}

/* -------------------------------------------------------------------------
   Mobile navigation
   ---------------------------------------------------------------------- */

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--radius-sm);
	color: var(--color-heading);
	transition: background-color var(--dur) var(--ease);
}

.nav-toggle:hover {
	background: var(--color-surface-muted);
}

.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

/* The panel slides in from the right over a third of a second on the soft
   ease, and slides back out (asked for on 2026-11-13; it faded in before).
   Its ground is white at nine tenths with the page blurred behind it, so
   the page shows through faintly; a browser without backdrop blur gets
   the white a little more solid, so the type stays readable. */
.mobile-nav {
	position: fixed;
	inset: 5rem 0 0;
	z-index: var(--z-overlay);
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
	padding: var(--space-lg) var(--container-pad) var(--space-2xl);
	background: rgba(255, 255, 255, 0.94);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(100%);
	transition: transform 0.32s var(--ease-out);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
	.mobile-nav {
		background: rgba(255, 255, 255, 0.86);
		-webkit-backdrop-filter: blur(18px) saturate(1.2);
		backdrop-filter: blur(18px) saturate(1.2);
	}
}

.mobile-nav.is-open {
	transform: translateX(0);
}

.mobile-nav .nav__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3xs);
}

/* The row holds the link and its submenu button side by side; the submenu
   itself wraps onto a new line beneath both. */
.mobile-nav .nav__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	border-bottom: 1px solid var(--color-border);
}

.mobile-nav .nav__link {
	flex: 1;
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
	padding: 0.875rem 0;
	color: var(--color-heading);
	font-size: var(--fs-lg);
	font-weight: var(--fw-medium);
}

.mobile-nav .nav__link:hover {
	color: var(--color-primary);
}

.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--radius-sm);
	color: var(--color-heading);
	transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.submenu-toggle:hover {
	background: var(--color-surface-muted);
	color: var(--color-primary);
}

.submenu-toggle .nav__toggle-icon {
	transition: transform var(--dur) var(--ease);
}

.submenu-toggle[aria-expanded="true"] .nav__toggle-icon {
	transform: rotate(180deg);
}

/* No padding of its own (2026-11-16): the rows carry the step in and the
   foot, so the list's height can go to nothing when it slides shut. */
.mobile-nav .sub-menu {
	flex-basis: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
	/* Reset the desktop dropdown treatment. */
	position: static;
	min-width: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}

.mobile-nav .sub-menu a {
	display: block;
	padding: 0.625rem 0 0.625rem var(--space-sm);
	color: var(--color-text);
	font-size: var(--fs-body);
}

.mobile-nav .sub-menu li:last-child a {
	padding-bottom: calc(0.625rem + var(--space-2xs));
}

/* While sliding open or shut (main.js sets the heights): the height and
   the rows' fade play over 0.3s, the rows clipped to it. */
.mobile-nav .sub-menu.is-animating {
	overflow: hidden;
	transition: height 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

/* The section's name is the button that opens its rows (2026-11-16): a
   full-width row in the same type as the plain links, the chevron at its
   end turning over while the rows are open. */
.mobile-nav button.nav__link {
	width: 100%;
	justify-content: space-between;
	border: 0;
	background: none;
	font: inherit;
	font-size: var(--fs-lg);
	font-weight: var(--fw-medium);
	text-align: left;
	cursor: pointer;
}

.mobile-nav .nav__link .nav__toggle-icon {
	flex-shrink: 0;
	transition: transform var(--dur) var(--ease);
}

.mobile-nav .nav__link[aria-expanded="true"] .nav__toggle-icon {
	transform: rotate(180deg);
}

/* "View All Services" at the foot of the rows, as under each pill on a
   wide screen: the grey of that row, the arrow at the end, sliding right
   and back while the pointer stays (--arrow-slide; main.js holds
   .is-sliding on it until the stroke it is on has finished). */
.mobile-nav .sub-menu .nav__all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-block-start: 0.25rem;
	color: #545759;
}

.mobile-nav .sub-menu .nav__all:hover,
.mobile-nav .sub-menu .nav__all:focus-visible {
	color: var(--color-primary);
}

.mobile-nav .sub-menu .nav__all svg {
	width: 0.875rem;
	height: 0.875rem;
}

.mobile-nav .sub-menu .nav__all:hover svg,
.mobile-nav .sub-menu .nav__all:focus-visible svg,
.mobile-nav .sub-menu .nav__all svg.is-sliding {
	animation: var(--arrow-slide);
}

/* Stops the page behind the panel from scrolling while it is open. */
body.nav-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
   Header navigation
   The nav design of 2026-10-29: plain labels with a chevron, 30px apart,
   Manrope medium 15; under each a plain white card - rows of 14 on 40px
   lines, a light grey-blue wash on the row under the pointer, the NHS
   mark after an NHS row, and "View All Services" with an arrow at the
   foot - which opens on hover (main.js) as well as on click and from the
   keyboard. Beside the items, two pill buttons: one filled, one outlined.
   Until 2026-10-29 the items were grey pills over tinted panels.
   ---------------------------------------------------------------------- */

/* 20 apart since 2026-11-09 (the design's 30): the arrows grew to 16 and
   the buttons' labels are in Manrope now, which is wider, and together
   they pushed the second button 35px past the container at 1440. */
.nav-pills {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-pills__item {
	position: relative;
}

.nav-pills__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--color-heading);
	font-family: var(--font-display);
	font-size: 0.9375rem;
	font-weight: var(--fw-medium);
	line-height: 1.25;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
	transition: color var(--dur) var(--ease);
}

.nav-pills__pill:hover,
.nav-pills__pill[aria-expanded="true"] {
	background: none;
	color: var(--color-primary);
}

/* 16 square since 2026-11-09 (it was 12, and read as a speck beside the
   15px label). */
.nav-pills__chevron {
	flex: none;
	width: 1rem;
	height: 1rem;
	color: var(--color-text);
	transition: transform var(--dur) var(--ease);
}

.nav-pills__pill[aria-expanded="true"] .nav-pills__chevron {
	transform: rotate(180deg);
}

/* ---- The two buttons ----
   40 high on 24px of padding, Manrope 14 with the arrow after the label;
   the first filled, the second white on a pale blue line. */

.site-header__cta {
	gap: 0.5rem;
	height: 2.5rem;
	padding: 0 1.25rem;
	font-family: var(--font-display);
	font-size: 0.875rem;
}

.site-header__cta .btn__icon {
	width: 0.875rem;
	height: 0.875rem;
}

/* The arrow goes right and back for as long as the pointer stays
   (2026-11-16), the same stroke as the arrow links below (--arrow-slide;
   main.js holds .is-sliding on it until the stroke it is on has finished)
   - in place of the plain buttons' one nudge to the right. */
.site-header__cta:hover .btn__icon,
.site-header__cta:focus-visible .btn__icon,
.site-header__cta .btn__icon.is-sliding {
	transform: none;
	animation: var(--arrow-slide);
}

.site-header__cta--outline {
	--btn-bg: #ffffff;
	--btn-fg: var(--color-primary);
	--btn-border: #b3cfe4;
}

.site-header__cta--outline:hover {
	--btn-bg: var(--color-primary-50);
	--btn-fg: var(--color-primary);
	--btn-border: var(--color-primary);
}

/* ---- The dropdown ---- */

.nav-dropdown {
	position: absolute;
	top: calc(100% + 0.5rem);
	/* The rows' text starts level with the label above. */
	left: -1.25rem;
	z-index: var(--z-overlay);
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	/* Absolutely positioned, so shrink-to-fit would otherwise measure the
	   card against the label's own width; max-content sizes it to its
	   rows, and the max-width keeps it inside the viewport. */
	width: max-content;
	max-width: calc(100vw - 2rem);
	flex-wrap: wrap;
}

/* An invisible bridge over the gap under the label, so the pointer can
   travel down to the card without the card closing on the way. */
.nav-dropdown::before {
	position: absolute;
	inset: -0.6rem 0 auto;
	height: 0.6rem;
	content: "";
}

.nav-panel {
	/* The pale blue of the header's outlined button since 2026-11-09 (it
	   was #e6ebf0, too faint for the hat below to show at all). */
	--nav-panel-line: #b3cfe4;
	display: flex;
	flex-direction: column;
	min-width: 14rem;
	padding: 0.5rem;
	background: var(--color-surface);
	border: 1px solid var(--nav-panel-line);
	border-radius: 0.625rem;
	box-shadow: 0 12px 32px rgba(15, 42, 74, 0.12);
	text-align: left;
}

/* The "hat" (2026-11-09): a small peak on the card's top edge, under the
   start of the label that opened it. A 14px square turned 45 degrees and
   centred on the edge, its two upper sides carrying the card's line; only
   the half above the edge is drawn (the clip), white, so it hides the
   line it stands on and never reaches the first row's hover tint. On the
   first card only, where one dropdown holds several. */
.nav-dropdown > .nav-panel:first-child {
	position: relative;
}

.nav-dropdown > .nav-panel:first-child::before {
	position: absolute;
	top: -7px;
	left: 28px;
	width: 14px;
	height: 14px;
	background: var(--color-surface);
	border-top: 1px solid var(--nav-panel-line);
	border-left: 1px solid var(--nav-panel-line);
	border-top-left-radius: 2px;
	clip-path: polygon(0 0, 100% 0, 0 100%);
	transform: rotate(45deg);
	content: "";
}

/* A heading is drawn only where one dropdown holds several panels (the
   header partial decides), to tell them apart. */
.nav-panel__head {
	padding: 0.5rem 0.75rem 0.25rem;
}

.nav-panel__title {
	margin: 0;
	color: var(--color-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
}

.nav-panel--green .nav-panel__title { color: #1e7a3f; }
.nav-panel--amber .nav-panel__title { color: #9a6b1a; }

.nav-panel__subtitle {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--fs-xs);
}

.nav-panel__list {
	flex: 1;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-panel__link {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.1rem 0.75rem;
	padding: 0.5625rem 0.75rem;
	border-radius: 0.375rem;
	color: var(--color-heading);
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.nav-panel__link:hover,
.nav-panel__link:focus-visible {
	background: #eef2f5;
	color: var(--color-heading);
}

.nav-panel__label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: var(--fw-regular);
	line-height: 1.3;
}

.nav-panel__icon {
	flex-shrink: 0;
	color: var(--color-primary);
}

/* The NHS mark: the service's own blue lozenge with the white italic
   wordmark. */
.nav-panel__badge {
	padding: 0.05rem 0.3rem;
	background: #005eb8;
	border-radius: 3px;
	color: #ffffff;
	font-size: 0.625rem;
	font-weight: var(--fw-bold);
	font-style: italic;
	line-height: 1.4;
	letter-spacing: 0.02em;
}

/* A tag on the right and a line under the label, where a menu item sets
   them (Appearance → Menus); the design's own rows carry neither. */
.nav-panel__tag {
	grid-column: 2;
	grid-row: 1;
	color: var(--color-muted);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.nav-panel__sub {
	grid-column: 1 / -1;
	color: var(--color-muted);
	font-size: var(--fs-xs);
	line-height: 1.4;
}

.nav-panel__promo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.25rem 0;
	padding: 0.6rem 0.75rem;
	background: #e8f1fb;
	border-radius: 0.375rem;
	color: #1b4f9c;
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
}

.nav-panel__promo:hover {
	background: var(--color-primary-100);
	color: #123a63;
}

/* "View All Services", its arrow on the right. */
.nav-panel__all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 0.5625rem 0.75rem;
	border-radius: 0.375rem;
	color: #545759;
	font-family: var(--font-display);
	font-size: 0.875rem;
	line-height: 1.3;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-panel__all:hover,
.nav-panel__all:focus-visible {
	background: #eef2f5;
	color: var(--color-primary);
}

.nav-panel__all svg {
	width: 0.875rem;
	height: 0.875rem;
}

.nav-panel__all:hover svg,
.nav-panel__all:focus-visible svg,
.nav-panel__all svg.is-sliding {
	animation: var(--arrow-slide);
}

/* -------------------------------------------------------------------------
   Arrow links (2026-11-09)

   Every text link with an arrow after it - "Learn More", "View More",
   the index cards' links, "View All Services" above - moves its arrow
   the same way while the pointer is on it: 5px to the right and back,
   over 0.8s, again and again. Each link's own stylesheet says when
   (its :hover, or its card's); the movement itself is here, once, so
   one change of the numbers below changes them all.

   On its own the loop would stop dead when the pointer leaves and the
   arrow would jump home from wherever it was. main.js (initArrowLinks)
   puts .is-sliding on the arrow while it moves and takes it off at the
   end of a stroke, so the arrow always finishes back in its place.
   ---------------------------------------------------------------------- */

:root {
	--arrow-slide: batley-arrow-slide 0.8s ease-in-out infinite;
}

@keyframes batley-arrow-slide {
	0%,
	100% {
		transform: translateX(0);
	}

	50% {
		transform: translateX(5px);
	}
}

/* -------------------------------------------------------------------------
   Media
   ---------------------------------------------------------------------- */

.media {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius-xl);
	background: var(--color-surface-muted);
}

.media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform var(--dur-slow) var(--ease-out);
}

.media--zoom:hover img {
	transform: scale(1.04);
}

/* Aspect ratios taken from the exported asset dimensions. */
.media--hero      { aspect-ratio: 1374 / 775; border-radius: var(--radius-2xl); }
.media--feature   { aspect-ratio: 793 / 466; }
.media--wide      { aspect-ratio: 387 / 245; border-radius: var(--radius-lg); }
.media--tall      { aspect-ratio: 387 / 466; }
.media--portrait  { aspect-ratio: 303 / 415; }
.media--card      { aspect-ratio: 360 / 294; border-radius: var(--radius-lg); }
.media--square    { aspect-ratio: 1; }

/* -------------------------------------------------------------------------
   Cards
   ---------------------------------------------------------------------- */

.card {
	display: flex;
	flex-direction: column;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
	padding: var(--space-md);
	flex: 1;
}

.card__title {
	font-size: var(--fs-h4);
}

/* The whole card is clickable, but the link itself stays the accessible
   target rather than a click handler on a div. */
.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card--linked {
	position: relative;
}

.card__excerpt {
	color: var(--color-text);
	font-size: var(--fs-sm);
}

/* The coloured panels from the design live with the composition that uses
   them, as .popular-card--* in sections.css. Their gradients are still drawn
   in CSS from the sampled endpoints rather than used as flat images, so the
   copy inside stays real text. */

/* -------------------------------------------------------------------------
   Reviews
   ---------------------------------------------------------------------- */

.review-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	padding: var(--space-md) var(--space-md) var(--space-lg);
	background: var(--color-surface-muted);
	border-radius: var(--radius-xl);
	break-inside: avoid;
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.review-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
}

/* The highlighted variant: the design's blue wash, palest at the top right
   and deepening toward the bottom left. */
.review-card--featured {
	background: linear-gradient(215deg, #f2f8ff 0%, #cfe3fb 45%, #8cbaf2 100%);
}

.review-card__head {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

.review-card__avatar {
	flex-shrink: 0;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	object-fit: cover;
	background: var(--color-divider);
}

.review-card__name {
	font-size: var(--fs-h4);
	font-weight: var(--fw-semibold);
	color: var(--color-heading);
	margin: 0;
}

.review-card__date {
	font-size: var(--fs-sm);
	color: var(--color-muted);
}

.review-card__text {
	color: var(--color-heading);
	font-size: var(--fs-sm);
	line-height: var(--lh-body);
}

.review-card__text p + p {
	margin-top: var(--space-2xs);
}

/* Star rating */
.rating {
	display: inline-flex;
	align-items: center;
	gap: 0.125rem;
	color: var(--color-star);
}

.rating .star { flex-shrink: 0; }
.rating .star--off { opacity: 1; }

/* The Google rating card lives with the reviews composition that uses it, as
   .google-card in sections.css. */

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="password"],
textarea,
select {
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-heading);
	font-size: var(--fs-sm);
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--color-primary-400);
	box-shadow: 0 0 0 3px var(--color-primary-100);
}

textarea { min-height: 9rem; resize: vertical; }

label {
	display: inline-block;
	margin-bottom: var(--space-3xs);
	color: var(--color-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
}

.search-form {
	display: flex;
	gap: var(--space-2xs);
}

/* The box itself, drawn here rather than left to the browser: Safari on an
   iPhone gives a search box a rounded, shaded look of its own (2026-11-10). */
.search-form .search-field {
	flex: 1;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
}

.search-form .search-field:focus {
	border-color: var(--color-primary-600);
}

/* -------------------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------------- */

.pagination {
	margin-top: var(--space-2xl);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-3xs);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: var(--space-2xs);
	border-radius: var(--radius-sm);
	color: var(--color-heading);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.pagination .page-numbers:hover {
	background: var(--color-primary-50);
	color: var(--color-primary);
}

.pagination .page-numbers.current {
	background: var(--color-primary);
	color: var(--color-on-primary);
}

/* -------------------------------------------------------------------------
   Scroll reveal
   Elements start slightly offset and settle once observed by main.js. The
   "no-js" guard means content is visible even if JavaScript never runs.
   The rise is slow and soft (2026-10-21): 0.8s on a gentle ease-out,
   after a short wait, so nothing snaps into place. --reveal-delay, set
   on the element by its own stylesheet, holds its rise back further so
   a row of cards comes up one after another.
   ---------------------------------------------------------------------- */

/* The rise is the `translate` property, not `transform` (2026-11-16): the
   two compose, so an element's own hover lift (the cards' translateY)
   still shows once it has arrived - on `transform` the arrived state's
   `none`, written with more weight than any :hover, cancelled every lift
   on the site. */
.js .reveal {
	--reveal-duration: 0.8s;
	--reveal-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--reveal-wait: 0.15s;
	opacity: 0;
	translate: 0 24px;
	transition: opacity var(--reveal-duration) var(--reveal-ease), translate var(--reveal-duration) var(--reveal-ease);
	transition-delay: calc(var(--reveal-wait) + var(--reveal-delay, 0s));
}

.js .reveal.is-visible {
	opacity: 1;
	translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.js .reveal {
		opacity: 1;
		translate: 0 0;
	}
}

/* -------------------------------------------------------------------------
   Call button (2026-11-09)
   A round blue button with a white handset, fixed to the bottom right
   corner of every page; a tap rings the number typed under wp-admin →
   Call Button (inc/call-button.php). The blue is the one in the picture
   the button was asked for with.

   It rings like a phone left on a table: the handset shakes in two short
   bursts, a ring of the same blue spreads out from the disc with each
   burst, and then it rests - 2.4 seconds from one ring to the next. Only
   the handset and the rings move; the disc stays where it is, so the thing
   being tapped never dodges the finger. It sits under the header's layer,
   so the open phone menu covers it. A visitor who has asked for less
   motion gets it still (the reduced-motion rule in base.css), which is why
   the rings are invisible until their animation says otherwise.
   ---------------------------------------------------------------------- */

.has-call-fab {
	--call-fab-size: 60px;
	--call-fab-gap: 24px;
}

.call-fab {
	--call-fab-blue: #4c89ed;
	--call-fab-cycle: 2.4s;
	position: fixed;
	right: calc(var(--call-fab-gap) + env(safe-area-inset-right, 0px));
	bottom: calc(var(--call-fab-gap) + env(safe-area-inset-bottom, 0px));
	z-index: calc(var(--z-header) - 10);
	display: grid;
	place-items: center;
	width: var(--call-fab-size);
	height: var(--call-fab-size);
	border-radius: 50%;
	background: var(--call-fab-blue);
	color: #fff;
	box-shadow: 0 8px 20px rgba(76, 137, 237, 0.38), 0 2px 6px rgba(16, 24, 40, 0.14);
	-webkit-tap-highlight-color: transparent;
	transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* On a phone the button keeps off the hero (asked for on 2026-11-12): it
   waits below the foot of the screen while the hero is in view and rises
   into its corner once the hero has scrolled away, back down if the page
   returns to the top. main.js (initCallFab) marks it; without the script
   it is simply there, as on a desktop. It moves by translate, which the
   hover's transform leaves alone. */
@media (max-width: 575.98px) {
	.js .call-fab {
		visibility: hidden;
		translate: 0 calc(100% + var(--call-fab-gap) + 1rem);
		transition: translate 0.45s var(--ease-out), visibility 0s linear 0.45s, background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
	}

	.js .call-fab.is-shown {
		visibility: visible;
		translate: 0 0;
		transition-delay: 0s;
	}
}

@media (max-width: 575.98px) and (prefers-reduced-motion: reduce) {
	.js .call-fab {
		transition: none;
	}
}

.call-fab:hover,
.call-fab:focus-visible {
	--call-fab-blue: #3a78df;
	color: #fff;
	border-radius: 50%;
	transform: scale(1.06);
}

.call-fab:active {
	transform: scale(0.96);
}

/* The two rings: behind the handset, the disc's own size and colour, each
   spreading out and fading as its burst begins. */
.call-fab::before,
.call-fab::after {
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--call-fab-blue);
	opacity: 0;
	content: "";
	pointer-events: none;
	animation: call-fab-ring var(--call-fab-cycle) ease-out infinite;
}

.call-fab::after {
	animation-delay: calc(var(--call-fab-cycle) * 0.26);
}

.call-fab__icon {
	display: grid;
	place-items: center;
	animation: call-fab-shake var(--call-fab-cycle) ease-in-out infinite;
}

.call-fab__icon svg {
	display: block;
}

@keyframes call-fab-ring {
	0% {
		opacity: 0.5;
		transform: scale(1);
	}

	42%,
	100% {
		opacity: 0;
		transform: scale(1.9);
	}
}

/* Two bursts, a breath between them, then rest. */
@keyframes call-fab-shake {
	0%,
	20%,
	26%,
	46%,
	100% {
		transform: rotate(0);
	}

	2.5%,
	7.5%,
	28.5%,
	33.5% {
		transform: rotate(-16deg);
	}

	5%,
	10%,
	31%,
	36% {
		transform: rotate(16deg);
	}

	12.5%,
	38.5% {
		transform: rotate(-12deg);
	}

	15%,
	41% {
		transform: rotate(12deg);
	}

	17.5%,
	43.5% {
		transform: rotate(-6deg);
	}
}

@media (max-width: 575.98px) {
	.has-call-fab {
		--call-fab-size: 56px;
		--call-fab-gap: 16px;
	}
}

/* Room for the button at the very foot of the page, where it would
   otherwise lie on the end of the footer's last bar - the last legal link
   on a laptop, the copyright line on a phone. Whatever sits at that end of
   the bar keeps clear of the button's column: the button's width, its gap
   from the edge and 12 of air, less the space the bar already leaves at
   the side of the screen ((100vw - 100%) / 2, the bar being centred and
   100% being its own width). On a wide screen that comes to nothing and
   the footer is exactly the design's. Only with the button on the page -
   the body's class is from inc/call-button.php. */
.has-call-fab .site-footer__bottom > :last-child {
	margin-inline-end: max(0px, calc(var(--call-fab-gap) + var(--call-fab-size) + 12px - (100vw - 100%) / 2));
}

/* Stacked, the copyright line is at the foot and the links above it. */
@media (max-width: 767.98px) {
	.has-call-fab .site-footer__bottom > * {
		margin-inline-end: max(0px, calc(var(--call-fab-gap) + var(--call-fab-size) + 12px - (100vw - 100%) / 2));
	}
}

@media print {
	.call-fab {
		display: none;
	}
}

/* -------------------------------------------------------------------------
   Announcement bar (2026-11-09)
   The orange strip across the top of every page, above the header; its
   wording and link are typed under wp-admin → Announcement Bar
   (inc/announcement-bar.php). Read off the 1440 design: the full width
   of the screen and 38 tall in the orange #e54d2e, one centred line in
   white, Manrope 16 on a 22 line with 8 above and below, the words
   between two stars in bold.

   It is part of the page and scrolls away with it; the header under it
   is left exactly as it was. With a link, the link is stretched over the
   whole bar, so a click anywhere on the orange follows it. The wording
   keeps to one line; where it is wider than the screen it scrolls (the
   ticker, below), at 14 on a phone.
   ---------------------------------------------------------------------- */

.announce {
	position: relative;
	background: #e54d2e;
	color: #fff;
}

.announce__text {
	margin: 0;
	padding-block: 0.5rem;
	font-size: 1rem;
	line-height: 1.375;
	text-align: center;
	text-wrap: balance;
}

.announce__text strong {
	font-weight: var(--fw-bold);
}

.announce a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.announce a:hover {
	color: inherit;
}

/* One link for the whole bar. The line is under the bold words alone -
   "Winter flu Jab Service" - and is always there; the rest of the wording
   is never underlined, under the pointer or not (asked for on 2026-11-09;
   the whole line took an underline on hover until then). The underline is
   on the bold words themselves, because one set on the link would run
   under everything inside it. A bar with no link has no line at all. */
.announce .announce__link,
.announce .announce__link:hover,
.announce .announce__link:focus-visible {
	text-decoration: none;
}

.announce__link strong {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.announce__link::after {
	position: absolute;
	inset: 0;
	content: "";
}

/* The site's blue ring is lost on the orange. */
.announce a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* The ticker (asked for on 2026-11-12). The wording keeps to one line.
   Where the line is wider than the screen - a phone - main.js marks the
   bar (announce--scroll) and the wording scrolls across like a marquee:
   in from the right edge, out on the left and round again, at a pace
   the script sets from its length (--announce-duration), holding still
   under the pointer or keyboard focus. The gutters go while it moves,
   so it runs edge to edge. Where the line fits it stays centred and
   still, as the design has it. Without the script, or with reduced
   motion, the line wraps as it did. */
.js .announce__text {
	overflow: hidden;
	white-space: nowrap;
}

.announce__track {
	display: inline-block;
}

.announce--scroll .container {
	max-width: none;
	padding-inline: 0;
}

.announce--scroll .announce__text {
	text-align: left;
}

.announce--scroll .announce__track {
	padding-inline-start: 100%;
	animation: announce-marquee var(--announce-duration, 16s) linear infinite;
	will-change: transform;
}

.announce--scroll:hover .announce__track,
.announce--scroll:focus-within .announce__track {
	animation-play-state: paused;
}

@keyframes announce-marquee {
	to {
		transform: translateX(-100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.js .announce__text {
		overflow: visible;
		white-space: normal;
	}
}

@media (max-width: 767.98px) {
	.announce__text {
		font-size: 0.875rem;
		line-height: 1.5714;
	}
}

@media print {
	.announce {
		display: none;
	}
}

/* -------------------------------------------------------------------------
   Touch screens (2026-11-10)
   The footer's links are a line of text 21px tall, under the 24px a
   finger needs. On a touch screen each takes 6px of tap room above and
   below, given back as negative margin so the lines sit exactly where
   they did.
   ---------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
	.footer-menu a,
	.legal-menu a,
	.footer-lines a {
		display: inline-block;
		padding-block: 0.375rem;
		margin-block: -0.375rem;
	}
}

/* A tap leaves a card in its hover state until the next tap elsewhere, so
   on a touch screen the lift a hover gives a card - the home page's
   cards, the index cards, the review cards - is left out: a tapped card
   rose and the one tapped before it dropped, which read as a row moving
   up and down (2026-11-12). The outline and the colour a hover gives
   stay; only the movement goes. The html prefix outranks each page's own
   hover rule, whichever stylesheet comes last. */
@media (hover: none) and (pointer: coarse) {
	html .h2-pop-card:hover,
	html .h2-blog-card:hover,
	html .h2-review-card--link:hover,
	html .ps-reviews .h2-review-card--link:hover,
	html .si-card:hover,
	html .card:hover,
	html .review-card:hover,
	html .popular-card:hover,
	html .service-panel:hover {
		transform: none;
	}
}

/* -------------------------------------------------------------------------
   The splash video (2026-11-16)

   Over everything as the site opens (template-parts/components/splash.php,
   main.js initSplash): the video filling the screen on black, a Skip pill
   at the foot. It fades over 0.4s when the video ends, Skip is pressed or
   its time is up, and the page behind is held still meanwhile. A visitor
   who has seen it (html.splash-seen, decided before it is drawn) never
   sees it at all.
   ---------------------------------------------------------------------- */

.splash {
	position: fixed;
	inset: 0;
	z-index: calc(var(--z-modal) + 100);
	display: grid;
	place-items: center;
	background: #000000;
	transition: opacity 0.4s var(--ease-out), visibility 0s linear 0.4s;
}

.splash-seen .splash,
.splash.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.splash-seen .splash {
	display: none;
}

.splash__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000000;
}

.splash__skip {
	position: absolute;
	right: max(1.25rem, env(safe-area-inset-right));
	bottom: max(1.25rem, env(safe-area-inset-bottom));
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	height: 2.75rem;
	padding: 0 1.25rem;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: var(--radius-pill);
	background: rgba(0, 0, 0, 0.4);
	color: #ffffff;
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: var(--fw-medium);
	cursor: pointer;
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.splash__skip:hover,
.splash__skip:focus-visible {
	border-color: #ffffff;
	background: rgba(255, 255, 255, 0.16);
}

body.splash-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.splash {
		transition: none;
	}
}
