/*
 * Page sections (inc/page-sections.php), loaded only on service pages that use them.
 * Each block borrows an existing pattern of the site:
 *   cards   -> home "advantages" cards
 *   steps   -> home "how it works" numbers
 *   figures -> home "about us" dark band
 *   pricing -> plan cards of the pricing page (ul.pricelist, styled in style.css)
 * The image + text block reuses the .content_description markup.
 * .ps-band wraps the sections rendered on a dark background (home page rhythm).
 */

.ps-section {
	margin-bottom: 8rem;
}

/* ---------- Dark band ---------- */
/* Full-width starry band around a section (home "slider" / about page style),
   so the page alternates dark and white backgrounds like the home page. */
.ps-band {
	position: relative;
	clear: both;
	background: #191f2b url('../img/stars_sliderbg.svg') no-repeat center;
	background-size: cover;
	padding: 6rem 0;
	margin-bottom: 7rem;
}

.ps-band > section.content {
	margin-bottom: 0;
}

.page .ps-band section.content h2,
.page .ps-band section.content div.description h2 {
	color: white;
}

.page-template-template-services .ps-band section p.subtitle {
	color: #b9c3cf;
}

/* Image + text on dark */
.page .ps-band .content_description {
	padding-bottom: 0;
}

.page .ps-band .content_description li,
.page .ps-band .content_description p {
	color: #dde5e8;
}

/* Cards on dark: panels like the home "slider" boxes */
.ps-band .ps-cards__grid li {
	background: #252d3d;
	box-shadow: none;
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.ps-band .ps-cards__grid h3 {
	color: white;
}

.ps-band .ps-cards__grid p {
	color: #b9c3cf;
}

.ps-band .ps-cards__icon {
	color: white;
}

.ps-band .ps-cards__grid li:hover {
	background: #333e53;
	border-color: rgba(53, 186, 230, 0.4);
}

/* Steps on dark: disc filled with the panel colour */
.ps-band .ps-steps__num {
	background: #252d3d;
}

.ps-band .ps-steps__list h3 {
	color: white;
}

.ps-band .ps-steps__list p {
	color: #b9c3cf;
}

/* ---------- Image + text ---------- */
/* Keeps a tall (portrait) illustration from dwarfing the text next to it */
.page .ps-image-text .content_description figure img {
	max-height: 24rem;
}

/* Raster illustrations in the two template "Content" blocks (GEO page, files named
   geo-service-*): the template prints them at their natural size, cap them like the SVG ones. */
.page section.content:not(.ps-image-text) .content_description figure img[src*="/geo-service-"] {
	width: auto;
	max-width: 100%;
	max-height: 26rem;
}

/* ---------- Cards ---------- */
.ps-cards__grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem 3%;
}

.ps-cards__grid.ps-cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.ps-cards__grid li {
	position: relative;
	background: white;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	border-radius: 0.5rem;
	padding: 2rem 2rem 2rem 5.5rem;
	transition: all 0.3s ease;
}

/* Inline line icon (img/ps-icons): strokes follow `color`, accent stays blue */
.ps-cards__icon {
	position: absolute;
	left: 1.3rem;
	top: 2rem;
	width: 48px;
	height: 48px;
	color: #191f2b;
	transition: color 0.3s ease;
}

.ps-cards__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ps-cards__grid h3 {
	font-size: 1.1rem;
	margin-bottom: 0.5rem;
	transition: color 0.3s ease;
}

.ps-cards__grid p {
	font-size: 0.9rem;
	line-height: 1.4rem;
	color: rgba(91, 95, 102, 1);
	transition: color 0.3s ease;
}

/* Links inside section texts */
.ps-image-text .block_txt a,
.ps-cards__grid a,
.ps-steps__list a,
.ps-figures__note a,
.ps-pricing__note a {
	color: #35bae6;
}

.ps-cards__grid li:hover {
	background: #333e53;
}

.ps-cards__grid li:hover h3 {
	color: white;
}

.ps-cards__grid li:hover p {
	color: #dde5e8;
}

.ps-cards__grid li:hover .ps-cards__icon {
	color: white;
}

/* ---------- Numbered steps ---------- */
/* One row: blue numbers in a thin ringed disc with a soft halo, joined by a
   light dashed line, text centred underneath. Same drawing on white and on
   dark bands (only the disc fill changes). */
