/* =========================================================
   MADRID INFORMACIÓN · PLANTILLA DE ARTÍCULO ANCHO
   ========================================================= */


/* Normalización dentro de la plantilla */

.mi-single,
.mi-single *,
.mi-single *::before,
.mi-single *::after {
	box-sizing: border-box;
}


/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.mi-single {
	width: 100%;
	max-width: none;
	margin: 0;
	padding:
		clamp(18px, 2.5vw, 34px)
		clamp(12px, 2vw, 28px)
		clamp(40px, 5vw, 72px);
	background: #fff;
}

.mi-single__article {
	width: 100%;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0;
}


/* =========================================================
   METADATOS
   ========================================================= */

.mi-single__header {
	width: 100%;
	margin: 0 auto 18px;
	padding: 0;
}

.mi-single__meta {
	display: flex;
	align-items: center;
	justify-content: center;
	align-content: center;
	flex-wrap: wrap;
	gap: 8px;

	width: fit-content;
	max-width: 100%;
	margin-right: auto;
	margin-left: auto;
	padding: 0;
}

.mi-single__meta-item {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 7px;

	min-height: 38px;
	padding: 8px 14px;

	border: 1px solid rgba(62, 122, 140, 0.18);
	border-radius: 999px;

	background:
		linear-gradient(
			135deg,
			rgba(255, 255, 255, 0.98),
			rgba(232, 242, 244, 0.92)
		);

	box-shadow:
		0 5px 16px rgba(21, 56, 70, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);

	color: #365966;
	font-size: 13px;
	font-weight: 650;
	line-height: 1.25;
	text-align: center;
}

.mi-single__meta-symbol {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	color: #397b8d;
}

.mi-single__meta-symbol svg {
	display: block;
	width: 17px;
	height: 17px;
}

.mi-single__category-links {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 5px;
}

.mi-single__category-links a {
	color: #245f72;
	font-weight: 750;
	text-decoration: none;
}

.mi-single__category-links a:hover {
	color: #163f4e;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mi-single__category-separator {
	color: #94aab2;
	font-weight: 400;
}


/* =========================================================
   METADATOS DESTACADOS
   ========================================================= */


/* ETIQUETA TEMPORAL: ACTUALIZACIÓN */

.mi-single__meta-item--update {
	border-color: rgba(126, 55, 221, 0.55);

	background:
		linear-gradient(
			135deg,
			#6d28d9 0%,
			#8b3fe8 55%,
			#a855f7 100%
		);

	box-shadow:
		0 6px 18px rgba(109, 40, 217, 0.24),
		inset 0 1px 0 rgba(255, 255, 255, 0.24);

	color: #fff;

	font-size: 12px;
	font-weight: 850;
	letter-spacing: 0.045em;
	text-transform: uppercase;
}

.mi-single__meta-item--update .mi-single__meta-symbol {
	color: #fff;
}


/* CATEGORÍAS PRINCIPALES */

.mi-single__meta-item--categories {
	border-color: rgba(38, 104, 124, 0.65);

	background:
		linear-gradient(
			135deg,
			#245f72 0%,
			#397f91 100%
		);

	box-shadow:
		0 6px 18px rgba(31, 88, 106, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);

	color: #fff;
	font-weight: 800;
}

.mi-single__meta-item--categories .mi-single__meta-symbol {
	color: #fff;
}

.mi-single__meta-item--categories .mi-single__category-links a {
	color: #fff;
	font-weight: 800;
}

.mi-single__meta-item--categories .mi-single__category-links a:hover {
	color: #fff;
	opacity: 0.84;
}

.mi-single__meta-item--categories .mi-single__category-separator {
	color: rgba(255, 255, 255, 0.65);
}


/* =========================================================
   AJUSTE DINÁMICO DE LOS METADATOS
   ========================================================= */


/*
 * Cuando no existe la etiqueta Actualización,
 * categoría y fecha forman un grupo centrado.
 */

.mi-single__meta--without-update {
	width: fit-content;
	justify-content: center;
}


/*
 * Cuando existe Actualización, las tres cápsulas
 * forman también un conjunto centrado.
 */

.mi-single__meta--with-update {
	width: fit-content;
	justify-content: center;
}


/* =========================================================
   CUERPO DEL ARTÍCULO
   ========================================================= */

.mi-single__content {
	width: 100%;
	max-width: none;
	margin: 0 auto;
	padding: 0;
}


/*
 * Los elementos insertados directamente en el editor reciben
 * un margen mínimo. Evita que texto, títulos o bloques sin tarjeta
 * queden pegados al borde de la pantalla.
 */

