/**
 * Wartapedia — Styling Reels / Cerita Berita 60 Detik & AI Studio.
 */

/* ==========================================================================
   1. Baris Reels Carousel di Beranda
   ========================================================================== */

.wtp-reels-bar {
	position: relative;
	margin-bottom: 24px;
	padding: 18px 20px 8px;
	border-radius: 18px;
	background: #ffffff;
	border: 1px solid var(--wtp-line, #e2e8f0);
	box-shadow: 0 4px 20px rgba(15, 37, 71, .04);
}

.wtp-reels-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.wtp-reels-title-wrap {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.wtp-reels-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: linear-gradient(135deg, #ec4899 0%, #ef4444 100%);
	color: #fff;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	width: fit-content;
	box-shadow: 0 2px 8px rgba(236, 72, 153, .35);
}

.wtp-reels-badge__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 0 6px rgba(255, 255, 255, .9);
	animation: wtp-reels-pulse 1.4s ease-in-out infinite;
}

@keyframes wtp-reels-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .4; transform: scale(0.75); }
}

.wtp-reels-title {
	font-family: var(--wtp-serif, Georgia, serif);
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--wtp-navy, #0b2547);
	margin: 0;
	letter-spacing: -.01em;
}

.wtp-reels-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.wtp-reels-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--wtp-green-dark, #15803d);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	transition: gap .15s ease, color .15s ease;
}

.wtp-reels-more:hover {
	gap: 9px;
	color: var(--wtp-green, #16a34a);
}

.wtp-reels-more .wtp-icon {
	width: 15px;
	height: 15px;
}

.wtp-reels-nav {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wtp-reels-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--wtp-line, #e2e8f0);
	background: #ffffff;
	color: var(--wtp-navy, #0b2547);
	box-shadow: 0 2px 6px rgba(15, 37, 71, .06);
	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease, border-color .15s ease;
}

.wtp-reels-nav-btn:hover {
	background: var(--wtp-surface-2, #f1f5f9);
	border-color: #cbd5e1;
	transform: scale(1.05);
}

.wtp-reels-nav-btn .wtp-icon {
	width: 16px;
	height: 16px;
}

/* Scroller Container */
.wtp-reels-track-wrap {
	position: relative;
	margin: 0 -6px;
}

.wtp-reels-scroller {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 6px 14px;
	scroll-snap-type: x mandatory;
}

.wtp-reels-scroller::-webkit-scrollbar {
	display: none;
}

/* ==========================================================================
   2. Kartu Reel Potret
   ========================================================================== */

.wtp-reel-card {
	flex: 0 0 148px;
	width: 148px;
	height: 238px;
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	user-select: none;
	scroll-snap-align: start;
	background: #0f172a;
	box-shadow: 0 6px 18px rgba(15, 37, 71, .1);
	border: 1px solid rgba(255, 255, 255, .14);
	transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease;
}

.wtp-reel-card:hover {
	transform: translateY(-5px) scale(1.02);
	box-shadow: 0 14px 30px rgba(15, 37, 71, .2);
}

.wtp-reel-card:focus-visible {
	outline: 2px solid var(--wtp-green, #16a34a);
	outline-offset: 3px;
}

.wtp-reel-card__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.wtp-reel-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.02);
	transition: transform .4s ease;
}

.wtp-reel-card:hover .wtp-reel-card__media img {
	transform: scale(1.08);
}

.wtp-reel-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(5, 15, 30, .05) 0%, rgba(5, 15, 30, .2) 35%, rgba(5, 15, 30, .88) 100%);
	pointer-events: none;
}

/* Ikon Video Play di Tengah Kartu */
.wtp-reel-card__play {
	position: absolute;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	pointer-events: none;
}

.wtp-reel-card__play-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .28);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1.5px solid rgba(255, 255, 255, .7);
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
	transition: transform .2s ease, background-color .2s ease;
}

.wtp-reel-card:hover .wtp-reel-card__play-btn {
	transform: scale(1.12);
	background: rgba(255, 255, 255, .45);
}

.wtp-reel-card__play-btn .wtp-icon {
	width: 18px;
	height: 18px;
	margin-left: 2px;
}

/* Konten Teks di Bagian Bawah Kartu */
.wtp-reel-card__content {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 12px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 6px;
	pointer-events: none;
}

.wtp-reel-card__badge {
	align-self: flex-start;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--cat-color, #ec4899);
	color: #ffffff;
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.wtp-reel-card__title {
	color: #ffffff;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.32;
	margin: 0;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ==========================================================================
   3. Modal & Fullscreen Reels Viewer (Stories / Reels Pop-up)
   ========================================================================== */

.wtp-reels-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s;
}

.wtp-reels-modal.is-active {
	opacity: 1;
	visibility: visible;
}

.wtp-reels-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 15, 30, .88);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
}

/* Tombol Panah Navigasi Desktop */
.wtp-reels-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .15);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, .25);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
	transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.wtp-reels-arrow--prev {
	left: max(24px, calc(50% - 280px));
}

