/* ==========================================================================
   UNJ Portal - estilos principales
   Paleta tomada de unj.edu.pe
   ========================================================================== */

:root {
	--unj-primary: #035aa6;
	--unj-primary-dark: #003d68;
	--unj-secondary: #0090d0;
	--unj-accent: #fcbf1e;
	--unj-accent-dark: #e5a800;
	--unj-slate: #393d4f;
	--unj-muted: #6a7293;
	--unj-border: #e2e7ef;
	--unj-light: #f3f6fa;
	--unj-white: #fff;

	--unj-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--unj-radius: 12px;
	--unj-radius-sm: 6px;
	--unj-shadow: 0 10px 30px rgba(3, 61, 104, 0.1);
	--unj-shadow-sm: 0 2px 10px rgba(3, 61, 104, 0.08);
	--unj-container: 1240px;
	--unj-gutter: clamp(16px, 4vw, 32px);
	--unj-topbar-h: 38px;
	--unj-mainbar-h: 84px;
	--unj-admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--unj-mainbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
	margin: 0;
	font-family: var(--unj-font);
	font-size: 1rem;
	line-height: 1.7;
	color: var(--unj-slate);
	background: var(--unj-white);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }
svg.icon { flex-shrink: 0; }

a { color: var(--unj-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--unj-secondary); }

h1, h2, h3, h4, h5, h6 {
	color: var(--unj-primary-dark);
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 0.6em;
}

:focus-visible { outline: 3px solid var(--unj-accent); outline-offset: 2px; border-radius: 3px; }

.container {
	width: 100%;
	max-width: calc(var(--unj-container) + var(--unj-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--unj-gutter);
}

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
	top: 8px; left: 8px; z-index: 100000; padding: 12px 20px;
	background: var(--unj-accent); color: var(--unj-primary-dark); font-weight: 700; border-radius: var(--unj-radius-sm);
}
.site-main:focus { outline: none; }
.text-center { text-align: center; }

/* ---------- Botones ---------- */
.btn,
.wp-block-button__link,
input[type="submit"],
button.submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 22px;
	border: 2px solid transparent;
	border-radius: var(--unj-radius-sm);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-primary, input[type="submit"] { background: var(--unj-primary); color: #fff; }
.btn-primary:hover, input[type="submit"]:hover { background: var(--unj-primary-dark); color: #fff; }
.btn-accent { background: var(--unj-accent); color: var(--unj-primary-dark); }
.btn-accent:hover { background: var(--unj-accent-dark); color: var(--unj-primary-dark); }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.85); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--unj-primary-dark); }

.badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--unj-accent);
	color: var(--unj-primary-dark);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.4;
}
.badge-light { background: rgba(3, 90, 166, 0.1); color: var(--unj-primary); }
a.badge:hover { color: var(--unj-primary-dark); filter: brightness(0.95); }

