/* =======================================================================
 * ax-stories — success stories tabs (Figma 2419-197)
 *
 * Thumbnails act as tabs. Active = white pill (avatar + name + role) with a
 * looping purple ring; inactive = avatar only. Prev/next arrows page people.
 * Selecting swaps the quote, body and photo. #top-prefixed to beat Enfold.
 * ===================================================================== */

#top .ax-stories {
	--ax-purple: #444192;
	font-family: "Montserrat", sans-serif;
	margin: 0 auto;
}

/* ---------------------------------------------------------------------
 * Thumbnail bar
 * ------------------------------------------------------------------- */
#top .ax-stories__bar {
	display: flex;
	align-items: center;
	gap: 14px;
}

#top .ax-stories__thumbs {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: 6px 2px;
    justify-content: center;
}

#top .ax-stories__thumbs::-webkit-scrollbar {
	display: none;
}

#top .ax-stories__thumb {
	flex: none;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 2px;
	background: #fff;
	border: 0;
	border-radius: 77px;
	cursor: pointer;
}

#top .ax-stories__avatar-wrap {
	position: relative;
	flex: none;
	width: 80px;
	height: 80px;
}

#top .ax-stories__avatar {
	position: absolute;
	inset: 6px;
	width: calc(100% - 12px);
	height: calc(100% - 12px);
	border-radius: 50%;
	object-fit: cover;
	background: #c6c6c6;
	display: block;
}

/* looping ring — only on the active thumb */
#top .ax-stories__ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	opacity: 0;
	background: conic-gradient(from 0deg, var(--ax-purple), #8f8cd6 40%, rgba(68,65,146,0) 72%, rgba(68,65,146,0) 100%);
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}

#top .ax-stories__thumb.is-active .ax-stories__ring {
	opacity: 1;
	animation: ax-stories-spin 1.6s linear infinite;
}

@keyframes ax-stories-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	#top .ax-stories__thumb.is-active .ax-stories__ring {
		animation: none;
	}
}

/* name / role — only shown on the active (expanded) thumb */
#top .ax-stories__thumb-meta {
	display: none;
	flex-direction: column;
	gap: 2px;
	padding-right: 22px;
}

#top .ax-stories__thumb.is-active .ax-stories__thumb-meta {
	display: flex;
}

#top .ax-stories__thumb-name {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--ax-purple);
	white-space: nowrap;
	text-align: left;
	font-family: Montserrat;
}

#top .ax-stories__thumb-role {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.28;
    color: var(--ax-purple);
    text-align: left;
    font-family: Montserrat;
    max-width: 180px;
}

/* arrows */
#top .ax-stories__arrow {
	flex: none;
	width: 49px;
	height: 49px;
	border-radius: 77px;
	background: #EBEBEB;
	border: unset !important;
	display: grid;
	place-items: center;
	cursor: pointer;
	padding: 0;
	transition: background .2s ease;
}

#top .ax-stories__arrow svg {
	width: 11px;
	height: 20px;
}

#top .ax-stories__arrow svg path {
	fill: var(--ax-purple);
	transition: fill .2s ease;
}

#top .ax-stories__arrow:hover {
	background: var(--ax-purple);
}

#top .ax-stories__arrow:hover svg path {
	fill: #fff;
}

/* ---------------------------------------------------------------------
 * Panels (text left, photo right)
 * ------------------------------------------------------------------- */
#top .ax-stories__panel {
	display: none;
	grid-template-columns: 1fr 493px;
	gap: 56px;
	align-items: center;
	padding-right: 66px;
}

#top .ax-stories__panel.is-active {
	display: grid;
}

#top .ax-stories__quote {
    margin: 0 0 24px;
    font-family: "Inter", sans-serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.19;
    color: var(--ax-purple);
    padding: 0px;
    border: unset !important;
}

#top .ax-stories__body p {
	margin: 0 0 16px;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.74;
	color: #000;
}

#top .ax-stories__body p:last-child {
	margin-bottom: 0;
}

#top .ax-stories__media {
	position: relative;
}

#top .ax-stories__media img {
	width: 100%;
	height: 514px;
	object-fit: cover;
	border-radius: 25px;
	display: block;
}

#top .ax-stories_inner_cont {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    align-items: end;
    gap: 20px;
    margin-bottom: 40px;
}

/* ---------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------- */
@media (max-width: 989px) {	
	#top .ax-stories_inner_cont {
		grid-template-columns: 100%;
		margin-bottom: 30px;
	}

	/* hide desktop arrows — mobile uses the segmented pagination */
	#top .ax-stories__arrow {
		display: none;
	}

	/* thumb bar -> Splide carousel */
	#top .ax-stories__thumbs.splide {
		display: block;
		overflow: visible;
	}

	#top .ax-stories__thumbs.splide .splide__track {
		overflow: visible;
	}

	#top .ax-stories__thumbs.splide .splide__slide {
		display: flex;
		align-items: center;
	}

	/* inactive thumbs: faded avatar only */
	#top .ax-stories__thumbs.splide .ax-stories__thumb {
		opacity: .45;
		box-shadow: none;
		transition: opacity .3s ease;
	}

	/* only the centered (Splide-active) thumb expands — ignore the JS class so
	   just one thumb is ever wide (keeps autoWidth measurements correct) */
	#top .ax-stories__thumbs.splide .ax-stories__thumb .ax-stories__thumb-meta {
		display: none;
	}

	#top .ax-stories__thumbs.splide .ax-stories__thumb .ax-stories__ring {
		opacity: 0;
		animation: none;
	}

	#top .ax-stories__thumbs.splide .splide__slide.is-active .ax-stories__thumb {
		opacity: 1;
	}

	#top .ax-stories__thumbs.splide .splide__slide.is-active .ax-stories__thumb-meta {
		display: flex;
	}

	#top .ax-stories__thumbs.splide .splide__slide.is-active .ax-stories__ring {
		opacity: 1;
		animation: ax-stories-spin 1.6s linear infinite;
	}

	/* segmented progress pagination */
	#top .ax-stories .splide__pagination {
		position: relative;
		display: flex;
		gap: 8px;
		justify-content: center;
		align-items: center;
		margin: 22px 0 0;
		padding: 0;
		width: 100%;
	}

	#top .ax-stories .splide__pagination li {
		flex: 1 1 0;
		max-width: 75px;
		line-height: 0;
	}

	#top .ax-stories .splide__pagination__page {
		width: 100%;
		height: 3px;
		margin: 0;
		border-radius: 16px;
		background: #d9d9d9;
		opacity: 1;
		transform: none;
		transition: height .2s ease, background .2s ease;
	}

	#top .ax-stories .splide__pagination__page.is-active {
		height: 6px;
		background: var(--ax-purple);
	}

	#top .ax-stories__panel {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	#top .ax-stories__media {
		order: -1;
	}

	#top .ax-stories__media img {
		height: 334px;
	}

	#top .ax-stories__avatar-wrap {
		width: 64px;
		height: 64px;
	}

	#top .ax-stories__thumb-name {
		font-size: 17px;
	}

	#top .ax-stories__quote {
        font-size: 22px;
        margin: 0 0 20px;
    }
	
	#top .ax-stories__body p {
		font-size: 15px;
		line-height: 1.60;
	}
	
	#top .ax-stories__panel {
		padding-right: 0px;
	}
}