/**
 * DSMK Horario Google — estilos base del frontend.
 *
 * Las tipografías se heredan del tema / kit de Elementor. Los widgets ajustan
 * el aspecto mediante las variables CSS --dhg-*.
 */

/* ─────────────────────────────────────────────────────────────────────────
   HORARIO SEMANAL
   ───────────────────────────────────────────────────────────────────────── */
.dhg-horario {
	--dhg-row-padding: .5em;
	--dhg-justify: space-between;
	--dhg-direction: row;
	--dhg-hours-align: flex-end;
	--dhg-separator: rgba(0, 0, 0, .12);
	--dhg-separator: color-mix(in srgb, currentColor 15%, transparent);
	--dhg-separator-style: solid;
	--dhg-separator-width: 1px;
	--dhg-today-bg: transparent;
	--dhg-today-weight: 600;
	--dhg-today-padding-x: 0;
}

.dhg-horario .dhg-titulo {
	margin: 0 0 .75em;
}

.dhg-horario .dhg-aviso {
	margin: 0 0 .75em;
	font-weight: 600;
	color: var(--dhg-closed-color, currentColor);
}

.dhg-horario .dhg-estado {
	margin-bottom: .75em;
}

.dhg-dias,
.dhg-especiales-lista {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dhg-dia,
.dhg-especial {
	display: flex;
	flex-direction: var(--dhg-direction);
	flex-wrap: wrap;
	justify-content: var(--dhg-justify);
	align-items: baseline;
	gap: .15em 1em;
	margin: 0;
	padding: var(--dhg-row-padding) var(--dhg-today-padding-x);
	border-bottom: var(--dhg-separator-width) var(--dhg-separator-style) var(--dhg-separator);
}

.dhg-dia:last-child,
.dhg-especial:last-child {
	border-bottom: 0;
}

.dhg-dia-horas {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: var(--dhg-hours-align);
	gap: 0 .9em;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.dhg-rangos-stacked .dhg-dia-horas {
	flex-direction: column;
	align-items: var(--dhg-hours-align);
}

.dhg-cerrado {
	color: var(--dhg-closed-color, currentColor);
}

/* El color del día de hoy lo aplica el widget directamente sobre nombre y horas. */
.dhg-dia.is-today,
.dhg-especial.is-today {
	background: var(--dhg-today-bg);
	font-weight: var(--dhg-today-weight);
}

/* Horarios especiales */
.dhg-especiales {
	margin-top: 1em;
}

.dhg-especiales[hidden],
.dhg-especial[hidden] {
	display: none !important;
}

.dhg-especiales-titulo {
	margin: 0 0 .25em;
	font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────
   ESTADO "ABIERTO AHORA"
   ───────────────────────────────────────────────────────────────────────── */
.dhg-estado {
	--dhg-open: #3f7d3a;
	--dhg-soon: #b7791f;
	--dhg-closed: #91320a;
	--dhg-dot: .55em;
	--dhg-state: var(--dhg-closed);
	display: inline-flex;
	align-items: center;
	gap: .5em;
	line-height: 1.3;
	text-align: left;
}

.dhg-estado[hidden] {
	display: none !important;
}

.dhg-estado.is-open   { --dhg-state: var(--dhg-open); }
.dhg-estado.is-soon   { --dhg-state: var(--dhg-soon); }
.dhg-estado.is-closed { --dhg-state: var(--dhg-closed); }

.dhg-estado-punto {
	flex: none;
	width: var(--dhg-dot);
	height: var(--dhg-dot);
	border-radius: 50%;
	background: var(--dhg-state);
}

.dhg-estado.is-open .dhg-estado-punto {
	animation: dhg-pulso 2.4s ease-out infinite;
}

/* Texto en flujo normal: si no cabe, corta entre palabras y el "·" sigue pegado a la etiqueta. */
.dhg-estado-texto {
	display: block;
	min-width: 0;
}

.dhg-estado-label {
	font-weight: 600;
	color: var(--dhg-state);
}

.dhg-estado-detalle:not([hidden])::before {
	content: "·";
	margin: 0 .45em;
	opacity: .6;
}

.dhg-estado-stacked {
	align-items: flex-start;
}

.dhg-estado-stacked .dhg-estado-punto {
	margin-top: .4em;
}

.dhg-estado-stacked .dhg-estado-texto {
	display: flex;
	flex-direction: column;
}

.dhg-estado-stacked .dhg-estado-detalle::before {
	content: none;
}

@keyframes dhg-pulso {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dhg-state) 55%, transparent); }
	70%  { box-shadow: 0 0 0 .5em transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
	.dhg-estado.is-open .dhg-estado-punto {
		animation: none;
	}
}

/* ─────────────────────────────────────────────────────────────────────────
   SIN DATOS (solo editor / administradores)
   ───────────────────────────────────────────────────────────────────────── */
.dhg-vacio {
	padding: .75em 1em;
	border: 1px dashed currentColor;
	opacity: .7;
	font-size: .875em;
}

/* ─────────────────────────────────────────────────────────────────────────
   IMPRESIÓN
   ───────────────────────────────────────────────────────────────────────── */
@media print {
	.dhg-estado {
		display: none !important;
	}
}
