/**
 * Tobalt Lessons Timer — Frontend Styles (v2.0.0)
 *
 * Author: Tobalt — https://tobalt.lt
 *
 * Design goals (per spec):
 *  - sidebar / mobile-first
 *  - one accent color (inherited from the theme)
 *  - neutral bg, subtle border/shadow, 8px rounded
 *  - title bold, meta muted, no tables, no clutter
 */

.tlt-widget {
	--tlt-accent: var(--wp--preset--color--primary, currentColor);
	--tlt-muted: color-mix(in srgb, currentColor 60%, transparent);
	--tlt-subtle: color-mix(in srgb, currentColor 10%, transparent);
	--tlt-surface: color-mix(in srgb, currentColor 3%, transparent);

	display: block;
	box-sizing: border-box;
	max-width: 100%;
	padding: 14px 16px 12px;
	border: 1px solid var(--tlt-subtle);
	border-radius: 8px;
	background: var(--tlt-surface);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
	font-size: 14px;
	line-height: 1.45;
}

.tlt-widget *,
.tlt-widget *::before,
.tlt-widget *::after {
	box-sizing: border-box;
}

/* ── Head ──────────────────────────────────────────────── */
.tlt-widget__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}

.tlt-widget__head-main {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tlt-widget__title {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--tlt-muted);
}

.tlt-widget__day {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: capitalize;
}

/* ── Status line ────────────────────────────────────────── */
.tlt-widget__status {
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--tlt-subtle);
	font-size: 12px;
	font-weight: 600;
	color: var(--tlt-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* When a lesson is active the status line is empty — collapse it
 * so the list sits flush under the weekday header. */
.tlt-widget__status[data-state="active"]:empty {
	display: none;
}

/* ── Debug indicator ────────────────────────────────────── */
.tlt-widget__debug-badge {
	flex-shrink: 0;
	padding: 2px 6px;
	border-radius: 3px;
	background: #d63638;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .06em;
	cursor: help;
}

.tlt-widget--debug {
	outline: 1px dashed #d63638;
	outline-offset: 2px;
}

/* ── Day list ───────────────────────────────────────────── */
.tlt-widget__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tlt-widget__item {
	padding: 6px 8px;
	border-radius: 6px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1px;
	transition: background .2s ease;
}

.tlt-widget__item-time {
	font-size: 11px;
	font-weight: 600;
	color: var(--tlt-muted);
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

.tlt-widget__item-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
}

.tlt-widget__item-meta {
	font-size: 11px;
	color: var(--tlt-muted);
	line-height: 1.3;
}

.tlt-widget__dot {
	margin: 0 2px;
	opacity: .5;
}

/* Past lessons — dimmed */
.tlt-widget__item--past {
	opacity: .45;
}

.tlt-widget__item--past .tlt-widget__item-name {
	font-weight: 500;
}

/* Upcoming lessons — default weight, no highlight */
.tlt-widget__item--upcoming {
	/* intentionally default */
}

/* Current lesson — subtle emphasis only */
.tlt-widget__item--current {
	position: relative;
	padding-left: 12px;
	border-left: 3px solid var(--tlt-accent);
}

.tlt-widget__item--current .tlt-widget__item-time {
	color: var(--tlt-accent);
	display: flex;
	align-items: center;
	gap: 6px;
}

.tlt-widget__item-now {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--tlt-accent);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.tlt-widget__item--current .tlt-widget__item-name {
	font-size: 14px;
	font-weight: 700;
}

.tlt-widget__item-countdown {
	display: inline-block;
	margin-top: 3px;
	padding: 1px 8px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--tlt-accent) 15%, transparent);
	color: var(--tlt-accent);
	font-size: 11px;
	font-weight: 700;
}

.tlt-widget__empty {
	padding: 6px 0;
	color: var(--tlt-muted);
	font-size: 13px;
}

/* ── Foot ──────────────────────────────────────────────── */
.tlt-widget__foot {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--tlt-subtle);
	text-align: right;
}

.tlt-widget__link {
	font-size: 12px;
	font-weight: 600;
	color: var(--tlt-accent);
	text-decoration: none;
}

.tlt-widget__link:hover,
.tlt-widget__link:focus-visible {
	text-decoration: underline;
}

/* ══════════════════════════════════════════════════════
   FULL SCHEDULE VIEW (Mon–Fri 5-column grid)
   ══════════════════════════════════════════════════════ */
.tlt-full {
	--tlt-accent: var(--wp--preset--color--primary, currentColor);
	--tlt-muted: color-mix(in srgb, currentColor 60%, transparent);
	--tlt-subtle: color-mix(in srgb, currentColor 10%, transparent);
	--tlt-surface: color-mix(in srgb, currentColor 3%, transparent);

	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 14px;
	align-items: start;
}

.tlt-full__day {
	padding: 14px 14px 12px;
	border: 1px solid var(--tlt-subtle);
	border-radius: 10px;
	background: var(--tlt-surface);
	min-width: 0;
}

.tlt-full__day--today {
	border-color: var(--tlt-accent);
	box-shadow: 0 0 0 1px var(--tlt-accent), 0 4px 14px color-mix(in srgb, var(--tlt-accent) 15%, transparent);
}

.tlt-full__day-header {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--tlt-subtle);
}

.tlt-full__day-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	text-transform: capitalize;
}

.tlt-full__today {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	padding: 2px 6px;
	border-radius: 3px;
	background: var(--tlt-accent);
	color: #fff;
}

.tlt-full__empty {
	margin: 0;
	color: var(--tlt-muted);
	font-size: 12px;
	font-style: italic;
}

.tlt-full__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tlt-full__item {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.tlt-full__item-time {
	font-size: 11px;
	font-weight: 600;
	color: var(--tlt-muted);
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

.tlt-full__item-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.tlt-full__item-meta {
	font-size: 11px;
	color: var(--tlt-muted);
	line-height: 1.3;
}

.tlt-full__dot {
	margin: 0 2px;
	opacity: .5;
}

/* Past lessons on today's column — dimmed */
.tlt-full__item--past {
	opacity: .4;
}

/* Current lesson — subtle accent bar on the left */
.tlt-full__item--current {
	position: relative;
	padding-left: 10px;
	border-left: 3px solid var(--tlt-accent);
}

.tlt-full__item--current .tlt-full__item-time {
	color: var(--tlt-accent);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.tlt-full__item--current .tlt-full__item-name {
	font-weight: 700;
	font-size: 14px;
}

.tlt-full__now {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--tlt-accent);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.tlt-full__item-countdown {
	display: inline-block;
	align-self: flex-start;
	margin-top: 3px;
	padding: 1px 8px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--tlt-accent) 15%, transparent);
	color: var(--tlt-accent);
	font-size: 11px;
	font-weight: 700;
}

/* Responsive: 5 → 2 → 1 columns */
@media (max-width: 900px) {
	.tlt-full {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.tlt-full {
		grid-template-columns: 1fr;
	}
}