.ps-steps__list {
	list-style: none;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
}

.ps-steps__list li {
	position: relative;
	padding: 0 1rem;
	text-align: center;
}

/* Link to the previous step, drawn behind the ring */
.ps-steps__list li::before {
	content: "";
	position: absolute;
	top: 2.4rem;
	right: 50%;
	width: 100%;
	border-top: 2px dashed rgba(53, 186, 230, 0.4);
}

.ps-steps__list li:first-child::before {
	display: none;
}

.ps-steps__num {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.8rem;
	height: 4.8rem;
	margin: 0 auto 1.4rem auto;
	border: 2px solid rgba(53, 186, 230, 0.55);
	border-radius: 50%;
	background: #eef8fc;
	box-shadow: 0 0 0 7px rgba(53, 186, 230, 0.08);
	font-family: sans-serif;
	color: #35bae6;
	font-size: 1.7rem;
	font-weight: 600;
}

.ps-steps__list h3 {
	margin-bottom: 0.5rem;
	font-size: 1.15rem;
}

.ps-steps__list p {
	max-width: 15rem;
	margin: 0 auto;
	text-wrap: balance;
	font-size: 0.9rem;
	line-height: 1.5rem;
	color: rgba(91, 95, 102, 1);
}

/* Illustrated steps (always on a white section): astronaut illustration
   straight on the background, then a filled number disc, one colour per step,
   sitting on a dashed line that joins the steps, then the text. */
.ps-steps__list.ps-steps--illustrated {
	position: relative;
	isolation: isolate;
	column-gap: 1rem;
}

.ps-steps--illustrated li {
	container-type: inline-size; /* 75cqw = height of the 4:3 illustration */
	padding: 0 0.4rem;
}

/* Dashed line through the discs: each step draws its share, from the middle of
   the first step to the middle of the last one */
.ps-steps--illustrated li::before {
	display: block;
	z-index: -1;
	top: calc(75cqw + 0.2rem);
	right: -0.5rem;
	left: -0.5rem;
	width: auto;
	border-top: 2px dashed #cfe9f5;
}

.ps-steps--illustrated li:first-child::before {
	display: block;
	left: 50%;
}

.ps-steps--illustrated li:last-child::before {
	right: 50%;
}

.ps-steps__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

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