.link-arrow {
	display: inline-flex; align-items: center; gap: 6px;
	font-weight: 700; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.link-arrow .icon { transition: transform 0.2s; }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ==========================================================================
   Cabecera
   ========================================================================== */
.site-header {
	position: sticky;
	top: calc(var(--unj-admin-bar) - var(--unj-topbar-h));
	z-index: 1000;
	background: #fff;
	box-shadow: 0 1px 0 var(--unj-border);
	transition: box-shadow 0.2s;
}
.site-header.is-scrolled { box-shadow: var(--unj-shadow-sm); }

/* Barra superior */
.topbar {
	height: var(--unj-topbar-h);
	background: var(--unj-primary-dark);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.75rem;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 100%; }
.topbar-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-menu { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.topbar-menu a {
	display: block; padding: 4px 10px; border-radius: 4px;
	color: rgba(255, 255, 255, 0.85); font-weight: 500; text-decoration: none;
}
.topbar-menu a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.social-links { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.social-links a {
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
	color: inherit; transition: background-color 0.2s, color 0.2s;
}
.topbar-social a { color: rgba(255, 255, 255, 0.85); }
.topbar-social a:hover { background: var(--unj-accent); color: var(--unj-primary-dark); }

/* Barra principal */
.mainbar { position: relative; background: #fff; }
.mainbar-inner { display: flex; align-items: center; gap: 24px; min-height: var(--unj-mainbar-h); }

.site-branding { flex-shrink: 0; }
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { max-height: 56px; width: auto; }
.brand-text { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--unj-primary); }
.brand-mark {
	display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px;
	background: var(--unj-primary); color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em;
}
.brand-name { max-width: 170px; font-size: 0.8125rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; }

/* Menú principal (escritorio) */
.primary-nav { flex: 1; display: flex; justify-content: center; }
.primary-nav-head, .mobile-only { display: none; }
.primary-nav .menu { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.primary-nav li { position: relative; }
.primary-nav .menu > li { display: flex; align-items: center; }
.primary-nav .menu > li > a {
	position: relative;
	display: block;
	padding: 30px 12px;
	color: var(--unj-slate);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.primary-nav .menu > li.menu-item-has-children > a { padding-right: 4px; }
.primary-nav .menu > li > a::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 20px; height: 3px;
	border-radius: 3px; background: var(--unj-accent); transform: scaleX(0); transition: transform 0.2s;
}
.primary-nav .menu > li > a:hover,
.primary-nav .menu > li.is-open > a,
.primary-nav .menu > li.current-menu-item > a,
.primary-nav .menu > li.current-menu-ancestor > a { color: var(--unj-primary); }
.primary-nav .menu > li > a:hover::after,
.primary-nav .menu > li.current-menu-item > a::after,
.primary-nav .menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }

.submenu-toggle {
	display: grid; place-items: center; width: 24px; height: 28px; margin-right: 6px; padding: 0;
	border: 0; background: none; color: var(--unj-muted); cursor: pointer; border-radius: 4px;
}
.submenu-toggle svg { transition: transform 0.2s; }
li.is-open > .submenu-toggle svg { transform: rotate(180deg); }
.submenu-toggle:hover { color: var(--unj-primary); }

.primary-nav .sub-menu {
	position: absolute;
	top: calc(100% - 12px);
	left: 0;
	z-index: 20;
	min-width: 270px;
	max-width: 340px;
	margin: 0;
	padding: 10px;
	list-style: none;
	background: #fff;
	border-top: 3px solid var(--unj-primary);
	border-radius: 0 0 var(--unj-radius) var(--unj-radius);
	box-shadow: var(--unj-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.primary-nav li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu li { display: flex; align-items: center; justify-content: space-between; }
.primary-nav .sub-menu a {
	flex: 1;
	display: block;
	padding: 9px 12px;
	border-radius: var(--unj-radius-sm);
	color: var(--unj-slate);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
}
.primary-nav .sub-menu a:hover,
.primary-nav .sub-menu .current-menu-item > a { background: var(--unj-light); color: var(--unj-primary); }
.primary-nav .sub-menu .submenu-toggle svg { transform: rotate(-90deg); }
.primary-nav .sub-menu li.is-open > .submenu-toggle svg { transform: rotate(-90deg); color: var(--unj-primary); }
.primary-nav .sub-menu .sub-menu { top: -13px; left: calc(100% + 10px); border-radius: var(--unj-radius); }
/* Submenús del último elemento abren hacia la izquierda */
.primary-nav .menu > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; }
.primary-nav .menu > li:nth-last-child(-n+2) .sub-menu .sub-menu { left: auto; right: calc(100% + 10px); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
	display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--unj-primary-dark); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--unj-light); color: var(--unj-primary); }
.nav-toggle { display: none; }
.header-cta { padding: 10px 22px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8125rem; }

/* Variante: cabecera azul (para el logo blanco institucional) */
.header-blue .mainbar { background: var(--unj-primary); }
.header-blue .site-header { box-shadow: none; }
.header-blue .site-header.is-scrolled { box-shadow: 0 4px 18px rgba(0, 30, 60, 0.25); }
.header-blue .brand-text { color: #fff; }
.header-blue .brand-mark { background: #fff; color: var(--unj-primary); }
.header-blue .icon-btn { color: #fff; }
.header-blue .icon-btn:hover,
.header-blue .icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (min-width: 1081px) {
	.header-blue .primary-nav .menu > li > a { color: #fff; }
	.header-blue .primary-nav .menu > li > a:hover,
	.header-blue .primary-nav .menu > li.is-open > a,
	.header-blue .primary-nav .menu > li.current-menu-item > a,
	.header-blue .primary-nav .menu > li.current-menu-ancestor > a { color: var(--unj-accent); }
	.header-blue .primary-nav .menu > li > .submenu-toggle { color: rgba(255, 255, 255, 0.75); }
	.header-blue .primary-nav .menu > li > .submenu-toggle:hover { color: #fff; }
	.header-blue .primary-nav .sub-menu { border-top-color: var(--unj-accent); }
}

/* Panel de búsqueda */
.search-panel {
	position: absolute; left: 0; right: 0; top: 100%;
	padding: 20px 0; background: #fff; border-top: 1px solid var(--unj-border); box-shadow: var(--unj-shadow);
}
.search-form { display: flex; max-width: 720px; margin-inline: auto; }
.search-field {
	flex: 1; min-width: 0; padding: 14px 18px;
	border: 2px solid var(--unj-border); border-right: 0; border-radius: var(--unj-radius-sm) 0 0 var(--unj-radius-sm);
	font: inherit; color: var(--unj-slate); background: #fff;
}
.search-field:focus { outline: none; border-color: var(--unj-primary); }
.search-submit {
	display: grid; place-items: center; width: 56px; border: 0; cursor: pointer;
	border-radius: 0 var(--unj-radius-sm) var(--unj-radius-sm) 0; background: var(--unj-primary); color: #fff;
}
.search-submit:hover { background: var(--unj-primary-dark); }

/* ---------- Menú móvil ---------- */
@media (max-width: 1080px) {
	:root { --unj-topbar-h: 0px; --unj-mainbar-h: 70px; }
	.topbar { display: none; }
	.nav-toggle { display: grid; }
	.custom-logo { max-height: 44px; }

	.primary-nav {
		position: fixed;
		top: var(--unj-admin-bar);
		right: 0;
		bottom: 0;
		z-index: 1100;
		display: flex;
		flex-direction: column;
		width: min(380px, 88vw);
		padding: 0 0 32px;
		overflow-y: auto;
		background: #fff;
		box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
		transform: translateX(105%);
		visibility: hidden;
		transition: transform 0.28s ease, visibility 0.28s;
	}
	.nav-open .primary-nav { transform: none; visibility: visible; }
	.nav-open { overflow: hidden; }
	/* Debajo de .site-header (z-index 1000), que contiene el panel del menú */
	.nav-overlay {
		position: fixed; inset: 0; z-index: 999; background: rgba(0, 29, 52, 0.55);
	}
	.primary-nav-head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 14px 16px 14px 22px; background: var(--unj-primary); color: #fff;
		position: sticky; top: 0; z-index: 2;
	}
	.primary-nav-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8125rem; }
	.nav-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; }

	.primary-nav .menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
	.primary-nav .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--unj-border); }
	.primary-nav li { display: flex; flex-wrap: wrap; align-items: center; }
	.primary-nav .menu > li > a { flex: 1; padding: 15px 22px; }
	.primary-nav .menu > li.menu-item-has-children > a { padding-right: 8px; }
	.primary-nav .menu > li > a::after { display: none; }
	.submenu-toggle { width: 48px; height: 48px; margin: 0 6px 0 0; }
	.primary-nav .sub-menu,
	.primary-nav .sub-menu .sub-menu {
		position: static; flex-basis: 100%; min-width: 0; max-width: none;
		display: none; padding: 0 0 10px 14px; border: 0; border-radius: 0; box-shadow: none;
		opacity: 1; visibility: visible; transform: none; background: transparent;
	}
	.primary-nav .sub-menu .sub-menu { padding-bottom: 4px; }
	.primary-nav li.is-open > .sub-menu { display: block; }
	.primary-nav .sub-menu a { padding: 10px 12px; }
	.primary-nav .sub-menu .submenu-toggle svg { transform: none; }
	.primary-nav .sub-menu li.is-open > .submenu-toggle svg { transform: rotate(180deg); }

	.mobile-only { display: block; }
	.mobile-resources { padding: 18px 22px 0; }
	.mobile-resources-title { margin: 0 0 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--unj-muted); }
	.mobile-resources-menu { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 16px; }
	.mobile-resources-menu a { display: block; padding: 6px 0; font-size: 0.8125rem; text-decoration: none; color: var(--unj-slate); break-inside: avoid; }
}
@media (max-width: 520px) {
	.header-cta { padding: 9px 14px; font-size: 0.75rem; }
	.brand-name { display: none; }
	.mainbar-inner { gap: 8px; }
	.header-actions { gap: 4px; }
}

/* ==========================================================================
   Portada
   ========================================================================== */
.hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: clamp(72px, 10vw, 140px) 0 clamp(120px, 13vw, 180px);
	background: linear-gradient(135deg, var(--unj-primary-dark) 0%, var(--unj-primary) 60%, var(--unj-secondary) 100%);
	color: #fff;
}
.hero.has-image::before {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background: var(--hero-image) center / cover no-repeat;
}
.hero.has-image::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(100deg, rgba(0, 45, 80, 0.94) 0%, rgba(3, 90, 166, 0.82) 50%, rgba(3, 90, 166, 0.35) 100%);
}
.hero:not(.has-image)::after {
	content: ""; position: absolute; z-index: -1; right: -10%; top: -30%;
	width: 60vw; max-width: 760px; aspect-ratio: 1; border-radius: 50%;
	border: 80px solid rgba(255, 255, 255, 0.05);
	box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.03);
}
.hero-inner { max-width: calc(var(--unj-container) + var(--unj-gutter) * 2); }
.hero-kicker {
	display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
	font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--unj-accent);
}
.hero-kicker::before { content: ""; width: 32px; height: 3px; border-radius: 3px; background: var(--unj-accent); }
.hero-title {
	max-width: 760px; margin: 0 0 20px; color: #fff;
	font-size: clamp(2rem, 4.6vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
}
.hero-text { max-width: 620px; margin: 0 0 34px; font-size: clamp(1rem, 1.6vw, 1.1875rem); color: rgba(255, 255, 255, 0.88); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.features { position: relative; z-index: 2; margin-top: -72px; }
.features-grid {
	display: grid; grid-template-columns: repeat(3, 1fr);
	margin: 0; padding: 0; list-style: none;
	background: #fff; border-radius: var(--unj-radius); box-shadow: var(--unj-shadow);
}
.feature { display: flex; gap: 18px; align-items: flex-start; padding: 30px 28px; }
.feature + .feature { border-left: 1px solid var(--unj-border); }
.feature-icon {
	display: grid; place-items: center; width: 54px; height: 54px; flex-shrink: 0;
	border-radius: 14px; background: rgba(3, 90, 166, 0.08); color: var(--unj-primary);
}
.feature:nth-child(2) .feature-icon { background: rgba(252, 191, 30, 0.18); color: #b07f00; }
.feature:nth-child(3) .feature-icon { background: rgba(0, 144, 208, 0.12); color: var(--unj-secondary); }
.feature-title { margin: 2px 0 4px; font-size: 1.0625rem; }
.feature-title a { color: inherit; text-decoration: none; }
.feature-title a:hover { color: var(--unj-primary); }
.feature-text { margin: 0; font-size: 0.875rem; color: var(--unj-muted); line-height: 1.5; }
@media (max-width: 860px) {
	.features-grid { grid-template-columns: 1fr; }
	.feature + .feature { border-left: 0; border-top: 1px solid var(--unj-border); }
	.feature { padding: 22px; }
}

/* Secciones */
.section { padding: clamp(56px, 7vw, 96px) 0; }
.section-tight { padding: clamp(40px, 5vw, 64px) 0; }
.section-light { background: var(--unj-light); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head-center { justify-content: center; text-align: center; }
.section-kicker {
	margin: 0 0 6px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--unj-secondary);
}
.section-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -0.01em; }
.section-title::after {
	content: ""; display: block; width: 56px; height: 4px; margin-top: 14px; border-radius: 4px; background: var(--unj-accent);
}
.section-head-center .section-title::after { margin-inline: auto; }
.home-content { padding-bottom: 0; }

/* Programas */
.programs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.program-card {
	position: relative; display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border-radius: var(--unj-radius); box-shadow: var(--unj-shadow-sm);
	transition: transform 0.25s, box-shadow 0.25s;
}
.program-card:hover { transform: translateY(-4px); box-shadow: var(--unj-shadow); }
.program-media { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--unj-primary), var(--unj-secondary)); overflow: hidden; }
.program-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.program-card:hover .program-media img { transform: scale(1.05); }
.program-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 22px; }
.program-body .badge { align-self: flex-start; }
.program-title { margin: 0; font-size: 1.125rem; }
.program-title a { color: var(--unj-primary-dark); text-decoration: none; }
.program-excerpt { margin: 0; font-size: 0.875rem; color: var(--unj-muted); line-height: 1.55; }
.program-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: 0.875rem; font-weight: 700; color: var(--unj-primary); }
.program-card:hover .program-more { color: var(--unj-secondary); }
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* Noticias */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card {
	display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border: 1px solid var(--unj-border); border-radius: var(--unj-radius);
	transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: var(--unj-shadow); transform: translateY(-3px); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--unj-light); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-placeholder {
	display: grid; place-items: center; width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--unj-primary-dark), var(--unj-primary));
	color: rgba(255, 255, 255, 0.25); font-size: 2.5rem; font-weight: 800;
}
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 0.8125rem; color: var(--unj-muted); }
.meta-date { display: inline-flex; align-items: center; gap: 6px; }
.card-title { margin: 0; font-size: 1.0625rem; line-height: 1.4; }
.card-title a { color: var(--unj-primary-dark); text-decoration: none; }
.card-title a:hover { color: var(--unj-primary); }
.card-excerpt { margin: 0; font-size: 0.9rem; color: var(--unj-muted); line-height: 1.6; }

