/* MT Events — Frontend calendar views
 *
 * Scoped under .mte-cal so it co-exists cleanly with theme styles.
 * Override custom properties on .mte-cal in your theme to re-skin.
 */

.mte-cal {
	--mte-bg:        #ffffff;
	--mte-text:      #111827;
	--mte-muted:     #6b7280;
	--mte-line:      #e5e7eb;
	--mte-line-soft: #f3f4f6;
	--mte-today:     #fef3c7;
	--mte-radius:    6px;
	--mte-font:      inherit;
	/* Leaves breathing room above the calendar when it's the scroll anchor
	 * target after prev/next navigation. Override on the host theme if a
	 * taller sticky header is present: .mte-cal { --mte-scroll-margin: 100px; } */
	--mte-scroll-margin: 24px;

	font-family: var(--mte-font);
	color: var(--mte-text);
	background: var(--mte-bg);
	border: 1px solid var(--mte-line);
	border-radius: var(--mte-radius);
	overflow: hidden;
	max-width: 100%;
	scroll-margin-top: var(--mte-scroll-margin);
}

.mte-cal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--mte-line);
	background: #fafafa;
}

.mte-cal__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.mte-cal__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--mte-line);
	color: var(--mte-text);
	text-decoration: none;
	font-size: 16px;
	line-height: 1;
	transition: background 0.15s ease;
}

.mte-cal__nav:hover {
	background: var(--mte-line-soft);
}

/* -------------------------------------------------------------------------
 * Month view
 * ------------------------------------------------------------------------- */

.mte-cal--month .mte-cal__weekdays {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	background: #fafafa;
	border-bottom: 1px solid var(--mte-line);
}

.mte-cal__weekday {
	padding: 8px 10px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--mte-muted);
	text-align: left;
	min-width: 0;
}

.mte-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.mte-cal__day {
	min-height: 100px;
	min-width: 0;
	padding: 6px 6px 8px;
	border-right: 1px solid var(--mte-line-soft);
	border-bottom: 1px solid var(--mte-line-soft);
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 4px;
	overflow: hidden;
}

.mte-cal__day:nth-child(7n) { border-right: none; }

.mte-cal__day.is-out {
	background: #fafafa;
	color: #c0c4ca;
}

.mte-cal__day.is-today {
	background: var(--mte-today);
}

.mte-cal__date {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--mte-muted);
}

.mte-cal__day.is-today .mte-cal__date {
	color: var(--mte-text);
}

.mte-cal__events {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mte-cal__event {
	margin: 0;
	padding: 0;
}

.mte-cal__event-link {
	display: block;
	padding: 3px 6px;
	font-size: 0.78rem;
	line-height: 1.25;
	border-radius: 3px;
	background: color-mix(in srgb, var(--mte-c) 12%, white);
	border-left: 3px solid var(--mte-c);
	color: var(--mte-text);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.mte-cal__event-link:hover {
	background: color-mix(in srgb, var(--mte-c) 22%, white);
}

.mte-cal__event-time {
	font-weight: 600;
	margin-right: 4px;
	color: var(--mte-muted);
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
 * Week view
 * ------------------------------------------------------------------------- */

.mte-cal--week {
	--mte-hour-h: 36px;
	--mte-header-h: 44px;
}

.mte-cal--week .mte-week__grid {
	display: grid;
	grid-template-columns: 64px repeat(7, minmax(0, 1fr));
}

.mte-week__hours {
	border-right: 1px solid var(--mte-line);
	min-width: 0;
}

.mte-week__hour-label {
	height: var(--mte-hour-h);
	padding: 4px 8px 0 8px;
	font-size: 0.72rem;
	color: var(--mte-muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
	border-top: 1px solid var(--mte-line-soft);
	box-sizing: border-box;
}

.mte-week__hour-label:first-of-type {
	border-top: none;
}

.mte-week__column {
	border-right: 1px solid var(--mte-line-soft);
	min-width: 0;
}

.mte-week__column:last-child {
	border-right: none;
}

.mte-week__column.is-today .mte-week__day-head {
	background: var(--mte-today);
}

.mte-week__day-head {
	height: var(--mte-header-h);
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	padding: 8px;
	border-bottom: 1px solid var(--mte-line);
	background: #fafafa;
	box-sizing: border-box;
}

.mte-week__day-head--spacer {
	background: #fafafa;
}

.mte-week__day-name {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--mte-muted);
}

.mte-week__day-num {
	font-size: 1rem;
	font-weight: 600;
}

.mte-week__day-body {
	position: relative;
	height: calc(var(--mte-hour-h) * var(--mte-hour-span));
}

.mte-week__column.is-today .mte-week__day-body {
	background: rgba(254, 243, 199, 0.25);
}

.mte-week__hour-line {
	height: var(--mte-hour-h);
	border-top: 1px solid var(--mte-line-soft);
}

.mte-week__hour-line:first-child {
	border-top: none;
}

.mte-week__event {
	position: absolute;
	left: 3px;
	right: 3px;
	padding: 4px 6px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--mte-c) 16%, white);
	border-left: 3px solid var(--mte-c);
	color: var(--mte-text);
	text-decoration: none;
	font-size: 0.75rem;
	line-height: 1.25;
	overflow: hidden;
	transition: background 0.15s ease;
	box-sizing: border-box;
}

.mte-week__event:hover {
	background: color-mix(in srgb, var(--mte-c) 28%, white);
	z-index: 2;
}

.mte-week__event-time {
	display: block;
	font-weight: 600;
	color: var(--mte-muted);
	font-variant-numeric: tabular-nums;
}

.mte-week__event-title {
	display: block;
	font-weight: 500;
}

/* -------------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------------- */

@media (max-width: 640px) {
	.mte-cal--month .mte-cal__day { min-height: 70px; }
	.mte-cal__event-link { font-size: 0.7rem; }
	.mte-cal__event-time { display: none; }
	.mte-week__day-name { font-size: 0.65rem; }
}

/* -------------------------------------------------------------------------
 * Week view — simple theme
 *
 * Card-based layout. No hour grid; events stack inside their day's column.
 * Each event card uses the room colour as its accent: tinted background,
 * full colour for the time / title text. Per-event-type icons render at the
 * bottom of the card (optional — set per event type in the admin).
 * ------------------------------------------------------------------------- */

.mte-cal--simple {
	--mte-radius: 12px;
}

.mte-cal--simple .mte-simple__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.mte-cal--simple .mte-simple__column {
	border-right: 1px solid var(--mte-line-soft);
	padding: 24px 14px;
	min-height: 260px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.mte-cal--simple .mte-simple__column:last-child {
	border-right: none;
}

.mte-cal--simple .mte-simple__column.is-today {
	background: linear-gradient(to bottom, color-mix(in srgb, var(--mte-today) 60%, transparent), transparent 80%);
}

.mte-cal--simple .mte-simple__day-head {
	text-align: center;
}

.mte-cal--simple .mte-simple__day-name {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--mte-muted);
}

.mte-cal--simple .mte-simple__day-num {
	font-size: 2rem;
	line-height: 1;
	font-weight: 500;
	margin-top: 6px;
	color: var(--mte-text);
	font-variant-numeric: tabular-nums;
}

.mte-cal--simple .mte-simple__events {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mte-cal--simple .mte-simple__event {
	display: block;
	padding: 12px 14px 14px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--mte-c) 14%, white);
	color: color-mix(in srgb, var(--mte-c) 88%, black);
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mte-cal--simple .mte-simple__event:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
	background: color-mix(in srgb, var(--mte-c) 20%, white);
}

