/*
 * Janda Events — the blog index and the article page.
 *
 * Figma "Articles" (desktop 51284:5614 1440×3392, mobile 51288:2317 428×6636)
 * and "Articles Details" (desktop 51284:5390 1440×5758, mobile 51288:2380
 * 428×8898).
 *
 * The card row on both pages is the shared one in shared-sections.css; what is
 * here is the index's heading/filter/pager furniture and the article itself.
 */

/* ==========================================================================
   Blog index — "All Blogs", Figma "Frame 1984078247" (1440×2064)
   ========================================================================== */

.blog-index {
	padding-block: var(--space-48) var(--space-64);
	background-color: var(--c-white);
}

/*
 * Last band on the page — /articles/ and every category archive end on it. The
 * footer's angle is cut out of this ground rather than stacked below it, which
 * is what left an empty band between the pager and the footer; the reserve
 * keeps the slope off the pager.
 */
.blog-index--overlap {
	padding-bottom: calc(var(--space-64) + var(--footer-angle-h));
}

.blog-index__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-32);
	width: 100%;
	max-width: calc(var(--container) + (var(--gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.blog-index__title {
	margin: 0;
	color: var(--c-primary-500);
	text-align: center;
}

/*
 * The pills run past the right edge at 428 in the frame, so the row scrolls
 * rather than wrapping — the design keeps them on one line. The negative
 * margins let it bleed to the screen edge instead of stopping at the gutter,
 * which is what makes the cut-off pill read as "there is more this way".
 */
.blog-index__filters {
	width: 100%;
	margin-inline: calc(var(--gutter) * -1);
	padding-inline: var(--gutter);
	overflow-x: auto;
	scrollbar-width: none;
}

.blog-index__filters::-webkit-scrollbar {
	display: none;
}

.blog-index__pills {
	display: flex;
	gap: 11px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* flex, not block: it makes the whitespace between the markup's <li> and its
   anchor an anonymous box that never generates, which was otherwise adding a
   space's width past the pill and overflowing the row. */
.blog-index__pills > li {
	display: flex;
	flex: 0 0 auto;
}

/*
 * Bigger and quieter than the .chip used by the Featured Talent filters: 46px
 * tall, a hairline grey border, and the active one filled black rather than
 * teal.
 */
.filter-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 var(--space-24);
	border: 1px solid #e6e6e6;
	border-radius: var(--radius-pill);
	background-color: var(--c-white);
	color: var(--c-body);
	font-size: var(--fs-body-md);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
		border-color var(--dur-fast) var(--ease);
}

.filter-pill:hover {
	border-color: var(--c-body);
	color: var(--c-body);
}

.filter-pill.is-current {
	background-color: var(--c-black);
	border-color: var(--c-black);
	color: var(--c-white);
}

.blog-index__results {
	width: 100%;
}

/*
 * The swapped-in results fade rather than blinking. The height is not animated
 * and nothing is hidden — a filtered set is usually a different height, and
 * collapsing to zero first would bounce the footer up the screen and back.
 */
.blog-index__results {
	transition: opacity var(--dur) var(--ease);
}

.blog-index.is-loading .blog-index__results {
	opacity: 0.45;
	pointer-events: none;
}

/* The pills stay live during a fetch — clicking a second one mid-flight is a
   change of mind, and the request in flight is discarded for it. */
.blog-index.is-loading .filter-pill {
	cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
	.blog-index__results {
		transition: none;
	}
}

.blog-index__grid {
	display: grid;
	gap: var(--space-32) var(--space-24);
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-index__grid > li {
	display: flex;
}

.blog-index__pager {
	display: flex;
	justify-content: center;
	gap: var(--space-8);
	margin-top: var(--space-16);
}

/* Mirrors the arrow rather than shipping a second glyph — same as the gallery
   and Add To The Experience rails. */
.blog-index__pager .rail-btn--prev .icon {
	transform: scaleX(-1);
}

.blog-index__pager .is-disabled {
	opacity: 0.4;
	pointer-events: none;
}

.blog-index__empty {
	margin: 0;
	color: var(--c-body);
	text-align: center;
}

/* Two-up on a tablet, three-up once the columns can hold the design's card. */
/* Row alignment across the cards lives with the card, in shared-sections.css —
   this grid is one of the three it covers. */

@media (min-width: 48em) {
	.blog-index__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.blog-index {
		padding-block: var(--space-64) var(--space-96);
	}

	.blog-index__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.blog-index__inner {
		gap: var(--space-40);
	}

	/* Centred at 1440 with room to spare; the bleed only earns its keep when
	   the row is wider than the screen. */
	.blog-index__filters {
		display: flex;
		justify-content: center;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}
}

/*
 * The index sits on white, so the hero's angled divider has to be cut out of
 * white too — everywhere else it carries into the dark band below it.
 */
.blog .we-hero__angle,
.archive .we-hero__angle {
	color: var(--c-white);
}

/* ==========================================================================
   Article hero — Figma "Frame 1984078331" (1440×740 / 428×640)
   ========================================================================== */

.article-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 640px;
	padding-top: 88px; /* the header sits over this section */
	padding-bottom: var(--space-48);
	overflow: hidden;
	isolation: isolate;
	background-color: var(--c-primary-900);
	color: var(--c-white);
	text-align: center;
}

.article-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

/*
 * Desaturated in CSS rather than requiring a black-and-white upload, so the
 * white headline holds its contrast over whatever photo is set.
 */
.article-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1);
}

.article-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--hero-wash);
}

