/* El correo de la barra superior heredaba el azul de los enlaces sobre el fondo navy. */
.site-topbar a,
.elementor-widget-text-editor .container a[href^="mailto:"] {
	color: #fff !important;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	white-space: normal;
}

.site-topbar a:hover,
.site-topbar a:focus-visible,
.elementor-widget-text-editor .container a[href^="mailto:"]:hover,
.elementor-widget-text-editor .container a[href^="mailto:"]:focus-visible {
	color: #f0d010 !important;
}

.site-topbar .container,
.elementor-widget-text-editor .container:has(a[href^="mailto:"]) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem 1.25rem;
	width: min(100% - 2rem, 72rem);
	max-width: 72rem;
	margin-inline: auto;
	overflow: visible;
}

.elementor-widget-text-editor:has(a[href^="mailto:"]) .elementor-widget-container {
	overflow: visible;
}

/* Astra usa una fila flexible para el contenido y la barra lateral.
   La ficha queda como único hijo y se pega a la izquierda. */
body.cpd-entrada .ast-container,
body.cpd-entrada #primary,
body.cpd-entrada .site-content > .ast-container,
body.cpd-entrada.ast-plain-container.ast-no-sidebar #primary,
body.cpd-entrada.ast-separate-container .site-content > .ast-container {
	display: block !important;
	max-width: none !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.cpd-entrada #contenido,
body.cpd-entrada main {
	display: block;
	width: 100%;
	max-width: none;
	margin-left: auto;
	margin-right: auto;
}

body.cpd-entrada .breadcrumbs,
body.cpd-entrada .e-section--alt {
	width: 100%;
	background: #fff;
}

body.cpd-entrada .breadcrumbs > .container,
body.cpd-entrada .e-section--alt > .container,
body.cpd-entrada #contenido > .e-section > .container {
	width: min(100% - 2rem, 72rem);
	max-width: 72rem;
	margin-left: auto !important;
	margin-right: auto !important;
}

body.cpd-entrada .media-figure img,
body.cpd-entrada .article-body img {
	width: 100%;
	height: auto;
}

