/* =========================================================================
   Batley Pharmacy — base
   Design tokens, reset, element defaults and the typography scale.
   Loaded first; everything else builds on these custom properties.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   Colours below were sampled directly from the exported Figma assets in
   assets/images/ rather than eyeballed. The source of each group is noted so
   a value can be traced back and re-checked.
   ---------------------------------------------------------------------- */

:root {
	/* Brand — sampled from logo.png */
	--color-brand-green: #0f7e10;
	--color-brand-blue: #0d74d8;
	--color-brand-orange: #f37951;

	/* Primary blue scale — sampled from the gradient bands and badge */
	--color-primary-900: #0a61b1;
	--color-primary-800: #0c62b2;
	--color-primary-700: #2e7fd6;
	--color-primary-600: #428fef;
	--color-primary-500: #4a93ef;
	--color-primary-400: #64aaf7;
	--color-primary-300: #8fbffa;
	--color-primary-200: #bcdffb;
	--color-primary-100: #ddf0fb;
	--color-primary-50: #edf9fe;

	/* Semantic aliases */
	--color-primary: var(--color-primary-900);
	/* The blue words inside a heading: the design system's light/primary/text. */
	--color-heading-accent: #1668b8;
	--color-primary-hover: var(--color-primary-700);
	--color-on-primary: #ffffff;

	/* Accent gradients — endpoints sampled from the three gradient cards.
	   Reproduced in CSS rather than used as flat images so the copy inside
	   them stays real text: selectable, translatable and readable by
	   assistive technology. */
	--gradient-blue: linear-gradient(180deg, #0c62b2 0%, #6aa1d5 100%);
	--gradient-green: linear-gradient(180deg, #50a227 0%, #a4d48c 100%);
	--gradient-orange: linear-gradient(180deg, #f37951 0%, #feb884 100%);

	/* Rating — sampled from google-reviews-badge.png */
	--color-star: #ffb700;

	/* Neutrals — sampled from the review cards */
	--color-heading: #232323;
	--color-text: #575757;
	--color-muted: #70757a;
	--color-divider: #d9d9d9;
	--color-border: #e6e6e6;
	--color-surface: #ffffff;
	--color-surface-soft: #f8f8f8;
	--color-surface-muted: #f3f3f3;
	--color-background: #ffffff;

	/* Focus ring */
	--color-focus: var(--color-primary-600);

	/* ---- Typography ----
	   One face for the whole site: Manrope, self-hosted from assets/fonts/
	   (the variable file, every weight), as asked for on 2026-11-06. The
	   earlier designs set running text in Albert Sans and button labels in
	   IBM Plex Sans; the four tokens are kept so a rule can still say what
	   it is for, and all four resolve to Manrope. The @font-face block is at
	   the foot of this file. */
	--font-primary: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-heading: var(--font-primary);
	--font-button: var(--font-primary);
	--font-display: var(--font-primary);

	--fw-regular: 400;
	--fw-medium: 500;
	--fw-semibold: 600;
	--fw-bold: 700;

	/* Fluid scale: each step interpolates between its mobile and desktop size
	   so text keeps working at every width, not just at the breakpoints. */
	--fs-display: clamp(2.25rem, 1.30rem + 4.20vw, 4.00rem); /*  36 →  64 */

	/* The Figma's section-heading spec — Albert Sans Medium, 50px over an
	   80px line with 0.1px tracking — and its 18px/30px paragraph. The
	   heading interpolates up to exactly 50px; the ratios hold on the way.
	   The ceiling is in px, not rem, on purpose: the design says 50, and a
	   px ceiling keeps it at 50 whatever the root does (while the page
	   still grew past 1440, a rem ceiling took these to 66px at 1920). */
	--fs-heading: clamp(2rem, 1.52rem + 2.14vw, 50px);       /*  32 →  50 */
	--lh-display: 1.6;                                        /*  80 ÷ 50 */
	--fs-lead: 1.125rem;                                      /*  18 */
	--lh-lead: 1.6667;                                        /*  30 ÷ 18 */
	--ls-button: 0.1px;

	--fs-h1: clamp(2.00rem, 1.46rem + 2.40vw, 3.00rem);      /*  32 →  48 */
	/* Every h2 on the site: the design system's "5XL/Semi Bold", 48 at the
	   1440 design width, easing down on narrower screens. */
	--fs-h2: clamp(2rem, 1.5rem + 1.75vw, 3rem);              /*  32 →  48 */
	--fs-h3: clamp(1.375rem, 1.17rem + 0.90vw, 1.75rem);     /*  22 →  28 */
	--fs-h4: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);   /*  18 →  21 */
	--fs-lg: clamp(1.0625rem, 1.00rem + 0.30vw, 1.1875rem);  /*  17 →  19 */
	--fs-body: 1rem;                                          /*  16 */
	--fs-sm: 0.9375rem;                                       /*  15 */
	--fs-xs: 0.8125rem;                                       /*  13 */

	--lh-tight: 1.15;
	--lh-heading: 1.25;
	--lh-snug: 1.45;
	--lh-body: 1.65;

	--ls-tight: -0.02em;
	/* The Figma tracks its headings at a flat 0.1px. */
	--ls-heading: 0.1px;
	--ls-normal: 0;
	--ls-wide: 0.04em;

	/* ---- Spacing ---- */
	--space-3xs: 0.25rem;
	--space-2xs: 0.5rem;
	--space-xs: 0.75rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2rem;
	--space-xl: 3rem;
	--space-2xl: 4rem;
	--space-3xl: 6rem;

	/* Vertical rhythm between page sections, fluid across viewports. */
	--section-gap: clamp(3.5rem, 2.20rem + 5.60vw, 7rem);

	/* ---- Layout ---- */
	--container-max: 1200px;
	--container-wide: 1374px;
	--container-pad: clamp(1rem, 0.55rem + 2.20vw, 2.5rem);

	/* ---- Radii ---- */
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-xl: 24px;
	--radius-2xl: 32px;
	--radius-pill: 999px;

	/* ---- Elevation ---- */
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
	--shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
	--shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.10);
	--shadow-primary: 0 8px 24px rgba(10, 97, 177, 0.24);

	/* ---- Motion ---- */
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--dur-fast: 150ms;
	--dur: 250ms;
	--dur-slow: 400ms;

	/* ---- Layers ---- */
	--z-base: 1;
	--z-sticky: 100;
	--z-header: 200;
	--z-overlay: 300;
	--z-modal: 400;
}

/* -------------------------------------------------------------------------
   2. Reset
   ---------------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Keep anchored headings clear of the sticky header. */
	scroll-padding-top: 6rem;
}

