/* =============================================================================
   Piwan Running Text — Frontend Ticker Styles
   Version: 1.1.0
   ============================================================================= */

/* --- Wrapper ---------------------------------------------------------------- */
.prt-ticker-wrap {
	display: flex;
	align-items: center;
	position: relative;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
	line-height: 1;
}

.prt-ticker-wrap *,
.prt-ticker-wrap *::before,
.prt-ticker-wrap *::after {
	box-sizing: border-box;
}

/* --- Badge ------------------------------------------------------------------ */
.prt-badge {
	position: relative;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	padding: 0 14px;
	white-space: nowrap;
	z-index: 2;
	height: 100%;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.prt-badge-shape-rectangle {
	border-radius: 0;
}

.prt-badge-shape-rounded {
	border-radius: 4px;
	margin: 5px 8px 5px 0;
	height: calc(100% - 10px);
}

.prt-badge-shape-pill {
	border-radius: 100px;
	margin: 5px 8px 5px 0;
	height: calc(100% - 10px);
}

/* --- Ticker content area ---------------------------------------------------- */
.prt-ticker-content {
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	position: relative;
}

/* Subtle left fade mask so text doesn't hard-cut at badge edge */
.prt-ticker-content::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 24px;
	z-index: 1;
	pointer-events: none;
}

/* --- Ticker track ----------------------------------------------------------- */
.prt-ticker-track {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	will-change: transform;
	position: relative;
}

/* Direction: Right to Left (standard news ticker) */
.prt-ticker-track.prt-dir-rtl {
	animation: prt-scroll-rtl linear infinite;
}

/* Direction: Left to Right */
.prt-ticker-track.prt-dir-ltr {
	animation: prt-scroll-ltr linear infinite;
}

/* Pause on hover */
.prt-ticker-wrap.prt-pause-hover:hover .prt-ticker-track {
	animation-play-state: paused;
}

/* --- Individual items ------------------------------------------------------- */
.prt-ticker-item {
	display: inline-flex;
	align-items: center;
	padding: 0 12px;
	color: inherit;
	text-decoration: none;
}

a.prt-ticker-item-link {
	cursor: pointer;
}

a.prt-ticker-item-link:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.prt-ticker-sep {
	padding: 0 6px;
	opacity: 0.45;
	user-select: none;
	pointer-events: none;
}

/* --- Keyframe animations ---------------------------------------------------- */
/*
 * The track contains 2× the items (loop_items = fill_items × 2).
 * Animating to -50% brings the second copy into view exactly as
 * the first copy exits — producing a seamless infinite loop.
 */
@keyframes prt-scroll-rtl {
	0%   { transform: translate3d(0, 0, 0); }
	100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes prt-scroll-ltr {
	0%   { transform: translate3d(-50%, 0, 0); }
	100% { transform: translate3d(0, 0, 0); }
}

/* --- Responsive device visibility ------------------------------------------ */
@media (max-width: 480px) {
	.prt-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 481px) and (max-width: 768px) {
	.prt-hide-tablet {
		display: none !important;
	}
}

@media (min-width: 769px) {
	.prt-hide-desktop {
		display: none !important;
	}
}

/* --- Admin-only notice (visible only to logged-in admins) ------------------ */
.prt-admin-notice {
	padding: 8px 12px;
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	color: #664d03;
	font-size: 13px;
	font-family: monospace;
}

/* --- Sticky wrapper --------------------------------------------------------- */
/*
 * position:sticky — keeps the ticker at the top of the viewport as user scrolls.
 * Theme-native: works within normal document flow without JS or DOM manipulation.
 * z-index: 998 — sits below WordPress admin bar (z-index: 99999) and most
 * sticky navbars (typically 999–1000), but above regular content.
 *
 * How to use: Enable "Sticky Ticker" in Settings → Piwan Running Text → Behavior,
 * then place [piwan_running_text] directly below your header in your theme's
 * header area or as a Custom HTML block.
 *
 * Sticky Offset: If your theme has a fixed/sticky header, set the offset to
 * match that header's height so the ticker sticks just below it.
 */
.prt-sticky-outer {
	position: sticky;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 998;
}
