/*
 * Camp schedule module.
 *
 * Sits inside an existing marketing page (a YOOtheme builder section on this
 * site) and inherits its type; the only colours it owns are the activity
 * colours the manager chose, which arrive per card as --bg with a readable
 * --ink already computed server-side (CardInk).
 *
 * Replaces a UIkit-dependent block that emitted the whole schedule twice —
 * once for desktop, once for mobile. One DOM here, laid out by the grid.
 */

.mod-few-sched {
	--mod-few-sched-gap: 14px;
	--mod-few-sched-rule: rgba(127, 127, 127, 0.22);
	--mod-few-sched-muted: rgba(127, 127, 127, 1);
	--mod-few-sched-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

@supports (color: color-mix(in srgb, currentColor 50%, transparent)) {
	.mod-few-sched {
		--mod-few-sched-rule: color-mix(in srgb, currentColor 18%, transparent);
		--mod-few-sched-muted: color-mix(in srgb, currentColor 58%, transparent);
	}
}

.mod-few-sched__empty {
	color: var(--mod-few-sched-muted);
	font-style: italic;
}

.mod-few-sched__grid {
	display: grid;
	grid-template-columns: repeat(var(--mod-few-sched-days, 5), minmax(0, 1fr));
	gap: var(--mod-few-sched-gap);
}

.mod-few-sched__day {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mod-few-sched__daylabel {
	margin: 0 0 12px;
	padding: 0 2px 9px;
	border-bottom: 2px solid var(--mod-few-sched-rule);
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.2;
}

.mod-few-sched__cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ---------- one activity ---------- */

.mod-few-sched__act {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 13px;
	border: 0;
	border-radius: 12px;
	background: var(--bg);
	color: var(--ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	appearance: none;
}

.mod-few-sched__act:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.mod-few-sched__title {
	font-weight: 650;
	font-size: 0.92rem;
	line-height: 1.28;
	margin-right: 6px;
}

.mod-few-sched__time {
	font-family: var(--mod-few-sched-mono);
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	opacity: 0.82;
	/* The time is one value and must never break across it. */
	white-space: nowrap;
}

/*
 * Lanes: one per session running in parallel. This is the whole point of the
 * card — four weapons in four halls reads as scale, where four identical
 * cards read as a rendering fault.
 */
.mod-few-sched__lanes {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin-top: 9px;
}

.mod-few-sched__lane {
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--chip);
	font-size: 0.74rem;
	line-height: 1.35;
}

.mod-few-sched__lane b {
	font-weight: 650;
}

/* A schedule still being planned has to hold the column on its own. */
.mod-few-sched--roomy .mod-few-sched__act {
	padding: 16px;
	border-radius: 14px;
}

.mod-few-sched--roomy .mod-few-sched__title {
	font-size: 1.06rem;
}

.mod-few-sched--roomy .mod-few-sched__time {
	font-size: 0.78rem;
}

.mod-few-sched--roomy .mod-few-sched__lanes {
	margin-top: 12px;
	gap: 5px;
}

.mod-few-sched--roomy .mod-few-sched__lane {
	padding: 3px 9px;
	font-size: 0.8rem;
}

/* ---------- details ---------- */

.mod-few-sched__dialog {
	width: min(520px, calc(100vw - 32px));
	max-height: min(82vh, 760px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: #16202a;
	box-shadow: 0 24px 60px rgba(6, 14, 22, 0.28);
}

.mod-few-sched__dialog::backdrop {
	background: rgba(8, 14, 20, 0.62);
}

.mod-few-sched__sheet {
	position: relative;
	padding: 26px;
}

.mod-few-sched__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.14);
	color: inherit;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.mod-few-sched__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* The card's colour, carried into the dialog so it is recognisably the one
   that was clicked. */
.mod-few-sched__swatch {
	display: block;
	width: 46px;
	height: 5px;
	margin-bottom: 14px;
	border-radius: 999px;
	background: var(--bg);
}

.mod-few-sched__sheettitle {
	margin: 0 34px 4px 0;
	font-size: 1.2rem;
	line-height: 1.25;
}

.mod-few-sched__sheettime {
	margin: 0 0 16px;
	font-family: var(--mod-few-sched-mono);
	font-size: 0.76rem;
	letter-spacing: 0.05em;
	color: #5b6c78;
}

.mod-few-sched__sheetlanes {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.mod-few-sched__sheetlanes li {
	display: flex;
	gap: 8px;
	align-items: baseline;
	padding: 6px 10px;
	border-radius: 8px;
	background: rgba(127, 127, 127, 0.1);
	font-size: 0.86rem;
}

.mod-few-sched__sheetlanes span {
	color: #5b6c78;
}

.mod-few-sched__desc {
	max-height: 44vh;
	overflow-y: auto;
	line-height: 1.6;
}

.mod-few-sched__desc > :first-child { margin-top: 0; }
.mod-few-sched__desc > :last-child { margin-bottom: 0; }
.mod-few-sched__desc p { margin: 0 0 10px; }
.mod-few-sched__desc ul { margin: 0 0 10px; padding-left: 20px; }
.mod-few-sched__desc a { color: inherit; }

.mod-few-sched__nodesc {
	color: #7d8b95;
	font-style: italic;
}

@media (prefers-color-scheme: dark) {
	.mod-few-sched__dialog { background: #14222c; color: #e9f1f6; }
	.mod-few-sched__sheettime,
	.mod-few-sched__sheetlanes span { color: #9fb0bc; }
	.mod-few-sched__nodesc { color: #8fa1ad; }
}

/*
 * Days step down rather than each rendering a second time for mobile. Below
 * the last step the schedule reads as one column of days, which is how the
 * old block's mobile stack behaved — without a duplicate copy in the DOM.
 */
@media (max-width: 1100px) {
	.mod-few-sched__grid { grid-template-columns: repeat(min(3, var(--mod-few-sched-days, 5)), minmax(0, 1fr)); }
}

@media (max-width: 780px) {
	.mod-few-sched__grid { grid-template-columns: repeat(min(2, var(--mod-few-sched-days, 5)), minmax(0, 1fr)); }
}

@media (max-width: 520px) {
	.mod-few-sched { --mod-few-sched-gap: 18px; }
	.mod-few-sched__grid { grid-template-columns: minmax(0, 1fr); }
}
