/**
 * Blogs page.
 *
 * Enqueued only on the page with the slug "blogs". Section numbering matches
 * page-blogs.php.
 *
 * Sizes come from the 1728-wide Figma frame and are used as CSS pixels at the
 * top of each clamp — the shell is widened to 1360 so its 1280 content column
 * matches the design, the same way the Case Studies page does it.
 *
 * Everything that has a side is written logically (padding-inline,
 * border-start-start-radius…) so the Arabic build mirrors without a single
 * rule in rtl.css.
 */

.zouma-blhero .zouma-shell,
.zouma-blfeat .zouma-shell,
.zouma-bllist .zouma-shell {
	max-width: 1360px;
}

/* The state the `hidden` attribute is meant to produce.
 *
 * `hidden` is only a UA `display: none`, and every rule below that gives one
 * of these a display — the cards are flex columns, the pager items are list
 * items — outranks it. Without this the filtered-out cards and the pruned
 * page numbers stay on screen with the attribute set, which is exactly the
 * failure that looks like the JavaScript not running. */
.zouma-blcard[hidden],
.zouma-blpager li[hidden] {
	display: none;
}

/* 01 · Hero -------------------------------------------------------------- */

.zouma-blhero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* The design fixes this hero at 567 rather than a screenful.
	 *
	 * Stated rather than dropped: `main > section` floors every band at
	 * 100svh and is (0,0,2), so deleting a height here would hand the hero
	 * straight back to that floor. The header's own height is counted inside
	 * the 567 — the section is pulled up under it below. */
	min-height: 567px;
	/* The header floats over the hero rather than sitting above it, so pull
	 * the section up under it and add the height back as padding. */
	margin-top: calc(-1 * var(--zouma-header-h));
	padding-top: var(--zouma-header-h);
	background: var(--zouma-dark);
	color: #fff;
	overflow: hidden;
	text-align: center;
}

/* The world map is artwork behind the copy, centred in the frame — the same
 * file the Careers hero uses, at a lower opacity because here it sits under
 * text rather than beside it. */
.zouma-blhero__bg {
	position: absolute;
	inset: 0;
	background: url("../images/world-dots.svg") center / contain no-repeat;
	opacity: 0.4;
	pointer-events: none;
}

.zouma-blhero__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: clamp(2.5rem, calc(4 * var(--zouma-vw)), 4rem);
}

/* .zouma-eyebrow--light resolves to the pale sky used on photographic panels;
 * on this flat dark field the design asks for the brand cyan, and the strip is
 * set a little tighter than the shared eyebrow. */
