/* =========================================================================
   Batley Pharmacy - the services index pages

   The four pages "View All Services" opens from the header (the designs of
   2026-10-29): a hero and the services as cards. Loaded by enqueue.php on
   pages using template-service-index.php and on nothing else. Read off the
   1440 exports over the 1280 container.

   The hero: a 1280x395 panel with 24px corners in the pale blue #cae2fe,
   40px under the header; the heading Manrope SemiBold 60/60 in the navy
   and the paragraph IBM Plex Sans 18/28, both 30px in and the heading 50
   down, on a 580px measure; the photograph the right 756 of the panel,
   fading in from the blue; and along the left of the foot a 32px step
   where the page shows through, its right end curving down into the
   panel over 120px - that curve is in the export, so the CSS step runs
   only as far as the picture and the two meet on one line.

   The cards: 416x162, three across 16px apart and 20px between rows, 80px
   under the hero; a pale blue ground #f5f9fe on a hairline #cfe0f5 with
   12px corners; the picture 140 square at 12px in, grey #eef0f2 until it
   is set; the tag a pill at the top right, 12px in blue on the paler blue;
   the name 18 SemiBold 38px down beside the picture, the line 13/16 in
   grey, the link 14 medium in the brand blue with a 14px arrow.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Hero
   ---------------------------------------------------------------------- */

/* 40 top and bottom, as every section on a desktop (2026-11-13): the
   cards' own 40 above them makes the design's 80 from the hero. */
.si-hero {
	padding-block: 2.5rem;
}

.si-hero__panel {
	position: relative;
	isolation: isolate;
	display: flex;
	min-height: 24.6875rem;
	overflow: hidden;
	border-radius: 1.5rem;
	background: #cae2fe;
}

/* The photograph: the right 756 of the panel (the export from 604, where
   the fade has all but reached the blue; the design's own type, which
   reaches 690, is blended out of the cut), as tall as the panel. Under
   1440 the panel is narrower than the design and the picture, scaled to
   the panel's height, is cropped on its right rather than squeezed. */
.si-hero__photo {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 0;
	width: 59.0625%;
	height: 100%;
	object-fit: cover;
	object-position: left center;
}

/* The seam: the panel's own blue laid over the picture's left 100px,
   thinning to nothing, so the cut's edge never shows. It stops above the
   step, whose curve and white are the export's own. */
