/* =========================================================================
   Batley Pharmacy â€” responsive
   Loaded last so these rules win without needing extra specificity.

   Most layout in this theme is intrinsically responsive: containers use
   fluid padding, grids use auto-fit + minmax, and type uses clamp(). What
   follows handles the changes that genuinely need a breakpoint â€” chiefly
   swapping the desktop menu for the mobile panel.

   Breakpoints
     1400px+   large desktop
     1200px+   desktop
     1200px+   the navigation switch â€” the pill bar needs this to fit
      992px+   laptop â€” the hero overlay's lower bound
      768px+   tablet
      576px+   mobile landscape
      < 576px  mobile portrait
      < 380px  small handsets
   ========================================================================= */

/* -------------------------------------------------------------------------
   Large desktop â€” allow the layout a little more room
   ---------------------------------------------------------------------- */

@media (min-width: 1400px) {
	:root {
		--container-max: 1280px;
	}
}

/* -------------------------------------------------------------------------
   Wide screens - the page stops at the design's 1440 and centres

   The designs are drawn at 1440 and the site is built to that width.
   Past it nothing grows: the root font size holds at 16px, the wide
   container holds at its 1374 (plus 40px either side) and the page
   sits in the middle of the screen with the body's white either side.
   The footer's panel is capped at the same 1374 in sections.css, so the
   hero, the panels and the footer share one edge at every width and
   nothing reads as boxed under something wider.

   Until 2026-10-20 a block here grew the root font size and both
   containers with the viewport from 1440 up to 1920, so the page filled
   a wide screen at the design's proportions. Building to 1440 instead
   was decided on that date; the block was removed rather than kept
   behind a switch, because every composition in cqw already scales
   with its panel and needs nothing from here.
   ---------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
   Navigation switch â€” measured, not guessed: the logo, five pills and the
   Contact Us button need about 1200px before they all fit on one row, so
   the pill bar hands over to the hamburger below that. (At the old 992px
   switch the button overflowed the viewport edge between 992 and 1150.)
   ---------------------------------------------------------------------- */

@media (min-width: 1200px) {
	.nav-toggle {
		display: none;
	}

	/* The panel is fixed-position, so it must be removed outright rather
	   than merely made transparent. */
	.mobile-nav {
		display: none;
	}
}