.zouma-blhero .zouma-eyebrow {
	margin: 0;
	color: var(--zouma-cyan);
	font-family: var(--zouma-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}

.zouma-blhero__title {
	max-width: 18ch;
	margin: 20px 0 0;
	color: #fff;
	font-family: var(--zouma-font-heading);
	font-size: clamp(2rem, 1.3rem + calc(2.8 * var(--zouma-vw)), 3rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.zouma-blhero__text {
	max-width: 640px;
	margin: 20px 0 0;
	color: rgba(255, 255, 255, 0.82);
	font-family: var(--zouma-font-body);
	font-size: clamp(0.875rem, 0.8rem + calc(0.26 * var(--zouma-vw)), 0.9375rem);
	line-height: 1.75;
}

/* 02 · Featured article -------------------------------------------------- */

.zouma-blfeat {
	/* Content height, not a screenful — see the note on the hero. */
	min-height: auto;
	display: block;
	padding-block: clamp(3rem, calc(5.6 * var(--zouma-vw)), 5.5rem) 0;
	background: #fff;
}

.zouma-blfeat__title {
	margin: 0 0 40px;
	font-family: var(--zouma-font-heading);
	font-size: clamp(1.125rem, 1rem + calc(0.5 * var(--zouma-vw)), 1.375rem);
	font-weight: 600;
	line-height: 1.3;
}

/* The media column is capped rather than fixed: below the stacking breakpoint
 * there are widths where a hard 604px would outgrow the shell, and a grid
 * track cannot shrink past its maximum. */
.zouma-blfeat__card {
	display: grid;
	grid-template-columns: minmax(0, 604px) minmax(0, 1fr);
	border: 1px solid var(--zouma-color-border);
	border-radius: 8px;
	overflow: hidden;
}

.zouma-blfeat__media {
	/* Only the leading corners are rounded — the trailing edge runs into the
	 * body. Logical corners, so the mirror image is correct in Arabic. */
	border-start-start-radius: 8px;
	border-end-start-radius: 8px;
	background: var(--zouma-blue-pale);
	overflow: hidden;
}

.zouma-blfeat__media img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 320px;
	object-fit: cover;
}

.zouma-blfeat__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	/* min-width, not width: a grid item floors at its content's min-content
	 * width and would push the card wider than the shell, which .zouma-site
	 * then clips without a scrollbar to show for it. */
	min-width: 0;
	padding: clamp(1.5rem, calc(2.8 * var(--zouma-vw)), 2.5rem);
}

/* An article with no image on it yet: the body takes the whole card rather
 * than sitting in the first track with an empty media column beside it. */
.zouma-blfeat__body:only-child {
	grid-column: 1 / -1;
}

.zouma-blfeat__heading {
	text-wrap: initial;
	margin: 14px 0 0;
	font-family: var(--zouma-font-heading);
	font-size: clamp(1.375rem, 1rem + calc(1.5 * var(--zouma-vw)), 2rem);
	font-weight: 700;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.zouma-blfeat__excerpt {
	margin: 14px 0 0;
	color: var(--zouma-color-muted);
	font-family: var(--zouma-font-body);
	font-size: clamp(0.8125rem, 0.76rem + calc(0.26 * var(--zouma-vw)), 0.9375rem);
	line-height: 1.7;
}

.zouma-blfeat__cta {
	margin-top: 26px;
}

/* The article meta line, shared by the featured card and the grid cards. */

.zouma-blfeat__meta,
.zouma-blcard__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--zouma-color-muted);
	font-family: var(--zouma-font-body);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* The separator between the category and the reading time. A drawn dot rather
 * than a bullet character, so it takes the brand cyan at a size text does
 * not. */
.zouma-blmeta__sep {
	flex: none;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--zouma-cyan);
}

/* 03 · The listing ------------------------------------------------------- */

.zouma-bllist {
	min-height: auto;
	display: block;
	padding-block: clamp(3rem, calc(5.6 * var(--zouma-vw)), 5.5rem);
	background: #fff;
}

.zouma-bllist__title {
	margin: 0;
	font-family: var(--zouma-font-heading);
	font-size: clamp(1.125rem, 1rem + calc(0.5 * var(--zouma-vw)), 1.375rem);
	font-weight: 600;
	line-height: 1.3;
}

.zouma-blchips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.zouma-blchips__item {
	display: inline-flex;
}

.zouma-blchip {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--zouma-blue-pale);
	color: var(--zouma-blue-dark);
	font-family: var(--zouma-font-body);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition:
		background var(--zouma-transition),
		color var(--zouma-transition),
		border-color var(--zouma-transition);
}

/*
 * The hover and focus colours of every link on this page are stated, not
 * inherited.
 *
 * style.css repaints `a:hover, a:focus` with the primary blue, and that
 * selector is (0,1,1) — a plain class loses to it. Left to itself a chip goes
 * from ink-on-pale to blue-on-pale the moment the pointer touches it, which is
 * the repaint this codebase has chased before.
 */
.zouma-blchip:hover,
.zouma-blchip:focus {
	background: #cfe3f5;
	color: var(--zouma-blue-dark);
}

.zouma-blchip.is-active,
.zouma-blchip.is-active:hover,
.zouma-blchip.is-active:focus {
	background: var(--zouma-dark);
	border-color: var(--zouma-dark);
	color: #fff;
}

.zouma-blgrid {
	display: grid;
	/* minmax(0, 1fr), not 1fr: a grid item floors at min-content, so a long
	 * unbroken title in a 1fr track widens the whole grid past the shell. */
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px 24px;
	margin-top: clamp(2rem, calc(3.4 * var(--zouma-vw)), 3rem);
}

/* Borderless on white — the card is held together by its spacing, as in the
 * design, and the media is the only thing carrying a shape. */