.si-hero__panel::before {
	position: absolute;
	top: 0;
	bottom: 2rem;
	left: 40.9375%;
	z-index: 1;
	width: 6.25rem;
	background: linear-gradient(90deg, #cae2fe 0%, rgba(202, 226, 254, 0) 100%);
	content: "";
	pointer-events: none;
}

/* The step: the page's own ground under the left of the panel, 32px deep,
   as far as the picture, which carries it on to its curve and the foot.

   The box reaches 24px above the step as well, and in the 24px square at
   its top left it paints the page's ground everywhere but a quarter circle
   round the square's top right: that is the blue's own corner above the
   step, rounded to the panel's radius like the other three, where a plain
   box left it square (2026-11-03). The rest of that upper band is
   transparent, so the blue shows through. */
.si-hero__panel::after {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 1;
	width: 40.9375%;
	height: calc(2rem + 1.5rem);
	background:
		radial-gradient(circle at 100% 0, transparent calc(1.5rem - 0.5px), var(--color-background) calc(1.5rem + 0.5px)) 0 0 / 1.5rem 1.5rem no-repeat,
		linear-gradient(var(--color-background), var(--color-background)) 0 100% / 100% 2rem no-repeat;
	content: "";
	pointer-events: none;
}

/* Without a picture the step would end in mid-air, so it takes the whole
   foot, with the design's curve drawn on its right end. */
.si-hero__panel--no-media::before {
	display: none;
}

.si-hero__panel--no-media::after {
	width: 60%;
	height: 2rem;
	background: var(--color-background);
	border-start-end-radius: 3.75rem 2rem;
}

.si-hero__copy {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.25rem;
	width: 100%;
	max-width: 40rem;
	padding: 3.125rem 1.875rem 4rem;
}

/* The design system's "6XL/Semi Bold": Manrope 600, 60 on a 100% line. */
.si-hero__title {
	margin: 0;
	color: #143559;
	font-family: var(--font-display);
	font-size: 3.75rem;
	font-weight: var(--fw-semibold);
	line-height: 1;
	letter-spacing: 0;
	/* The editor's line breaks are the design's. */
	white-space: pre-line;
	text-wrap: initial;
}

/* IBM Plex Sans 18/28 in #232323, as every service hero paragraph. */
.si-hero__text {
	margin: 0;
	max-width: 36.25rem;
	color: #232323;
	font-family: var(--font-button);
	font-size: var(--fs-lead);
	line-height: var(--lh-lead);
}

/* -------------------------------------------------------------------------
   2. Service cards
   ---------------------------------------------------------------------- */

.si-cards {
	padding-block: 2.5rem;
}

/* 40px to the footer, as the design has it: the cards' own 40 of bottom
   padding, and nothing more from the page's gap. */
.page-template-template-service-index .site-footer {
	margin-top: 0;
}

.si-cards__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Fading up (the reveal in components.css): across each row in turn. */
.si-card:nth-child(3n + 2) {
	--reveal-delay: 0.1s;
}

.si-card:nth-child(3n) {
	--reveal-delay: 0.2s;
}

/* 134 tall (design of 2026-11-16): 12 of padding round a picture 140 by
   110, the wording beside it filling the picture's height so the link
   sits close under the line, not 60 below it as it did under the 140
   square. In a row made taller by a two-line name, the picture and the
   wording of the other cards sit centred in the card, not left at its
   top (2026-11-16). */
.si-card {
	position: relative;
	display: flex;
	gap: 1.25rem;
	align-items: center;
	min-height: 8.375rem;
	padding: 0.75rem;
	border: 1px solid #b5d5fb;
	border-radius: 0.75rem;
	background: #f5f9fe;
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.si-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(15, 42, 74, 0.1);
}

.si-card__media {
	position: relative;
	flex: none;
	width: 8.75rem;
	height: 6.875rem;
	overflow: hidden;
	border-radius: 0.5rem;
	background: #eef0f2;
}

.si-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The tag: a pill over the picture, 8 in from its top left corner. */
.si-card__badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1;
	padding: 0.125rem 0.625rem;
	border: 1px solid #b5d5fb;
	border-radius: var(--radius-pill);
	background: #eaf3fe;
	color: #3079c1;
	font-family: var(--font-display);
	font-size: 0.75rem;
	line-height: 1.4;
	white-space: nowrap;
}

/* The body is at least as tall as the picture. The name and the line
   under it start level with the picture's top, and the link is pushed down
   to its foot (margin-block-start: auto), so the room a card has to spare
   opens between the line and the link, never above the name - a two-line
   name (TBE, most of the NHS services) simply has less of it (2026-11-10;
   the design's 38 above a one-line name went with this). */
.si-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	min-width: 0;
	min-height: 6.875rem;
	padding: 0 0.5rem 0 0;
}

/* The name, Manrope SemiBold 18. Its own size: the site's h2 rule would
   set it at 48. */
.si-card__title {
	margin: 0;
	color: #1c2023;
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: var(--fw-semibold);
	line-height: 1.3;
	letter-spacing: 0;
	text-wrap: initial;
}

/* Held to the design's two lines, so every card in a row stays 134 tall;
   the whole line is still in the page for anyone reading it aloud. */
