/**
 * Life Changing Stories archive.
 *
 * Loads AFTER single-story.css and reuses its tokens (--ipa-story-*), hero band,
 * button and play-badge styling. Only the filter chips, card grid, pager and CTA
 * are defined here.
 */

/* ------------------------------------------------------- 2. Location filter -- */

.ipa-archive__count {
	margin: 24px 0 0;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba( 255, 255, 255, 0.75 );
}

.ipa-archive__filter {
	background: var( --ipa-story-tint );
	border-bottom: 1px solid var( --ipa-story-line );
	padding: 24px var( --ipa-story-pad );
}

.ipa-archive__chips {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: var( --ipa-story-max );
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.ipa-archive__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border: 1px solid var( --ipa-story-line );
	border-radius: 999px;
	background: #fff;
	color: var( --ipa-story-body );
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ipa-archive__chip:hover,
.ipa-archive__chip:focus-visible {
	border-color: var( --ipa-story-blue );
	color: var( --ipa-story-blue-deep );
}

.ipa-archive__chip.is-active {
	background: var( --ipa-story-blue-deep );
	border-color: var( --ipa-story-blue-deep );
	color: #fff;
}

.ipa-archive__chip-count {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 999px;
	background: var( --ipa-story-line );
	color: var( --ipa-story-body );
}

.ipa-archive__chip.is-active .ipa-archive__chip-count {
	background: rgba( 255, 255, 255, 0.22 );
	color: #fff;
}

/* ------------------------------------------------------------- 3. The grid -- */

/*
 * Figma node 695:4255 — "Testimonial Card". Full-bleed horizontal rows, NOT a
 * card grid: image on the left half, copy on the right, stacked 40px apart.
 * Comp is drawn at a 1300px container / 394px card height; everything below is
 * expressed in ratios and clamps so it holds at other widths.
 */

.ipa-archive__body {
	padding: clamp( 44px, 6vw, 76px ) var( --ipa-story-pad );
	background: #f7f7f7; /* Page ground from the comp. */
}

.ipa-archive__grid {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 1300px;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.ipa-archive__card {
	display: grid;
	grid-template-columns: 1fr;
	align-items: center;
	background: #fff;
	overflow: hidden;
}

@media ( min-width: 860px ) {
	.ipa-archive__card {
		/* Even split, exactly as the comp: image half, copy half. */
		grid-template-columns: 1fr 1fr;
		min-height: 394px;
	}
}

/* ---- Image half ---- */

.ipa-archive__media {
	position: relative;
	display: block;
	align-self: stretch;
	min-height: 260px;
	overflow: hidden;
	background: var( --ipa-story-line );
}

@media ( min-width: 860px ) {
	.ipa-archive__media {
		min-height: 394px;
	}
}

.ipa-archive__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.ipa-archive__card.is-video:hover .ipa-archive__media img,
.ipa-archive__card.is-video:focus-within .ipa-archive__media img {
	transform: scale( 1.04 );
}

/* The comp draws the play button as a large translucent disc over the image. */
.ipa-archive__card .ipa-story__play {
	width: clamp( 64px, 9vw, 100px );
	height: clamp( 64px, 9vw, 100px );
	background: rgba( 255, 255, 255, 0.82 );
	box-shadow: none;
}

.ipa-archive__card.is-video:hover .ipa-story__play,
.ipa-archive__card.is-video:focus-within .ipa-story__play {
	background: #fff;
	transform: scale( 1.06 );
}

/* ---- Copy half ---- */

.ipa-archive__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	padding: clamp( 28px, 3vw, 40px ) clamp( 24px, 3.8vw, 50px );
}

.ipa-archive__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.ipa-archive__title {
	margin: 0;
	font-family: var( --ipa-story-display );
	font-weight: 400;
	/* 32px in the comp. */
	font-size: clamp( 1.45rem, 1.1rem + 0.9vw, 2rem );
	line-height: 1.18;
	color: #000;
	max-width: 365px;
}

.ipa-archive__place {
	font-size: clamp( 1rem, 0.9rem + 0.35vw, 1.3125rem ); /* 21px */
	font-weight: 300;
	line-height: 1.4;
	color: var( --ipa-story-blue );
	text-decoration: underline;
	text-underline-position: from-font;
}

a.ipa-archive__place:hover,
a.ipa-archive__place:focus-visible {
	color: var( --ipa-story-blue-deep );
}

/* Tag pills. Rendered only when ipa_lcs_story_tags() returns something. */
.ipa-archive__tags {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.ipa-archive__tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 129px;
	min-height: 35px;
	padding: 8px 16px;
	border-radius: 50px;
	background: #f0f0f0;
	color: #000;
	font-size: 0.875rem;
	line-height: 1;
	text-decoration: none;
}

a.ipa-archive__tag:hover,
a.ipa-archive__tag:focus-visible {
	background: var( --ipa-story-line );
}

.ipa-archive__excerpt {
	margin: 0;
	font-size: clamp( 1rem, 0.94rem + 0.2vw, 1.125rem ); /* 18px */
	font-weight: 300;
	line-height: 1.5;
	color: #000;
}

/* ---- Actions ---- */

.ipa-archive__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
	width: 100%;
}

