/* Milla Tiempo AEMET — carrusel ligero, sin dependencias. */

/* ---- Ajuste de la franja superior del tema (solo con el componente insertado) ---- */
.mdt-in-topbar .top-header-wrap .left-side { flex: 0 0 auto; }
.mdt-in-topbar .top-header-wrap .right-side { flex: 1 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; }
.mdt-in-topbar .top-header-wrap .right-side .social-icons { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.mdt-in-topbar .top-header-wrap .right-side .social-icons > div,
.mdt-in-topbar .top-header-wrap .right-side .social-icons > ul { flex: 0 0 auto; }

/* ---- Componente ---- */
.mdt {
	--mdt-v: 3;
	--mdt-i: 0;
	--mdt-h: 24px;
	container: mdt / inline-size;
	display: flex;
	align-items: center;
	gap: 6px;
	height: var(--mdt-h);
	min-width: 0;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: var(--font-size-sm, 0.89rem);
	line-height: var(--mdt-h);
}
.mdt--topbar { flex: 1 1 auto; margin-inline: 24px 4px; }
.mdt--empty { visibility: hidden; }

.mdt__viewport { flex: 1 1 0; min-width: 0; overflow: hidden; }
.mdt .mdt__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translateX(calc(-100% / var(--mdt-v) * var(--mdt-i)));
	transition: transform 0.45s ease;
	will-change: transform;
}
.mdt.mdt--instant .mdt__track { transition: none; }
.mdt .mdt__item { flex: 0 0 calc(100% / var(--mdt-v)); min-width: 0; margin: 0; padding: 0; list-style: none; container: mdt-item / inline-size; }
.mdt .mdt__item::before, .mdt .mdt__item::marker { content: none; }

.mdt .mdt__link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--mdt-h);
	padding: 0 6px;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 3px;
}
.mdt .mdt__btn:focus-visible,
.mdt .mdt__src a:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }

.mdt__vis { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mdt__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mdt__name--short { display: none; }
.mdt__temp { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }

.mdt .mdt__icon,
.mdt .mdt__btn svg {
	flex: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
span.mdt__icon { display: inline-block; }

/* Controles */
.mdt__controls { display: none; flex: none; align-items: center; gap: 2px; }
.mdt--js .mdt__controls { display: flex; }
.mdt--static .mdt__controls { visibility: hidden; }
.mdt .mdt__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	opacity: 0.85;
	cursor: pointer;
}
.mdt .mdt__btn:hover { background: rgba(255, 255, 255, 0.16); opacity: 1; }
.mdt .mdt__btn svg { width: 16px; height: 16px; stroke-width: 2; }
.mdt .mdt__btn[data-mdt-toggle] svg { stroke-width: 2.2; }

/* Fuente y hora de la previsión */
.mdt .mdt__meta {
	flex: none;
	margin: 0 0 0 6px;
	padding: 0;
	font-size: 0.78em;
	line-height: var(--mdt-h);
	white-space: nowrap;
	opacity: 0.92;
}
.mdt .mdt__src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mdt__meta-short { display: none; }
.mdt__sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@container mdt-item (max-width: 250px) {
	.mdt__name--long { display: none; }
	.mdt__name--short { display: inline; }
}

@container mdt (max-width: 780px) {
	.mdt__meta-long { display: none; }
	.mdt__meta-short { display: inline; }
}

/* Tablet: dos ciudades si caben (el JS ajusta según el ancho real). */
@media (max-width: 1024px) {
	.mdt { --mdt-v: 2; }
	.mdt--topbar { margin-inline: 12px 0; }
}

/* Móvil: una ciudad; la fuente pasa a una segunda línea fija. */
@media (max-width: 600px) {
	.mdt { --mdt-v: 1; flex-wrap: wrap; height: calc(var(--mdt-h) + 16px); row-gap: 0; }
	.mdt .mdt__meta { flex: 0 0 100%; margin: 0; height: 16px; line-height: 16px; text-align: center; font-size: 11px; }
	.mdt-in-topbar .top-header-wrap .right-side { align-self: stretch; width: 100%; }
	.mdt-in-topbar .top-header-wrap .right-side .social-icons { flex-wrap: wrap; justify-content: center; row-gap: 4px; }
	.mdt--topbar { flex: 1 1 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.mdt .mdt__track { transition: none; }
}