.wtp-reels-arrow--next {
	right: max(24px, calc(50% - 280px));
}

.wtp-reels-arrow:hover {
	transform: translateY(-50%) scale(1.1);
	background: rgba(255, 255, 255, .28);
	border-color: rgba(255, 255, 255, .5);
}

.wtp-reels-arrow .wtp-icon {
	width: 24px;
	height: 24px;
}

/* Stage / Kartu Utama Viewer */
.wtp-reels-stage {
	position: relative;
	z-index: 2;
	width: min(420px, 92vw);
	height: min(740px, 92vh);
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 25px 60px rgba(0, 0, 0, .6);
	border: 1px solid rgba(255, 255, 255, .18);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: #080f1e;
	touch-action: pan-y;
	user-select: none;
}

/* Background Image Layer */
.wtp-reels-stage__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transform: scale(1.02);
	filter: saturate(1.05);
	transition: opacity .35s ease, transform 4s ease;
}

.wtp-reels-stage__gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(4, 12, 26, .75) 0%,
		rgba(4, 12, 26, .2) 28%,
		rgba(4, 12, 26, .65) 58%,
		rgba(4, 12, 26, .95) 100%
	);
	pointer-events: none;
}

/* Top Bar: Progress & Branding & Close */
.wtp-reels-top {
	position: relative;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px 0;
}

/* Bar Durasi / Progress Bar */
.wtp-reels-progress {
	height: 4px;
	width: 100%;
	background: rgba(255, 255, 255, .28);
	border-radius: 99px;
	overflow: hidden;
}

.wtp-reels-progress__bar {
	height: 100%;
	width: 0%;
	background: #ffffff;
	box-shadow: 0 0 10px rgba(255, 255, 255, .9);
	transition: width 0.1s linear;
}

.wtp-reels-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wtp-reels-brand {
	display: inline-flex;
	align-items: center;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}

.wtp-reels-brand .wtp-logo-mark {
	width: 32px;
}

.wtp-reels-brand .wtp-logo__name {
	font-size: 16px;
	color: #fff;
}

.wtp-reels-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, .25);
	color: #ffffff;
	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease;
}

.wtp-reels-close:hover {
	background: rgba(0, 0, 0, .7);
	transform: scale(1.08);
}

.wtp-reels-close .wtp-icon {
	width: 18px;
	height: 18px;
}

/* Pause Hint Icon */
.wtp-reels-pause-hint {
	position: absolute;
	top: 48%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8);
	z-index: 6;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}

.wtp-reels-stage.is-paused .wtp-reels-pause-hint {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.wtp-reels-pause-hint .wtp-icon {
	width: 28px;
	height: 28px;
}

/* Bottom Content: Title, AI Summary, CTA, Actions */
.wtp-reels-bottom {
	position: relative;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 20px 24px;
	color: #ffffff;
}

.wtp-reels-meta {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 12px;
}

.wtp-reels-cat {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 6px;
	background: var(--wtp-green, #16a34a);
	color: #ffffff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.wtp-reels-date {
	color: rgba(255, 255, 255, .82);
	font-weight: 500;
}

.wtp-reels-heading {
	font-family: var(--wtp-serif, Georgia, serif);
	font-size: 21px;
	font-weight: 800;
	line-height: 1.25;
	color: #ffffff;
	margin: 0;
	letter-spacing: -.01em;
	text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Kotak Rangkuman AI Studio (Gemini) */
.wtp-reels-summary-box {
	background: rgba(10, 25, 47, .72);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 14px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.wtp-reels-summary-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 800;
	color: #34d399;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.wtp-reels-ai-sparkle {
	font-size: 13px;
}

.wtp-reels-summary-text {
	font-size: 13px;
	line-height: 1.48;
	color: rgba(255, 255, 255, .94);
	margin: 0;
	min-height: 40px;
}

/* Skeleton Loading saat AI merangkum */
.wtp-reels-skeleton {
	height: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, rgba(255, 255, 255, .15) 25%, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, .15) 75%);
	background-size: 200% 100%;
	animation: wtp-shimmer 1.4s infinite;
	margin-bottom: 6px;
}

.wtp-reels-skeleton--short {
	width: 65%;
	margin-bottom: 0;
}

/* Bar Tombol Aksi */
.wtp-reels-actions-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 4px;
}