.article-hero__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-16);
	width: 100%;
	max-width: calc(var(--container) + (var(--gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.article-hero__meta {
	display: flex;
	align-items: center;
	gap: var(--space-16);
	margin: 0;
	font-size: var(--fs-body-md);
	color: rgba(255, 255, 255, 0.85);
}

.article-hero__chip {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 0 var(--space-12);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: var(--radius-pill);
	color: var(--c-white);
	font-size: var(--fs-body-sm);
	line-height: 1;
	text-decoration: none;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.article-hero__chip:hover {
	background-color: var(--c-white);
	color: var(--c-primary-800);
}

.article-hero__title {
	max-width: 984px;
	margin: 0;
	color: var(--c-white);
}

/*
 * The body face, not the display one. Figma renders 51284:5613 at 175x25 and
 * boxes it 180x39: Plus Jakarta Sans 26/400 inks out at 174.8 x 25.4 and its
 * auto line height is 1.5, i.e. the 39 box exactly. Nyght Serif can be scaled
 * to the same 175 width (at 28) but is then 27.2 tall, and the frame's render
 * is plainly sans. The 20 here is the 428 frame's rung, unmeasured — the
 * mobile frame's own byline node was not reachable when this was written.
 */
.article-hero__byline {
	margin: 0;
	color: rgba(255, 255, 255, 0.9);
	font-size: 1.25rem;
	line-height: var(--lh-body);
}

@media (min-width: 64em) {
	.article-hero {
		min-height: 740px;
		justify-content: flex-end;
		padding-top: 121px;
		padding-bottom: 140px;
	}

	/*
	 * The frame stacks the hero on a 24 rhythm: chips 48..74, title 98..156,
	 * byline 180 (51284:5607). The 16 below is the 428 frame's and stays there.
	 */
	.article-hero__inner {
		gap: var(--space-24);
	}

	/* 26 on the 1440 frame — see the note on the base rule. */
	.article-hero__byline {
		font-size: 1.625rem;
	}
}

/* ==========================================================================
   Article body — Figma "Frame 1984078229" (1440×3661)

   A 984 measure centred in the container, then the share row under a rule.
   ========================================================================== */

.article-body {
	padding-block: var(--space-48);
	background-color: var(--c-white);
}

.article-body__inner {
	width: 100%;
	max-width: calc(984px + (var(--gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* The copy itself is styled by the shared .entry-content rules in
   components.css — this wrapper only sets the band it sits in. */

@media (min-width: 64em) {
	.article-body {
		padding-block: var(--space-120) var(--space-96);
	}
}

/* --- share row ----------------------------------------------------------- */

.article-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-16);
	margin-top: var(--space-48);
	padding-top: var(--space-32);
	border-top: 1px solid var(--c-border);
}

.article-share__label {
	margin: 0;
	font-size: var(--fs-body-md);
	color: var(--c-body);
}

.article-share__list {
	display: flex;
	gap: var(--space-8);
	margin: 0;
	padding: 0;
	list-style: none;
}

.article-share__btn {
	border-color: #e6e6e6;
	color: #666666;
}

.article-share__btn:hover {
	background-color: var(--c-primary-500);
	border-color: var(--c-primary-500);
	color: var(--c-white);
}

.article-share__btn .icon {
	width: 100%;
	height: 100%;
}

/*
 * The copy confirmation. Given a full row of its own so it never reflows the
 * icons when it appears; empty until something is announced, so it collapses.
 */
.article-share__status {
	flex: 1 0 100%;
	margin: 0;
	color: var(--c-primary-800);
	font-size: var(--fs-body-sm);
}

.article-share__status:empty {
	display: none;
}

@media (min-width: 64em) {
	.article-share {
		margin-top: var(--space-64);
	}
}