.mte-cal--simple .mte-simple__event-time {
	font-size: 0.74rem;
	font-weight: 600;
	margin-bottom: 6px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
}

.mte-cal--simple .mte-simple__event-title {
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.3;
	word-wrap: break-word;
}

.mte-cal--simple .mte-simple__event-icon {
	margin-top: 12px;
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
}

.mte-cal--simple .mte-simple__event-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

@media (max-width: 768px) {
	.mte-cal--simple .mte-simple__grid {
		grid-template-columns: 1fr;
	}
	.mte-cal--simple .mte-simple__column {
		border-right: none;
		border-bottom: 1px solid var(--mte-line-soft);
		padding: 18px;
		min-height: 0;
	}
	.mte-cal--simple .mte-simple__column:last-child {
		border-bottom: none;
	}
	.mte-cal--simple .mte-simple__day-head {
		text-align: left;
		display: flex;
		align-items: baseline;
		gap: 12px;
	}
	.mte-cal--simple .mte-simple__day-num {
		font-size: 1.5rem;
		margin-top: 0;
	}
}

/* -------------------------------------------------------------------------
 * Filter chips (opt-in via filters="yes" on shortcodes)
 *
 * Rendered above the calendar header. Each chip is a small pill button.
 * Inactive = outlined neutral. Active = filled in the room/type colour.
 * Multiple chips in a group OR together; groups AND across.
 * ------------------------------------------------------------------------- */

.mte-cal .mte-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 24px;
	padding: 12px 18px;
	border-bottom: 1px solid var(--mte-line);
	background: #fafafa;
}

.mte-cal .mte-filters__group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.mte-cal .mte-filters__label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mte-muted);
	margin-right: 4px;
}

.mte-cal .mte-filters__chip {
	font: inherit;
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 5px 12px;
	border-radius: 999px;
	border: 1px solid var(--mte-line);
	background: #fff;
	color: var(--mte-text);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mte-cal .mte-filters__chip:hover {
	background: var(--mte-line-soft);
}

.mte-cal .mte-filters__chip.is-active {
	background: color-mix(in srgb, var(--mte-c, var(--mte-text)) 16%, white);
	border-color: color-mix(in srgb, var(--mte-c, var(--mte-text)) 50%, white);
	color: color-mix(in srgb, var(--mte-c, var(--mte-text)) 88%, black);
	font-weight: 600;
}

.mte-cal .mte-filters__chip:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--mte-c, var(--mte-text)) 50%, white);
	outline-offset: 2px;
}

/* Hidden by client-side filter. Important so it overrides theme display rules. */
.mte-hidden {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Duration badge (simple theme)
 *
 * Small inline pill inside the time row of each event card. Inherits the
 * event card's accent colour via currentColor — no extra plumbing.
 * ------------------------------------------------------------------------- */

.mte-cal--simple .mte-simple__event-time {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 8px;
}

.mte-cal--simple .mte-simple__event-duration {
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 1px 7px;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 18%, white);
	border: 1px solid color-mix(in srgb, currentColor 30%, white);
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
 * Booking button — used inside single event templates
 *
 *   [mt_event_booking text="Book now"]
 *
 * Colour comes from the event's room. Falls back to a neutral accent if no
 * room is set. Override .mte-booking-btn in your theme stylesheet to restyle.
 * ------------------------------------------------------------------------- */

.mte-booking-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 28px;
	border-radius: 8px;
	background: var(--mte-c, #2563eb);
	color: #fff !important;
	font: inherit;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mte-booking-btn:hover {
	filter: brightness(0.95);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px color-mix(in srgb, var(--mte-c, #2563eb) 30%, transparent);
}

.mte-booking-btn:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--mte-c, #2563eb) 50%, white);
	outline-offset: 2px;
}
