/* =====================================================================
   Sport Timetable – frontend
   Všetko je scopované pod .st-timetable, aby nekolidovalo s témou Neve.
   Farby miestností prichádzajú inline cez --st-c (nie sú v CSS natvrdo).
   ===================================================================== */

.st-timetable {
	--st-label-w: 132px;
	--st-lane-h: 64px;
	--st-gap: 4px;
	--st-line: rgba(15, 23, 42, 0.08);
	--st-line-strong: rgba(15, 23, 42, 0.16);
	--st-ink: #1f2937;
	--st-ink-soft: #6b7280;
	--st-bg: #ffffff;
	--st-bg-alt: #fafafa;
	--st-today: rgba(250, 204, 21, 0.12);
	--st-radius: 8px;
	--st-font: inherit;

	font-family: var(--st-font);
	color: var(--st-ink);
	line-height: 1.3;
	margin: 0 0 2rem;
	box-sizing: border-box;
	
}
.st-timetable *,
.st-timetable *::before,
.st-timetable *::after {
	box-sizing: border-box;
	
}
.st-timetable.is-loading .st-grid-wrap {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s;
}

/* ---------- Toolbar ---------- */

.st-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin-bottom: 1rem;
}

.st-rooms {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.st-room-btn,
.st-room-title {
	--st-c: #64748b;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--st-line-strong);
	background: var(--st-bg);
	color: var(--st-ink);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	line-height: 1.2;
	white-space: nowrap;
	transition: background 0.12s, border-color 0.12s;
}
.st-room-btn:hover,
.st-room-btn:focus-visible {
	border-color: var(--st-c);
	text-decoration: none;
	color: var(--st-ink);
}
.st-room-btn.is-active {
	background: var(--st-c);
	border-color: var(--st-c);
	color: #fff;
}
.st-room-btn.is-active .st-room-swatch {
	background: #fff;
}
.st-room-btn[data-room=""] {
	--st-c: #1f2937;
}
.st-room-swatch {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--st-c);
	flex: 0 0 auto;
}
.st-room-title {
	border: 0;
	padding-left: 0;
	font-size: 1.05rem;
	font-weight: 600;
}
.st-room-title .st-room-swatch {
	width: 12px;
	height: 12px;
}

.st-weeknav {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}
.st-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--st-line-strong);
	background: var(--st-bg);
	color: var(--st-ink);
	font-size: 1.5rem;
	line-height: 1;
	text-decoration: none;
	padding-bottom: 3px;
}
.st-nav-btn:hover,
.st-nav-btn:focus-visible {
	background: var(--st-bg-alt);
	color: var(--st-ink);
	text-decoration: none;
}
.st-week-label {
	min-width: 12ch;
	text-align: center;
	font-weight: 600;
	font-size: 1rem;
	padding: 0 8px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.st-nav-today {
	margin-left: 10px;
	font-size: 0.8rem;
	color: var(--st-ink-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.st-nav-today.is-current {
	visibility: hidden;
}
.st-nav-today:hover {
	color: var(--st-ink);
}

/* ---------- Grid ---------- */

.st-grid-wrap {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--st-line-strong);
	border-radius: var(--st-radius);
	background: var(--st-bg);
	scrollbar-width: thin;
}

.st-grid {
	min-width: calc(var(--st-label-w) + var(--st-slots) * var(--st-slot-w));
	position: relative;
}

.st-timeline,
.st-day {
	display: flex;
	align-items: stretch;
}

.st-corner,
.st-day-label {
	flex: 0 0 var(--st-label-w);
	width: var(--st-label-w);
	position: sticky;
	left: 0;
	z-index: 3;
	background: var(--st-bg);
	border-right: 1px solid var(--st-line-strong);
}

.st-track {
	flex: 1 1 auto;
	position: relative;
	min-width: calc(var(--st-slots) * var(--st-slot-w));
	background-image: linear-gradient(to right, var(--st-line) 1px, transparent 1px);
	background-size: calc(100% / var(--st-slots)) 100%;
	background-repeat: repeat-x;
}

/* Časová os */
.st-timeline {
	height: 38px;
	border-bottom: 1px solid var(--st-line-strong);
	background: var(--st-bg-alt);
}
.st-corner {
	background: var(--st-bg-alt);
}
.st-timeline-track {
	background-image: none;
	overflow: hidden;
}
.st-tick {
	position: absolute;
	top: 0;
	height: 100%;
	display: flex;
	align-items: center;
	padding-left: 6px;
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--st-ink-soft);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	transform: translateX(0);
	pointer-events: none;
}
.st-tick::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 1px;
	height: 6px;
	background: var(--st-line-strong);
}
.st-tick--hour {
	color: var(--st-ink);
}
.st-tick--hour::before {
	height: 10px;
}
.st-tick:not(.st-tick--hour) {
	font-size: 0.64rem;
	color: rgba(107, 114, 128, 0.7);
}
.st-tick--last {
	padding-left: 0;
	padding-right: 6px;
	transform: translateX(-100%);
}
.st-tick--last::before {
	left: auto;
	right: 0;
}

/* Riadky dní */
.st-day {
	min-height: calc(var(--st-lanes) * var(--st-lane-h) + 2 * var(--st-gap));
	border-bottom: 1px solid var(--st-line);
}
.st-day:last-child {
	border-bottom: 0;
}
.st-day--weekend .st-day-track,
.st-day--weekend .st-day-label {
	background-color: var(--st-bg-alt);
}
.st-day--today .st-day-track,
.st-day--today .st-day-label {
	background-color: var(--st-today);
}
.st-day--today .st-day-label {
	box-shadow: inset 3px 0 0 #eab308;
}