@media (max-width: 1199.98px) {
	.primary-nav {
		display: none;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.mobile-nav {
		inset-block-start: 5rem;
	}
}

/* The bar at its design sizes needs the full 1280: between the switch and
   1400 the items close up, the type drops a size and the buttons lose
   some padding, so the five items and both buttons still sit on one row. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
	.site-header__inner {
		gap: var(--space-sm);
	}

	.site-branding img,
	.custom-logo {
		max-height: 2rem;
	}

	.nav-pills {
		gap: 1rem;
	}

	.nav-pills__pill {
		font-size: 0.875rem;
	}

	.site-header__cta {
		padding-inline: 1rem;
	}
}

/* The narrowest desktops, just above the switch to the menu button: the
   bar ran 53px past the screen's edge at 1200 once the arrows grew and the
   buttons took Manrope (2026-11-09), so here the items and buttons close
   up a little more, the buttons' type drops a size and the arrows are 14. */
@media (min-width: 1200px) and (max-width: 1279.98px) {
	.site-header__inner {
		gap: 0.75rem;
	}

	.nav-pills {
		gap: 0.75rem;
	}

	.nav-pills__chevron {
		width: 0.875rem;
		height: 0.875rem;
	}

	.site-header__cta {
		padding-inline: 0.75rem;
		font-size: 0.8125rem;
	}
}

/* -------------------------------------------------------------------------
   Below laptop â€” the dense layouts stack
   ---------------------------------------------------------------------- */

@media (max-width: 991.98px) {

	/* ---------------------------------------------------------------------
	   Hero below the desktop overlay: the same character, recomposed for
	   portrait. The photograph becomes a covering background layer and the
	   content column sits on top of it in normal flow, so the frame is
	   always exactly as tall as its content needs â€” text can never outgrow
	   the picture. The pale wash on the photograph's left keeps the dark
	   heading legible, and a scrim shades the foot for the white claims,
	   just as the desktop composition reads.
	   ------------------------------------------------------------------ */

	/* The frame itself is the flex column: the lead, claims and scroll cue
	   are its direct children (only the title, button and review card live
	   inside the panel), so the frame is the one ancestor that can order
	   them all. The panel dissolves so its three join the same flow. */
	.hero__frame {
		container-type: normal;
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-sm);
		min-height: clamp(30rem, 140vw, 38rem);
		padding: clamp(1rem, 4.5vw, 1.75rem);
		border-radius: var(--radius-xl);
		overflow: hidden;
	}

	.hero__photo {
		position: absolute;
		inset: 0;
		height: 100%;
		object-fit: cover;
		/* Show the team through the frame's middle; the wash overlay below
		   keeps the heading legible above them. */
		object-position: 60% center;
	}

	/* Recreates the photograph's own pale wash behind the heading, and
	   shades its foot for the white claims â€” the desktop reading, redrawn
	   for a portrait crop. */
	.hero__frame::before {
		content: "";
		position: absolute;
		inset: 0 0 auto 0;
		z-index: 1;
		height: 60%;
		background: linear-gradient(180deg, rgba(255, 244, 240, 0.95) 0%, rgba(255, 244, 240, 0.82) 55%, transparent 100%);
		pointer-events: none;
	}

	.hero__frame::after {
		content: "";
		position: absolute;
		inset: auto 0 0 0;
		z-index: 1;
		height: 38%;
		background: linear-gradient(180deg, transparent, rgba(9, 32, 63, 0.62));
		pointer-events: none;
	}

	.hero__panel {
		display: contents;
	}

	/* In flow, but positioned so they paint above the wash and scrim. */
	.hero__title,
	.hero__cta,
	.hero__proof,
	.hero__stats,
	.hero__lead {
		position: relative;
		z-index: 2;
		width: auto;
		left: auto;
		right: auto;
		top: auto;
	}

	/* The markup orders these for the desktop overlay; the flex column
	   re-reads them: promise, lead, action, proof â€” then the claims at the
	   foot. */
	.hero__title {
		order: 1;
		width: 100%;
		font-size: var(--fs-heading);
		line-height: 1.35;
	}

	.hero__lead {
		order: 2;
		max-width: 30rem;
		font-size: var(--fs-lead);
	}

	.hero__cta {
		order: 3;
		gap: var(--space-2xs);
		padding: 0.5rem 0.5rem 0.5rem 1.5rem;
		font-size: var(--fs-body);
	}

	.hero__cta-icon {
		width: 2.25rem;
		height: 2.25rem;
	}

	.hero__cta-icon svg {
		width: 1.125rem;
		height: 1.125rem;
	}

	/* The review card keeps its desktop treatment â€” white boxes floating on
	   the photograph â€” only sized in rem instead of frame units. */
	.hero__proof {
		order: 4;
		position: relative;
		margin-top: var(--space-2xs);
		width: min(19rem, 100%);
	}

	.hero__proof {
		/* The cqw sizes above have no container at this width. */
		--proof-step: 0.7rem;
	}

	.hero__proof-faces {
		padding: 0.9rem 0.9rem 0.3rem;
		border-radius: var(--radius-lg) var(--radius-lg) 0 0;
	}

	.hero__faces li + li {
		margin-left: -0.4rem;
	}

	.hero__faces img {
		width: 2.25rem;
		height: 2.25rem;
		border-width: 2px;
	}

	.hero__proof-link {
		top: 0;
		right: 0;
		width: 3.5rem;
		height: 3.5rem;
	}

	.hero__proof-link svg {
		width: 1.25rem;
		height: 1.25rem;
	}

	.hero__proof-text {
		padding: 0.7rem 0.9rem 1.1rem;
		border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
		font-size: var(--fs-sm);
		line-height: 1.7;
	}

	/* The claims ride the scrim at the foot of the photograph, in white,
	   exactly as they do on desktop. */
	.hero__stats {
		order: 5;
		margin-top: auto;
		padding-top: var(--space-md);
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: var(--space-sm) var(--space-lg);
	}

	.hero__stat {
		gap: 0.15rem;
	}

	.hero__stat-value {
		font-size: var(--fs-body);
	}

	.hero__stat-label {
		font-size: var(--fs-xs);
	}

	/* The cue pointed down a composition that now sizes to its content. */
	.hero__scroll {
		display: none;
	}

	/* Three fixed footer columns become however many fit. */
	.site-footer__columns {
		grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
	}
}

