/**
 * PIASVC Home — Stories of Impact section + rich hover cards.
 *
 * Scrollbar (desktop hover panel): white thumb on translucent white track,
 * on the primary-blue overlay.
 */

.liwg-stories {
	background-color: #ffffff;
	padding: 80px 20px 52px;
}

.liwg-stories__inner {
	max-width: 1240px;
	margin-left: auto;
	margin-right: auto;
}

.liwg-stories__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
	gap: 48px;
	align-items: start;
}

.liwg-stories__header {
	grid-column: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.liwg-stories__stage {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
}

.liwg-stories__viewport {
	overflow: hidden;
	width: 100%;
	touch-action: pan-y;
}

.liwg-stories__viewport.is-dragging .liwg-stories__track {
	transition: none;
}

.liwg-stories__track {
	display: flex;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	will-change: transform;
	transition: transform 0.45s ease;
}

.liwg-stories__item {
	flex: 0 0 calc((100% - 48px) / 3);
	min-width: 0;
}

.liwg-stories__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 24px;
}

.liwg-stories__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1.5px solid #16557b;
	border-radius: 50%;
	background-color: transparent;
	color: #16557b;
	opacity: 0.72;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.liwg-stories__nav:hover:not(:disabled),
.liwg-stories__nav:focus-visible:not(:disabled) {
	background-color: #16557b;
	border-color: #16557b;
	color: #ffffff;
	opacity: 1;
}

.liwg-stories__nav:focus {
	outline: none;
}

.liwg-stories__nav:focus-visible {
	outline: 2px solid #16557b;
	outline-offset: 3px;
}

.liwg-stories__nav:disabled {
	border-color: #b8b8b8;
	color: #b8b8b8;
	opacity: 0.35;
	cursor: default;
}

.liwg-stories__dots {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}

.liwg-stories__dot {
	width: 10px;
	height: 10px;
	margin: 0;
	padding: 0;
	border: 1.5px solid #16557b;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.liwg-stories__dot.is-active {
	background-color: #16557b;
	border-color: #16557b;
}

.liwg-stories__dot:hover:not(.is-active) {
	background-color: #9bb8c9;
	border-color: #9bb8c9;
}

.liwg-stories__dot:focus {
	outline: none;
}

.liwg-stories__dot:focus-visible {
	outline: 2px solid #16557b;
	outline-offset: 3px;
}

.liwg-stories__cta {
	margin-top: 36px;
}

.liwg-stories__heading {
	margin: 0 0 28px;
	color: #16557b;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.25;
	text-wrap: balance;
}

.liwg-stories__heading.liwg-scroll-reveal {
	will-change: transform;
}

html[lang="lo"] .liwg-stories__heading {
	line-height: 1.35;
}

.liwg-stories__intro {
	margin: 0;
	color: #767676;
	font-size: 18px;
	line-height: 1.55;
	text-wrap: pretty;
}

.liwg-stories__intro p {
	margin: 0 0 0.75em;
}

.liwg-stories__intro p:last-child {
	margin-bottom: 0;
}

/* Story card */

.liwg-story-card {
	position: relative;
	border-radius: 8px;
	box-shadow: 0 4px 18px rgba(17, 17, 17, 0.08);
	overflow: hidden;
}

.liwg-story-card__media {
	position: relative;
	aspect-ratio: 210 / 297;
	overflow: hidden;
	background-color: #e8eef5;
}

.liwg-story-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.liwg-story-card__media-link {
	position: absolute;
	inset: 0;
	z-index: 1;
	cursor: pointer;
}

.liwg-story-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-sizing: border-box;
	padding: 0;
	overflow: hidden;
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgba(22, 85, 123, 0.92) 0%,
		rgba(22, 85, 123, 0.72) 38%,
		rgba(22, 85, 123, 0.18) 72%,
		rgba(22, 85, 123, 0) 100%
	);
	transition: background 0.5s ease;
}

