/* Single Service page template.
   Shared tokens/components (hl-section, hl-eyebrow, hl-h2, hl-lead,
   hl-article/entry-content, hl-accordion, hl-card-link, hl-grid, reveal)
   live in main.css — this file only adds what's specific to this template. */

/* Constrain the optional intro to the same reading width as the body
   content below it, instead of the full 1440px section width. */
.hl-service-intro .hl-inner {
	max-width: 800px;
}

/* ---- Numbered content sections ---- */

/* Narrow reading column — but ONLY without the sidebar. With it, the layout
   takes the full header container width (see main.css); this rule is two
   classes deep and would otherwise out-specify that and clamp it back. */
.hl-svc .hl-inner:not(.hl-svc__layout--sidebar) {
	/* Fixed-ish gutter rather than the global 5%: a percentage padding
	   resolves against the viewport, so on a wide screen it would squeeze the
	   text/image row below the width its two columns need. */
	max-width: 1120px;
	padding-left: clamp(20px, 5vw, 48px);
	padding-right: clamp(20px, 5vw, 48px);
}

.hl-svc__section {
	padding-top: 56px;
	scroll-margin-top: 120px; /* clears the sticky header on #anchor jumps */
}

.hl-svc__section:first-child { padding-top: 0; }

/* The divider belongs to the section, not to its heading. It used to sit on
   .hl-svc__title, which worked while the heading was always the first thing in
   a section — now that the image leads, a title-borne rule would be drawn
   between the picture and its own heading instead of between two sections. */
.hl-svc__section + .hl-svc__section {
	margin-top: 48px;
	border-top: 1px solid var(--hl-line);
}

.hl-svc__body { min-width: 0; }

.hl-svc__title {
	font-family: var(--hl-serif);
	font-weight: 400;
	font-size: clamp(34px, 3.6vw, 48px);
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--hl-navy);
	margin: 0 0 20px;
}

/* Media leads the section, above its copy (no sticky behaviour, no column of
   its own). One 760px column for every piece of media, left-aligned: the margin
   sits below because the media opens the block and the copy follows. */
.hl-svc__media {
	max-width: 760px;
	margin: 0 0 28px;
}

/* A section picture: matted like the blog's lead image (.hl-post-figure — white
   padding, outer border, shadow). The mat is on the <img> itself so it hugs the
   picture whatever its shape. Height is capped so an editor-added portrait photo
   never towers over its section: the picture scales down in proportion (no
   cropping, no letterboxing) and every service page shows the same maximum.
   Width is natural up to the column, so a small image is not blown up. */
.hl-svc__img {
	display: block;
	box-sizing: border-box;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 560px;
	padding: 12px;
	background: #fff;
	border: 1px solid #D1D9DF;
	border-radius: 6px;
	box-shadow: 0 24px 48px -16px rgba(11, 34, 51, 0.28), 0 4px 12px rgba(11, 34, 51, 0.08);
}

/* ---- Click-to-play video ---- */

.hl-svc__video {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--hl-radius);
	overflow: hidden;
	background: var(--hl-navy);
	box-shadow: var(--hl-shadow);
}

.hl-svc__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.hl-svc__video-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: var(--hl-navy);
	cursor: pointer;
}

.hl-svc__video-poster img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	box-shadow: none;
}

.hl-svc__video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(29, 137, 202, 0.92);
	transition: transform 0.2s ease, background 0.2s ease;
}

/* Play triangle, drawn with a border so it needs no asset. */
.hl-svc__video-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}

.hl-svc__video-poster:hover .hl-svc__video-play,
.hl-svc__video-poster:focus-visible .hl-svc__video-play {
	background: var(--hl-blue);
	transform: translate(-50%, -50%) scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
	.hl-svc__video-play { transition: none; }
	.hl-svc__video-poster:hover .hl-svc__video-play { transform: translate(-50%, -50%); }
}

@media (max-width: 600px) {
	.hl-svc__section { padding-top: 40px; }
}

/* ---- Video grid (above the FAQ): two per row, one per row on phones ----
   Reflows for any count the editor sets: a LONE video fills the whole grid
   width (a half-width cell stuck in the middle looks broken), while an odd
   LAST video among several centres at half width so rows stay balanced. */
.hl-svc-videos__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px;
	/* Centred, narrower than the content column (62% on desktop). Wider share
	   on tablets so each video stays watchable; phones use the full width. */
	width: 80%;
	margin-inline: auto;
}

@media (min-width: 1025px) {
	.hl-svc-videos__grid { width: 62%; gap: 20px; }
}

/* The article above already ends with 96px of padding, so the video section
   adds none on top: the space above the videos then equals the space below
   (96px, or 72px on small screens — the pull-up below trims the difference). */
.hl-article + .hl-svc-videos { padding-top: 0; }
@media (max-width: 768px) {
	.hl-article + .hl-svc-videos { margin-top: -24px; }
}

@media (min-width: 641px) {
	/* Lone video: span both columns at full grid width. */
	.hl-svc-videos__item:only-child { grid-column: 1 / -1; }
	/* Odd last video of 3+: its own row, centred at one column's width. */
	.hl-svc-videos__item:last-child:nth-child(odd):not(:only-child) {
		grid-column: 1 / -1;
		width: calc(50% - 14px);
		justify-self: center;
	}
}

@media (min-width: 1025px) {
	.hl-svc-videos__item:last-child:nth-child(odd):not(:only-child) { width: calc(50% - 10px); }
}

@media (max-width: 640px) {
	.hl-svc-videos__grid { grid-template-columns: 1fr; gap: 20px; width: 100%; }
}

/* Excerpt line under a related-service card title (hl-card-link itself
   is a shared component; the excerpt is unique to this template). */
.hl-card-link__excerpt {
	font-size: 15px;
	line-height: 1.7;
	color: var(--hl-muted);
	margin: 10px 0 0;
}