.st-day-label {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 8px 12px;
	gap: 2px;
}
.st-day-name {
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.01em;
}
.st-day-date {
	font-size: 0.78rem;
	color: var(--st-ink-soft);
	font-variant-numeric: tabular-nums;
}
.st-day-short {
	display: none;
}
.st-day-today-badge {
	position: absolute;
	top: 6px;
	right: 8px;
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a16207;
	font-weight: 600;
}

.st-day-track {
	padding: var(--st-gap) 0;
}

/* ---------- Event bloky ---------- */

.st-event {
	--st-c: #3b82f6;
	--st-c-bg: rgba(59, 130, 246, 0.16);
	--st-c-text: #1e3a8a;
	position: absolute;
	top: calc(var(--st-gap) + var(--st-lane) * var(--st-lane-h));
	height: calc(var(--st-lane-h) - var(--st-gap));
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 4px solid var(--st-c);
	border-radius: 6px;
	background: var(--st-c-bg);
	color: var(--st-c-text);
	font: inherit;
	text-align: left;
	overflow: hidden;
	display: flex;
	align-items: center;
	cursor: default;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
	appearance: none;
	-webkit-appearance: none;
	min-width: 3px;
}
.st-event--clickable {
	cursor: pointer;
}
.st-event--clickable:hover,
.st-event--clickable:focus-visible {
	filter: saturate(1.25) brightness(0.98);
	outline: 2px solid var(--st-c);
	outline-offset: 1px;
	z-index: 2;
}
.st-event-inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	padding: 4px 8px 4px 7px;
	width: 100%;
	min-width: 0;
}
.st-event-text {
	font-weight: 600;
	font-size: 0.82rem;
	line-height: 1.2;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.st-event-time {
	font-size: 0.7rem;
	opacity: 0.85;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Krátke udalosti: menšie písmo, jeden riadok, čas skrytý pri najkratších */
.st-event--s .st-event-text {
	font-size: 0.74rem;
}
.st-event--xs .st-event-inner {
	padding: 2px 4px 2px 3px;
}
.st-event--xs .st-event-text {
	font-size: 0.66rem;
	-webkit-line-clamp: 3;
}
.st-event--xs .st-event-time {
	display: none;
}

.st-event--clip-start {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	border-left-style: dashed;
}
.st-event--clip-end {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.st-event--modified .st-event-time::after {
	content: " ✱";
	font-size: 0.65em;
	vertical-align: super;
}

.st-empty {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	color: var(--st-ink-soft);
	text-align: center;
}

/* ---------- Detail (dialog) ---------- */

.st-dialog {
	border: 0;
	border-radius: 12px;
	padding: 0;
	max-width: min(520px, 92vw);
	width: 100%;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
	color: var(--st-ink, #1f2937);
}
.st-dialog::backdrop {
	background: rgba(15, 23, 42, 0.45);
}
.st-dialog-inner {
	position: relative;
	padding: 24px 28px 28px;
}
.st-dialog-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 1rem;
	cursor: pointer;
	color: #6b7280;
}
.st-dialog-close:hover {
	background: #f3f4f6;
	color: #1f2937;
}
.st-details {
	--st-c: #3b82f6;
}
.st-details-room {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 6px;
	font-size: 0.8rem;
	color: #6b7280;
}
.st-details-title {
	margin: 0 0 4px;
	font-size: 1.35rem;
	line-height: 1.2;
	color: var(--st-c-text, #1f2937);
}
.st-details-time {
	margin: 0 0 14px;
	font-size: 0.95rem;
	color: #374151;
}
.st-details-image {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 0 0 14px;
}
.st-details-desc {
	font-size: 0.95rem;
}
.st-details-desc > :first-child {
	margin-top: 0;
}
.st-details-admin {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px dashed rgba(15, 23, 42, 0.16);
	font-size: 0.9rem;
}
.st-details-note {
	background: #fffbeb;
	border-left: 3px solid #f59e0b;
	padding: 8px 10px;
	border-radius: 4px;
}

/* ---------- Chybový stav ---------- */
.st-timetable--error {
	padding: 12px 16px;
	border: 1px solid #fca5a5;
	background: #fef2f2;
	border-radius: 8px;
	color: #991b1b;
}

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	.st-timetable {
		--st-label-w: 64px;
		--st-lane-h: 58px;
	}
	.st-day-long {
		display: none;
	}
	.st-day-short {
		display: inline;
	}
	.st-day-label {
		padding: 6px 8px;
	}
	.st-day-name {
		font-size: 0.85rem;
	}
	.st-day-today-badge {
		display: none;
	}
	.st-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.st-weeknav {
		margin-left: 0;
		justify-content: center;
	}
	.st-rooms {
		justify-content: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 4px;
		scrollbar-width: none;
	}
	.st-rooms::-webkit-scrollbar {
		display: none;
	}
	.st-dialog-inner {
		padding: 20px 18px 22px;
	}
}

@media (max-width: 480px) {
	.st-timetable {
		--st-label-w: 56px;
	}
	.st-week-label {
		font-size: 0.9rem;
	}
}

/* ---------- Tlač ---------- */
@media print {
	.st-toolbar .st-rooms,
	.st-nav-btn,
	.st-nav-today,
	.st-dialog {
		display: none !important;
	}
	.st-grid-wrap {
		overflow: visible;
		border: 0;
	}
	.st-grid {
		min-width: 0;
	}
	.st-track {
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.st-timetable * {
		transition: none !important;
	}
}