.liwg-story-card__scroll {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-sizing: border-box;
	width: 100%;
	height: auto;
	max-height: 100%;
	padding: 20px 18px;
	pointer-events: none;
}

@media (min-width: 1280px) {
	.liwg-story-card__overlay {
		justify-content: flex-start;
	}

	.liwg-story-card__scroll {
		justify-content: flex-start;
		padding: 24px 18px 20px;
	}
}

.liwg-story-card__title {
	margin: 0 0 8px;
	color: #ffffff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	text-wrap: pretty;
}

.liwg-story-card__title-link {
	color: inherit;
	text-decoration: none;
	pointer-events: auto;
}

.liwg-story-card__title-link:hover,
.liwg-story-card__title-link:focus {
	text-decoration: underline;
}

.liwg-story-card__date {
	display: block;
	color: rgba(255, 255, 255, 0.92);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.liwg-story-card__hover {
	height: 0;
	margin-top: 0;
	opacity: 0;
	overflow-x: hidden;
	overflow-y: hidden;
	pointer-events: none;
}

.liwg-story-card__hover.is-open {
	overflow-x: hidden;
	overflow-y: scroll;
	overscroll-behavior: contain;
	pointer-events: auto;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: #ffffff rgba(255, 255, 255, 0.22);
}

.liwg-story-card__hover.is-open::-webkit-scrollbar {
	width: 6px;
}

.liwg-story-card__hover.is-open::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.22);
	border-radius: 3px;
}

.liwg-story-card__hover.is-open::-webkit-scrollbar-thumb {
	background-color: #ffffff;
	border-radius: 3px;
}

.liwg-story-card__excerpt {
	display: block;
	margin: 0 0 12px;
	color: rgba(255, 255, 255, 0.94);
	font-size: 13px;
	line-height: 1.5;
	text-decoration: none;
	cursor: pointer;
	pointer-events: auto;
}

.liwg-story-card__excerpt:hover,
.liwg-story-card__excerpt:focus {
	text-decoration: underline;
}

.liwg-story-card__body {
	position: relative;
	margin: 0 0 0;
	color: rgba(255, 255, 255, 0.94);
	font-size: 13px;
	line-height: 1.5;
	cursor: pointer;
	pointer-events: auto;
}

.liwg-story-card__body > *:last-child {
	margin-bottom: 0;
}

.liwg-story-card__body h2,
.liwg-story-card__body h3,
.liwg-story-card__body h4 {
	margin: 22px 0 8px;
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.liwg-story-card__body p,
.liwg-story-card__body li {
	font-size: 13px;
	line-height: 1.5;
}

.liwg-story-card__body p {
	margin: 0 0 10px;
}

.liwg-story-card__body ul,
.liwg-story-card__body ol {
	margin: 0 0 12px;
	padding: 0;
	font-size: 13px;
	line-height: 1.5;
}

.liwg-story-card__body li {
	margin: 0 0 6px;
}

.liwg-story-card__body ul {
	list-style: none;
}

.liwg-story-card__body ul li {
	position: relative;
	padding-left: 1.15em;
}

.liwg-story-card__body ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 0.45em;
	height: 0.45em;
	background-color: #ffffff;
}

.liwg-story-card__body ol {
	list-style: none;
	counter-reset: liwg-story-ol;
}

.liwg-story-card__body ol li {
	position: relative;
	padding-left: 1.4em;
	counter-increment: liwg-story-ol;
}

.liwg-story-card__body ol li::before {
	content: counter(liwg-story-ol) ".";
	position: absolute;
	left: 0;
	top: 0;
	color: #ffffff;
	font-weight: 700;
	line-height: 1.5;
}

.liwg-story-card__body a {
	color: #ffffff;
	text-decoration: underline;
	cursor: pointer;
}

.liwg-story-card__body strong {
	font-weight: 700;
}

.liwg-story-card__body em {
	font-style: italic;
}