.si-card__text {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #848a8f;
	font-family: var(--font-display);
	font-size: 0.8125rem;
	line-height: 1.23;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* The name's link reaches over the whole card, so the card is the link;
   the wording link below sits above it and stays its own. */
.si-card__title-link {
	color: inherit;
	text-decoration: none;
}

.si-card__title-link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.si-card:hover .si-card__title-link {
	color: var(--color-primary);
}

.si-card__title-link:focus-visible {
	outline: none;
}

.si-card:has(.si-card__title-link:focus-visible) {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

/* At the foot of the body, level with the picture's foot: the auto margin
   takes whatever room the card has to spare, so the name and the line sit
   at the top and the link at the bottom (justify-between, 2026-11-16). No
   padding of its own: with it, a two-line name (TBE) pushed the wording
   past the picture and the row grew. The body's gap keeps 6 between the
   line and the link on a card with no room to spare. */
.si-card__link {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-block-start: auto;
	color: var(--color-primary);
	font-family: var(--font-button);
	font-size: 0.875rem;
	font-weight: var(--fw-medium);
	line-height: 1.3;
	text-decoration: none;
	transition: color var(--dur) var(--ease);
}

/* No underline on hover (2026-11-09): the colour deepens and the arrow
   slides right and back for as long as the pointer stays. The movement
   (--arrow-slide and its keyframes) is in components.css; main.js holds
   .is-sliding on the arrow until the stroke it is on has finished. */
.si-card__link:hover,
.si-card__link:focus-visible {
	color: var(--color-primary-hover);
	text-decoration: none;
}

.si-card__link svg {
	width: 0.875rem;
	height: 0.875rem;
}

/* The whole card is a link (the name is stretched over it), so the arrow
   answers the card as well as its own link. */
.si-card:hover .si-card__link svg,
.si-card__link:focus-visible svg,
.si-card__link svg.is-sliding {
	animation: var(--arrow-slide);
}

/* -------------------------------------------------------------------------
   3. The tabs over the cards (the vaccines index, design of 2026-11-09)

   Read off the 1440 export: a pill 48 tall in the cards' pale blue
   #f5f9fe with a faint shadow under it, 40 under the hero and 48 over the
   grid; inside it, 4 in from every edge, the tabs 40 tall and 6 apart,
   their labels Manrope Medium 15 with 16 either side in the deep blue
   #0052a1; the chosen tab a full pill in the brand blue with its label in
   white. Only a page with tabs carries .si-cards--tabbed, so the indexes
   without them keep their 80 under the hero.

   In motion, as the opening-hours switch on the home page: main.js
   measures the chosen tab and writes its place into four variables, and
   the blue pill slides from the tab that was chosen to the one just
   pressed, the labels changing colour as it arrives; the cards of the new
   tab rise in one after another (initServiceTabs). Until the script has
   measured, the chosen tab keeps its own blue, so nothing flashes.
   ---------------------------------------------------------------------- */

.si-cards--tabbed {
	padding-block-start: 2.5rem;
}

.si-tabs {
	display: flex;
	margin-block-end: 3rem;
}

/* The element in the selector is load-bearing: base.css's ul[class] reset
   outranks a lone class and would take the 4 of padding away. */
ul.si-tabs__list {
	position: relative;
	display: flex;
	gap: 0.375rem;
	max-width: 100%;
	margin: 0;
	padding: 0.25rem;
	border-radius: 1.5rem;
	background: #f5f9fe;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.16);
	list-style: none;
}

.si-tabs__item {
	display: flex;
}

.si-tabs__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	padding: 0.25rem 1rem;
	border-radius: 1.25rem;
	color: #0052a1;
	font-family: var(--font-display);
	font-size: 0.9375rem;
	font-weight: var(--fw-medium);
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.si-tabs__tab:hover,
.si-tabs__tab:focus-visible {
	background: #e3effd;
	color: var(--color-primary);
	text-decoration: none;
}

.si-tabs__tab.is-active,
.si-tabs__tab.is-active:hover,
.si-tabs__tab.is-active:focus-visible {
	background: var(--color-primary);
	color: #fff;
}

/* The sliding pill, once main.js has measured the chosen tab. */
.js .si-tabs__list.is-ready::before {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
	width: var(--tab-w, 0px);
	height: var(--tab-h, 0px);
	border-radius: 1.25rem;
	background: var(--color-primary);
	content: "";
	transform: translate(var(--tab-x, 0px), var(--tab-y, 0px));
	transition: transform var(--dur-slow) var(--ease-out), width var(--dur-slow) var(--ease-out), height var(--dur-slow) var(--ease-out);
	pointer-events: none;
}

.js .si-tabs__list.is-ready .si-tabs__tab {
	position: relative;
	z-index: 1;
}

/* The label takes its white over the time the pill takes to slide under
   it, so the white arrives with the blue rather than ahead of it. */
.js .si-tabs__list.is-ready .si-tabs__tab.is-active,
.js .si-tabs__list.is-ready .si-tabs__tab.is-active:hover,
.js .si-tabs__list.is-ready .si-tabs__tab.is-active:focus-visible {
	background: transparent;
	transition: color var(--dur-slow) var(--ease-out), background-color var(--dur) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
	.js .si-tabs__list.is-ready::before,
	.js .si-tabs__list.is-ready .si-tabs__tab {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
   Narrower screens
   ---------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
	.si-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.si-hero__title {
		font-size: 3rem;
	}
}

/* The hero stacks: the copy on the blue, the picture under it, the step
   gone - a notch under a picture reads as a mistake. */
@media (max-width: 991.98px) {
	.si-hero__panel {
		flex-direction: column;
		min-height: 0;
	}

	/* Cropped from the top: the box is wider than the picture's shape, so
	   the picture is scaled to its width and its foot - the step cut into
	   the export - falls outside. */
	.si-hero__photo {
		position: static;
		width: 100%;
		height: 15rem;
		object-position: center top;
	}

	.si-hero__panel::before,
	.si-hero__panel::after {
		display: none;
	}

	.si-hero__copy {
		max-width: none;
		padding: 2.5rem 1.5rem 2rem;
	}

	.si-hero__title {
		white-space: normal;
	}

	.si-cards {
		padding-block-start: 3rem;
	}
}

@media (max-width: 639.98px) {
	.si-hero {
		padding-block-start: 1.5rem;
	}

	.si-hero__panel {
		border-radius: 1rem;
	}

	.si-hero__copy {
		gap: 1rem;
		padding: 1.75rem 1.0625rem 1.75rem;
	}

	.si-hero__title {
		font-size: 2.25rem;
	}

	.si-hero__text {
		font-size: 1rem;
		line-height: 1.6;
	}

	.si-hero__photo {
		height: 10.5rem;
	}

	.si-cards__grid {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	/* The wording is usually taller than the smaller picture here; the
	   picture stays centred against it. */
	.si-card {
		gap: 0.875rem;
		min-height: 0;
	}

	.si-card__media {
		width: 6.5rem;
		height: 5.125rem;
	}

	/* The smaller picture: the body matches it. */
	.si-card__body {
		min-height: 5.125rem;
	}
}

/* The tabs on a phone: three labels in a row are wider than the screen,
   so the pill takes the full width and the tabs share it equally, each
   label on two lines where it needs them - all three stay in view, where
   a strip that scrolls sideways would hide the last one. */
@media (max-width: 991.98px) {
	.si-cards--tabbed {
		padding-block-start: 2rem;
	}

	.si-tabs {
		margin-block-end: 2rem;
	}
}

@media (max-width: 575.98px) {
	/* 40 over the tabs, as every section has on a phone (2026-11-16). */
	.si-cards--tabbed {
		padding-block-start: 2.5rem;
	}

	.si-tabs {
		margin-block-end: 1.5rem;
	}

	.si-tabs__list {
		gap: 0.25rem;
		width: 100%;
		border-radius: 1.75rem;
	}

	/* Each label on one line (asked for on 2026-11-16): the tabs take their
	   own width and share what is left, and the type is sized to the
	   screen - the three labels, their padding and the gaps come to about
	   27 times the font size plus 78px, so this keeps them on one line
	   from 360px up, between 10.5 and 12px. */
	.si-tabs__item {
		flex: 1 1 auto;
		min-width: 0;
	}

	.si-tabs__tab {
		width: 100%;
		min-height: 2.5rem;
		padding: 0.25rem 0.3125rem;
		border-radius: 1.25rem;
		font-size: clamp(0.65625rem, (100vw - 78px) / 27, 0.75rem);
		line-height: 1.2;
		white-space: nowrap;
	}

	.js .si-tabs__list.is-ready::before {
		border-radius: 1.25rem;
	}
}

/* -------------------------------------------------------------------------
   The phone's own picture for the hero (2026-11-12)

   The design's portrait export for phones - 343 by about 570 - carries
   the blue, the photograph, the rounded corners and the step along the
   left of its foot, so on a phone it is the panel: drawn at its own
   proportions with no background, rounding or crop of the panel's own,
   and the heading and paragraph laid on it - at the top, or at the foot
   above the step where the page's box says so. The step is about a tenth
   of the export's height, so the wording at the foot keeps that much and
   a little more clear of it. The picture element around the img is
   transparent to the layout, so the img lays out exactly as it did alone.
   ---------------------------------------------------------------------- */

.si-hero__pic {
	display: contents;
}

/* A page with a phone picture but no photograph for wide screens: the img
   carries the phone picture, and wide screens leave it out. */
.si-hero__panel--no-media .si-hero__photo {
	display: none;
}

@media (max-width: 575.98px) {
	.si-hero__panel--phone {
		display: block;
		min-height: 0;
		overflow: visible;
		border-radius: 0;
		background: none;
	}

	.si-hero__panel--phone .si-hero__photo {
		display: block;
		position: static;
		width: 100%;
		height: auto;
		object-fit: fill;
		object-position: center;
	}

	.si-hero__panel--phone .si-hero__copy {
		position: absolute;
		inset: 0 0 auto;
		gap: 1rem;
		padding: 1.5rem 1.0625rem 0;
	}

	.si-hero__panel--phone-foot .si-hero__copy {
		inset: auto 0 calc(10% + 0.75rem);
		padding: 0 1.0625rem;
	}
}