/* -------------------------------------------------------------------------
   "Care you can book today"

   The composition is a 1200px design: copy in a 305px column, then three
   card columns of 299 / 260 / 207. Below that width the narrowest column
   stops being able to hold a sentence, so it is unwound in two steps.
   ---------------------------------------------------------------------- */

/* Step one: the copy moves above the cards, which keep all three columns and
   the full width of the container to themselves. */
@media (max-width: 1199.98px) {
	.popular__inner {
		grid-template-columns: 1fr;
		gap: var(--space-xl);
	}

	.popular__copy {
		padding-top: 0;
	}

	.popular__text {
		max-width: 44rem;
	}
}

/* Step two: the paired columns are dissolved and the six cards flow on their
   own. display:contents lets them leave their wrappers without a second set of
   markup.

   They flow into CSS columns rather than a grid. A grid would align the cards
   into rows, and since a portrait photograph is roughly twice the height of a
   panel, every row would be padded out to the tallest card in it â€” a column of
   holes. Multi-column packs them top to bottom with nothing left over, which
   is the behaviour the staggered desktop layout had anyway. */
@media (max-width: 899.98px) {
	.popular__col {
		display: contents;
	}

	.popular__cards {
		display: block;
		columns: 2;
		column-gap: var(--space-md);
	}

	.popular-card {
		/* Multi-column would otherwise split a card across the break. */
		break-inside: avoid;
		margin-bottom: var(--space-md);
	}

	/* Nothing is absorbing leftover height any more, so the panels size to
	   their own text and the photographs keep their ratio. */
	.popular-card--panel {
		flex: none;
		min-height: 0;
		padding: var(--space-lg) var(--space-md);
	}

	.popular-card__label {
		width: min(88%, 15rem);
	}

	/* The featured pair â€” wide beside tall â€” has no room to sit side by side. */
	.blog__featured {
		grid-template-columns: 1fr;
	}

	/* The three staggered review columns dissolve the same way the cards
	   section does: wrappers become display:contents and the cards flow into
	   however many columns fit, at their natural heights. */
	.reviews-col {
		display: contents;
	}

	.reviews-grid {
		grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
		gap: var(--space-md);
	}

	.reviews-col .review-card,
	.reviews-col .review-card--featured,
	.reviews-col .review-card + .review-card,
	.reviews-col .google-card {
		flex: none;
	}
}

/* -------------------------------------------------------------------------
   Tablet and below
   ---------------------------------------------------------------------- */

@media (max-width: 767.98px) {
	/* The call to action still appears inside the mobile panel, so hiding it
	   in the bar does not remove it from the page. */
	.site-header__cta {
		display: none;
	}

	.site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}

	.site-footer__legal {
		text-align: left;
	}

	.post-navigation .nav-next {
		text-align: left;
	}

	.entry-content ul,
	.entry-content ol {
		padding-left: 1.125rem;
	}

	/* The plane can hang further out at desktop widths; on a phone the panel
	   is the full container, so rein it in before it clips at the viewport. */
	.travel__plane {
		left: -8%;
		width: 92%;
	}
}

/* -------------------------------------------------------------------------
   Mobile landscape and below
   ---------------------------------------------------------------------- */

@media (max-width: 575.98px) {
	/* Two columns of cards this narrow would leave the panels a word per line. */
	.popular__cards {
		columns: 1;
	}

	.post-grid {
		gap: var(--space-md);
	}

	.section__header {
		margin-bottom: var(--space-lg);
	}

	.comment-list .children {
		padding-left: var(--space-2xs);
	}

	.btn {
		padding: 0.75rem 1.375rem;
	}

	/* Stacking beats letting a long label push the row sideways. */
	.search-form {
		flex-wrap: wrap;
	}

	.search-form .search-field {
		flex-basis: 100%;
	}
}

