/**
 * Estilos complementarios — Red Revistas Científicas
 * Paleta: #072752 + acento #FD9800
 */

:root {
	--rr-brand: #072752;
	--rr-brand-dark: #051c38;
	--rr-brand-darker: #041222;
	--rr-brand-light: #1a5a9e;
	--rr-brand-muted: #e8eef6;
	--rr-accent: #FD9800;
	--rr-accent-dark: #E08800;
	--rr-accent-darker: #CC7A00;
	--rr-accent-light: #FFB74D;
	--rr-accent-muted: #FFF3E0;
	/* Alias compatibles con componentes existentes */
	--rr-orange: var(--rr-accent);
	--rr-orange-dark: var(--rr-accent-dark);
	--rr-orange-darker: var(--rr-accent-darker);
	--rr-orange-light: var(--rr-accent-light);
	--rr-orange-muted: var(--rr-accent-muted);
}

/* ── Header: capas (redes → logo → menú) ────────────── */
.site-header {
	width: 100%;
	z-index: 200;
	transition: box-shadow 0.3s ease;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
}

.site-header > .wp-block-group {
	margin: 0 !important;
	gap: 0 !important;
}

/* Inicio: header flota sobre el banner */
.home-hero-wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.home-hero-wrapper > .site-header,
.home-hero-wrapper > .rr-banner,
.home-hero-wrapper > * {
	margin: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

body.home .site-header.is-overlay,
.home-hero-wrapper .site-header.is-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
}

body.admin-bar.home .site-header.is-overlay,
body.admin-bar .home-hero-wrapper .site-header.is-overlay {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar.home .site-header.is-overlay,
	body.admin-bar .home-hero-wrapper .site-header.is-overlay {
		top: 46px;
	}
}

/* Fijo al hacer scroll: solo la barra de menú, pegada al borde superior */
.header-nav-bar.is-nav-fixed {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 300;
	box-shadow: 0 2px 12px rgba(7, 39, 82, 0.28);
	margin: 0 !important;
}

/* Franja superior — redes sociales */
.header-social-bar {
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(4px);
}

.header-social-bar p {
	margin: 0;
	color: #fff;
	opacity: 0.95;
}

.header-social-links .wp-block-social-link-anchor {
	color: #fff !important;
}

.header-social-links .wp-block-social-link-anchor:hover {
	color: var(--rr-orange-light) !important;
}

/* Franja del logo — fondo blanco sólido, alineado a la izquierda */
.header-logo-bar {
	background: #ffffff !important;
	margin: 0 !important;
}

.header-logo-bar > .wp-block-group {
	max-width: 1200px;
	margin-inline: auto;
	width: 100%;
}

.header-site-logo,
.header-logo-bar .wp-block-site-logo {
	display: flex;
	justify-content: flex-start;
	line-height: 0;
}

.header-site-logo img,
.header-logo-bar .wp-block-site-logo img,
.site-header .header-site-logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(300px, 55vw);
	max-height: 72px;
	margin: 0;
	object-fit: contain;
	object-position: left center;
}

@media (min-width: 782px) {
	.header-site-logo img,
	.header-logo-bar .wp-block-site-logo img {
		max-width: 320px;
		max-height: 80px;
	}
}

@media (max-width: 600px) {
	.header-logo-bar {
		padding-top: 0.75rem !important;
		padding-bottom: 0.75rem !important;
	}

	.header-site-logo img,
	.header-logo-bar .wp-block-site-logo img {
		max-width: 220px;
		max-height: 56px;
	}
}

/* Menú principal — azul institucional */
.header-nav-bar {
	background-color: var(--rr-brand) !important;
	margin: 0 !important;
	margin-bottom: 0 !important;
}

.header-nav-bar > .wp-block-group,
.header-nav-bar .wp-block-navigation {
	margin: 0 !important;
}

.header-main-nav .wp-block-navigation-item__content,
.header-main-nav .wp-block-navigation-item__label {
	color: #ffffff !important;
	font-weight: 500;
	text-decoration: none;
}

.header-main-nav .wp-block-navigation-item__content:hover,
.header-main-nav .current-menu-item .wp-block-navigation-item__content {
	color: #fff !important;
	opacity: 0.85;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.header-main-nav .wp-block-navigation__responsive-container-open,
.header-main-nav .wp-block-navigation__responsive-container-close {
	color: #ffffff;
}

/* Menú móvil */
.header-main-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--rr-brand-darker);
}