.ipa-archive__card-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Comp uses a very wide 75px inset; clamp so it survives narrow columns. */
	padding: 15px clamp( 28px, 4.5vw, 75px );
	border-radius: 50px;
	background: var( --ipa-story-blue );
	color: #fff;
	font-size: clamp( 0.9rem, 0.85rem + 0.2vw, 1.125rem );
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0.9px;
	text-transform: uppercase;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease;
}

.ipa-archive__card-cta:hover,
.ipa-archive__card-cta:focus-visible {
	background: var( --ipa-story-blue-deep );
	color: #fff;
	transform: translateY( -2px );
}

.ipa-archive__secondary {
	font-size: clamp( 0.95rem, 0.9rem + 0.2vw, 1.125rem );
	font-weight: 600;
	line-height: 1.5;
	color: #000;
	text-decoration: underline;
	text-underline-position: from-font;
}

.ipa-archive__secondary:hover,
.ipa-archive__secondary:focus-visible {
	color: var( --ipa-story-blue-deep );
}

.ipa-archive__empty {
	max-width: var( --ipa-story-max );
	margin: 0 auto;
	text-align: center;
	font-size: 1.05rem;
	color: var( --ipa-story-muted );
	padding: 40px 0;
}

/* ---------------------------------------------------------------- 4. Pager -- */

.ipa-archive__pager {
	max-width: var( --ipa-story-max );
	margin: clamp( 36px, 5vw, 56px ) auto 0;
	display: flex;
	justify-content: center;
}

.ipa-archive__pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	margin: 0 4px;
	border: 1px solid var( --ipa-story-line );
	border-radius: 999px;
	background: #fff;
	color: var( --ipa-story-body );
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ipa-archive__pager .page-numbers:hover,
.ipa-archive__pager .page-numbers:focus-visible {
	border-color: var( --ipa-story-blue );
	color: var( --ipa-story-blue-deep );
}

.ipa-archive__pager .page-numbers.current {
	background: var( --ipa-story-blue-deep );
	border-color: var( --ipa-story-blue-deep );
	color: #fff;
}

.ipa-archive__pager .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ------------------------------------------------------------------ 5. CTA -- */

.ipa-archive__cta {
	background:
		radial-gradient( 100% 120% at 15% 100%, rgba( 255, 255, 255, 0.12 ) 0%, rgba( 255, 255, 255, 0 ) 55% ),
		linear-gradient( 135deg, var( --ipa-story-blue ) 0%, var( --ipa-story-blue-deep ) 100% );
	color: #fff;
	padding: clamp( 48px, 6vw, 88px ) var( --ipa-story-pad );
	text-align: center;
}

.ipa-archive__cta-inner {
	max-width: 680px;
	margin: 0 auto;
}

.ipa-archive__cta-title {
	margin: 0;
	font-family: var( --ipa-story-display );
	font-weight: 400;
	line-height: 1.15;
	color: #fff;
	font-size: clamp( 1.6rem, 1.15rem + 1.6vw, 2.5rem );
}

.ipa-archive__cta-text {
	margin: 16px 0 30px;
	font-size: 1.05rem;
	line-height: 1.6;
	color: rgba( 255, 255, 255, 0.9 );
}
