/*
 * Cridare News — ticker contínuo de últimas notícias.
 */

.cn-news-ticker {
	overflow: hidden;
	background: var(--cn-surface);
	border-block-end: 1px solid var(--cn-border);
	color: var(--cn-text);
	font-family: var(--cn-font-ui);
}

.cn-news-ticker__inner {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	width: min(calc(100% - 2rem), var(--cn-wide-width));
	max-width: 100%;
	min-height: 2.625rem;
	align-items: stretch;
	padding-block: 0;
	border-inline: 1px solid var(--cn-border);
	box-sizing: border-box;
}

.cn-news-ticker__label {
	display: flex;
	min-height: 2.625rem;
	align-items: center;
	justify-content: center;
	padding-inline: 0.875rem;
	background: var(--cn-brand-secondary);
	color: var(--cn-brand-on-secondary);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.055em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
}

.cn-news-ticker__label-short { display: none; }

.cn-news-ticker__viewport {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	overflow: clip;
	contain: paint;
	background: var(--cn-surface-muted);
}

.cn-news-ticker__track {
	display: flex;
	width: max-content;
	min-width: 100%;
	min-height: 2.625rem;
	align-items: center;
	animation: cn-news-ticker-scroll 42s linear infinite;
	will-change: transform;
}

.cn-news-ticker__items {
	display: flex;
	width: max-content;
	min-height: 2.625rem;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0 var(--cn-space-6) 0 0;
	list-style: none;
}

.cn-news-ticker__item {
	display: flex;
	min-height: 2.625rem;
	flex: 0 0 auto;
	align-items: center;
	white-space: nowrap;
}

.cn-news-ticker__item::before {
	content: "•";
	margin-inline: var(--cn-space-3);
	color: var(--cn-brand-secondary);
	font-size: 0.75rem;
	line-height: 1;
}

.cn-news-ticker__item a {
	display: flex;
	min-height: 2.625rem;
	align-items: center;
	color: var(--cn-brand-primary);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.cn-news-ticker__item a:hover,
.cn-news-ticker__item a:focus-visible {
	color: var(--cn-brand-secondary);
	text-decoration: underline;
	text-underline-offset: 0.16em;
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.cn-news-ticker__viewport:hover .cn-news-ticker__track,
.cn-news-ticker__viewport:focus-within .cn-news-ticker__track {
	animation-play-state: paused;
}

@keyframes cn-news-ticker-scroll {
	to { transform: translate3d(-50%,0,0); }
}

@media (max-width: 479px) {
	.cn-news-ticker__inner {
		width: min(calc(100% - 1.25rem), var(--cn-wide-width));
		min-height: 2.5rem;
	}

	.cn-news-ticker__label {
		min-height: 2.5rem;
		padding-inline: 0.625rem;
		font-size: 0.6875rem;
		letter-spacing: 0.05em;
	}

	.cn-news-ticker__label-full { display: none; }
	.cn-news-ticker__label-short { display: inline; }

	.cn-news-ticker__track,
	.cn-news-ticker__items,
	.cn-news-ticker__item,
	.cn-news-ticker__item a {
		min-height: 2.5rem;
	}

	.cn-news-ticker__item a { font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: reduce) {
	.cn-news-ticker__viewport {
		overflow-x: auto;
		overflow-y: hidden;
		contain: paint;
		scrollbar-width: thin;
	}

	.cn-news-ticker__track {
		animation: none;
		transform: none;
		will-change: auto;
	}

	.cn-news-ticker__items[aria-hidden="true"] { display: none; }
}
