/* Top Stories Slider */
.topStories {
	position: relative;
	width: 550px;
    max-width: 100%;
}

.topStories__sliderWrapper {
	position: relative;
}

.topStories__slider {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	cursor: grab;
	user-select: none;
	align-items: flex-start;
}

.topStories__slider.dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.topStories__slider::-webkit-scrollbar {
	display: none;
}

.topStories__slide {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	cursor: pointer;
	user-select: none;
}

.topStories__thumbnail {
	position: relative;
	display: block;
}

.topStories__imageRing {
	width: 89px;
	height: 89px;
	border-radius: 50%;
	padding: 3px;
	background-image: linear-gradient(220deg, #488122 0%, #77D538 25%, #9CEE65 50%, #9EC2F5 75%, #296FD4 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.topStories__slide.viewed .topStories__imageRing {
	background: #D0E2FB;
}

.topStories__image {
	width: 100% !important;
	height: 100% !important;
	display: block;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #fff;
}

.topStories__slideTitle {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    margin: 2px 0 0 0;
    max-width: 80px;
    overflow: hidden;
    line-height: 12px;
}

/* Slider Navigation Arrows */
.topStories__sliderArrow {
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--grey-600);
	color: var(--white);
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--transition-base) var(--ease-out);
	z-index: 10;
	opacity: 0;
}

.topStories__sliderArrow.visible {
	display: flex;
	opacity: 0;
}

.topStories__sliderArrow--next.visible {
	opacity: 1;
}

.topStories:hover .topStories__sliderArrow.visible {
	opacity: 1;
}

.topStories__sliderArrow:hover {
	background: var(--black);
	transform: translateY(-50%) scale(1.05);
}

.topStories__sliderArrow--prev {
	left: -10px;
}

.topStories__sliderArrow--next {
	right: -10px;
}

.topStories__sliderArrow img {
	width: 20px;
	height: 20px;
	display: block;
}

/* Lightbox Styles */
.topStories__lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh; /* Dynamic viewport height for mobile browsers */
	z-index: 99999999;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	overscroll-behavior: none;
}

.topStories__lightbox.active {
	display: flex;
}

.topStories__lightbox__overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh; /* Dynamic viewport height for mobile browsers */
	background: rgba(0, 0, 0, 0.9);
	cursor: pointer;
	z-index: 1;
	overscroll-behavior: none;
}

.topStories__lightbox__content {
	position: relative;
	z-index: 10000;
	width: 445px;
	max-width: 90%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.topStories__lightbox__close {
	position: fixed;
	top: 20px;
	right: 20px;
	background: transparent;
	border: none;
	color: white;
	cursor: pointer !important;
	padding: 0;
	z-index: 10000000000;
	transition: transform 0.2s ease;
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: all;
}

.topStories__lightbox__close svg {
	display: block;
	cursor: pointer;
}

/* Progress Bars */
.topStories__lightbox__progressWrapper {
	position: absolute;
	top: 13px;
	left: 10px;
	right: 10px;
	z-index: 10002;
}

.topStories__lightbox__progressBars {
	display: flex;
	gap: 4px;
}

.topStories__lightbox__progressBar {
	flex: 1;
	height: 3px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	overflow: hidden;
	position: relative;
}

.topStories__lightbox__progressBar__fill {
	height: 100%;
	background: white;
	width: 0%;
}

.topStories__lightbox__progressBar__fill.active {
	animation: progressFill 4s linear forwards;
	transition: none;
}

.topStories__lightbox__progressBar__fill.active.paused {
	animation-play-state: paused;
}

.topStories__lightbox__progressBar__fill.completed {
	width: 100%;
}

@keyframes progressFill {
	from {
		width: 0%;
	}
	to {
		width: 100%;
	}
}

/* Play/Pause Button */
.topStories__lightbox__playPause {
	position: absolute;
	top: 20px;
	right: 10px;
	background: transparent;
	border: none;
	color: white;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	transition: background 0.2s ease;
	z-index: 10002;
}

.topStories__lightbox__playPause:hover {
	background: rgba(255, 255, 255, 0.2);
}

.topStories__lightbox__playPause__play {
	display: none;
}

.topStories__lightbox__playPause.paused .topStories__lightbox__playPause__pause {
	display: none;
}

.topStories__lightbox__playPause.paused .topStories__lightbox__playPause__play {
	display: block;
}

.topStories__lightbox__story {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	width: 100%;
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 1;
}

.topStories__lightbox__imageWrapper {
	width: 100%;
	height: 800px;
	max-height: 75vh;
	max-height: 75dvh; /* Dynamic viewport height for mobile browsers */
	overflow: hidden;
	background: #000;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.topStories__lightbox__imageWrapper::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: var(--bg-image);
	background-size: cover;
	background-position: center;
	filter: blur(20px);
	opacity: 0.3;
	z-index: 0;
}

.topStories__lightbox__imageWrapper::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 80px;
	background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
	z-index: 1;
	pointer-events: none;
}

