/* ==========================================================================
   EOM Directorios y Recursos Musicales - Estilos Frontend (Compatible Astra)
   ========================================================================== */

.eom-dir-wrap {
	--eom-primary: var(--ast-global-color-0, #046bd2);
	--eom-primary-hover: var(--ast-global-color-1, #045cb4);
	--eom-heading: var(--ast-global-color-2, #1e293b);
	--eom-text: var(--ast-global-color-3, #334155);
	--eom-muted: #64748b;
	--eom-bg: #f8fafc;
	--eom-card: #ffffff;
	--eom-border: #e2e8f0;
	--eom-radius: 14px;
	font-family: inherit;
	color: var(--eom-text);
	margin: 28px auto;
	max-width: 1240px;
	box-sizing: border-box;
}

.eom-dir-wrap *,
.eom-dir-wrap *::before,
.eom-dir-wrap *::after {
	box-sizing: border-box;
}

.eom-dir-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 48px 20px;
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	font-weight: 600;
	color: var(--eom-muted);
}

.eom-dir-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--eom-border);
	border-top-color: var(--eom-primary);
	border-radius: 50%;
	animation: eomDirSpin 0.75s linear infinite;
}

@keyframes eomDirSpin {
	to { transform: rotate(360deg); }
}

/* Panel superior del Mapa de Google My Maps */
.eom-dir-map-box {
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	margin-bottom: 20px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.eom-dir-map-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 18px;
	background: var(--eom-bg);
	border-bottom: 1px solid var(--eom-border);
}

.eom-dir-map-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--eom-heading);
	display: flex;
	align-items: center;
	gap: 8px;
}

.eom-dir-map-frame-wrap {
	width: 100%;
	height: 400px;
	background: #e2e8f0;
}

.eom-dir-map-frame-wrap iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Barra alfabética A-Z (Autores y Diccionario) */
.eom-dir-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	padding: 10px 14px;
	margin-bottom: 18px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.eom-dir-alpha-btn {
	border: 1px solid transparent;
	background: var(--eom-bg);
	color: var(--eom-heading);
	font-size: 12px;
	font-weight: 600;
	min-width: 31px;
	height: 30px;
	padding: 0 8px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.eom-dir-alpha-btn:hover {
	border-color: var(--eom-primary);
	color: var(--eom-primary);
}

.eom-dir-alpha-btn.is-active {
	background: var(--eom-primary);
	color: #ffffff;
	border-color: var(--eom-primary);
}

/* Layout principal: Sidebar de Filtros + Listado */
.eom-dir-layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.eom-dir-mobile-filter-toggle {
	display: none;
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	border: 1px solid var(--eom-border);
	background: var(--eom-card);
	color: var(--eom-heading);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

@media (max-width: 920px) {
	.eom-dir-layout {
		grid-template-columns: 1fr;
	}
	.eom-dir-mobile-filter-toggle {
		display: flex;
	}
	.eom-dir-sidebar.is-collapsed-mobile {
		display: none;
	}
}

/* Sidebar de filtros (estilo Fotocasa / Milanuncios) */
.eom-dir-sidebar {
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	padding: 18px;
	position: sticky;
	top: 24px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.eom-dir-sidebar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--eom-border);
}

.eom-dir-sidebar-head h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--eom-heading);
}

.eom-dir-reset-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--eom-primary);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.eom-dir-reset-link:hover {
	text-decoration: underline;
}

.eom-dir-filter-group {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--eom-border);
}

.eom-dir-filter-group:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.eom-dir-filter-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--eom-heading);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.eom-dir-search-box {
	position: relative;
}

.eom-dir-input,
.eom-dir-select {
	width: 100%;
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--eom-heading);
	background: var(--eom-bg);
	border: 1px solid var(--eom-border);
	border-radius: 10px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eom-dir-input:focus,
.eom-dir-select:focus {
	border-color: var(--eom-primary);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(4, 107, 210, 0.12);
}

.eom-dir-checkbox-list {
	display: flex;
	flex-direction: column;
	gap: 7px;
	max-height: 215px;
	overflow-y: auto;
	padding-right: 4px;
}

.eom-dir-checkbox-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	color: var(--eom-text);
	cursor: pointer;
}

.eom-dir-checkbox-item label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	flex: 1;
	margin: 0;
	font-weight: 400;
}

.eom-dir-facet-count {
	font-size: 12px;
	color: var(--eom-muted);
	background: var(--eom-bg);
	padding: 1px 7px;
	border-radius: 999px;
	border: 1px solid var(--eom-border);
}