html {
	/* clip, not hidden: it forbids sideways scrolling outright without
	   turning the root into a scroll container, and unlike overflow on body
	   it holds on iOS Safari. The aeroplane deliberately sits off-canvas
	   between scroll positions; this keeps it from widening the document. */
	overflow-x: clip;
}

body {
	margin: 0;
	background-color: var(--color-background);
	color: var(--color-text);
	font-family: var(--font-primary);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	font-weight: var(--fw-regular);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	/* Belt and braces against sideways scroll on small screens. clip, as on
	   html above (2026-11-16): hidden made the body a scroll container, and a
	   sticky element - the blog post's side column - then held to the body,
	   which never scrolls, rather than to the window, so it never stuck. */
	overflow-x: clip;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
	margin: 0;
}

ul[class],
ol[class] {
	margin: 0;
	padding: 0;
	list-style: none;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
	border-style: none;
}

/* Components below set display on elements that are also toggled with the
   hidden attribute, so the attribute has to win. This is the one place the
   theme uses !important. */
[hidden] {
	display: none !important;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

/* Safari on iPhones and iPads draws its own rounded, shaded boxes over
   text fields, search boxes and buttons unless told not to (2026-11-10).
   Ticks, radios and file pickers keep their own look. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
textarea,
button {
	-webkit-appearance: none;
	appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

button {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

/* On a touch screen a field set smaller than 16px makes Safari zoom the
   whole page in when it is tapped, and the page does not always zoom back
   out. Fields keep their own size everywhere else. */
@media (hover: none) and (pointer: coarse) {
	input:not([type="checkbox"]):not([type="radio"]),
	textarea,
	select {
		font-size: max(1rem, 1em);
	}
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* -------------------------------------------------------------------------
   3. Typography
   ---------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
	color: var(--color-heading);
	font-family: var(--font-heading);
	/* Medium, per the Figma's heading spec; components that genuinely need
	   more weight say so themselves. */
	font-weight: var(--fw-medium);
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	text-wrap: balance;
}

/*
 * Every word of an h1, h2 and h3 starts with a capital (2026-11-09, asked
 * for by the client's developer: "Expert Healthcare, Right On Your
 * Doorstep"). It is the browser that raises the first letter; the words
 * stay as typed in wp-admin, and letters already capital stay capital
 * ("NHS", "HPV").
 *
 * Small words are raised with the rest ("Symptoms Of Cholera") - CSS has
 * no way to leave "of" and "and" down. That is why the same transform was
 * tried on 2026-09-18 and taken out the same day; it is wanted now. h4 to
 * h6 are left in the case they were typed.
 */
h1, h2, h3 {
	text-transform: capitalize;
}

h1 { font-size: var(--fs-h1); }

/* The design system's "5XL/Semi Bold", which every h2 on the site takes
   (2026-10-21): Manrope 600, 48 on a 100% line, 0.5% tracked. A section
   that draws its heading to an export's own measure sets the size itself
   and inherits the rest. */
h2 {
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: var(--fw-semibold);
	line-height: 1;
	letter-spacing: 0.005em;
}

h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-body); }

