/* Horarios de clase – CRA Villas del Tajo (colores y letras de la web) */
.cra-hor {
	--hor-titulos: var(--cra-titulos, "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif);
	--hor-texto: var(--cra-texto, "Figtree", "Segoe UI", system-ui, sans-serif);
	--hor-tinta: #2e2925;
	--hor-suave: #6b5f57;
	--hor-linea: #efe6df;
	--hor-verde: #02703a;
	font-family: var(--hor-texto);
	color: var(--hor-tinta);
}
.cra-hor *, .cra-hor *::before, .cra-hor *::after { box-sizing: border-box; }
.cra-hor [hidden] { display: none !important; }

/* Botones de los cursos */
.cra-hor-menu { display: flex; flex-direction: column; gap: 14px; margin: 0 0 26px; padding: 20px 22px; border-radius: 26px; background: #fff6ef; }
.cra-hor-menu__bloque { display: flex; flex-direction: column; gap: 10px; }
.cra-hor-menu__bloque + .cra-hor-menu__bloque { padding-top: 14px; border-top: 1px solid var(--hor-linea); }
.cra-hor-menu__seccion { margin: 0; font-family: var(--hor-titulos); font-weight: 700; font-size: 18px; }
.cra-hor-menu__etapa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cra-hor-menu__nombre { min-width: 78px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hor-suave); }
.cra-hor .cra-hor-curso {
	display: inline-flex; align-items: center; padding: 9px 18px; border-radius: 999px;
	border: 2px solid var(--hor-linea); background: #fff; color: var(--hor-tinta);
	font-weight: 700; font-size: 15px; line-height: 1.1; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.cra-hor .cra-hor-curso:hover, .cra-hor .cra-hor-curso:focus-visible { border-color: var(--hor-verde); color: var(--hor-verde); }
.cra-hor .cra-hor-curso.is-activo { background: var(--hor-verde); border-color: var(--hor-verde); color: #fff; }

.cra-hor-aviso { margin: -10px 0 0; padding: 18px 22px; border: 2px dashed var(--hor-linea); border-radius: 22px; text-align: center; color: var(--hor-suave); font-weight: 600; }

/* Cabecera de cada horario */
.cra-hor-grupo { --sec: #cde8d8; --sec-tinta: #014d28; }
.cra-hor-grupo--albaricoque { --sec: #fdd2a8; --sec-tinta: #6a3410; }
.cra-hor-grupo--prado { --sec: #6dbb86; --sec-tinta: #0b3a1d; }
.cra-hor-grupo--cielo { --sec: #84cff3; --sec-tinta: #0c3a52; }
.cra-hor-grupo + .cra-hor-grupo { margin-top: 40px; }
.cra-hor.is-listo .cra-hor-grupo + .cra-hor-grupo { margin-top: 0; }
.cra-hor-cabecera { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 16px; }
.cra-hor-antetitulo { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sec-tinta); }
.cra-hor-antetitulo::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--sec); vertical-align: 1px; }
.cra-hor .cra-hor-titulo { margin: 0; font-family: var(--hor-titulos); font-weight: 700; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; color: var(--hor-tinta); }
.cra-hor-junto { margin: 6px 0 0; font-size: 15px; color: var(--hor-suave); }
.cra-hor-tutor { display: flex; flex-direction: column; margin: 0; padding: 10px 18px; border-radius: 18px; background: var(--sec); color: var(--sec-tinta); font-weight: 700; font-size: 16px; }
.cra-hor-tutor span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }

/* Tabla */
.cra-hor-tabla-envoltorio { overflow-x: auto; border-radius: 22px; border: 1px solid var(--hor-linea); background: #fff; }
.cra-hor .cra-hor-tabla { width: 100%; min-width: 680px; margin: 0; border-collapse: separate; border-spacing: 4px; table-layout: fixed; font-size: 14.5px; }
.cra-hor .cra-hor-tabla th, .cra-hor .cra-hor-tabla td { border: 0; padding: 10px 8px; text-align: center; vertical-align: middle; }
.cra-hor .cra-hor-tabla thead th { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hor-suave); background: none; }
.cra-hor .cra-hor-tabla th.cra-hor-hora { width: 110px; font-size: 13px; font-weight: 700; color: var(--hor-suave); white-space: nowrap; background: none; }
.cra-hor .cra-hor-tabla td { border-radius: 12px; background: var(--fondo, #faf7f4); color: var(--tinta, var(--hor-tinta)); }
.cra-hor .cra-hor-tabla td.cra-hor-libre { background: #faf7f4; }
.cra-hor .cra-hor-tabla td.cra-hor-varias { padding: 0; background: none; }
.cra-hor-opcion { display: block; padding: 8px 8px; border-radius: 12px; background: var(--fondo); color: var(--tinta); }
.cra-hor-opcion + .cra-hor-opcion { margin-top: 4px; }
.cra-hor-asig { display: block; font-weight: 700; line-height: 1.25; }
.cra-hor-profe { display: block; margin-top: 3px; font-size: 12.5px; opacity: .85; }
.cra-hor .cra-hor-tabla td.cra-hor-pausa { background: repeating-linear-gradient(135deg, #fff6ef, #fff6ef 10px, #fdeee2 10px, #fdeee2 20px); color: #6a3410; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.cra-hor-fila--comedor td.cra-hor-pausa { background: #eaf6ee; color: #0b3a1d; }

/* Pestañas de días: solo en pantallas estrechas */
.cra-hor-dias { display: none; }
@media (max-width: 700px) {
	.cra-hor-menu { padding: 16px; border-radius: 20px; }
	.cra-hor-menu__nombre { width: 100%; }
	.cra-hor-grupo.has-dias .cra-hor-dias { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; }
	.cra-hor-dias button { flex: 1 0 auto; padding: 8px 12px; border: 2px solid var(--hor-linea); border-radius: 999px; background: #fff; color: var(--hor-tinta); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
	.cra-hor-dias button[aria-selected="true"] { background: var(--sec); border-color: var(--sec); color: var(--sec-tinta); }
	.cra-hor-grupo.has-dias .cra-hor-tabla { min-width: 0; table-layout: auto; }
	.cra-hor-grupo.has-dias .cra-hor-tabla td { width: 100%; }
	.cra-hor-grupo.has-dias .cra-hor-tabla thead { display: none; }
	.cra-hor-grupo.has-dias .cra-hor-tabla th.cra-hor-hora { width: 92px; }
	.cra-hor-grupo.has-dias .cra-hor-tabla:not([data-dia-activo="0"]) .d0,
	.cra-hor-grupo.has-dias .cra-hor-tabla:not([data-dia-activo="1"]) .d1,
	.cra-hor-grupo.has-dias .cra-hor-tabla:not([data-dia-activo="2"]) .d2,
	.cra-hor-grupo.has-dias .cra-hor-tabla:not([data-dia-activo="3"]) .d3,
	.cra-hor-grupo.has-dias .cra-hor-tabla:not([data-dia-activo="4"]) .d4 { display: none; }
	.cra-hor-grupo.has-dias .cra-hor-tabla td.cra-hor-pausa { letter-spacing: .06em; }
}

/* Profesorado */
.cra-hor-equipo { margin-top: 18px; padding: 18px 22px; border-radius: 22px; background: #fff6ef; }
.cra-hor .cra-hor-equipo h4 { margin: 0 0 10px; font-family: var(--hor-titulos); font-size: 18px; font-weight: 700; color: var(--hor-tinta); }
.cra-hor-equipo ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.cra-hor-equipo li { display: grid; grid-template-columns: 12px 1fr; align-items: center; column-gap: 10px; font-size: 15px; line-height: 1.35; }
.cra-hor-equipo li .cra-hor-quien { grid-column: 2; color: var(--hor-suave); }
.cra-hor-punto { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(46, 41, 37, .12); }
.cra-hor-nota { margin: 12px 0 0; font-size: 14px; color: var(--hor-suave); }
.cra-hor-vacio { padding: 18px 20px; border-radius: 18px; background: #fff6ef; }

@media print {
	.cra-hor-menu, .cra-hor-dias { display: none !important; }
	.cra-hor-grupo[hidden] { display: none !important; }
}
.cra-hor-sesion { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--hor-verde); }

/* Ventana emergente del horario */
html.cra-hor-abierto { overflow: hidden; }
.cra-hor-ventana {
	width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
	margin: auto; padding: 0; border: 0; border-radius: 28px; background: #fff; color: var(--hor-tinta);
	box-shadow: 0 30px 80px rgba(46, 41, 37, .35); overflow: hidden;
}
.cra-hor-ventana[open] { display: flex; flex-direction: column; animation: cra-hor-entra .22s ease-out; }
.cra-hor-ventana::backdrop { background: rgba(46, 41, 37, .55); backdrop-filter: blur(2px); }
.cra-hor-ventana__cuerpo { overflow: auto; padding: 30px 34px 32px; overscroll-behavior: contain; }
.cra-hor .cra-hor-ventana .cra-hor-grupo + .cra-hor-grupo { margin-top: 0; }
.cra-hor .cra-hor-ventana .cra-hor-cabecera { padding-right: 52px; }
.cra-hor .cra-hor-cerrar {
	position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0; border: 2px solid var(--hor-linea); border-radius: 50%;
	background: #fff; color: var(--hor-tinta); font: 400 28px/1 system-ui, sans-serif; cursor: pointer;
}
.cra-hor .cra-hor-cerrar:hover, .cra-hor .cra-hor-cerrar:focus-visible { border-color: var(--hor-verde); color: var(--hor-verde); outline: none; }
@keyframes cra-hor-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 700px) {
	.cra-hor-ventana { width: 100vw; max-height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; }
	.cra-hor-ventana__cuerpo { padding: 22px 16px 26px; }
	.cra-hor .cra-hor-cerrar { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .cra-hor-ventana[open] { animation: none; } }
@media print {
	.cra-hor-ventana { position: static; width: auto; max-height: none; box-shadow: none; }
	.cra-hor-cerrar { display: none !important; }
}
/* Con la ventana, el aviso «Pulsa un curso…» sobra: el texto de la página ya lo dice */
.cra-hor.has-ventana .cra-hor-aviso { display: none; }