.ps-steps--illustrated .ps-steps__num {
	width: 3rem;
	height: 3rem;
	margin: -1.4rem auto 0.9rem auto;
	border: 4px solid white;
	color: white;
	font-size: 1.05rem;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Colours taken from the illustrations */
.ps-steps--illustrated li:nth-child(6n + 1) .ps-steps__num { background: #35bae6; }
.ps-steps--illustrated li:nth-child(6n + 2) .ps-steps__num { background: #f7a531; }
.ps-steps--illustrated li:nth-child(6n + 3) .ps-steps__num { background: #7c5cff; }
.ps-steps--illustrated li:nth-child(6n + 4) .ps-steps__num { background: #2ec4a0; }
.ps-steps--illustrated li:nth-child(6n + 5) .ps-steps__num { background: #ff6b6b; }
.ps-steps--illustrated li:nth-child(6n + 6) .ps-steps__num { background: #2b7fd8; }

/* Few steps: narrower row so the illustrations keep the size they have with 5 steps */
.ps-steps__list.ps-steps--illustrated.ps-steps--3 {
	max-width: 56rem;
	margin: 0 auto;
}

.ps-steps__list.ps-steps--illustrated.ps-steps--4 {
	max-width: 68rem;
	margin: 0 auto;
}

/* Six steps: still one row on wide screens, slightly smaller text */
.ps-steps--illustrated.ps-steps--6 p {
	font-size: 0.85rem;
	line-height: 1.4rem;
}

/* Below 1250px: two rows of three */
@media (max-width: 1250px) {
	.ps-steps__list.ps-steps--illustrated.ps-steps--6 {
		grid-auto-flow: row;
		grid-template-columns: repeat(3, 1fr);
		row-gap: 2.5rem;
	}

	.ps-steps--illustrated.ps-steps--6 li::before,
	.ps-steps--illustrated.ps-steps--6 li:first-child::before {
		display: none;
	}
}

/* ---------- Figures band ---------- */
.ps-figures {
	position: relative;
	overflow: hidden;
	background: #191f2b;
	color: white;
	padding: 5rem 0 5.5rem 0;
	margin-bottom: 8rem;
	text-align: center;
	clear: both;
}

.ps-figures__stars {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: url('../img/stars_sliderbg.svg') no-repeat center;
	background-size: cover;
}

.ps-figures .content {
	position: relative;
	z-index: 1;
}

.ps-figures h2 {
	color: white;
	font-weight: 400;
}

.page-template-template-services section.ps-figures p.subtitle {
	color: #dde5e8;
	margin-bottom: 3rem;
}

.ps-figures__list {
	list-style: none;
	display: flex;
	max-width: 1150px;
	margin: 0 auto;
}

.ps-figures__list li {
	flex: 1;
	padding: 2rem 1rem;
	font-size: 1.1rem;
	background: rgba(56, 70, 91, 0.18);
}

.ps-figures__list li:first-child {
	border-radius: 10px 0 0 10px;
}

.ps-figures__list li:last-child {
	border-radius: 0 10px 10px 0;
}

.ps-figures__list strong {
	display: block;
	font-weight: 400;
	font-size: 3rem;
	line-height: 1.3;
	color: #35bae6;
	font-family: sans-serif;
}

.ps-figures__list strong span {
	font-size: 1.3rem;
	margin-left: 0.2rem;
}

.ps-figures__note {
	max-width: 52rem;
	margin: 2.5rem auto 0 auto;
	font-size: 1.1rem;
	line-height: 2rem;
	color: #dde5e8;
}

.ps-figures__action {
	margin-top: 2.5rem;
}

/* Same look as the primary CTA in the hero */
.ps-btn {
	background: #35bae6;
	color: white;
	padding: 0 4rem 0 3rem;
	font-size: 1.1rem;
	letter-spacing: 1px;
	text-decoration: none;
	display: inline-block;
	border-radius: 6px;
	position: relative;
	line-height: 3.3rem;
	border: 1px solid #35bae6;
	transition: all 0.3s ease;
}

.ps-btn::before {
	content: "";
	position: absolute;
	width: 1.1rem;
	height: 1.1rem;
	right: 1.8rem;
	top: 1.1rem;
	background: url('../img/bt_arrow.svg');
	transition: all 0.4s cubic-bezier(0.83, 0, 0.17, 1);
}

.ps-btn:hover {
	background-color: transparent;
	border-color: white;
}

.ps-btn:hover::before {
	right: 1.2rem;
}

/* ---------- Pricing grid ---------- */
/* The cards themselves come from style.css (ul.pricelist) */
.ps-pricing__note {
	max-width: 52rem;
	margin: 3rem auto 0 auto;
	text-align: center;
	font-size: 1.1rem;
	line-height: 2rem;
	color: #666666;
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
	.ps-cards__grid,
	.ps-cards__grid.ps-cols-2 {
		grid-template-columns: repeat(2, 1fr);
	}

	/* More than 4 steps: two rows of three */
	.ps-steps__list.ps-steps--5,
	.ps-steps__list.ps-steps--6 {
		grid-auto-flow: row;
		grid-template-columns: repeat(3, 1fr);
		row-gap: 3rem;
	}

	.ps-steps--5 li:nth-child(3n + 1)::before,
	.ps-steps--6 li:nth-child(3n + 1)::before {
		display: none;
	}

	/* Illustrated steps on several rows: no dashed line (it would dangle at row ends) */
	.ps-steps--illustrated li::before,
	.ps-steps--illustrated li:first-child::before {
		display: none;
	}

	/* Five illustrated steps: 3 + 2, second row centred */
	.ps-steps__list.ps-steps--illustrated.ps-steps--5 {
		grid-template-columns: repeat(6, 1fr);
		row-gap: 2rem;
	}

	.ps-steps--illustrated.ps-steps--5 li {
		grid-column: span 2;
	}

	.ps-steps--illustrated.ps-steps--5 li:nth-child(4) {
		grid-column: 2 / span 2;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 699px) {
	.ps-section {
		margin-bottom: 3rem;
		padding: 0 1rem;
	}

	.ps-band {
		padding: 3rem 0;
		margin-bottom: 3rem;
	}

	.ps-cards__grid,
	.ps-cards__grid.ps-cols-2 {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.ps-cards__grid li {
		padding: 1.2rem 1.2rem 1.2rem 4.5rem;
	}

	.ps-cards__icon {
		left: 1rem;
		top: 1.3rem;
		width: 40px;
		height: 40px;
	}

	/* Vertical timeline: rings on the left, dotted line running down */
	.ps-steps__list,
	.ps-steps__list.ps-steps--5,
	.ps-steps__list.ps-steps--6 {
		grid-auto-flow: row;
		grid-template-columns: 1fr;
		row-gap: 0;
	}

	.ps-steps__list li {
		padding: 0 0 1.8rem 4.4rem;
		text-align: left;
		min-height: 4.4rem;
	}

	.ps-steps__list li:last-child {
		padding-bottom: 0;
	}

	.ps-steps__list li::before,
	.ps-steps--5 li:nth-child(3n + 1)::before,
	.ps-steps--6 li:nth-child(3n + 1)::before {
		display: block;
		top: 0;
		right: auto;
		left: 1.6rem;
		width: 0;
		height: 100%;
		border-top: 0;
		border-left: 2px dashed rgba(53, 186, 230, 0.4);
	}

	.ps-steps__list li:first-child::before {
		display: block;
	}

	.ps-steps__list li:last-child::before {
		display: none;
	}

	.ps-steps__num {
		position: absolute;
		left: 0;
		top: 0;
		width: 3.3rem;
		height: 3.3rem;
		margin: 0;
		box-shadow: 0 0 0 5px rgba(53, 186, 230, 0.08);
		font-size: 1.1rem;
	}

	.ps-steps__list h3 {
		padding-top: 0.2rem;
		font-size: 1.1rem;
	}

	.ps-steps__list p {
		max-width: none;
		margin: 0;
		text-wrap: wrap;
	}

	/* Illustrated steps: one row per step, illustration on the left with its coloured number */
	.ps-steps__list.ps-steps--illustrated,
	.ps-steps__list.ps-steps--illustrated.ps-steps--5,
	.ps-steps__list.ps-steps--illustrated.ps-steps--6 {
		grid-template-columns: 1fr;
		row-gap: 1.5rem;
	}

	/* Undo the tablet 3 + 2 placement */
	.ps-steps--illustrated.ps-steps--5 li,
	.ps-steps--illustrated.ps-steps--5 li:nth-child(4) {
		grid-column: auto;
	}

	.ps-steps__list.ps-steps--illustrated li {
		display: grid;
		grid-template-columns: 40% 1fr;
		grid-template-rows: 1fr auto auto 1fr;
		column-gap: 1rem;
		min-height: 0;
		padding: 0;
	}

	.ps-steps--illustrated li::before,
	.ps-steps--illustrated li:first-child::before {
		display: none;
	}

	.ps-steps__media {
		grid-column: 1;
		grid-row: 1 / -1;
		margin: 0;
		border-radius: 0;
	}

	.ps-steps--illustrated .ps-steps__num {
		left: 0.2rem;
		top: 0.2rem;
		width: 2.3rem;
		height: 2.3rem;
		margin: 0;
		border-width: 3px;
		font-size: 0.85rem;
	}

	.ps-steps--illustrated h3 {
		grid-column: 2;
		grid-row: 2;
	}

	.ps-steps--illustrated p,
	.ps-steps--illustrated.ps-steps--6 p {
		grid-column: 2;
		grid-row: 3;
		font-size: 0.85rem;
		line-height: 1.35rem;
	}

	.ps-figures {
		padding: 3rem 1rem;
		margin-bottom: 3rem;
	}

	.ps-figures__list {
		flex-direction: column;
	}

	.ps-figures__list li {
		padding: 1.2rem 1rem;
	}

	.ps-figures__list li:first-child {
		border-radius: 10px 10px 0 0;
	}

	.ps-figures__list li:last-child {
		border-radius: 0 0 10px 10px;
	}

	.ps-figures__list strong {
		font-size: 2.2rem;
	}

	.ps-figures__note {
		font-size: 0.9rem;
		line-height: 1.6rem;
		margin-top: 1.5rem;
	}

	/* Side gutter the theme only gives to the website grid (.service_pricing.web) */
	.ps-pricing ul.pricelist {
		padding: 0 1rem;
	}

	.ps-pricing__note {
		font-size: 0.9rem;
		line-height: 1.6rem;
		margin-top: 1.5rem;
		padding: 0 1rem;
	}
}