.eom-dir-pills-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.eom-dir-pill-btn {
	padding: 6px 11px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 9px;
	border: 1px solid var(--eom-border);
	background: var(--eom-bg);
	color: var(--eom-text);
	cursor: pointer;
	transition: all 0.15s ease;
}

.eom-dir-pill-btn.is-active {
	background: var(--eom-primary);
	color: #ffffff;
	border-color: var(--eom-primary);
}

.eom-dir-year-range {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

/* Barra de herramientas de resultados */
.eom-dir-toolbar {
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	padding: 12px 16px;
	margin-bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.eom-dir-count {
	font-size: 14px;
	font-weight: 700;
	color: var(--eom-heading);
}

.eom-dir-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.eom-dir-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #eff6ff;
	color: var(--eom-primary);
	border: 1px solid #bfdbfe;
}

.eom-dir-chip button {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font-weight: 700;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
}

.eom-dir-toolbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.eom-dir-view-switch {
	display: inline-flex;
	background: var(--eom-bg);
	border: 1px solid var(--eom-border);
	border-radius: 9px;
	padding: 2px;
}

.eom-dir-view-btn {
	border: 0;
	background: transparent;
	color: var(--eom-muted);
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 7px;
	cursor: pointer;
}

.eom-dir-view-btn.is-active {
	background: var(--eom-primary);
	color: #ffffff;
}

/* Rejilla y Lista de Tarjetas */
.eom-dir-cards.is-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

@media (max-width: 680px) {
	.eom-dir-cards.is-grid {
		grid-template-columns: 1fr;
	}
}

.eom-dir-cards.is-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.eom-card {
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.eom-card:hover {
	transform: translateY(-2px);
	border-color: #cbd5e1;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.eom-dir-cards.is-list .eom-card--school,
.eom-dir-cards.is-list .eom-card--author,
.eom-dir-cards.is-list .eom-card--indice {
	flex-direction: row;
}

@media (max-width: 640px) {
	.eom-dir-cards.is-list .eom-card--school,
	.eom-dir-cards.is-list .eom-card--author,
	.eom-dir-cards.is-list .eom-card--indice {
		flex-direction: column;
	}
}

/* Cabecera visual de Escuela con soporte para Foto desde Drive */
.eom-school-media {
	position: relative;
	height: 148px;
	background: linear-gradient(135deg, #046bd2 0%, #1e3a8a 100%);
	color: #ffffff;
	padding: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
}

.eom-dir-cards.is-list .eom-school-media {
	width: 230px;
	height: auto;
	min-height: 155px;
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.eom-dir-cards.is-list .eom-school-media {
		width: 100%;
		height: 145px;
	}
}

.eom-school-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.eom-school-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.18));
	z-index: 1;
	pointer-events: none;
}

.eom-school-media-top,
.eom-school-media-bottom {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	flex-wrap: wrap;
}

.eom-badge-glass {
	background: rgba(15, 23, 42, 0.58);
	backdrop-filter: blur(4px);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
}

/* Cabecera visual de Autores y Compositores con soporte de Imagen / Drive */
.eom-author-media {
	position: relative;
	height: 154px;
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #046bd2 100%);
	color: #ffffff;
	padding: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
}

.eom-dir-cards.is-list .eom-author-media {
	width: 230px;
	height: auto;
	min-height: 160px;
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.eom-dir-cards.is-list .eom-author-media {
		width: 100%;
		height: 150px;
	}
}

.eom-author-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 20%;
	z-index: 0;
}

.eom-author-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.22) 60%, rgba(15, 23, 42, 0.4) 100%);
	z-index: 1;
	pointer-events: none;
}

.eom-author-bg-svg {
	position: absolute;
	right: -10px;
	bottom: -15px;
	width: 130px;
	height: 130px;
	opacity: 0.12;
	color: #ffffff;
	z-index: 0;
	pointer-events: none;
}

/* Cabecera visual de Índice Temático y Aplicaciones */
.eom-indice-media {
	position: relative;
	height: 154px;
	background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
	color: #ffffff;
	padding: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
}

.eom-indice-media.is-app {
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #0284c7 100%);
}

.eom-dir-cards.is-list .eom-indice-media {
	width: 230px;
	height: auto;
	min-height: 160px;
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.eom-dir-cards.is-list .eom-indice-media {
		width: 100%;
		height: 150px;
	}
}

