/**
 * Modales claustro — layout limpio (título + buscador + atajos).
 */

.jursoc-claustro-modal {
	--jcm-width: calc(100vw - 1.5rem);
	--jcm-max-height: min(96dvh, calc(100dvh - 1.5rem));
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 0.75rem;
	box-sizing: border-box;
}

.jursoc-claustro-modal[hidden] {
	display: none !important;
}

.jursoc-claustro-modal.is-hover-mode {
	align-items: flex-start;
	justify-content: flex-start;
	padding: 0;
	pointer-events: none;
}

.jursoc-claustro-modal.is-hover-mode .jursoc-claustro-modal__overlay {
	background: transparent;
	backdrop-filter: none;
	pointer-events: none;
}

.jursoc-claustro-modal.is-hover-mode .jursoc-claustro-modal__dialog {
	position: fixed;
	top: var(--panel-top, 4.5rem);
	left: var(--panel-left, 1rem);
	width: var(--panel-width, var(--jcm-width));
	max-height: var(--panel-max-height, var(--jcm-max-height));
	pointer-events: auto;
	box-shadow: 0 20px 56px rgba(15, 39, 68, 0.18);
}

.jursoc-claustro-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 39, 68, 0.42);
	backdrop-filter: blur(6px);
}

.jursoc-claustro-modal.is-pinned .jursoc-claustro-modal__overlay {
	pointer-events: auto;
}

.jursoc-claustro-modal__dialog {
	position: relative;
	z-index: 1;
	width: var(--jcm-width);
	max-height: var(--jcm-max-height);
	display: flex;
	flex-direction: column;
	background: #f8fafc;
	border-radius: 20px;
	box-shadow: 0 28px 80px rgba(15, 39, 68, 0.22);
	border: 1px solid rgba(15, 39, 68, 0.08);
	overflow: hidden;
}

.jursoc-claustro-modal__close {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	z-index: 5;
	width: 2.25rem;
	height: 2.25rem;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #64748b;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(15, 39, 68, 0.08);
	transition: background 0.2s, color 0.2s;
}

.jursoc-claustro-modal__close:hover,
.jursoc-claustro-modal__close:focus-visible {
	background: #fff;
	color: #0f2744;
	outline: none;
}

.jursoc-claustro-modal__body {
	flex: 1;
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
}

.jursoc-claustro-modal__panel {
	animation: jursoc-claustro-modal-in 0.25s ease;
	min-height: min(88vh, 720px);
}