.mi-single__content > * {
	max-width: 1260px;
	margin-right: auto;
	margin-left: auto;
}


/*
 * El artículo HTML principal puede aprovechar casi todo el ancho,
 * pero conserva siempre una pequeña separación lateral.
 */

.mi-single__content > article,
.mi-single__content > section,
.mi-single__content > div:not(.wp-block-shortcode) {
	width: 100%;
	max-width: 1260px;
}


/* Textos sueltos creados fuera del artículo HTML */

.mi-single__content > p,
.mi-single__content > h1,
.mi-single__content > h2,
.mi-single__content > h3,
.mi-single__content > h4,
.mi-single__content > ul,
.mi-single__content > ol,
.mi-single__content > blockquote {
	width: calc(100% - 16px);
	max-width: 1180px;
}


/* Multimedia segura */

.mi-single__content img,
.mi-single__content video,
.mi-single__content iframe,
.mi-single__content table,
.mi-single__content figure {
	max-width: 100%;
}

.mi-single__content img {
	height: auto;
}


/* =========================================================
   SHORTCODE DE HISTORIAS
   ========================================================= */


/*
 * Limita el bloque de shortcode completo.
 */

.mi-single__content > .wp-block-shortcode {
	display: block;
	width: calc(100% - 24px) !important;
	max-width: 1120px !important;
	margin:
		clamp(22px, 3vw, 38px)
		auto !important;
	padding: 0 !important;
}


/*
 * Impide que el contenido generado por el shortcode fuerce
 * 100vw, márgenes negativos o desbordamientos.
 */

.mi-single__content > .wp-block-shortcode > * {
	width: 100% !important;
	max-width: 100% !important;
	margin-right: auto !important;
	margin-left: auto !important;
	left: auto !important;
	right: auto !important;
	transform: none !important;
}


/*
 * Selectores adicionales para el shortcode de Historias.
 * Cubren varios nombres posibles del contenedor generado.
 */

.mi-single__content .mi-historias-avisos,
.mi-single__content .mi-historias,
.mi-single__content .mi-avisos-historias,
.mi-single__content [class*="historias-avisos"],
.mi-single__content [class*="historias_avisos"] {
	width: 100% !important;
	max-width: 1120px !important;
	margin-right: auto !important;
	margin-left: auto !important;
}


/*
 * Evita scroll lateral si algún elemento interno intenta
 * escapar del contenedor.
 */

.mi-single__content,
.mi-single__content > .wp-block-shortcode {
	overflow-x: clip;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

	.mi-single {
		padding-right: 16px;
		padding-left: 16px;
	}

	.mi-single__content > .wp-block-shortcode {
		width: calc(100% - 12px) !important;
	}

}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 767px) {

	.mi-single {
		padding:
			12px
			10px
			42px;
	}

	.mi-single__header {
		margin-bottom: 12px;
	}

	.mi-single__meta {
		width: fit-content;
		max-width: 100%;
		gap: 6px;
	}

	.mi-single__meta--without-update,
	.mi-single__meta--with-update {
		justify-content: center;
	}

	.mi-single__meta-item {
		min-height: 35px;
		padding: 7px 11px;
		font-size: 12px;
	}

	.mi-single__meta-item--update,
	.mi-single__meta-item--categories {
		min-height: 36px;
	}

	.mi-single__meta-item--categories {
		max-width: 100%;
	}

	.mi-single__content {
		width: 100%;
	}

	.mi-single__content > * {
		max-width: 100%;
	}

	.mi-single__content > article,
	.mi-single__content > section,
	.mi-single__content > div:not(.wp-block-shortcode) {
		width: 100%;
		max-width: 100%;
	}

	.mi-single__content > p,
	.mi-single__content > h1,
	.mi-single__content > h2,
	.mi-single__content > h3,
	.mi-single__content > h4,
	.mi-single__content > ul,
	.mi-single__content > ol,
	.mi-single__content > blockquote {
		width: calc(100% - 8px);
	}

	.mi-single__content > .wp-block-shortcode {
		width: calc(100% - 12px) !important;
		max-width: 100% !important;
		margin-top: 18px !important;
		margin-bottom: 22px !important;
	}

}


/* =========================================================
   MÓVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 390px) {

	.mi-single {
		padding-right: 8px;
		padding-left: 8px;
	}

	.mi-single__meta-item {
		padding-right: 9px;
		padding-left: 9px;
		font-size: 11.5px;
	}

}