.eom-indice-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.eom-indice-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.25) 60%, rgba(15, 23, 42, 0.4) 100%);
	z-index: 1;
	pointer-events: none;
}

.eom-card-body {
	padding: 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.eom-card-title {
	margin: 0 0 6px 0;
	font-size: 16px;
	line-height: 1.35;
	font-weight: 700;
	color: var(--eom-heading);
}

.eom-card-subtitle {
	font-size: 13px;
	font-weight: 600;
	color: var(--eom-primary);
	margin: 0 0 8px 0;
}

.eom-card-desc {
	font-size: 13px;
	line-height: 1.55;
	color: var(--eom-text);
	margin: 8px 0 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.eom-tag-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.eom-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 600;
	background: var(--eom-bg);
	color: var(--eom-heading);
	border: 1px solid var(--eom-border);
}

.eom-tag--primary {
	background: #eff6ff;
	color: var(--eom-primary);
	border-color: #bfdbfe;
}

/* Tarjeta específica de Libros (Portada lateral) */
.eom-book-layout {
	display: flex;
	gap: 16px;
	padding: 18px;
	height: 100%;
}

.eom-book-cover {
	width: 92px;
	min-height: 132px;
	flex-shrink: 0;
	border-radius: 10px;
	background: linear-gradient(145deg, #046bd2 0%, #1e293b 100%);
	color: #ffffff;
	padding: 10px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}

.eom-book-cover img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eom-book-cover-title {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Tarjeta específica de Autores / Compositores */
.eom-author-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 10px;
}

.eom-author-avatar {
	width: 54px;
	height: 54px;
	border-radius: 14px;
	background: var(--eom-bg);
	border: 1px solid var(--eom-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
	color: var(--eom-primary);
	flex-shrink: 0;
	overflow: hidden;
}

.eom-author-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Tarjeta específica de Diccionario */
.eom-dict-layout {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px;
}

.eom-dict-letter {
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: var(--eom-primary);
	color: #ffffff;
	font-weight: 700;
	font-size: 17px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Pie de tarjeta y botones */
.eom-card-footer {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--eom-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.eom-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border-radius: 9px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	border: 1px solid transparent;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.eom-btn--primary {
	background: var(--eom-primary);
	color: #ffffff !important;
}

.eom-btn--primary:hover {
	background: var(--eom-primary-hover);
}

.eom-btn--ghost {
	background: var(--eom-bg);
	color: var(--eom-heading) !important;
	border-color: var(--eom-border);
}

.eom-btn--ghost:hover {
	border-color: var(--eom-primary);
	color: var(--eom-primary) !important;
}

.eom-link-inline {
	font-size: 12px;
	font-weight: 600;
	color: var(--eom-primary) !important;
	text-decoration: none !important;
}

.eom-link-inline:hover {
	text-decoration: underline !important;
}

/* Paginación */
.eom-dir-pagination {
	margin-top: 22px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
}

.eom-dir-page-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.eom-page-btn {
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--eom-border);
	background: var(--eom-bg);
	color: var(--eom-heading);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.eom-page-btn.is-active {
	background: var(--eom-primary);
	color: #ffffff;
	border-color: var(--eom-primary);
}

.eom-page-btn:disabled {
	opacity: 0.45;
	cursor: default;
}

/* Estado vacío */
.eom-dir-empty {
	background: var(--eom-card);
	border: 1px solid var(--eom-border);
	border-radius: var(--eom-radius);
	padding: 42px 24px;
	text-align: center;
}

/* Modal de Ficha Completa */
.eom-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(15, 23, 42, 0.62);
	backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.eom-modal-dialog {
	background: #ffffff;
	border-radius: 16px;
	max-width: 640px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	padding: 26px;
	position: relative;
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
	color: #1e293b;
}

.eom-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #334155;
	font-size: 16px;
	cursor: pointer;
}

.eom-modal-row {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 9px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 13px;
}

.eom-modal-row strong {
	color: #64748b;
	min-width: 130px;
}

/* Marco multimedia fijo en Modal de Ficha (formato homogéneo y encaje completo con degradado) */
.eom-modal-frame,
.eom-modal-media {
	width: 100%;
	height: 280px;
	max-height: 280px;
	border-radius: 14px;
	overflow: hidden;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
	position: relative;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.eom-modal-frame img,
.eom-modal-media img {
	max-height: 100% !important;
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	display: block !important;
	margin: auto !important;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
	.eom-modal-frame,
	.eom-modal-media {
		height: 210px !important;
		max-height: 210px !important;
	}
}
