/* -------------------------------------------------------------------------
   [elmur_ds_theory] shortcode
   ------------------------------------------------------------------------- */

.elmur-ds-theory {
	margin: 2rem 0;
	/* Offset for the anchor jump after month/location navigation.
	   Override --elmur-ds-theory-scroll-offset if a sticky header overlaps. */
	scroll-margin-top: var(--elmur-ds-theory-scroll-offset, 2rem);
}

.elmur-ds-theory__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.elmur-ds-theory__views {
	display: flex;
	gap: 0.5rem;
}

.elmur-ds-theory__loc-select {
	padding: 0.5rem 1rem;
	border: 1px solid var(--color-border, #e5e5e5);
	border-radius: var(--radius-md, 8px);
	background: var(--color-bg, #fff);
	color: var(--color-text, #1a1a1a);
	font-family: inherit;
	cursor: pointer;
}

.elmur-ds-theory__view-btn {
	padding: 0.5rem 1rem;
	border: 1px solid var(--color-border, #e5e5e5);
	background: var(--color-bg-alt, #f5f5f5);
	color: var(--color-text, #1a1a1a);
	border-radius: var(--radius-md, 8px);
	cursor: pointer;
	font-family: inherit;
}

.elmur-ds-theory__view-btn.is-active {
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
	border-color: var(--color-accent, #cc0000);
}

.elmur-ds-theory__panel.is-hidden {
	display: none;
}

.elmur-ds-theory__table {
	width: 100%;
	border-collapse: collapse;
}

.elmur-ds-theory__table th,
.elmur-ds-theory__table td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--color-border, #e5e5e5);
	text-align: left;
}

.elmur-ds-theory__desc {
	font-size: 0.9rem;
	color: var(--color-text-muted, #6b6b6b);
	margin-top: 0.25rem;
}

/* -------------------------------------------------------------------------
   Month-grid calendar
   ------------------------------------------------------------------------- */

.elmur-ds-theory__cal {
	border: 1px solid var(--color-border, #e5e5e5);
	border-radius: var(--radius-md, 8px);
	overflow: hidden;
	background: var(--color-bg, #fff);
}

.elmur-ds-theory__cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--color-bg-alt, #f5f5f5);
	border-bottom: 1px solid var(--color-border, #e5e5e5);
}

.elmur-ds-theory__cal-title {
	font-weight: 600;
	font-size: 1.1rem;
}

.elmur-ds-theory__cal-nav {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.elmur-ds-theory__today {
	display: inline-flex;
	align-items: center;
	height: 2rem;
	padding: 0 0.75rem;
	border-radius: var(--radius-md, 8px);
	text-decoration: none;
	font-size: 0.85rem;
	line-height: 1;
	color: var(--color-text, #1a1a1a);
	background: var(--color-bg, #fff);
	border: 1px solid var(--color-border, #e5e5e5);
}

.elmur-ds-theory__today:hover {
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
	border-color: var(--color-accent, #cc0000);
}

.elmur-ds-theory__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius-md, 8px);
	text-decoration: none;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--color-text, #1a1a1a);
	background: var(--color-bg, #fff);
	border: 1px solid var(--color-border, #e5e5e5);
}

.elmur-ds-theory__nav:hover {
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
	border-color: var(--color-accent, #cc0000);
}

.elmur-ds-theory__nav.is-disabled {
	opacity: 0.35;
	cursor: default;
}

.elmur-ds-theory__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.elmur-ds-theory__dow {
	padding: 0.5rem;
	text-align: center;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-text-muted, #6b6b6b);
	background: var(--color-bg-alt, #f5f5f5);
	border-bottom: 1px solid var(--color-border, #e5e5e5);
}

.elmur-ds-theory__day {
	min-height: 5.75rem;
	min-width: 0;
	padding: 0.35rem;
	border-right: 1px solid var(--color-border, #e5e5e5);
	border-bottom: 1px solid var(--color-border, #e5e5e5);
	text-align: left;
	font: inherit;
	color: inherit;
	background: var(--color-bg, #fff);
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.elmur-ds-theory__day:nth-child(7n) {
	border-right: 0;
}

button.elmur-ds-theory__day {
	cursor: pointer;
}

button.elmur-ds-theory__day:hover {
	background: var(--color-bg-alt, #f5f5f5);
}

.elmur-ds-theory__day.is-blank {
	background: var(--color-bg-alt, #fafafa);
}

.elmur-ds-theory__daynum {
	align-self: flex-start;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--color-text-muted, #6b6b6b);
}

.elmur-ds-theory__day.is-today .elmur-ds-theory__daynum {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	padding: 0;
	border-radius: 50%;
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
}

.elmur-ds-theory__chips {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.elmur-ds-theory__chip {
	display: block;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	font-size: 0.72rem;
	line-height: 1.3;
	padding: 0.12rem 0.4rem;
	border-radius: 4px;
	overflow: hidden;
}

/* Each text line inside a chip truncates on its own. */
.elmur-ds-theory__chip-main,
.elmur-ds-theory__chip-loc {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.elmur-ds-theory__chip-time,
.elmur-ds-theory__chip-end {
	font-weight: 600;
}

.elmur-ds-theory__chip-title {
	margin-left: 0.3rem;
}

.elmur-ds-theory__chip-loc {
	font-size: 0.65rem;
	line-height: 1.2;
	opacity: 0.9;
}

.elmur-ds-theory__chip--held {
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
}

.elmur-ds-theory__chip--off {
	background: var(--elmur-ds-chip, #9e9e9e);
	color: #fff;
}

.elmur-ds-theory__more {
	font-size: 0.7rem;
	color: var(--color-text-muted, #6b6b6b);
}

/* -------------------------------------------------------------------------
   Day detail overlay
   ------------------------------------------------------------------------- */

.elmur-ds-theory-no-scroll {
	overflow: hidden;
}

.elmur-ds-theory__overlay[hidden] {
	display: none;
}

.elmur-ds-theory__overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.5);
}

.elmur-ds-theory__modal {
	position: relative;
	width: 100%;
	max-width: 28.75rem;
	max-height: 85vh;
	overflow-y: auto;
	background: var(--color-bg, #fff);
	border-radius: var(--radius-md, 8px);
	padding: 1.5rem;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.elmur-ds-theory__modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	border: 0;
	background: transparent;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: var(--color-text-muted, #6b6b6b);
}

.elmur-ds-theory__detail-head {
	font-weight: 600;
	font-size: 1.05rem;
	margin-bottom: 1rem;
	padding-right: 1.5rem;
}

.elmur-ds-theory__detail-item {
	display: flex;
	gap: 0.75rem;
	padding: 0.6rem 0;
	border-top: 1px solid var(--color-border, #e5e5e5);
}

.elmur-ds-theory__detail-time {
	flex: 0 0 auto;
	font-weight: 600;
	color: var(--color-text, #1a1a1a);
}

.elmur-ds-theory__detail-item--off .elmur-ds-theory__detail-body {
	color: var(--color-text-muted, #6b6b6b);
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.elmur-ds-theory__off-dot {
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--elmur-ds-chip, #9e9e9e);
}

.elmur-ds-theory__detail-desc {
	font-size: 0.9rem;
	color: var(--color-text-muted, #6b6b6b);
	margin-top: 0.25rem;
}

.elmur-ds-theory__addcal {
	margin-top: 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.4rem;
}

.elmur-ds-theory__addcal-label {
	font-size: 0.8rem;
	color: var(--color-text-muted, #6b6b6b);
}

.elmur-ds-theory__addcal-btns {
	display: flex;
	gap: 0.5rem;
}

.elmur-ds-theory__addcal-btns .elmur-ds-theory__addcal-btn {
	flex: 1 1 0;
	text-align: center;
}

@media (max-width: 37.5rem) {
	.elmur-ds-theory__addcal-btns {
		flex-direction: column;
	}
}

.elmur-ds-theory__addcal-btn {
	font-size: 0.8rem;
	padding: 0.25rem 0.6rem;
	border-radius: var(--radius-md, 6px);
	border: 1px solid var(--color-border, #e5e5e5);
	background: var(--color-bg-alt, #f5f5f5);
	color: var(--color-text, #1a1a1a);
	text-decoration: none;
	white-space: nowrap;
}

.elmur-ds-theory__addcal-btn:hover {
	background: var(--color-accent, #cc0000);
	color: var(--color-on-primary, #fff);
	border-color: var(--color-accent, #cc0000);
}

.elmur-ds-theory__list-cal {
	white-space: nowrap;
}

.elmur-ds-theory__list-cal .elmur-ds-theory__addcal-btn {
	margin-right: 0.3rem;
}

.elmur-ds-theory__list-loc,
.elmur-ds-theory__detail-loc {
	font-size: 0.85rem;
	color: var(--color-text-muted, #6b6b6b);
	margin-top: 0.2rem;
}

@media (max-width: 37.5rem) {
	.elmur-ds-theory__day {
		min-height: 4.375rem;
		padding: 0.25rem;
	}

	.elmur-ds-theory__chips {
		gap: 0.15rem;
	}

	/* Hide long titles + location; held events show just the time as a compact chip. */
	.elmur-ds-theory__chip-time {
		margin-right: 0;
	}

	.elmur-ds-theory__chip-title,
	.elmur-ds-theory__chip-end,
	.elmur-ds-theory__chip-loc {
		display: none;
	}

	.elmur-ds-theory__chip--held {
		font-size: 0.6rem;
		padding: 0.05rem 0.25rem;
		text-align: center;
	}

	/* Holidays / cancellations have no time → show as a small colored dot. */
	.elmur-ds-theory__chip--off {
		width: 0.6rem;
		height: 0.6rem;
		padding: 0;
		border-radius: 50%;
	}

	.elmur-ds-theory__chip--off .elmur-ds-theory__chip-main {
		display: none;
	}

	.elmur-ds-theory__more {
		font-size: 0.6rem;
	}
}

/* ------------------------------------------------------------------
   Compact weekly times list ([elmur_ds_theory_times], footer/sidebar)
   ------------------------------------------------------------------ */

.elmur-ds-theory-times {
	line-height: 1.375rem;
}

.elmur-ds-theory-times__location {
	margin: 0 0 0.25rem;
	color: var(--color-accent, #cc0000);
}

.elmur-ds-theory-times__location:not(:first-child) {
	margin-top: 0.75rem;
}

.elmur-ds-theory-times__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	column-gap: 0.75em;
	row-gap: 0.25em;
	align-items: start;
}

.elmur-ds-theory-times__row {
	display: contents;
}

.elmur-ds-theory-times__day {
	font-weight: 500;
}

.elmur-ds-theory-times__note {
	margin: 0.75rem 0 0;
	font-size: 0.85em;
	color: var(--color-text-muted, #6b6b6b);
}

.elmur-ds-theory-times__note a {
	color: var(--color-accent, #cc0000);
	text-decoration: underline;
}

.elmur-ds-theory-times__note a:hover {
	color: var(--color-text, #1a1a1a);
	text-decoration: none;
}

/* -------------------------------------------------------------------------
   My theory lessons (student RSVP)
   ------------------------------------------------------------------------- */
.elmur-ds-theory-my {
	max-width: 46rem;
}

.elmur-ds-theory-my__notice {
	margin-bottom: 1.2em;
	padding: 0.75em 1em;
	border-radius: 4px;
	border-left: 4px solid transparent;
	font-size: 0.95em;
}

.elmur-ds-theory-my__notice--info {
	background: #eef4fb;
	border-color: #2271b1;
}

.elmur-ds-theory-my__notice--success {
	background: #edfaed;
	border-color: #4caf50;
	color: #1a6b1a;
}

.elmur-ds-theory-my__notice--error {
	background: #fcecec;
	border-color: #d63638;
	color: #8a1f1f;
}

.elmur-ds-theory-my__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--color-border, #e0e0e0);
	border-radius: 6px;
	overflow: hidden;
}

.elmur-ds-theory-my__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em 1em;
	padding: 0.85em 1em;
	border-top: 1px solid var(--color-border, #ececec);
}

.elmur-ds-theory-my__item:first-child {
	border-top: none;
}

.elmur-ds-theory-my__item.is-going {
	background: #f0faf4;
}

.elmur-ds-theory-my__info {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	min-width: 14rem;
}

.elmur-ds-theory-my__when {
	font-weight: 700;
}

.elmur-ds-theory-my__meta {
	font-size: 0.85em;
	color: var(--color-muted, #666);
}

.elmur-ds-theory-my__btn {
	display: inline-block;
	padding: 0.45em 1.1em;
	border-radius: 4px;
	border: 1px solid transparent;
	font-family: inherit;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
}

.elmur-ds-theory-my__btn--going {
	background: #2e7d32;
	color: #fff;
}

.elmur-ds-theory-my__btn--cancel {
	background: #fff;
	color: #8a1f1f;
	border-color: #d6a0a0;
}

.elmur-ds-theory-my__full {
	font-size: 0.9em;
	font-weight: 600;
	color: var(--color-muted, #888);
}

.elmur-ds-theory-my__empty {
	color: var(--color-muted, #666);
}