/* -------------------------------------------------------------------------
   Small handsets
   ---------------------------------------------------------------------- */

@media (max-width: 359.98px) {
	:root {
		/* Buy back a little horizontal room on very narrow screens. The phone
		   design (2026-10-26) is drawn at 375 with the 16px gutter, so this
		   starts below it. */
		--container-pad: 0.875rem;
	}

	.site-branding img,
	.custom-logo {
		max-height: 2.25rem;
	}

	.review-card,
	.card__body,
	.service-card {
		padding: var(--space-sm);
	}
}

/* -------------------------------------------------------------------------
   Short viewports â€” a landscape phone has very little height
   ---------------------------------------------------------------------- */

@media (max-height: 480px) and (max-width: 991.98px) {
	.mobile-nav {
		padding-block: var(--space-md);
	}

	.mobile-nav .nav__link {
		padding-block: 0.625rem;
		font-size: var(--fs-body);
	}
}

/* -------------------------------------------------------------------------
   Print
   ---------------------------------------------------------------------- */

@media print {
	.site-header,
	.site-footer,
	.mobile-nav,
	.nav-toggle,
	.pagination,
	.post-navigation,
	.comments-area {
		display: none;
	}

	body {
		color: #000;
		background: #fff;
	}

	.entry-content a::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		word-break: break-all;
	}
}

/* -------------------------------------------------------------------------
   The phone design (2026-10-26): the header and the footer

   The logo at 110 wide. In the footer, the legal links indented a step
   and the legal bar stacked, the links first and the copyright under
   them; the NHS mark further down. The quick links' step, the pin and
   handset before the contact lines and the social discs were the phone's
   alone until the desktop design of 2026-11-10 took them too; they are in
   sections.css now, at every width.
   ---------------------------------------------------------------------- */

/* The phone header 60 tall rather than 80, with the logo 36 rather than
   22 (asked for on 2026-11-12): the bar had 29 of air above and below
   a small logo. The phone menu hangs from the same 60 (main.js measures
   the header as the menu opens, so this is the no-script figure), and
   the home hero's first-screen height allows for it (photo-hero.css).

   Every section heading is 28 on a phone (asked for on 2026-11-12): the
   h2 size the site's headings take (base.css) is set here, and the two
   stylesheets that size their headings themselves - the home page's
   and the blog post's - say 28 at this width too. Headings that are
   labels (the footer's columns, the cards' names) keep their own sizes. */
