/* Little Course Manager – front end. Kept minimal so themes stay in charge. */

.lcm-courses {
	display: grid;
	gap: 1.5rem;
}

.lcm-course {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	padding: 1.25rem 1.5rem;
}

.lcm-course-title {
	margin: 0 0 0.5rem;
}

.lcm-course-meta,
.lcm-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0.25rem 1.5rem;
	margin: 0 0 1rem;
}

.lcm-course-meta dt,
.lcm-summary dt {
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	opacity: 0.7;
}

.lcm-course-meta dd,
.lcm-summary dd {
	margin: 0;
}

.lcm-state-open dd { color: #1a7f37; }
.lcm-state-waitlist dd { color: #9a6700; }
.lcm-state-full dd,
.lcm-state-past dd,
.lcm-state-cancelled dd { color: #b42318; }

.lcm-booking {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.lcm-booking h4 {
	margin: 0 0 0.75rem;
}

.lcm-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.lcm-field input {
	width: 100%;
	max-width: 28rem;
	box-sizing: border-box;
	padding: 0.5rem;
}

.lcm-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
}

.lcm-button {
	display: inline-block;
	cursor: pointer;
	text-decoration: none;
}

/* Honeypot: hidden from humans, visible to naive bots. */
.lcm-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lcm-notice {
	padding: 0.75rem 1rem;
	border-left: 4px solid;
	margin: 0 0 1rem;
	background: rgba(0, 0, 0, 0.03);
}

.lcm-notice > :first-child { margin-top: 0; }
.lcm-notice > :last-child { margin-bottom: 0; }
.lcm-notice ul { margin: 0; padding-left: 1.2em; }
.lcm-notice-success { border-color: #1a7f37; }
.lcm-notice-info { border-color: #9a6700; }
.lcm-notice-error { border-color: #b42318; }

.lcm-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Tables: compact course list and "My bookings". */
.lcm-table {
	width: 100%;
	font-size: 0.9em;
	border-collapse: collapse;
	margin: 0 0 1.5rem;
}

.lcm-table th,
.lcm-table td {
	padding: 0.6rem 0.75rem 0.6rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	text-align: left;
	vertical-align: middle;
}

.lcm-table th {
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	opacity: 0.7;
}

.lcm-table .lcm-col-action {
	text-align: right;
	padding-right: 0;
	white-space: nowrap;
}

.lcm-table .lcm-book {
	margin: 0;
}

.lcm-courses-compact .lcm-col-course {
	min-width: 6em;
}

.lcm-courses-compact .lcm-col-action .lcm-button {
	padding: 0.5em 1em;
	white-space: nowrap;
}

.lcm-courses-compact .lcm-time {
	display: block;
	font-size: 0.9em;
	opacity: 0.8;
}

.lcm-courses-compact .lcm-col-date {
	white-space: nowrap;
}

.lcm-courses-compact .lcm-is-open td {
	border-bottom: 0;
}

.lcm-courses-compact .lcm-booking-row > td {
	padding-top: 0;
}

.lcm-courses-compact .lcm-booking-row .lcm-booking {
	margin-top: 0;
}

td.lcm-state-open { color: #1a7f37; }
td.lcm-state-waitlist { color: #9a6700; }
td.lcm-state-full,
td.lcm-state-past,
td.lcm-state-cancelled { color: #b42318; }

.lcm-bookings-table .lcm-status-cancelled td:not(.lcm-col-action) {
	opacity: 0.65;
}

.lcm-lookup-result {
	margin-top: 1.5rem;
}

/* Narrow screens: stack the table cells, labelled via data-label. */
@media (max-width: 640px) {
	.lcm-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.lcm-table,
	.lcm-table tbody,
	.lcm-table tr,
	.lcm-table td {
		display: block;
		width: 100%;
	}

	.lcm-table tr {
		padding: 0.75rem 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	}

	.lcm-table td {
		padding: 0.15rem 0;
		border: 0;
		text-align: left;
	}

	.lcm-table td[data-label]:not(:empty)::before {
		content: attr(data-label) ": ";
		font-weight: 600;
	}

	.lcm-courses-compact .lcm-time {
		display: inline;
		margin-left: 0.5em;
	}

	.lcm-table .lcm-col-course::before {
		content: none !important;
	}

	.lcm-table .lcm-col-course {
		font-weight: 600;
	}

	.lcm-table .lcm-col-action {
		text-align: left;
		padding-top: 0.5rem;
	}

	.lcm-table .lcm-col-action:empty,
	.lcm-table td:empty {
		display: none;
	}

	.lcm-courses-compact .lcm-is-open {
		border-bottom: 0;
	}
}