.header-main-nav .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	color: #fff !important;
}

/* Espacio para páginas sin banner */
body:not(.home) {
	padding-top: 0;
}

/* ── Carrusel bajo el header en inicio ──────────────── */
body.home .rr-banner,
.home-hero-wrapper .rr-banner {
	margin: 0 !important;
	margin-block-start: 0 !important;
	padding: 0 !important;
}

body.home .rr-banner__track {
	height: 520px;
}

@media (min-width: 782px) {
	body.home .rr-banner__track {
		height: 580px;
	}
}

.rr-banner {
	position: relative;
	width: 100%;
	max-height: 600px;
	overflow: hidden;
	background: var(--rr-brand-darker);
}

.rr-banner--empty {
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	color: #fff;
	text-align: center;
}

.rr-banner__track {
	position: relative;
	width: 100%;
	height: 420px;
}

@media (min-width: 782px) {
	.rr-banner__track {
		height: 480px;
	}
}

.rr-banner__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease, visibility 0.6s ease;
}

.rr-banner__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.rr-banner__slide .rr-banner__link {
	display: block;
	width: 100%;
	height: 100%;
}

.rr-banner__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rr-banner__caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 1.25rem 1.5rem;
	background: linear-gradient(transparent, rgba(7, 39, 82, 0.9));
	color: #fff;
	z-index: 2;
}

.rr-banner__caption p {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 500;
	max-width: 1200px;
	margin-inline: auto;
}

.rr-banner__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	cursor: pointer;
	font-size: 1.25rem;
	color: var(--rr-brand);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.rr-banner__arrow:hover,
.rr-banner__arrow:focus {
	background: #fff;
	outline: 2px solid var(--rr-accent);
	outline-offset: 2px;
}

.rr-banner__arrow--prev {
	left: 1rem;
}

.rr-banner__arrow--next {
	right: 1rem;
}

.rr-banner__dots {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	display: flex;
	gap: 0.5rem;
}

.rr-banner__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: transparent;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease;
}

.rr-banner__dot.is-active,
.rr-banner__dot:hover {
	background: #fff;
}

@media (max-width: 600px) {
	.rr-banner__arrow {
		width: 36px;
		height: 36px;
		font-size: 1rem;
	}

	.rr-banner__arrow--prev {
		left: 0.5rem;
	}

	.rr-banner__arrow--next {
		right: 0.5rem;
	}

	.rr-banner__caption p {
		font-size: 0.95rem;
	}
}

/* ── Tarjetas universidades (estilo IESED instituciones) */
.universidad-card {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	text-align: center;
}

.universidad-card:hover {
	box-shadow: 0 4px 16px rgba(7, 39, 82, 0.14);
	transform: translateY(-2px);
}

.universidad-logo img {
	max-height: 80px;
	width: auto;
	object-fit: contain;
	margin: 0 auto;
}

.universidad-card h4 a {
	text-decoration: none;
	color: var(--wp--preset--color--heading);
}

.universidad-card h4 a:hover {
	color: var(--wp--preset--color--accent);
}

/* ── Noticias y eventos (inicio) ────────────────────── */
.rr-noticias-eventos {
	background: #ffffff;
	padding: 3.5rem 1.5rem;
}

.rr-noticias-eventos__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 2.5rem;
	align-items: start;
}

.rr-section-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.75rem;
	border-bottom: 2px solid var(--rr-brand);
	padding-bottom: 0.75rem;
}

.rr-section-header--sidebar {
	border-bottom-color: var(--rr-brand-light);
}

.rr-section-header__accent {
	width: 4px;
	height: 1.75rem;
	background: var(--rr-accent);
	border-radius: 2px;
	flex-shrink: 0;
}

.rr-section-header__title {
	margin: 0;
	flex: 1;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--rr-brand);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.rr-section-header__more {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--rr-orange);
	color: #fff;
	text-decoration: none;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
	transition: background 0.2s ease;
}

.rr-section-header__more:hover {
	background: var(--rr-orange-darker);
	color: #fff;
}

/* Carrusel de noticias */
.rr-noticias-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.rr-noticias-carousel__viewport {
	overflow: hidden;
	flex: 1;
}