.cpd-tipos {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.cpd-tipos a {
	display: block;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	background: #f4f7fb;
	color: var(--cpd-navy, #103070);
	text-decoration: none;
	font-weight: 600;
}

.cpd-tipos a:hover,
.cpd-tipos a:focus-visible {
	background: #e4edf6;
	color: var(--cpd-navy, #103070);
}

.cpd-tipos a[aria-current="page"] {
	background: var(--cpd-navy, #103070);
	color: #fff;
}

body.cpd-entrada .news-layout {
	align-items: start;
}

body.cpd-entrada .news-layout .card-list {
	margin-top: 1rem;
}

/* —— Ancho completo por defecto (Astra + Elementor) —— */
body.cpd-full-width .site-content,
body.cpd-full-width #content,
body.cpd-full-width #primary,
body.cpd-full-width #main,
body.cpd-full-width .ast-container,
body.cpd-full-width .ast-container-fluid,
body.cpd-full-width .site-content > .ast-container,
body.cpd-full-width.ast-plain-container .site-content > .ast-container,
body.cpd-full-width.ast-page-builder-template .site-content,
body.cpd-full-width .entry-content,
body.cpd-full-width .ast-article-single {
	max-width: none !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.cpd-full-width #secondary,
body.cpd-full-width .widget-area {
	display: none !important;
}

body.cpd-full-width .elementor-section.elementor-section-boxed > .elementor-container {
	max-width: 1140px;
}

body.cpd-full-width .elementor-section.elementor-section-stretched,
body.cpd-full-width .elementor-top-section,
body.cpd-full-width .e-con.e-parent {
	width: 100%;
}

/* Navbar mockup: refuerzo si Elementor envuelve el HTML */
.elementor-location-header .site-header .container,
.elementor-widget-html .site-header .container {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 0.75rem;
	row-gap: 0.2rem;
	width: min(100% - 2rem, 72rem);
	max-width: 72rem;
	margin-inline: auto;
	padding-block: 0.65rem 0.55rem;
}
.elementor-widget-html .site-header .brand {
	grid-column: 1 / -1;
	grid-row: 1;
	max-width: 280px;
}
.elementor-widget-html .site-header .primary-nav {
	grid-column: 1;
	grid-row: 2;
	justify-content: flex-start;
}
.elementor-widget-html .site-header .header-search {
	grid-column: 2;
	grid-row: 2;
}
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
	color: var(--cpd-navy, #103070) !important;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

/* Compartir: botones icono (legacy texto → círculo) */
.share-bar__actions .share-btn,
.cpd-repo-share__actions .cpd-repo-share__btn,
.cpd-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	min-height: 2.75rem;
	padding: 0;
	border-radius: 999px;
	border: 1px solid var(--cpd-border, #c5d0dc);
	background: #f5f8fb;
	color: var(--cpd-navy, #103070) !important;
	text-decoration: none;
	line-height: 0;
	font-size: 0;
	overflow: hidden;
}
.share-bar__actions .share-btn svg,
.cpd-repo-share__actions .cpd-repo-share__btn svg,
.cpd-share__btn svg {
	display: block;
}

/* Header vía [cpd_header] legacy */
.elementor-widget-shortcode .site-topbar,
.elementor-widget-shortcode .site-header,
.elementor-shortcode .site-topbar,
.elementor-shortcode .site-header {
	width: 100%;
	max-width: none;
}
.elementor-widget-shortcode > .elementor-widget-container,
.elementor-shortcode {
	overflow: visible;
}

/* Chrome CPD embebido: full bleed */
.cpd-ei-topbar,
.cpd-ei-header,
.cpd-ei-footer,
.elementor-location-header,
.elementor-location-footer {
	width: 100% !important;
	max-width: none !important;
}
.cpd-ei-topbar {
	background: #103070 !important;
}
.cpd-ei-topbar .elementor-widget-text-editor,
.cpd-ei-topbar .elementor-widget-text-editor a,
.cpd-ei-topbar .elementor-widget-text-editor p {
	color: #fff !important;
}
.cpd-ei-topbar .elementor-widget-container {
	overflow: visible;
}

/*
 * Menú: lo controla el widget Nav Menu de Elementor (hamburguesa en el breakpoint del widget).
 * No forzar el menú horizontal en móvil.
 */
/* El kit deja header y footer en position:fixed; en la ficha se montan sobre el texto. */
.elementor-location-header,
.elementor-location-footer {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	z-index: auto;
}
.cpd-ei-topbar {
	font-size: 0.875rem;
}

/* Tarjetas del shortcode y de la página /noticias/. No altera otras páginas. */

/* Noticias archive: romper la grilla del widget Posts de Elementor. */
body.cpd-noticias-archive .elementor-widget-posts,
body.cpd-noticias-archive .elementor-widget-posts .elementor-widget-container,
body.cpd-noticias-archive .elementor-widget-posts .elementor-posts-container,
body.cpd-noticias-archive .elementor-widget-posts .elementor-posts,
body.cpd-noticias-archive .elementor-widget-posts .elementor-grid {
	display: block !important;
	grid-template-columns: none !important;
	width: 100% !important;
	max-width: 100% !important;
	gap: 0 !important;
	float: none !important;
}
body.cpd-elementor-single .ast-single-entry-banner,
body.cpd-elementor-single .ast-single-post-featured-section,
body.cpd-elementor-single .ast-archive-entry-banner {
	display: none !important;
}
body.cpd-elementor-single .cpd-elementor-single-main {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}
/* El widget Posts de Elementor sigue en grid de N columnas; el feed debe ocupar todo el ancho. */
.elementor-widget-posts .elementor-widget-container:has(.cpd-news-feed),
.elementor-posts-container:has(.cpd-news-feed),
.elementor-grid:has(.cpd-news-feed),
.elementor-posts:has(.cpd-news-feed) {
	display: block !important;
	grid-template-columns: none !important;
	width: 100% !important;
	max-width: 100% !important;
}
.cpd-news-feed {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.cpd-news-grid,
.card-list:has(.cpd-news-tile) {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
	box-sizing: border-box;
}
.cpd-news-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cpd-news-grid--1 { grid-template-columns: 1fr; }
.cpd-news-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cpd-news-tile {
	margin: 0;
	min-width: 0;
	width: 100%;
}
.cpd-news-feed.is-loading {
	opacity: 0.72;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.cpd-news-years {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin: 0 0 1.15rem;
	padding: 0;
}
.cpd-news-year {
	appearance: none;
	border: 1px solid #103070;
	background: #fff;
	color: #103070;
	border-radius: 999px;
	padding: 0.4rem 0.95rem;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cpd-news-year:hover,
.cpd-news-year:focus-visible {
	background: #e8eef8;
	outline: none;
}
.cpd-news-year.is-active {
	background: #103070;
	border-color: #103070;
	color: #fff;
}
.cpd-news-more {
	margin: 1.25rem 0 0;
	text-align: center;
	color: #103070;
	font-size: 0.95rem;
}
.cpd-news-empty {
	margin: 0.5rem 0 1rem;
}
.cpd-news-year-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin: 1.5rem 0 0.25rem;
}
.cpd-news-year-nav__btn {
	appearance: none;
	border: 1px solid #103070;
	background: #103070;
	color: #fff;
	border-radius: 10px;
	padding: 0.7rem 1.1rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.cpd-news-year-nav__btn:hover,
.cpd-news-year-nav__btn:focus-visible {
	background: #1050a0;
	outline: none;
}
.cpd-news-tile a {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	width: 100%;
	border-radius: 16px;
	overflow: hidden;
	color: #fff;
	text-decoration: none;
	background: #1c2433;
	isolation: isolate;
}
.cpd-news-tile img,
.cpd-news-tile__ph {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cpd-news-tile a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(16, 48, 112, 0.72);
	backdrop-filter: blur(5px);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}
.cpd-news-tile a:hover::before,
.cpd-news-tile a:focus-visible::before {
	opacity: 1;
}
.cpd-news-tile__title {
	position: absolute;
	inset: 0;
	z-index: 2;
	box-sizing: border-box;
	margin: 0;
	padding: 1.05rem 1.15rem;
	color: #fff;
	font-weight: 800;
	font-size: clamp(0.78rem, 1.05vw, 0.95rem);
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	text-align: center;
	background: none;
	opacity: 0;
	transition: opacity 0.25s ease;
	overflow: hidden;
	hyphens: auto;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	align-content: center;
}
.cpd-news-tile a:hover .cpd-news-tile__title,
.cpd-news-tile a:focus-visible .cpd-news-tile__title {
	opacity: 1;
}
.cpd-news-tile--text a,
.cpd-news-tile--text .cpd-news-tile__ph {
	background: #103070;
}
.cpd-news-tile--text .cpd-news-tile__title {
	opacity: 1;
}
.cpd-news-tile--text a:hover::before,
.cpd-news-tile--text a:focus-visible::before {
	opacity: 0.28;
}
@media (max-width: 1100px) {
	.cpd-news-grid,
	.cpd-news-grid--3,
	.cpd-news-grid--4,
	.card-list:has(.cpd-news-tile) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 700px) {
	.cpd-news-grid,
	.cpd-news-grid--2,
	.cpd-news-grid--3,
	.cpd-news-grid--4,
	.card-list:has(.cpd-news-tile) {
		grid-template-columns: 1fr;
	}
}

.cpd-news-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	margin: 1.35rem 0 0.35rem;
}
.cpd-news-pager__pages {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}
.cpd-news-pager__btn,
.cpd-news-pager__num {
	appearance: none;
	border: 1px solid #103070;
	background: #fff;
	color: #103070;
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
	line-height: 1.2;
}
.cpd-news-pager__num.is-active,
.cpd-news-pager__btn:not([disabled]):hover,
.cpd-news-pager__num:hover {
	background: #103070;
	color: #fff;
}
.cpd-news-pager__btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}
.cpd-news-pager__ellipsis {
	color: #103070;
	padding: 0 0.2rem;
}
