/* ==========================================================================
   Onkofest 2026 — schedule (Ajakava)
   Plain CSS (not Tailwind utilities) so no rebuild is needed on the server.
   Sits on the purple festival section: no white panel, orange time rules,
   full width, overlapping events laid out in side-by-side lanes.
   ========================================================================== */

.onko-sched {
	--onko-hour: 88px;          /* must match $onko_hour_px in the render partial */
	--onko-gutter: 56px;
	--onko-colmin: 150px;
	--onko-orange: #F7B37F;
	color: #ffffff;
}

/* ---------- Day tabs ---------- */
.onko-sched__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 28px;
}
.onko-sched__tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 130px;
	padding: 11px 38px;
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: #ffffff;
	cursor: pointer;
	line-height: 1.1;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.onko-sched__tab:hover { border-color: var(--onko-orange); }
.onko-sched__tab.is-active {
	background: var(--onko-orange);
	border-color: var(--onko-orange);
	color: #4a0f90;
}
.onko-sched__tab-label { font-weight: 700; font-size: 1rem; }
.onko-sched__tab-date  { font-size: .8rem; opacity: .85; }

/* ---------- Desktop calendar ---------- */
.onko-cal__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 8px;
}
.onko-cal {
	min-width: calc(var(--onko-gutter) + var(--onko-cols) * var(--onko-colmin));
}
/* Desktop: let the columns shrink to fit the container so no stray horizontal
   scrollbar appears. Below this width the min-widths kick back in (scroll on tablets). */
@media (min-width: 1000px) {
	.onko-cal { min-width: 0; }
	.onko-cal__col,
	.onko-cal__colhead { min-width: 0; }
	/* Columns always fit at this width, so hide any sub-pixel overflow outright —
	   no stray horizontal scrollbar on desktop. */
	.onko-cal__scroll { overflow-x: hidden; }
}