p {
	text-wrap: pretty;
}

a {
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--dur) var(--ease);
}

a:hover {
	color: var(--color-primary-hover);
}

strong, b { font-weight: var(--fw-semibold); }

small { font-size: var(--fs-xs); }

blockquote {
	border-left: 3px solid var(--color-primary-300);
	padding-left: var(--space-md);
	color: var(--color-heading);
	font-size: var(--fs-lg);
}

code, kbd, pre, samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow-x: auto;
	padding: var(--space-md);
	background: var(--color-surface-muted);
	border-radius: var(--radius-md);
}

hr {
	border: 0;
	border-top: 1px solid var(--color-border);
	margin: var(--space-xl) 0;
}

/* -------------------------------------------------------------------------
   4. Layout utilities
   ---------------------------------------------------------------------- */

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

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

.container--narrow {
	max-width: calc(45rem + (var(--container-pad) * 2)); /* 720 at the design's 16px root; scales past 1440 */
}

.section {
	padding-block: var(--section-gap);
}

.section__header {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	margin-bottom: var(--space-xl);
	max-width: 46rem;
}

.section__eyebrow {
	color: var(--color-primary);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
}

.section__title {
	font-size: var(--fs-heading);
	font-weight: var(--fw-medium);
	line-height: var(--lh-display);
}

.section__lead {
	font-size: var(--fs-lead);
	line-height: var(--lh-lead);
	color: var(--color-text);
}

.section--center .section__header {
	margin-inline: auto;
	text-align: center;
	align-items: center;
}

/* -------------------------------------------------------------------------
   5. Accessibility helpers
   ---------------------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* The digits of a figure that counts up (batley_count_markup, main.js):
   one width per digit, so the text does not twitch sideways as it runs. */
.count-up {
	font-variant-numeric: tabular-nums;
}

/* Visible when focused, so keyboard users can jump straight to the content. */
.skip-link {
	position: absolute;
	top: -100%;
	left: var(--space-sm);
	z-index: var(--z-modal);
	padding: var(--space-2xs) var(--space-sm);
	background: var(--color-primary);
	color: var(--color-on-primary);
	border-radius: 0 0 var(--radius-sm) var(--radius-sm);
	font-weight: var(--fw-semibold);
	transition: top var(--dur) var(--ease);
}

.skip-link:focus {
	top: 0;
	color: var(--color-on-primary);
}

/* A single, consistent focus ring everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* Honour the OS "reduce motion" setting. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* -------------------------------------------------------------------------
   6. WordPress core classes
   ---------------------------------------------------------------------- */

.alignleft {
	float: left;
	margin: 0 var(--space-md) var(--space-sm) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--space-sm) var(--space-md);
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide {
	max-width: var(--container-wide);
	margin-inline: auto;
}

.alignfull {
	max-width: none;
	margin-inline: 0;
}

.wp-caption { margin-bottom: var(--space-md); }

.wp-caption-text,
.wp-block-image figcaption {
	color: var(--color-muted);
	font-size: var(--fs-sm);
	text-align: center;
	margin-top: var(--space-2xs);
}

.sticky { position: relative; }

.gallery-caption { display: block; }

/* -------------------------------------------------------------------------
   7. Self-hosted font
   Manrope, the latin subset of the variable file (Google Fonts v20, OFL),
   covering every weight the theme uses. Hosted locally so there is no
   third-party request and no Google Fonts GDPR question; swap keeps text
   visible while it loads. Albert Sans and IBM Plex Sans were declared here
   too until 2026-11-06, when the whole site moved to Manrope.
   ---------------------------------------------------------------------- */

@font-face {
	font-family: "Manrope";
	src: url("../fonts/manrope-variable.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