.wtp-reels-cta {
	flex: 1;
	min-height: 42px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 700;
	justify-content: center;
	gap: 6px;
	text-decoration: none;
	background: #ffffff;
	color: var(--wtp-navy, #0b2547);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.wtp-reels-cta:hover {
	background: #f1f5f9;
	color: var(--wtp-navy, #0b2547);
}

.wtp-reels-cta .wtp-icon {
	width: 14px;
	height: 14px;
}

.wtp-reels-socials {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wtp-reels-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 42px;
	height: 42px;
	padding: 0 10px;
	border-radius: 12px;
	background: rgba(255, 255, 255, .18);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, .3);
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease, color .15s ease;
}

.wtp-reels-action-btn:hover {
	background: rgba(255, 255, 255, .32);
	transform: scale(1.05);
}

.wtp-reels-action-btn .wtp-icon {
	width: 18px;
	height: 18px;
}

/* State Like */
.wtp-reels-like-btn.is-liked {
	color: #ef4444;
	border-color: rgba(239, 68, 68, .5);
	background: rgba(239, 68, 68, .2);
}

.wtp-reels-like-btn.is-liked .wtp-icon {
	fill: #ef4444;
}

.wtp-reels-like-btn:active .wtp-reels-heart-icon {
	animation: wtp-heartbeat .35s ease;
}

@keyframes wtp-heartbeat {
	0% { transform: scale(1); }
	50% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

/* Petunjuk Swipe Mobile */
.wtp-reels-swipe-hint {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: rgba(255, 255, 255, .7);
	font-size: 11px;
	font-weight: 500;
	margin-top: 2px;
	animation: wtp-swipe-float 2s ease-in-out infinite;
}

@keyframes wtp-swipe-float {
	0%, 100% { transform: translateY(0); opacity: .7; }
	50% { transform: translateY(-4px); opacity: 1; }
}

.wtp-reels-swipe-hint .wtp-icon {
	width: 13px;
	height: 13px;
}

/* ==========================================================================
   4. Kustom Halaman /reels/
   ========================================================================== */

.wtp-reels-page {
	padding-top: 10px;
}

.wtp-reels-filterbar {
	margin: 20px 0;
}

.wtp-reels-grid-wrap {
	margin: 24px 0 40px;
}

.wtp-reels-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
	gap: 16px;
}

.wtp-reels-grid .wtp-reel-card {
	flex: none;
	width: 100%;
	height: 250px;
}

/* ==========================================================================
   5. Tampilan Responsif Mobile
   ========================================================================== */

@media (max-width: 767px) {
	.wtp-reels-bar {
		padding: 14px 14px 6px;
		margin-bottom: 18px;
		border-radius: 14px;
	}

	.wtp-reels-title {
		font-size: 18px;
	}

	.wtp-reels-nav {
		display: none; /* Di ponsel geser langsung dengan jari */
	}

	.wtp-reel-card {
		flex: 0 0 132px;
		width: 132px;
		height: 215px;
		border-radius: 14px;
	}

	.wtp-reel-card__play-btn {
		width: 38px;
		height: 38px;
	}

	.wtp-reel-card__play-btn .wtp-icon {
		width: 15px;
		height: 15px;
	}

	.wtp-reel-card__title {
		font-size: 11.5px;
	}

	/* Modal di Mobile: TRUE FULLSCREEN APP-LIKE */
	.wtp-reels-modal {
		padding: 0;
	}

	.wtp-reels-arrow {
		display: none !important;
	}

	.wtp-reels-stage {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-width: 100vw;
		max-height: 100dvh;
		border-radius: 0;
		border: none;
	}

	.wtp-reels-top {
		padding-top: max(16px, env(safe-area-inset-top, 16px));
	}

	.wtp-reels-bottom {
		padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
		gap: 10px;
	}

	.wtp-reels-heading {
		font-size: 19px;
	}

	.wtp-reels-summary-box {
		padding: 10px 12px;
	}

	.wtp-reels-summary-text {
		font-size: 12.5px;
	}

	.wtp-reels-swipe-hint {
		display: flex;
	}

	.wtp-reels-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
}

/* ==========================================================================
   6. Animasi Transisi Halus Antar Reel (Slide-Up ala Reels / TikTok)
   ========================================================================== */

.wtp-reels-stage.is-animating-next .wtp-reels-stage__bg {
	animation: wtp-reel-bg-up .36s cubic-bezier(.2, .8, .2, 1);
}

.wtp-reels-stage.is-animating-next .wtp-reels-bottom {
	animation: wtp-reel-content-up .36s cubic-bezier(.2, .8, .2, 1);
}

.wtp-reels-stage.is-animating-prev .wtp-reels-stage__bg {
	animation: wtp-reel-bg-down .36s cubic-bezier(.2, .8, .2, 1);
}

.wtp-reels-stage.is-animating-prev .wtp-reels-bottom {
	animation: wtp-reel-content-down .36s cubic-bezier(.2, .8, .2, 1);
}

@keyframes wtp-reel-bg-up {
	0% {
		transform: translateY(35px) scale(1.08);
		opacity: .6;
	}
	100% {
		transform: translateY(0) scale(1.02);
		opacity: 1;
	}
}

@keyframes wtp-reel-content-up {
	0% {
		transform: translateY(28px);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes wtp-reel-bg-down {
	0% {
		transform: translateY(-35px) scale(1.08);
		opacity: .6;
	}
	100% {
		transform: translateY(0) scale(1.02);
		opacity: 1;
	}
}

@keyframes wtp-reel-content-down {
	0% {
		transform: translateY(-28px);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}