.topStories__lightbox__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	position: relative;
	z-index: 0;
}

.topStories__lightbox__title {
	position: absolute;
	top: 15px;
	left: 0;
	right: 0;
	margin: 0;
	padding: 1rem 60px 1rem 1.5rem;
	font-size: 16px !important;
	font-weight: 400;
	text-align: left;
	color: white;
	z-index: 10001;
}

.topStories__lightbox__linkWrapper {
	position: absolute;
	bottom: 20%;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	z-index: 10002;
}

.topStories__lightbox__link {
    text-align: center;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    background: #fff;
    color: #000 !important;
	padding: 7px 11px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topStories__lightbox__link__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	color: #0095F6;
}

.topStories__lightbox__link__text {
	color: #000;
	font-size: 17px;
	line-height: 1;
	font-weight: 600;
}

/* Navigation Arrows */
.topStories__lightbox__arrow {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(150, 150, 150, 0.9);
	border: none;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
	z-index: 10001;
}

.topStories__lightbox__arrow:hover {
	background: rgba(255, 255, 255, 0.9);
}

.topStories__lightbox__arrow--prev {
	left: calc((100vw - 500px) / 2 - 35px);
}

.topStories__lightbox__arrow--next {
	right: calc((100vw - 500px) / 2 - 35px);
}

.topStories__lightbox__arrow svg {
	color: #333;
}

/* Thumbnail Navigation */
.topStories__lightbox__navWrapper {
	position: relative;
	margin-top: 1rem;
	width: 100%;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

.topStories__lightbox__nav {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-behavior: smooth;
}

.topStories__lightbox__nav::-webkit-scrollbar {
	display: none;
}

.topStories__lightbox__navItem {
	flex: 0 0 auto;
	width: auto;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease, transform 0.2s ease;
	border: 2px solid transparent;
	display: flex;
	align-items: center;
}

.topStories__lightbox__navItem:hover {
	opacity: 0.8;
}

.topStories__lightbox__navItem.active {
	opacity: 1;
	border-color: #fff;
}

.topStories__lightbox__navImage {
	width: auto !important;
	height: 100% !important;
	max-height: 60px;
	object-fit: contain;
	display: block;
}

/* Thumbnail Navigation Arrows */
.topStories__lightbox__navArrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
	z-index: 10002;
	opacity: 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.topStories__lightbox__navArrow.visible {
	display: flex;
}

.topStories__lightbox__navWrapper:hover .topStories__lightbox__navArrow.visible {
	opacity: 1;
}

.topStories__lightbox__navArrow:hover {
	background: rgba(0, 0, 0, 0.8);
}

.topStories__lightbox__navArrow--prev {
	left: 5px;
}

.topStories__lightbox__navArrow--next {
	right: 5px;
}

.topStories__lightbox__navArrow svg {
	width: 16px;
	height: 16px;
}

.topStories__lightbox__navArrow svg path {
	stroke: #fff;
}

@media (max-width: 1024px) {
	.topStories {
    width: 100%;
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	#top-stories-section {
		order: -1;
	}

	.topStories__sliderArrow {
		display: none !important;
	}

	.topStories__lightbox__navArrow {
		display: none !important;
	}

	.topStories__lightbox__arrow {
		display: none !important;
	}

	.topStories__lightbox__content {
		width: 95%;
	}

	.topStories__lightbox__arrow {
		width: 32px;
		height: 32px;
	}

	.topStories__lightbox__arrow--prev {
		left: 10px;
	}

	.topStories__lightbox__arrow--next {
		right: 10px;
	}

	.topStories__lightbox__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
	}

	.topStories__imageRing {
    width: 85px;
    height: 85px;
	}

	.topStories__slider {
		display: flex;
		gap: 20px;
		overflow-x: auto;
		scroll-behavior: smooth;
		scrollbar-width: none;
		cursor: grab;
		user-select: none;
		align-items: flex-start;
	}
}

@media (max-width: 480px) {
	.topStories__title {
		font-size: 0.75rem;
		padding: 0.5rem;
	}

	.topStories__lightbox__navItem {
		width: 50px;
		height: 50px;
	}
}