@media (max-width: 575.98px) {
	:root {
		--fs-h2: 1.75rem;
		/* And h3 24 (asked for on 2026-11-12), the same way. */
		--fs-h3: 1.5rem;
	}

	/* Paragraphs 15 on a 22 line on a phone (asked for on 2026-11-12), as the
	   "Care you can book today" line is: every paragraph with a class of its
	   own - which is how the sections set their 18 and 16 - except those
	   that are not running text (the stars, a price, a figure, the bar's
	   line) or are already smaller, which keep their size; and the
	   questions' answers and a post's text, whose paragraphs carry no
	   class. The :not() lifts the rule over every section's own. The
	   contact form's field wrappers are left at 16 so the fields inherit
	   it: a field under 16 makes iPhones zoom in as it is tapped. */
	p[class]:not(.announce__text, .h2-hero__lead, .h2-hero__text, .h2-pop-card__copy, .h2-review-card__rating, .h2-blog-card__excerpt, .site-footer__copyright, .site-footer__credit, .wl-bmi__readout-label, .wl-bmi__value, .wl-bmi__hint, .wl-pricing__line, .wl-pricing__price, .ct-form__consent, .ct-form__field, .ct-form__trap, .si-card__text, .error-404__code, .md-product__price, .bp-product__price),
	.rx-faq__a p,
	body .bp-faq__a p,
	.bp-content p,
	.entry-content p {
		font-size: 0.9375rem;
		line-height: 1.5;
	}

	/* The lists beside those paragraphs at the same size (asked for across
	   the site on 2026-11-16): the medicine pages' points and details, the
	   blog's contents and lists, the contact page's services, the legal
	   pages' lists. The service pages' lists are in their own stylesheet. */
	body .md-product__points li,
	body .md-product__text,
	body .md-product__text p,
	body .md-details__body,
	body .md-details__body p,
	body .md-details__body li,
	body .bp-toc__list li,
	body .bp-content li,
	body .ct-service,
	body .entry-content li,
	body .pg-page__content li {
		font-size: 0.9375rem;
		line-height: 1.5;
	}

	/* Buttons at one size on a phone (2026-11-16): the 14 the service
	   pages' buttons have, where the header's, the legal pages' and the home
	   hero's were 16. */
	/* The footer's Pharmacy Info lines 14 on a phone (asked for on 2026-11-16):
	   at 16 with their bold labels they read as one with the 20px heading. */
	body .site-footer .footer-lines {
		font-size: 0.875rem;
		line-height: 1.6;
	}

	body .btn,
	body .pg-questions .btn,
	body .h2-hero--home .h2-hero__cta,
	body .h2-blog-card__more {
		font-size: 0.875rem;
	}

	.site-header__inner {
		min-height: 3.75rem;
	}

	.site-branding img,
	.custom-logo {
		max-height: 2.25rem;
	}

	.mobile-nav {
		inset-block-start: 3.75rem;
	}
}

@media (max-width: 767.98px) {
	/* The page's own gutter either side (16px at 375), as the design draws
	   the footer. A rule printed inline after the stylesheets widens it to
	   24 on narrow screens, so this one carries the extra class to win. */
	.site-footer .site-footer__panel {
		padding-inline: var(--container-pad);
	}

	/* The phone design's contact lines are a size down from the desktop's. */
	ul.footer-lines--contact {
		font-size: var(--fs-sm);
	}

	/* Tighter on a phone (asked for on 2026-11-12): the columns 32 apart
	   rather than 48, each heading 12 over its lines, the lines on a 1.4
	   line 10 apart rather than 17, the quick links 6 apart, the discs 16
	   under the contact lines, the NHS mark 40 under the discs, and the
	   legal bar 24 under its rule with its links 6 apart. */
	.site-footer__columns {
		gap: 2rem;
		padding-bottom: 2rem;
	}

	.footer__heading {
		margin-bottom: 0.75rem;
	}

	.footer-lines {
		gap: 0.625rem;
		line-height: 1.4;
	}

	ul.footer-lines--contact {
		gap: 0.375rem;
	}

	ul.footer-menu {
		gap: 0.375rem;
		padding-top: 0.25rem;
		line-height: 1.4;
	}

	/* The social discs and the NHS mark share one line under the contact
	   lines (asked for on 2026-11-12): the contact column wraps, its heading
	   and lines each a full row, the discs at the left and the mark at the
	   right of the row after them. */
	.site-footer__columns > .site-footer__col:last-child {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		column-gap: 1rem;
	}

	.site-footer__columns > .site-footer__col:last-child > .footer__heading,
	.site-footer__columns > .site-footer__col:last-child > .footer-lines {
		flex: 0 0 100%;
	}

	ul.social-links {
		margin-top: 1rem;
	}

	.nhs-badge {
		margin: 1rem 0 0 auto;
	}

	.site-footer .site-footer__panel {
		padding-block: 2rem 2.5rem;
	}

	.site-footer__bottom {
		gap: 0.75rem;
		padding-top: 1.25rem;
	}

	.site-footer__bottom > nav,
	.site-footer__bottom > .legal-menu {
		order: -1;
	}

	ul.legal-menu {
		flex-direction: column;
		gap: 0.375rem;
		padding-inline-start: 1rem;
	}

	.legal-menu li {
		padding-inline: 0;
	}

	.legal-menu li + li {
		border: 0;
	}

	.site-footer__copyright,
	.site-footer__credit {
		font-size: var(--fs-xs);
	}
}