@media (min-width: 981px) {
	.news .card-featured { grid-column: span 2; grid-row: span 2; }
	.news .card-featured .card-media { aspect-ratio: 16 / 9; }
	.news .card-featured .card-title { font-size: 1.5rem; }
}
@media (max-width: 980px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .news-grid { grid-template-columns: 1fr; } }

/* Cifras */
.stats { padding: 56px 0; background: var(--unj-primary-dark); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 800; line-height: 1; color: var(--unj-accent); }
.stat-label { font-size: 0.9rem; font-weight: 500; color: rgba(255, 255, 255, 0.82); }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 36px; } }

/* Eventos */
.events-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.event-card {
	position: relative; display: flex; gap: 20px; align-items: center; padding: 20px;
	background: #fff; border-radius: var(--unj-radius); box-shadow: var(--unj-shadow-sm);
	transition: box-shadow 0.25s, transform 0.25s;
}
.event-card:hover { box-shadow: var(--unj-shadow); transform: translateY(-2px); }
.event-date {
	display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
	width: 76px; height: 82px; border-radius: 10px; background: var(--unj-primary); color: #fff; line-height: 1;
}
.event-day { font-size: 1.875rem; font-weight: 800; }
.event-month { margin-top: 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--unj-accent); }
.event-title { margin: 0 0 6px; font-size: 1rem; line-height: 1.4; }
.event-title a { color: var(--unj-primary-dark); text-decoration: none; }
.event-card:hover .event-title a { color: var(--unj-primary); }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--unj-muted); }
.event-meta li { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) { .events-grid { grid-template-columns: 1fr; } }