@keyframes jursoc-claustro-modal-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* —— Panel interior —— */
.jursoc-claustro-modal__inner {
	position: relative;
	min-height: min(85vh, 680px);
	padding: clamp(1.5rem, 3vw, 2.5rem);
	background:
		radial-gradient(ellipse 80% 50% at 50% 0%, color-mix(in srgb, var(--claustro-color, #003366) 12%, transparent), transparent 70%),
		linear-gradient(180deg, #f8fafc 0%, #fff 45%, #f1f5f9 100%);
}

.jursoc-claustro-modal__meta {
	position: absolute;
	top: clamp(1rem, 2vw, 1.5rem);
	right: clamp(1rem, 2vw, 1.5rem);
	z-index: 2;
	max-width: min(280px, 34vw);
	text-align: right;
	padding-right: 2.5rem;
}

.jursoc-claustro-modal__meta-icon {
	display: inline-flex;
	justify-content: flex-end;
	width: 100%;
	margin-bottom: 0.35rem;
	color: var(--claustro-color, #003366);
	opacity: 0.85;
}

.jursoc-claustro-modal__meta-icon .jursoc-svg-icon {
	width: 1.35rem;
	height: 1.35rem;
	stroke: currentColor;
}

.jursoc-claustro-modal__meta-eyebrow {
	margin: 0 0 0.25rem;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #94a3b8;
}

.jursoc-claustro-modal__meta-lead {
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	line-height: 1.45;
	color: #5a6f85;
}

.jursoc-claustro-modal__meta-stat {
	margin: 0 0 0.4rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--claustro-color, #003366);
}

.jursoc-claustro-modal__meta-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.2s, border-color 0.2s;
}

.jursoc-claustro-modal__meta-link:hover,
.jursoc-claustro-modal__meta-link:focus-visible {
	color: var(--claustro-color, #003366);
	border-bottom-color: currentColor;
	outline: none;
}

.jursoc-claustro-modal__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	max-width: 920px;
	margin: 0 auto;
	padding-top: clamp(0.5rem, 2vh, 1.5rem);
	padding-right: min(0px, 0px);
	box-sizing: border-box;
}

.jursoc-claustro-modal__hero-title {
	margin: 0 0 clamp(1.25rem, 3vh, 1.75rem);
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 1.1;
	color: var(--claustro-color-dark, #0f2744);
	text-align: center;
}

.jursoc-claustro-modal__search-wrap {
	width: 100%;
	max-width: 584px;
	margin-bottom: clamp(1.5rem, 3vh, 2rem);
}

/* Buscador minimal (tipo barra Google) */
.jursoc-claustro-modal .jursoc-hub-search--minimal {
	margin: 0;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__panel {
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__panel::before {
	display: none;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__head,
.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__helpers,
.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__suggestions,
.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__status-dot,
.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__idle {
	display: none;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__head .jursoc-hub-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__field {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 3rem;
	padding: 0 1.1rem;
	background: #fff;
	border: 1px solid #dfe7ef;
	border-radius: 999px;
	box-shadow:
		0 1px 3px rgba(15, 39, 68, 0.06),
		0 8px 24px rgba(15, 39, 68, 0.06);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__field:focus-within {
	border-color: color-mix(in srgb, var(--claustro-color, #003366) 40%, #dfe7ef);
	box-shadow:
		0 1px 3px rgba(15, 39, 68, 0.08),
		0 8px 28px color-mix(in srgb, var(--claustro-color, #003366) 14%, transparent);
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__icon {
	color: #94a3b8;
	flex-shrink: 0;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 1rem;
	color: #0f2744;
	padding: 0.65rem 0;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__input:focus {
	outline: none;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__ghost {
	display: none;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__status {
	margin-top: 0.35rem;
	text-align: center;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__meta {
	font-size: 0.8rem;
	color: #64748b;
}

.jursoc-claustro-modal .jursoc-hub-search--minimal .jursoc-hub-search__empty {
	margin-top: 0.75rem;
	border-radius: 12px;
}

.jursoc-claustro-modal__shortcuts-wrap {
	width: 100%;
}

.jursoc-claustro-modal__more {
	margin: 1rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid #e8eef4;
	text-align: center;
}

.jursoc-claustro-modal__more-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--claustro-color, #003366);
	text-decoration: none;
}

.jursoc-claustro-modal__more-link:hover {
	text-decoration: underline;
}

.jursoc-claustro-modal__inner--docentes .jursoc-claustro-modal__shortcuts--docentes {
	grid-template-columns: repeat(5, minmax(0, 1fr));
	max-width: 52rem;
	margin-inline: auto;
}

.jursoc-claustro-modal__panel[data-claustro-panel='docentes'].has-search-active .jursoc-claustro-modal__shortcuts--docentes {
	grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
	max-width: 100%;
}

.jursoc-claustro-modal__shortcuts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
	justify-content: center;
	gap: 0.5rem 1rem;
	max-width: 100%;
	width: 100%;
}

.jursoc-claustro-modal__shortcut-group {
	grid-column: 1 / -1;
	margin: 0.75rem 0 0.15rem;
	padding-top: 0.65rem;
	border-top: 1px solid #e8eef4;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
	text-align: left;
}

.jursoc-claustro-modal__shortcuts > .jursoc-claustro-modal__shortcut-group:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.jursoc-claustro-modal__shortcut {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	max-width: 8.5rem;
	margin: 0 auto;
	padding: 0.7rem 0.4rem;
	text-decoration: none;
	color: #1e293b;
	border-radius: 12px;
	transition: background 0.2s, transform 0.2s;
}

.jursoc-claustro-modal__shortcut:hover,
.jursoc-claustro-modal__shortcut:focus-visible {
	background: rgba(255, 255, 255, 0.7);
	transform: translateY(-2px);
	outline: none;
}

.jursoc-claustro-modal__shortcut[hidden],
.jursoc-claustro-modal__shortcut.is-filtered-out {
	display: none;
}

.jursoc-claustro-modal__shortcut-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #e8eef4;
	box-shadow: 0 2px 8px rgba(15, 39, 68, 0.06);
	color: var(--claustro-color, #003366);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.jursoc-claustro-modal__shortcut-icon .jursoc-svg-icon {
	width: 1.45rem !important;
	height: 1.45rem !important;
	stroke: currentColor;
}

.jursoc-claustro-modal__shortcut:hover .jursoc-claustro-modal__shortcut-icon,
.jursoc-claustro-modal__shortcut:focus-visible .jursoc-claustro-modal__shortcut-icon {
	border-color: color-mix(in srgb, var(--claustro-color, #003366) 35%, #e8eef4);
	box-shadow: 0 6px 16px color-mix(in srgb, var(--claustro-color, #003366) 18%, transparent);
}

.jursoc-claustro-modal__shortcut-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.12rem;
	width: 100%;
	min-width: 0;
}

.jursoc-claustro-modal__shortcut-label {
	font-size: 0.76rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	color: #1e293b;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.jursoc-claustro-modal__shortcut-hint {
	font-size: 0.64rem;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	color: #94a3b8;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html.jursoc-claustro-modal-open {
	overflow: hidden;
}

@media (min-width: 1200px) {
	.jursoc-claustro-modal__shortcuts {
		grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
		gap: 0.65rem 1.25rem;
	}

	.jursoc-claustro-modal__shortcut {
		max-width: 9rem;
	}

	.jursoc-claustro-modal__shortcut-label {
		font-size: 0.8rem;
	}
}

@media (max-width: 768px) {
	.jursoc-claustro-modal__meta {
		position: static;
		max-width: none;
		text-align: left;
		padding: 0 0 1rem;
		margin-bottom: 0.5rem;
		border-bottom: 1px solid #e8eef4;
	}

	.jursoc-claustro-modal__inner {
		min-height: auto;
		padding: 1rem 1rem 1.25rem;
	}

	.jursoc-claustro-modal__panel {
		min-height: auto;
	}

	.jursoc-claustro-modal__stage {
		padding-top: 0;
	}

	.jursoc-claustro-modal__hero-title {
		font-size: 1.75rem;
	}

	.jursoc-claustro-modal__shortcuts {
		grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
	}

	.jursoc-claustro-modal__inner--docentes .jursoc-claustro-modal__shortcuts--docentes {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.jursoc-claustro-modal {
		padding: 0;
	}

	.jursoc-claustro-modal__dialog,
	.jursoc-claustro-modal.is-hover-mode .jursoc-claustro-modal__dialog {
		width: 100%;
		left: 0 !important;
		max-height: 100dvh;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jursoc-claustro-modal__panel {
		animation: none;
	}

	.jursoc-claustro-modal__shortcut {
		transition: none;
	}
}
