/* mod_hmetro_ticker — inherits the site's typeface; colour, spacing and shape come from the module settings. */
.hmt {
	--hmt-accent: #c8102e;
	--hmt-bg: #fff;
	--hmt-fg: #1c1f24;
	--hmt-muted: #5a626c;
	--hmt-line: #d9dde2;
	--hmt-radius: 4px;
	--hmt-pad-y: .55rem;
	--hmt-pad-x: 1.1rem;
	--hmt-fs: .95rem;
	--hmt-shift: 0px;
	--hmt-duration: 40s;
	display: flex;
	align-items: stretch;
	background: var(--hmt-bg);
	color: var(--hmt-fg);
	border: 1px solid var(--hmt-line);
	border-radius: var(--hmt-radius);
	overflow: hidden;
	font-size: var(--hmt-fs);
	line-height: 1.4;
}

.hmt--borderless {
	border: 0;
}

/* Themes */
.hmt--dark {
	--hmt-bg: #171a20;
	--hmt-fg: #f1f3f5;
	--hmt-muted: #a4acb6;
	--hmt-line: #2c313a;
}

@media (prefers-color-scheme: dark) {
	.hmt--auto {
		--hmt-bg: #171a20;
		--hmt-fg: #f1f3f5;
		--hmt-muted: #a4acb6;
		--hmt-line: #2c313a;
	}
}

/* Match site: no background of its own, text and lines follow the surrounding colour. */
.hmt--site {
	--hmt-muted: color-mix(in srgb, currentColor 65%, transparent);
	--hmt-line: color-mix(in srgb, currentColor 22%, transparent);
	background: transparent;
	color: inherit;
}

.hmt__label {
	flex: none;
	display: flex;
	align-items: center;
	padding: var(--hmt-pad-y) calc(var(--hmt-pad-x) * .85);
	background: var(--hmt-accent);
	color: #fff;
	font-weight: 700;
}

.hmt__viewport {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
}

.hmt__track {
	display: flex;
	width: max-content;
}

.hmt__group {
	display: flex;
	flex: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hmt__item {
	flex: none;
	display: flex;
	align-items: center;
	margin: 0;
	border-right: 1px solid var(--hmt-line);
}

.hmt__link {
	display: flex;
	align-items: baseline;
	gap: .6rem;
	padding: var(--hmt-pad-y) var(--hmt-pad-x);
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.hmt__link:hover .hmt__title,
.hmt__link:focus-visible .hmt__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hmt__meta {
	display: inline-flex;
	align-items: baseline;
	gap: .45rem;
}

.hmt__time {
	color: var(--hmt-muted);
	font-size: .82em;
	font-variant-numeric: tabular-nums;
}

.hmt__new {
	padding: .02rem .45rem;
	border-radius: 999px;
	background: var(--hmt-accent);
	color: #fff;
	font-size: .72em;
	font-weight: 700;
	line-height: 1.5;
}

.hmt__section {
	padding: .02rem .45rem;
	border: 1px solid var(--hmt-line);
	border-radius: 999px;
	color: var(--hmt-muted);
	font-size: .72em;
	font-weight: 600;
	line-height: 1.5;
}

.hmt__title {
	font-weight: 600;
}

.hmt__excerpt {
	color: var(--hmt-muted);
	font-size: .9em;
}

.hmt__tools {
	flex: none;
	display: flex;
	align-items: center;
	gap: .65rem;
	padding: 0 .75rem;
	border-left: 1px solid var(--hmt-line);
	color: var(--hmt-muted);
	font-size: .8em;
}

.hmt__tools a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hmt__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	padding: 0;
	border: 1px solid var(--hmt-line);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.hmt__toggle[hidden] {
	display: none;
}

.hmt__toggle .hmt__icon--play,
.hmt__toggle[data-state="paused"] .hmt__icon--pause {
	display: none;
}

.hmt__toggle[data-state="paused"] .hmt__icon--play {
	display: block;
}

.hmt a:focus-visible,
.hmt button:focus-visible {
	outline: 2px solid var(--hmt-accent);
	outline-offset: -2px;
}

/* Motion is added by ticker.js; without it the list is a plain scrollable row. */
.hmt.is-running .hmt__viewport {
	overflow: hidden;
}

.hmt--horizontal.is-running .hmt__viewport {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
}

.hmt--horizontal.is-running .hmt__track {
	animation: hmt-x var(--hmt-duration) linear infinite;
}

.hmt--vertical.is-running .hmt__track {
	animation: hmt-y var(--hmt-duration) linear infinite;
}

.hmt.is-running:hover .hmt__track,
.hmt.is-running:focus-within .hmt__track,
.hmt.is-paused .hmt__track {
	animation-play-state: paused;
}

@keyframes hmt-x {
	to { transform: translate3d(calc(var(--hmt-shift) * -1), 0, 0); }
}

@keyframes hmt-y {
	to { transform: translate3d(0, calc(var(--hmt-shift) * -1), 0); }
}

/* Vertical list */
.hmt--vertical {
	flex-direction: column;
}

.hmt--vertical .hmt__label {
	padding: var(--hmt-pad-y) calc(var(--hmt-pad-x) * .85);
}

.hmt--vertical .hmt__viewport {
	flex: none;
	height: var(--hmt-height, 240px);
	overflow-x: hidden;
	overflow-y: auto;
}

.hmt--vertical.is-running .hmt__viewport {
	overflow-y: hidden;
	-webkit-mask-image: linear-gradient(180deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
	mask-image: linear-gradient(180deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
}

.hmt--vertical .hmt__track,
.hmt--vertical .hmt__group {
	display: block;
	width: auto;
}

.hmt--vertical .hmt__item {
	display: block;
	border-right: 0;
	border-bottom: 1px solid var(--hmt-line);
}

.hmt--vertical .hmt__link {
	display: block;
	padding: calc(var(--hmt-pad-y) * 1.25) calc(var(--hmt-pad-x) * .85);
	white-space: normal;
}

.hmt--vertical .hmt__meta {
	display: flex;
	margin-bottom: .15rem;
}

.hmt--vertical .hmt__title,
.hmt--vertical .hmt__excerpt {
	display: block;
}

.hmt--vertical .hmt__excerpt {
	margin-top: .2rem;
}

.hmt--vertical .hmt__tools {
	justify-content: space-between;
	padding: .4rem .75rem;
	border-left: 0;
	border-top: 1px solid var(--hmt-line);
}

@media (max-width: 600px) {
	.hmt--horizontal {
		flex-wrap: wrap;
	}

	.hmt--horizontal .hmt__tools {
		flex: 1 0 100%;
		order: 3;
		justify-content: space-between;
		padding: .3rem .75rem;
		border-left: 0;
		border-top: 1px solid var(--hmt-line);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmt .hmt__track {
		animation: none !important;
	}

	.hmt .hmt__viewport {
		overflow: auto !important;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.hmt .hmt__clone,
	.hmt .hmt__toggle {
		display: none !important;
	}
}