/* Enlaces de interés (widgets) */
.links-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; align-items: center; }
.links-grid .widget {
	display: grid; place-items: center; min-height: 100px; padding: 16px; margin: 0;
	background: #fff; border: 1px solid var(--unj-border); border-radius: var(--unj-radius);
	transition: box-shadow 0.2s, border-color 0.2s;
}
.links-grid .widget:hover { border-color: transparent; box-shadow: var(--unj-shadow-sm); }
.links-grid .widget img { max-height: 64px; width: auto; filter: grayscale(1); opacity: 0.75; transition: filter 0.2s, opacity 0.2s; }
.links-grid .widget:hover img { filter: none; opacity: 1; }
.links-grid .widget figure { margin: 0; }
.links-grid .widget-title { display: none; }

/* ==========================================================================
   Páginas interiores
   ========================================================================== */
.page-header {
	position: relative; overflow: hidden;
	padding: clamp(36px, 5vw, 64px) 0;
	background: linear-gradient(135deg, var(--unj-primary-dark) 0%, var(--unj-primary) 100%);
	color: #fff;
}
.page-header::after {
	content: ""; position: absolute; right: -80px; bottom: -160px; width: 360px; height: 360px;
	border-radius: 50%; border: 60px solid rgba(255, 255, 255, 0.05);
}
.page-title { position: relative; z-index: 1; max-width: 900px; margin: 0; color: #fff; font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -0.01em; }
.page-subtitle { position: relative; z-index: 1; max-width: 760px; margin-top: 12px; color: rgba(255, 255, 255, 0.85); font-size: 1.0625rem; }
.page-subtitle p { margin: 0; }
.page-header-meta { margin-bottom: 14px; color: rgba(255, 255, 255, 0.85); }
.breadcrumbs { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.75); }
.breadcrumbs a { color: rgba(255, 255, 255, 0.9); text-decoration: none; }
.breadcrumbs a:hover { color: var(--unj-accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs [aria-current] { color: #fff; font-weight: 600; }

.layout-narrow { max-width: calc(860px + var(--unj-gutter) * 2); }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.layout-sidebar-left { grid-template-columns: 280px minmax(0, 1fr); }
.layout-main { min-width: 0; }
@media (max-width: 980px) {
	.layout-sidebar, .layout-sidebar-left { grid-template-columns: 1fr; }
}

.news-grid-archive { grid-template-columns: repeat(2, 1fr); }
.layout-main:only-child .news-grid-archive { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .layout-main:only-child .news-grid-archive { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .news-grid-archive, .layout-main:only-child .news-grid-archive { grid-template-columns: 1fr; } }
.card-search .card-title { font-size: 1.125rem; }

/* Navegación de sección (páginas con subpáginas) */
.section-nav {
	position: sticky; top: calc(var(--unj-mainbar-h) + var(--unj-admin-bar) + 20px);
	padding: 8px; background: var(--unj-light); border-radius: var(--unj-radius);
}
.section-nav-title { margin: 0; padding: 14px 14px 10px; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.section-nav-title a { color: var(--unj-primary-dark); text-decoration: none; }
.section-nav ul { margin: 0; padding: 0; list-style: none; }
.section-nav ul ul { padding-left: 12px; }
.section-nav a { display: block; padding: 9px 14px; border-radius: var(--unj-radius-sm); color: var(--unj-slate); font-size: 0.9rem; font-weight: 500; text-decoration: none; line-height: 1.4; }
.section-nav li a:hover { background: #fff; color: var(--unj-primary); }
.section-nav .current_page_item > a { background: var(--unj-primary); color: #fff; font-weight: 600; }
@media (max-width: 980px) { .section-nav { position: static; } }

/* Contenido */
.entry-thumbnail { margin: 0 0 32px; border-radius: var(--unj-radius); overflow: hidden; }
.entry-thumbnail img { display: block; width: 100%; }
.entry-content { font-size: 1.0625rem; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content h2 { margin-top: 1.8em; font-size: 1.75rem; }
.entry-content h3 { margin-top: 1.6em; font-size: 1.375rem; }
.entry-content h4 { margin-top: 1.4em; font-size: 1.125rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 0.35em; }
.entry-content blockquote, .wp-block-quote {
	margin-inline: 0; padding: 20px 24px; border-left: 4px solid var(--unj-accent);
	background: var(--unj-light); border-radius: 0 var(--unj-radius-sm) var(--unj-radius-sm) 0; font-style: italic;
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.entry-content th, .entry-content td { padding: 12px 14px; border: 1px solid var(--unj-border); text-align: left; }
.entry-content th, .wp-block-table thead { background: var(--unj-primary); color: #fff; }
.entry-content tbody tr:nth-child(even) { background: var(--unj-light); }
.entry-content img { border-radius: var(--unj-radius-sm); }
.entry-content .alignwide { margin-inline: calc((min(1240px, 100vw - var(--unj-gutter) * 2) - 100%) / -2); max-width: none; }
.entry-content .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.entry-content-full > .alignfull, .entry-content-full > .alignwide { margin-inline: auto; }
.entry-content-full > :not(.alignfull) { max-width: calc(780px + var(--unj-gutter) * 2); margin-inline: auto; padding-inline: var(--unj-gutter); }
.entry-content-full > .alignwide { max-width: calc(1240px + var(--unj-gutter) * 2); }
.entry-content-full > .alignfull { width: 100%; margin-inline: 0; }
.wp-block-file .wp-block-file__button { background: var(--unj-primary); border-radius: var(--unj-radius-sm); }
.wp-block-separator { border: 0; border-top: 1px solid var(--unj-border); }

.event-info {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
	margin: 0 0 32px; padding: 20px; list-style: none; background: var(--unj-light); border-radius: var(--unj-radius);
}
.event-info li { display: flex; gap: 12px; align-items: flex-start; color: var(--unj-primary); }
.event-info span { display: flex; flex-direction: column; color: var(--unj-slate); }
.event-info strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--unj-muted); }

.entry-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--unj-border); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tags a { padding: 5px 12px; border-radius: 999px; background: var(--unj-light); color: var(--unj-slate); font-size: 0.8125rem; text-decoration: none; }
.tags a:hover { background: var(--unj-primary); color: #fff; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-navigation a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px; border: 1px solid var(--unj-border); border-radius: var(--unj-radius); text-decoration: none; }
.post-navigation a:hover { border-color: var(--unj-primary); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.nav-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--unj-muted); }
.nav-title { font-weight: 600; color: var(--unj-primary-dark); line-height: 1.4; }

/* Paginación */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers {
	display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 14px;
	border: 1px solid var(--unj-border); border-radius: var(--unj-radius-sm);
	color: var(--unj-slate); font-weight: 600; text-decoration: none;
}
.page-numbers:hover { border-color: var(--unj-primary); color: var(--unj-primary); }
.page-numbers.current { background: var(--unj-primary); border-color: var(--unj-primary); color: #fff; }

/* Barra lateral */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sidebar .widget { padding: 24px; background: var(--unj-light); border-radius: var(--unj-radius); }
.widget-title { margin: 0 0 14px; font-size: 1rem; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--unj-border); font-size: 0.9rem; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--unj-slate); text-decoration: none; }
.sidebar a:hover { color: var(--unj-primary); }

/* Formularios */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], input[type="date"], textarea, select {
	width: 100%; padding: 12px 14px; border: 1px solid #cfd6e2; border-radius: var(--unj-radius-sm);
	font: inherit; color: var(--unj-slate); background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--unj-primary); box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.15); }
.comments-area { margin-top: 56px; }
.comment-list { padding-left: 0; list-style: none; }
.comment-list .children { list-style: none; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--unj-border); }

/* 404 / sin resultados */
.error-code { margin: 0; font-size: clamp(5rem, 14vw, 9rem); font-weight: 800; line-height: 1; color: var(--unj-light); -webkit-text-stroke: 2px var(--unj-primary); }
.error-404 .page-title { color: var(--unj-primary-dark); margin-bottom: 12px; }
.error-404 .search-form { margin: 28px auto; }
.no-results { padding: 40px; text-align: center; background: var(--unj-light); border-radius: var(--unj-radius); }
.no-results .search-form { margin-top: 20px; }

/* ==========================================================================
   Pie
   ========================================================================== */
.site-footer { background: var(--unj-primary-dark); color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }
.footer-grid {
	display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px;
	padding-top: clamp(48px, 6vw, 80px); padding-bottom: 48px;
}
.footer-brand { margin-bottom: 22px; }
.site-footer .custom-logo { max-height: 60px; filter: brightness(0) invert(1); }
.site-footer .brand-text { color: #fff; }
.site-footer .brand-mark { background: #fff; color: var(--unj-primary); }
.contact-list { display: flex; flex-direction: column; gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; line-height: 1.5; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .icon { margin-top: 2px; color: var(--unj-accent); }
.contact-list a { color: inherit; text-decoration: none; }
.contact-list a:hover { color: #fff; }
.footer-social a { background: rgba(255, 255, 255, 0.08); color: #fff; width: 38px; height: 38px; }
.footer-social a:hover { background: var(--unj-accent); color: var(--unj-primary-dark); }
.footer-title { margin: 0 0 18px; color: #fff; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-title::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 10px; border-radius: 3px; background: var(--unj-accent); }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li + li { margin-top: 8px; }
.footer-menu a { color: rgba(255, 255, 255, 0.78); text-decoration: none; line-height: 1.45; }
.footer-menu a:hover { color: var(--unj-accent); }
.footer-note { padding-bottom: 32px; font-size: 0.8125rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.15); font-size: 0.8125rem; }
.footer-bottom-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; }
.footer-bottom p { margin: 0; }
.legal-menu { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.legal-menu a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.legal-menu a:hover { color: var(--unj-accent); }
@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

.back-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 900;
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
	background: var(--unj-primary); color: #fff; box-shadow: var(--unj-shadow);
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.back-to-top:hover { background: var(--unj-accent); color: var(--unj-primary-dark); }
.show-top .back-to-top { opacity: 1; visibility: visible; transform: none; }

/* Impresión */
@media print {
	.site-header, .site-footer, .back-to-top, .sidebar, .section-nav, .breadcrumbs { display: none !important; }
	.page-header { background: none; color: #000; padding: 0; }
	.page-title { color: #000; }
}
