/*
 * VIM design system — tokens that GeneratePress cannot hold itself.
 *
 * Colours are NOT here. They live in GeneratePress global colors so they show
 * up in every block's picker, and GP emits them as --ink, --teal-900 and so on.
 * Adding them here as well would give us two sources of truth.
 *
 * What is here: the container width, the gutter, and the fluid type scale.
 */

:root {
	/*
	 * GenerateBlocks derives --gb-container-width from GeneratePress's
	 * container_width, but only through its v1 CSS pipeline, which this site
	 * does not run. On a v2-only site the variable is never emitted on the
	 * front end, so .gbp-section__inner ends up with no max-width at all.
	 * Defining it here is the fix. Keep it in step with the GeneratePress
	 * container width (Customizer > Layout > Container), which is also 1400.
	 */
	--gb-container-width: 1400px;
	--site-gutter: 40px;

	/*
	 * Fluid type scale, 44 / 28 / 20 / 18 from the spec.
	 * Each clamp hits its minimum at a 400px viewport and its maximum at
	 * 1400px, scaling linearly between.
	 *
	 * --fs-title sits one step above the spec's scale and is not in the comp.
	 * The comp is homepage-only, where every section heading is 44px and there
	 * is no page title; interior pages need an h1 that outranks those section
	 * headings, so h1 gets 56 and h2 keeps the comp's 44.
	 */
	/*
	 * Scaled down on 2026-08-24 (Tom: "things are generally scaled up for
	 * presentation in the mockup but should be generally smaller — let's scale
	 * down all headers slightly site-wide"). The comp is a 1920px presentation
	 * board, which flatters large type; at real reading sizes it ran big.
	 *
	 * --fs-title is the interior page hero's h1 and was deliberately cut least,
	 * because Tom judged the hero titles "almost fine as they are, just a little
	 * smaller": 56 -> 50, against 44 -> 38 for h2.
	 *
	 * Each clamp still hits its minimum at a 400px viewport and its maximum at
	 * 1400px, scaling linearly between — keep that convention if you retune them.
	 *
	 * Scaled down AGAIN on 2026-08-25 (Tom: "I also am thinking in general this
	 * header size site-wide is too large — let's make it smaller everywhere").
	 * One further step, chosen over a firmer cut because the next step down puts
	 * h3 at 21px against 16px body, where a heading has to lean on weight and
	 * colour rather than size to read as one.
	 *
	 *   h1  50 -> 44      h2  38 -> 33      h3  26 -> 23      h4  19 -> 18
	 *
	 * ⚠️ **Body stays at 16.** Every cut so far has moved the headings and left
	 * body alone on purpose — the complaint has always been that headings are
	 * loud, never that the text is big. Shrinking body to "keep the ratio" would
	 * undo the readability the scale is for. The h2-to-body ratio is now 2.1x,
	 * down from 2.4x, and that narrowing IS the change being asked for.
	 *
	 * ⚠️ **This is the third pass on these four numbers.** If a fourth is asked
	 * for, check whether the real problem is heading WEIGHT or MARGIN rather
	 * than size — h2 is 400 weight already, and the space around a heading does
	 * as much to make it shout as its size does.
	 */
	--fs-title: clamp(1.875rem, 1.525rem + 1.4vw, 2.75rem);    /* 30 -> 44, h1 */
	--fs-display: clamp(1.5625rem, 1.3188rem + 0.85vw, 2.0625rem); /* 25 -> 33, h2 */
	--fs-heading: clamp(1.25rem, 1.1313rem + 0.35vw, 1.4375rem);   /* 20 -> 23, h3 */
	--fs-lead: clamp(1rem, 0.9588rem + 0.19vw, 1.125rem);      /* 16 -> 18, h4 */

	/*
	 * Body text. Lowered from the spec's 18px to 16px on 2026-08-24 (Tom: "let's
	 * make the body font and button fonts 16px everywhere, 18 is too big").
	 *
	 * This one token also drives the two button styles, the primary menu items,
	 * h5 and h6, because each of those references var(--fs-body) rather than a
	 * literal — so they all came down together. Anything that still reads
	 * `var(--fs-body, 1.125rem)` is quoting a stale fallback that never applies
	 * while this token is defined; the fallback is inert, not a second value.
	 */
	--fs-body: 1rem;                                          /* 16 */

	/*
	 * Fine print: the footer's bottom bar. Small enough to sit under the rest of
	 * the footer without competing with it, and still 11.48:1 as white on
	 * --teal-900. Do not use it for anything a visitor has to read.
	 */
	--fs-small: 0.875rem;                                     /* 14 */

	/*
	 * How far an anchor target has to sit below the top of the viewport.
	 *
	 * GeneratePress's stuck menu is `position: fixed`, so without this an
	 * anchor lands underneath it and the heading you clicked to reach is the
	 * one thing you cannot see. Measured, not guessed: #sticky-navigation is
	 * 60px tall in its stuck state (a 60px logo, no padding of its own), and
	 * the remainder is breathing room so the heading does not sit flush
	 * against the bar.
	 *
	 * ⚠️ Re-measure this if the sticky bar's height changes — nothing links
	 * the two automatically.
	 */
	--vim-anchor-offset: 84px;
}

/*
 * Anchor targets clear the sticky menu.
 *
 * `scroll-margin-top` covers both routes to an anchor: the browser's own jump
 * when a page is opened with a #hash, and GP Premium's smooth-scroll script on
 * a same-page link.
 *
 * ⚠️ Both routes are needed, and it is easy to test only one. GP's smooth
 * scroll bails out unless the link points at the CURRENT page — its click
 * handler returns early when `toggle.pathname !== window.location.pathname` —
 * so a cross-page link like /contact/'s "About the Pharmacy" button is a plain
 * browser jump on load, with no script involved at all. That jump is governed
 * by this rule and nothing else.
 */
[id] {
	scroll-margin-top: var(--vim-anchor-offset);
}

/*
 * 🚨 Do NOT add `html { scroll-behavior: smooth }` here.
 *
 * GP Premium's smooth-scroll script animates by calling
 * `window.scrollTo(0, position)` once per animation frame. With CSS smooth
 * scrolling switched on, every one of those calls starts its own easing
 * animation instead of moving the page, and the two fight: the scroll crawls,
 * overshoots, or stops short. GP's back-to-top button has the same problem —
 * it animates with `scrollBy` on an interval.
 *
 * Same-page anchors are smooth already, via that script and the
 * `smooth-scroll` class. Cross-page anchors arrive as a browser jump on load,
 * which is correct — there is nothing to animate from.
 */

/*
 * The EN language pill. Open Sans at 75% width and weight 800 is what the comp
 * calls "Open Sans Condensed ExtraBold". Applied as a utility rather than a
 * button style, because it is a switcher, not a call to action, and the site
 * gets exactly two button styles.
 */
.vim-pill--condensed {
	font-stretch: 75%;
	font-weight: 800;
}