.liwg-story-card__more {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	margin-top: 18px;
	padding: 3px 12px;
	border: 1px solid #ffffff;
	border-radius: 3px;
	background-color: transparent;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.liwg-story-card__more:hover,
.liwg-story-card__more:focus {
	background-color: #ffffff;
	border-color: #ffffff;
	color: #16557b;
}

/* Desktop hover: title moves up, panel reveals + scrolls */

@media (min-width: 1280px) {
	.liwg-story-card__image {
		transition: transform 0.5s ease, filter 0.5s ease;
	}

	.liwg-story-card:hover .liwg-story-card__overlay,
	.liwg-story-card:focus-within .liwg-story-card__overlay,
	.liwg-story-card.is-hover .liwg-story-card__overlay {
		background: linear-gradient(
			to top,
			rgba(22, 85, 123, 0.98) 0%,
			rgba(22, 85, 123, 0.92) 45%,
			rgba(22, 85, 123, 0.78) 100%
		);
	}

	.liwg-story-card:hover .liwg-story-card__image,
	.liwg-story-card:focus-within .liwg-story-card__image,
	.liwg-story-card.is-hover .liwg-story-card__image {
		transform: scale(1.04);
		filter: blur(1px);
	}

	/* Text stack captures clicks/scroll; image areas outside it still hit the media link. */
	.liwg-story-card:hover .liwg-story-card__scroll,
	.liwg-story-card:focus-within .liwg-story-card__scroll,
	.liwg-story-card.is-hover .liwg-story-card__scroll {
		pointer-events: auto;
	}
}

/* Tablet + mobile: no hover panel */

@media (max-width: 1279px) {
	.liwg-stories__layout {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0;
	}

	.liwg-stories__header {
		display: contents;
	}

	.liwg-stories__heading {
		order: 1;
		width: 100%;
		margin: 0 0 20px;
		text-align: center;
	}

	.liwg-stories__intro {
		order: 2;
		width: 100%;
		max-width: 720px;
		margin: 0 auto 48px;
		text-align: center;
	}

	.liwg-stories__stage {
		order: 3;
		width: 100%;
		margin-bottom: 48px;
	}

	.liwg-stories__track {
		gap: 16px;
	}

	.liwg-stories__item {
		flex: 0 0 calc((100% - 32px) / 3);
	}

	.liwg-stories__controls {
		margin-top: 24px;
	}

	.liwg-stories__cta {
		order: 4;
		display: flex;
		justify-content: center;
		width: 100%;
		margin-top: 0;
	}

	.liwg-story-card__hover {
		display: none;
	}
}

@media (max-width: 478px) {
	.liwg-stories {
		padding: 60px 20px 40px;
	}

	.liwg-stories__heading {
		font-size: 28px;
		margin-bottom: 16px;
	}

	.liwg-stories__intro {
		font-size: 16px;
		margin-bottom: 32px;
	}

	.liwg-stories__stage {
		margin-bottom: 36px;
	}

	.liwg-stories__track {
		gap: 24px;
	}

	.liwg-stories__item {
		flex: 0 0 100%;
	}

	.liwg-stories__controls {
		margin-top: 20px;
	}

	.liwg-story-card__title {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.liwg-stories__track {
		transition: none;
	}

	.liwg-story-card__image,
	.liwg-story-card__overlay,
	.liwg-story-card__scroll,
	.liwg-story-card__hover {
		transition: none;
	}

	.liwg-story-card:hover .liwg-story-card__image,
	.liwg-story-card:focus-within .liwg-story-card__image {
		transform: none;
		filter: none;
	}

	.liwg-story-card:hover .liwg-story-card__overlay,
	.liwg-story-card:focus-within .liwg-story-card__overlay {
		padding-top: 0;
	}

	.liwg-story-card:hover .liwg-story-card__hover,
	.liwg-story-card:focus-within .liwg-story-card__hover {
		height: 0;
		margin-top: 0;
		opacity: 0;
	}

	.liwg-stories__heading.liwg-scroll-reveal {
		will-change: auto;
	}
}