/* Header row (sticky) */
.onko-cal__head {
	display: flex;
	position: sticky;
	top: 0;
	z-index: 6;
	padding-bottom: 8px;
	background: linear-gradient(180deg, #5a1fa0 70%, rgba(90, 31, 160, 0));
}
.onko-cal__corner { width: var(--onko-gutter); flex: 0 0 auto; }
.onko-cal__colhead {
	flex: 1 1 0;
	min-width: var(--onko-colmin);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	margin: 0 2px;
	padding: 10px 6px 11px;
	font-weight: 700;
	font-size: .92rem;
	letter-spacing: .02em;
	/* Flat-bottomed band that sits on top of its column — reads as a header, not a button. */
	border-radius: 7px 7px 0 0;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
}
.onko-cal__colhead--siselava  { background: #D6447D; }
.onko-cal__colhead--valilava  { background: #E8833A; }
.onko-cal__colhead--rannalava { background: #6a2cb0; }
.onko-cal__colhead--teabeala,
.onko-cal__colhead--loovala,
.onko-cal__colhead--vaimne,
.onko-cal__colhead--iluala,
.onko-cal__colhead--puhkeala  { background: #2EA8C7; }

/* Body: time gutter + columns */
.onko-cal__body { display: flex; position: relative; }
.onko-cal__gutter { width: var(--onko-gutter); flex: 0 0 auto; position: relative; }
.onko-cal__time {
	position: absolute;
	right: 8px;
	transform: translateY(-50%);
	font-size: .78rem;
	font-weight: 700;
	color: var(--onko-orange);
	white-space: nowrap;
}
.onko-cal__cols { flex: 1 1 auto; display: flex; position: relative; }
/* Header columns mirror the body's __cols wrapper exactly, so both rows split the
   available width through an identical flex context — otherwise sub-pixel rounding
   drifts the headers out of line with their columns. */
.onko-cal__headcols { flex: 1 1 auto; display: flex; min-width: 0; }
.onko-cal__hline {
	position: absolute;
	left: 0;
	right: 0;
	border-top: 1px solid rgba(247, 179, 127, 0.30);
	pointer-events: none;
}
.onko-cal__col {
	flex: 1 1 0;
	min-width: var(--onko-colmin);
	position: relative;
	/* Same horizontal margin as the column headers so the two stay aligned. */
	margin: 0 2px;
}

/* Saturday only: Siselava, Välilava & Rannalava carry the most programme — give
   them equal extra width (still wider than the rest). Scoped to Laupäev so
   Reede/Pühapäev keep equal columns. Applied to both header and body so the
   columns stay aligned. */
.onko-sched__day[data-day="laupaev"] .onko-cal__colhead--siselava,
.onko-sched__day[data-day="laupaev"] .onko-cal__colhead--valilava,
.onko-sched__day[data-day="laupaev"] .onko-cal__colhead--rannalava,
.onko-sched__day[data-day="laupaev"] .onko-cal__col--siselava,
.onko-sched__day[data-day="laupaev"] .onko-cal__col--valilava,
.onko-sched__day[data-day="laupaev"] .onko-cal__col--rannalava {
	flex-grow: 2;
	min-width: 210px;
}

/* ---------- Event blocks ---------- */
.onko-ev {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 2px;
	padding: 5px 9px;
	border: 0;
	border-radius: 7px;
	background: var(--ev-bg, #f1f1f4);
	color: var(--ev-fg, #34115D);
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	font: inherit;
	line-height: 1.15;
	z-index: 3;
	transition: transform .12s ease, box-shadow .12s ease;
}
/* Area "open all day" blocks: recessed background behind the sessions. The dark
   tint is a background overlay (not a filter) so the white text stays bright and
   readable, same as the support cards. */
.onko-ev.onko-ev--area {
	z-index: 1;
	box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.12);
}
.onko-ev:hover,
.onko-ev:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(20, 4, 40, 0.35);
	outline: none;
	z-index: 7;
}
.onko-ev__time  { font-size: .66rem; font-weight: 700; opacity: .6; white-space: nowrap; flex: 0 0 auto; }
/* Title is the priority — it shows in full; description yields first. */
.onko-ev__title {
	font-size: .86rem;
	font-weight: 600;
	flex: 0 0 auto;
}
.onko-ev__desc {
	font-size: .72rem;
	opacity: .8;
	margin-top: 2px;
	flex: 0 1 auto;
	min-height: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.onko-ev.is-short { justify-content: center; padding: 3px 7px; }
.onko-ev.is-short .onko-ev__time { display: none; }
.onko-ev.is-short .onko-ev__faces { display: none; }
.onko-ev.is-short .onko-ev__title {
	font-size: .72rem;
	line-height: 1.1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Side-by-side parallel events are narrow — smaller type, like the small cards. */
.onko-ev.is-laned .onko-ev__time  { font-size: .6rem; }
.onko-ev.is-laned .onko-ev__title { font-size: .74rem; line-height: 1.12; }

/* Speaker faces on a card */
.onko-ev__faces { display: flex; align-items: center; flex: 0 0 auto; margin-top: 3px; }
.onko-face {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	border: 1.5px solid rgba(255, 255, 255, 0.9);
	margin-left: -7px;
	background: #d9d2e6;
}
.onko-face:first-child { margin-left: 0; }
.onko-face--more {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .6rem;
	font-weight: 700;
	color: #4a0f90;
}

/* ---------- Cards coloured by area (matches the column headers / poster) ---------- */
.onko-ev--loc { box-shadow: 0 3px 10px rgba(20, 4, 40, 0.22); }
.onko-ev--loc .onko-ev__title { font-weight: 700; }
.onko-ev--loc .onko-ev__time  { opacity: .85; }
.onko-ev--loc-siselava  { --ev-bg:#D6447D; --ev-fg:#ffffff; }
.onko-ev--loc-valilava  { --ev-bg:#E8833A; --ev-fg:#3a1d00; }
.onko-ev--loc-rannalava { --ev-bg:#6a2cb0; --ev-fg:#ffffff; }
.onko-ev--loc-teabeala,
.onko-ev--loc-loovala,
.onko-ev--loc-vaimne,
.onko-ev--loc-iluala,
.onko-ev--loc-puhkeala  { --ev-bg:#2596B0; --ev-fg:#ffffff; }

/* Meals & movement breaks: darker than the column colour so they read as
   supporting activities. The dark tint is a background overlay (inset shadow)
   so it does NOT dim the text — text stays full-strength and readable. */
.onko-ev--support {
	box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.22), 0 3px 10px rgba(20, 4, 40, 0.22);
}

/* Evening party: special magenta */
.onko-ev--evening { --ev-bg:#c0398a; --ev-fg:#ffffff; box-shadow: 0 3px 10px rgba(138, 36, 98, 0.3); }
.onko-ev--evening .onko-ev__title { font-weight: 700; }

/* Full-width bars (opening / curfew / closing) */
/* Full-width bars (opening / curfew / closing) sit BEHIND the column cards, so a
   banner that shares a time slot with an event (e.g. the 16.00 opening over the
   16.00 area cards) no longer covers it. The label is left-aligned so it lands in
   the empty left column at that time rather than behind a card. */
.onko-ev--full {
	z-index: 0;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	justify-content: flex-start;
	text-align: left;
	padding-left: 14px;
}
.onko-ev--full .onko-ev__title { -webkit-line-clamp: 1; }
.onko-ev--banner { --ev-bg:#2a0d4d; --ev-border:#2a0d4d; --ev-fg:#ffffff; }
.onko-ev--banner .onko-ev__title { font-weight: 700; }

/* ---------- Mobile list ---------- */
.onko-sched__list { display: none; }
.onko-li {
	display: flex;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 0;
	border-radius: 10px;
	background: var(--ev-bg, #f1f1f4);
	color: var(--ev-fg, #34115D);
	text-align: left;
	cursor: pointer;
	font: inherit;
}
.onko-li__time { flex: 0 0 auto; font-size: .82rem; font-weight: 700; white-space: nowrap; opacity: .8; }
.onko-li__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.onko-li__title { font-weight: 700; font-size: 1rem; }
.onko-li__loc  { font-size: .8rem; opacity: .75; }
.onko-li__desc {
	font-size: .82rem;
	opacity: .85;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.onko-li .onko-ev__faces { margin-top: 4px; }

/* ---------- Modal ---------- */
.onko-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.onko-modal[hidden] { display: none; }
.onko-modal__backdrop { position: absolute; inset: 0; background: rgba(20, 4, 40, 0.6); }
.onko-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 480px;
	max-height: 85vh;
	overflow-y: auto;
	background: #ffffff;
	color: #34115D;
	border-radius: 16px;
	padding: 28px 26px 26px;
	box-shadow: 0 20px 60px rgba(20, 4, 40, 0.5);
}
.onko-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	border: 0;
	background: none;
	font-size: 1.8rem;
	line-height: 1;
	color: rgba(52, 17, 93, 0.5);
	cursor: pointer;
}
.onko-modal__close:hover { color: #34115D; }
.onko-modal__meta {
	font-size: .85rem;
	font-weight: 700;
	color: #8D44E2;
	margin: 0 0 6px;
}
.onko-modal__title { font-size: 1.5rem; font-weight: 700; margin: 0 0 14px; }
.onko-modal__desc  { font-size: 1rem; line-height: 1.55; margin: 0; }
.onko-modal__desc:empty { display: none; }
.onko-modal__desc p { margin: 0 0 0.8em; }
.onko-modal__desc p:last-child { margin-bottom: 0; }

/* Modal speakers: bigger faces with names */
.onko-modal__speakers { display: flex; flex-wrap: wrap; gap: 14px 18px; margin: 0 0 18px; }
.onko-modal__speakers:empty { display: none; }
.onko-modal__speaker { display: flex; flex-direction: column; align-items: center; width: 72px; text-align: center; }
.onko-modal__speaker img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 5px;
	background: #ece3f8;
}
.onko-modal__speaker span { font-size: .72rem; line-height: 1.15; color: #34115D; }
.onko-modal__speaker-role { display: block; color: rgba(52, 17, 93, 0.55); font-size: .64rem; margin-top: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
	.onko-cal__scroll { display: none; }
	.onko-sched__list { display: block; }
}