.rr-noticias-carousel__track {
	display: flex;
	gap: 1.5rem;
	transition: transform 0.5s ease;
	will-change: transform;
}

.rr-noticias-carousel__slide {
	flex: 0 0 calc((100% - 3rem) / 3);
	min-width: 0;
}

.rr-noticia-card {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease;
}

.rr-noticia-card:hover {
	box-shadow: 0 4px 16px rgba(253, 152, 0, 0.15);
}

.rr-noticia-card__image-link {
	display: block;
	line-height: 0;
}

.rr-noticia-card__image {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.rr-noticia-card__image--placeholder {
	background: var(--rr-brand-muted);
	height: 180px;
}

.rr-noticia-card__body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.rr-noticia-card__title {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
}

.rr-noticia-card__title a {
	color: var(--rr-brand);
	text-decoration: none;
}

.rr-noticia-card__title a:hover {
	color: var(--rr-orange);
}

.rr-noticia-card__excerpt {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	color: #555;
	line-height: 1.55;
	flex: 1;
}

.rr-noticia-card__more {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--rr-orange);
	text-decoration: none;
	margin-top: auto;
}

.rr-noticia-card__more:hover {
	color: var(--rr-orange-darker);
	text-decoration: underline;
}

.rr-noticias-carousel__arrow {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: var(--rr-brand-muted);
	color: var(--rr-brand);
	cursor: pointer;
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.rr-noticias-carousel__arrow:hover:not(:disabled),
.rr-noticias-carousel__arrow:focus:not(:disabled) {
	background: var(--rr-orange);
	color: #fff;
}

.rr-noticias-carousel__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

/* Barra lateral — próximos eventos */
.rr-eventos-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.rr-evento-item {
	background: #f3f3f3;
	border-radius: 6px;
	padding: 1.25rem;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rr-evento-item__title {
	margin: 0 0 1rem;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.4;
}

.rr-evento-item__title a {
	color: #333;
	text-decoration: none;
}

.rr-evento-item__title a:hover {
	color: var(--rr-brand);
}

.rr-evento-item__link {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--rr-orange);
	text-decoration: none;
	letter-spacing: 0.03em;
}

.rr-evento-item__link:hover {
	color: var(--rr-orange-darker);
	text-decoration: underline;
}

.rr-noticias-eventos__empty {
	color: #666;
	font-size: 0.95rem;
	line-height: 1.5;
}

.rr-noticias-eventos__empty--sidebar {
	font-size: 0.875rem;
}

@media (max-width: 960px) {
	.rr-noticias-eventos__inner {
		grid-template-columns: 1fr;
	}

	.rr-noticias-eventos__sidebar {
		order: 2;
	}

	.rr-noticias-carousel__slide {
		flex: 0 0 calc((100% - 1.5rem) / 2);
	}
}

@media (max-width: 600px) {
	.rr-noticias-eventos {
		padding: 2.5rem 1rem;
	}

	.rr-noticias-carousel__slide {
		flex: 0 0 100%;
	}

	.rr-noticias-carousel__arrow {
		display: none;
	}

	.rr-section-header__title {
		font-size: 1.1rem;
	}
}

/* ── Noticias (patrón legacy) ───────────────────────── */
.noticia-card {
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.noticia-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.noticia-card .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--heading);
}

.noticia-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* ── Sección Datos de la red (inicio) ───────────────── */
.rr-datos-red-section {
	text-align: center;
}