.zouma-blcard {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.zouma-blcard__media {
	width: 100%;
	aspect-ratio: 16 / 9;
	margin-bottom: 16px;
	border-radius: 6px;
	background: var(--zouma-blue-pale);
	overflow: hidden;
}

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

.zouma-blcard__title {
	text-wrap: initial;
	margin: 10px 0 0;
	font-family: var(--zouma-font-heading);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.zouma-blcard__excerpt {
	margin: 8px 0 0;
	color: var(--zouma-color-muted);
	font-family: var(--zouma-font-body);
	font-size: 0.8125rem;
	line-height: 1.7;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

.zouma-blcard__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	color: var(--zouma-cyan);
	font-family: var(--zouma-font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
}

.zouma-blcard__link:hover,
.zouma-blcard__link:focus {
	color: var(--zouma-blue);
}

.zouma-blcard__link .zouma-icon {
	transition: transform var(--zouma-transition);
}

.zouma-blcard__link:hover .zouma-icon {
	transform: translateX(3px);
}

.zouma-bllist__empty {
	margin: 32px 0 0;
	color: var(--zouma-color-muted);
	font-family: var(--zouma-font-body);
	font-size: 0.9375rem;
}

/* The pager ------------------------------------------------------------- */

.zouma-blpager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: clamp(2rem, calc(3.4 * var(--zouma-vw)), 3rem);
}

.zouma-blpager__list {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.zouma-blpager__nav,
.zouma-blpager__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--zouma-dark);
	font-family: var(--zouma-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition:
		background var(--zouma-transition),
		color var(--zouma-transition),
		border-color var(--zouma-transition);
}

.zouma-blpager__nav {
	border-color: var(--zouma-color-border);
}

.zouma-blpager__nav:hover,
.zouma-blpager__nav:focus,
.zouma-blpager__num:hover,
.zouma-blpager__num:focus {
	background: var(--zouma-blue-pale);
	color: var(--zouma-dark);
}

/* An arrow at either end of the range. It has no href, so it is already out of
 * the tab order and cannot be activated; this is only how it reads. */
.zouma-blpager__nav[aria-disabled="true"],
.zouma-blpager__nav[aria-disabled="true"]:hover {
	background: none;
	color: var(--zouma-color-muted);
	opacity: 0.45;
	cursor: default;
}

.zouma-blpager__num.is-active,
.zouma-blpager__num.is-active:hover,
.zouma-blpager__num.is-active:focus {
	background: var(--zouma-dark);
	border-color: var(--zouma-dark);
	color: #fff;
}

/* 04 · Closing call to action -------------------------------------------- */

.zouma-blcta {
	min-height: auto;
	display: block;
	padding-block: clamp(3rem, calc(6.6 * var(--zouma-vw)), 6.5rem);
	background: var(--zouma-blue-pale);
}

/* 1248 rather than the 1280 the rest of the page uses — the design insets this
 * band by an extra 16px either side. */
.zouma-blcta .zouma-shell {
	max-width: 1328px;
}

.zouma-blcta__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px clamp(1.5rem, calc(3 * var(--zouma-vw)), 3rem);
}

.zouma-blcta__body {
	flex: 1 1 460px;
	min-width: 0;
}

.zouma-blcta__title {
	margin: 14px 0 0;
	font-family: var(--zouma-font-heading);
	font-size: clamp(1.75rem, 1.15rem + calc(2.4 * var(--zouma-vw)), 2.25rem);
	font-weight: 700;
	line-height: 1.16;
	letter-spacing: -0.01em;
}

.zouma-blcta__text {
	max-width: 460px;
	margin: 18px 0 0;
	color: var(--zouma-color-muted);
	font-family: var(--zouma-font-body);
	font-size: clamp(0.75rem, 0.71rem + calc(0.22 * var(--zouma-vw)), 0.875rem);
	line-height: 1.66;
}

.zouma-blcta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.zouma-blcta__actions .zouma-btn {
	padding: 10px 18px;
}

/* The design outlines the secondary button in the ink colour, not the pale
 * hairline the shared white variant carries. */
.zouma-blcta__actions .zouma-btn--white {
	border-color: var(--zouma-dark);
}

/* Narrow ----------------------------------------------------------------- */

@media (max-width: 1100px) {
	.zouma-blgrid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.zouma-blfeat__card {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Stacked, the media is a banner across the top, so the rounded corners
	 * move with it. */
	.zouma-blfeat__media {
		border-start-start-radius: 8px;
		border-start-end-radius: 8px;
		border-end-start-radius: 0;
	}

	.zouma-blfeat__media img {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 720px) {
	.zouma-blgrid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.zouma-blchip,
	.zouma-blcard__link .zouma-icon,
	.zouma-blpager__nav,
	.zouma-blpager__num {
		transition: none;
	}

	.zouma-blcard__link:hover .zouma-icon {
		transform: none;
	}
}
