/*
 * Interfaz BYTE – estilos del front.
 * Los colores y tiempos configurables llegan como variables CSS
 * desde los ajustes del plugin (ver Byte_UI_Assets::inline_vars).
 */

:root {
	--byte-scroll-color: #9a9a9a;
	--byte-scroll-hover: #333333;
	--byte-scroll-size: 44px;
	--byte-ticker-bg: #111111;
	--byte-ticker-fg: #ffffff;
	--byte-ticker-duration: 30s;
	--byte-wa-bg: #25d366;
	--byte-wa-fg: #ffffff;
	--byte-wa-delay: 0s;
	--byte-z: 9990;
	--byte-radius: 6px;
}

/* ══════════ Botón ir arriba / abajo ══════════ */

.byte-scroll {
	position: fixed;
	bottom: 20px;
	z-index: var(--byte-z);
	display: none;
	align-items: center;
	justify-content: center;
	width: var(--byte-scroll-size);
	height: var(--byte-scroll-size);
	padding: 0;
	margin: 0;
	color: var(--byte-scroll-color);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.25s ease, transform 0.25s ease;
}

.byte-scroll--right {
	right: 20px;
}

.byte-scroll--left {
	left: 20px;
}

.byte-scroll.is-visible {
	display: flex;
}

.byte-scroll:hover,
.byte-scroll:focus-visible {
	color: var(--byte-scroll-hover);
}

.byte-scroll:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.byte-scroll__icon {
	display: flex;
	transition: transform 0.25s ease;
}

.byte-scroll.is-up .byte-scroll__icon {
	transform: rotate(180deg);
}

/* Si el botón de WhatsApp comparte esquina, se aparta. */
.byte-scroll--right.has-neighbour {
	right: 76px;
}

.byte-scroll--left.has-neighbour {
	left: 76px;
}

/* ══════════ Botón de WhatsApp ══════════ */

.byte-whatsapp {
	position: fixed;
	bottom: 20px;
	z-index: var(--byte-z);
	display: inline-flex;
	gap: 8px;
	align-items: center;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var(--byte-wa-fg);
	text-decoration: none;
	background: var(--byte-wa-bg);
	border-radius: var(--byte-radius);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	visibility: hidden;
	opacity: 0;
	animation: byte-appear 0.35s ease forwards;
	animation-delay: var(--byte-wa-delay);
}

.byte-whatsapp--left {
	left: 20px;
}

.byte-whatsapp--right {
	right: 20px;
}

.byte-whatsapp:hover,
.byte-whatsapp:focus-visible {
	color: var(--byte-wa-fg);
	filter: brightness(0.94);
}

.byte-whatsapp:focus-visible {
	outline: 2px solid var(--byte-wa-bg);
	outline-offset: 3px;
}

.byte-whatsapp__icon {
	flex: 0 0 auto;
}

@keyframes byte-appear {
	from {
		visibility: visible;
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 480px) {
	.byte-whatsapp__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.byte-whatsapp {
		padding: 12px;
		border-radius: 50%;
	}
}

/* ══════════ Rótulo de noticias ══════════ */

.byte-ticker {
	width: 100%;
	color: var(--byte-ticker-fg);
	background: var(--byte-ticker-bg);
}

.byte-ticker__viewport {
	overflow: hidden;
}

.byte-ticker__track {
	display: flex;
	width: max-content;
	animation: byte-ticker-scroll var(--byte-ticker-duration) linear infinite;
}

.byte-ticker:hover .byte-ticker__track,
.byte-ticker:focus-within .byte-ticker__track {
	animation-play-state: paused;
}

.byte-ticker__group {
	display: flex;
	flex: 0 0 auto;
}

.byte-ticker__item {
	padding: 12px 0;
	margin-right: 3rem;
	font-size: 1.05rem;
	line-height: 1.4;
	white-space: nowrap;
}

.byte-ticker__item a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@keyframes byte-ticker-scroll {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}

@media (max-width: 768px) {
	.byte-ticker__item {
		font-size: 0.95rem;
	}
}

/* ══════════ Slider ══════════ */

.byte-slider {
	position: relative;
	width: 100%;
}

.byte-slider__viewport {
	overflow: hidden;
}

.byte-slider__track {
	display: flex;
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.byte-slider__slide {
	flex: 0 0 100%;
	min-width: 100%;
}

.byte-slider__link,
.byte-slider__image {
	display: block;
	width: 100%;
	height: auto;
}

.byte-slider__nav {
	position: absolute;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: #fff;
	background: rgba(0, 0, 0, 0.42);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.2s ease;
}

.byte-slider__nav:hover,
.byte-slider__nav:focus-visible {
	background: rgba(0, 0, 0, 0.68);
}

.byte-slider__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.byte-slider__nav--prev {
	left: 12px;
}

.byte-slider__nav--next {
	right: 12px;
}

.byte-slider__dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	display: flex;
	gap: 8px;
	transform: translateX(-50%);
}

.byte-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s ease;
}

.byte-slider__dot.is-active {
	background: #fff;
}

.byte-slider__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.byte-slider__nav {
		width: 32px;
		height: 32px;
	}
}

/* ══════════ Texto que se escribe solo ══════════ */

.byte-typing {
	display: inline-flex;
	align-items: baseline;
	min-height: 1.2em;
}

.byte-typing__text {
	white-space: pre;
}

.byte-typing__caret {
	display: none;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	background: currentColor;
	animation: byte-caret 1s step-end infinite;
}

.byte-typing.is-ready .byte-typing__caret {
	display: inline-block;
}

/* Con JS activo el texto estático queda solo para lectores de pantalla. */
.byte-typing.is-ready .byte-typing__fallback {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@keyframes byte-caret {
	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0;
	}
}

/* ══════════ Movimiento reducido ══════════ */

@media (prefers-reduced-motion: reduce) {
	.byte-scroll,
	.byte-scroll__icon,
	.byte-slider__track {
		transition: none;
	}

	.byte-ticker__track {
		animation: none;
	}

	.byte-ticker__viewport {
		overflow-x: auto;
	}

	.byte-whatsapp {
		visibility: visible;
		opacity: 1;
		animation: none;
	}

	.byte-typing__caret {
		animation: none;
	}
}