.rr-datos-red-section > .wp-block-heading {
	margin-bottom: 0.5rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.rr-datos-red-section > p {
	max-width: 32rem;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 0;
	opacity: 0.88;
	line-height: 1.55;
	font-size: 0.95rem;
}

.rr-datos-red-section__cta .wp-block-button__link {
	min-width: 9.5rem;
	padding: 0.65rem 1.75rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rr-datos-red-section__cta .wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.rr-stats-grid--summary .rr-stat-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rr-stats-grid--summary .rr-stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

/* ── Estadísticas (plugin) — fallback sin variante ─── */
.has-primary-background-color .rr-stats-grid:not(.rr-stats-grid--summary):not(.rr-stats-grid--page) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1.5rem;
	margin: 2rem 0;
}

.has-primary-background-color .rr-stats-grid:not(.rr-stats-grid--summary):not(.rr-stats-grid--page) .rr-stat-card {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	padding: 1.5rem;
	text-align: center;
}

.has-primary-background-color .rr-stats-grid:not(.rr-stats-grid--summary):not(.rr-stats-grid--page) .rr-stat-icon {
	display: none;
}

.has-primary-background-color .rr-stats-grid:not(.rr-stats-grid--summary):not(.rr-stats-grid--page) .rr-stat-number {
	display: block;
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: #ffffff;
}

.has-primary-background-color .rr-stats-grid:not(.rr-stats-grid--summary):not(.rr-stats-grid--page) .rr-stat-label {
	display: block;
	font-size: 0.95rem;
	margin-top: 0.5rem;
	color: rgba(255, 255, 255, 0.92);
	opacity: 1;
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer .wp-block-navigation a {
	color: rgba(255, 255, 255, 0.9);
	text-decoration: none;
}

.site-footer .wp-block-navigation a:hover {
	color: #ffffff;
}

.site-footer .wp-block-separator {
	opacity: 0.3;
}

/* ── Citas ──────────────────────────────────────────── */
.wp-block-quote.is-style-large {
	border-left: 4px solid var(--wp--preset--color--primary);
	padding-left: 1.5rem;
}

.wp-block-quote cite {
	display: block;
	margin-top: 1rem;
	font-style: normal;
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark);
}

/* ── Archivos por categoría ─────────────────────────── */
.rr-archive {
	background: #ffffff;
}

.rr-archive-hero__title {
	color: var(--rr-brand) !important;
	font-size: 2rem !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin-bottom: 0.75rem !important;
}

.rr-archive-hero__description {
	color: #555;
	font-size: 1rem;
	line-height: 1.6;
	margin-bottom: 1.5rem;
	max-width: 720px;
}

.rr-category-nav {
	margin-bottom: 2rem;
}

.rr-category-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rr-category-nav__link {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--rr-brand);
	color: var(--rr-brand);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease;
}

.rr-category-nav__link:hover,
.rr-category-nav__link.is-active {
	background: var(--rr-orange);
	color: #fff;
}

.rr-archive-grid {
	gap: 1.5rem !important;
}

.rr-archive-query .rr-noticia-card {
	border: 1px solid #e8e8e8;
	border-radius: 4px;
	overflow: hidden;
	height: 100%;
}

.rr-archive-query .wp-block-post-featured-image {
	margin: 0;
}

.rr-archive-query .wp-block-post-featured-image img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.rr-archive-query .rr-noticia-card__body {
	padding: 1.25rem;
}

.rr-archive-query .rr-noticia-card__title {
	margin: 0 0 0.75rem;
}

.rr-archive-query .rr-noticia-card__title a {
	color: var(--rr-brand);
	text-decoration: none;
	font-weight: 700;
}

.rr-archive-query .rr-noticia-card__title a:hover {
	color: var(--rr-orange);
}

.rr-archive-query .rr-noticia-card__excerpt {
	color: #555;
	font-size: 0.9rem;
	line-height: 1.55;
	margin: 0;
}

.rr-archive-query .wp-block-post-excerpt__more-link {
	color: var(--rr-orange);
	font-weight: 600;
	text-decoration: none;
}

.rr-archive-query .wp-block-post-excerpt__more-link:hover {
	color: var(--rr-orange-darker);
	text-decoration: underline;
}

.rr-archive-pagination {
	margin-top: 2.5rem;
	gap: 0.5rem;
}

.rr-archive-pagination .wp-block-query-pagination-previous,
.rr-archive-pagination .wp-block-query-pagination-next,
.rr-archive-pagination .page-numbers {
	padding: 0.5rem 0.875rem;
	border-radius: 4px;
	color: var(--rr-brand);
	text-decoration: none;
}

.rr-archive-pagination .page-numbers.current {
	background: var(--rr-orange);
	color: #fff;
}

.rr-archive-empty {
	color: #666;
	padding: 2rem 0;
}

@media (max-width: 960px) {
	.rr-archive-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 600px) {
	.rr-archive-grid {
		grid-template-columns: 1fr !important;
	}

	.rr-archive-hero__title {
		font-size: 1.5rem !important;
	}
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 781px) {
	.universidades-grid {
		flex-direction: column;
	}

	.has-primary-background-color .rr-stat-number {
		font-size: 2rem;
	}
}
