/**
 * WOW Hall Booking — public calendar styles.
 * Scoped under .chb-cal so it won't disturb the surrounding theme.
 */

.chb-cal {
	--chb-cal-olive: #6d7b3e;
	--chb-cal-olive-past: #c6cfa2;
	--chb-cal-dark: #24352b;
	--chb-cal-accent: #a7b57e;
	--chb-cal-title: #6f7d34;
	--chb-cal-today-bg: #fdf6dd;
	--chb-cal-line: #e3e3e3;
	--chb-cal-daynum: #222;
	--chb-cal-daynum-muted: #b3b3b3;

	color: #222;
	font-size: 15px;
	line-height: 1.35;
}

/* Toolbar ---------------------------------------------------------------- */
.chb-cal-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.chb-cal-tb-left,
.chb-cal-tb-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 0;
}

.chb-cal-tb-left {
	justify-content: flex-start;
}

.chb-cal-tb-right {
	justify-content: flex-end;
}

.chb-cal-tb-center {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	justify-content: center;
}

.chb-cal-views {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: 6px;
}

.chb-cal-title {
	font-size: 1.9rem;
	font-weight: 700;
	color: var(--chb-cal-title);
	white-space: nowrap;
}

.chb-cal-btn {
	appearance: none;
	border: 0;
	border-radius: 4px;
	background: var(--chb-cal-dark);
	color: #fff;
	font-size: 0.95rem;
	line-height: 1;
	padding: 9px 14px;
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
}

.chb-cal-btn:hover {
	filter: brightness( 1.12 );
}

.chb-cal-nav {
	padding: 8px 12px;
	font-size: 1.2rem;
}

.chb-cal-today-btn {
	background: var(--chb-cal-accent);
	color: var(--chb-cal-dark);
	font-weight: 600;
}

.chb-cal-view-btn {
	cursor: default;
	opacity: 1;
}

.chb-cal-view-btn[disabled] {
	cursor: default;
}

/* Weekday header --------------------------------------------------------- */
.chb-cal-weekdays {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	border-bottom: 2px solid var(--chb-cal-line);
}

.chb-cal-weekday {
	padding: 8px 10px;
	font-weight: 700;
	color: #333;
}

/* Grid ------------------------------------------------------------------- */
.chb-cal-grid {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	gap: 1px;
	background: var(--chb-cal-line);
	border: 1px solid var(--chb-cal-line);
}

.chb-cal-cell {
	background: #fff;
	min-height: 118px;
	padding: 4px 6px 8px;
	display: flex;
	flex-direction: column;
}

.chb-cal-cell--other {
	background: #fff;
}

.chb-cal-cell--other .chb-cal-daynum {
	color: var(--chb-cal-daynum-muted);
	font-weight: 400;
}

.chb-cal-cell--today {
	background: var(--chb-cal-today-bg);
}

.chb-cal-daynum {
	text-align: right;
	font-weight: 700;
	color: var(--chb-cal-daynum);
	margin-bottom: 4px;
}

/* Events ----------------------------------------------------------------- */
.chb-cal-events {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.chb-cal-ev {
	background: var(--chb-cal-olive);
	color: #fff;
	border-radius: 3px;
	padding: 5px 8px;
	font-size: 0.86rem;
	overflow: hidden;
}

.chb-cal-ev--past {
	background: var(--chb-cal-olive-past);
}

.chb-cal-ev-time {
	display: block;
	font-weight: 400;
	opacity: 0.95;
}

.chb-cal-ev-title {
	display: block;
	font-weight: 600;
	word-wrap: break-word;
}

/* Status / notices ------------------------------------------------------- */
.chb-cal-status {
	min-height: 1.2em;
	margin-top: 10px;
	color: #666;
	font-size: 0.9rem;
}

.chb-cal-note {
	margin: 0 0 12px;
	padding: 8px 12px;
	background: #fff8e5;
	border: 1px solid #f0e2b6;
	border-radius: 4px;
	font-size: 0.9rem;
}

/* Small screens ---------------------------------------------------------- */
@media ( max-width: 640px ) {
	.chb-cal {
		font-size: 13px;
	}

	/* Toolbar: title on its own centred row, then the controls wrap onto the
	   next row(s) so nothing is clipped or overlaps on a narrow phone. */
	.chb-cal-toolbar {
		flex-wrap: wrap;
		gap: 8px;
	}
	.chb-cal-title {
		order: -1;
		flex: 1 1 100%;
		font-size: 1.3rem;
	}
	.chb-cal-tb-left {
		flex: 1 1 auto;
		flex-wrap: wrap;
		gap: 6px;
	}
	.chb-cal-tb-right {
		flex: 1 1 100%;
		justify-content: flex-start;
		flex-wrap: wrap;
		gap: 6px;
	}
	.chb-cal-btn {
		padding: 8px 11px;
		font-size: 0.9rem;
	}

	.chb-cal-cell {
		min-height: 76px;
		padding: 3px 4px 6px;
	}
	.chb-cal-ev {
		font-size: 0.74rem;
		padding: 3px 5px;
	}
	.chb-cal-weekday {
		padding: 6px 4px;
		font-size: 0.8rem;
	}
}

/* View toggle + book button --------------------------------------------- */
.chb-cal-view-btn {
	background: #eef0e6;
	color: var(--chb-cal-dark);
	cursor: pointer;
}

.chb-cal-view-btn.is-active {
	background: var(--chb-cal-dark);
	color: #fff;
}

.chb-cal-book-btn,
.chb-cal-book-btn:link,
.chb-cal-book-btn:visited,
.chb-cal-book-btn:hover,
.chb-cal-book-btn:focus,
.chb-cal-book-btn:active {
	background: var(--chb-cal-olive);
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
}

.chb-cal-book-btn:hover,
.chb-cal-book-btn:focus {
	filter: brightness( 1.08 );
}

/* Multi-day spanning chips ---------------------------------------------- */
.chb-cal-ev--span.is-cont-left {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.chb-cal-ev--span.is-cont-right {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.chb-cal-ev--span.is-cont-left .chb-cal-ev-title::before {
	content: "\2039 ";
	opacity: 0.85;
}

.chb-cal-ev--span.is-cont-right .chb-cal-ev-title::after {
	content: " \203A";
	opacity: 0.85;
}

/* Click-to-book day cells ----------------------------------------------- */
.chb-cal-cell--book {
	position: relative;
	cursor: pointer;
}

.chb-cal-cell--book:hover {
	background: #f6f8ef;
}

.chb-cal-cell--book.chb-cal-cell--today:hover {
	background: #f6efcf;
}

.chb-cal-book-hint {
	position: absolute;
	left: 6px;
	bottom: 4px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px 3px 3px;
	border-radius: 999px;
	background: var(--chb-cal-olive);
	color: #fff;
	font-size: 11.5px;
	line-height: 1;
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.12s ease;
	pointer-events: none;
}

.chb-cal-book-plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	font-size: 13px;
	font-weight: 700;
}

.chb-cal-book-label {
	font-weight: 600;
}

.chb-cal-cell--book:hover .chb-cal-book-hint {
	opacity: 1;
}

/* Agenda / list view ----------------------------------------------------- */
.chb-cal-list {
	border: 1px solid var(--chb-cal-line);
	border-radius: 4px;
	overflow: hidden;
}

.chb-cal-list-day {
	background: #f6f7f1;
	padding: 8px 12px;
	font-weight: 700;
	color: #333;
	border-top: 1px solid var(--chb-cal-line);
}

.chb-cal-list-day:first-child {
	border-top: 0;
}

.chb-cal-list-day.is-today {
	background: var(--chb-cal-today-bg);
}

.chb-cal-list-day.is-past {
	color: #8a8a8a;
}

.chb-cal-list-row {
	display: flex;
	gap: 14px;
	padding: 9px 12px;
	border-top: 1px solid #f0f0ec;
	align-items: baseline;
}

.chb-cal-list-time {
	flex: 0 0 140px;
	color: var(--chb-cal-title);
	font-weight: 600;
}

.chb-cal-list-title {
	flex: 1 1 auto;
	font-weight: 500;
}

.chb-cal-list-content {
	flex: 1 1 auto;
	min-width: 0;
}

.chb-cal-list-desc {
	margin-top: 2px;
	color: #6b6b66;
	font-weight: 400;
	font-size: 0.9rem;
	line-height: 1.4;
	white-space: pre-line;
}

.chb-cal-list-row.chb-cal-ev--internal .chb-cal-list-time {
	color: #7a6f2e;
}

@media ( max-width: 640px ) {
	.chb-cal-list-time {
		flex-basis: 96px;
		font-size: 0.85rem;
	}
}

.chb-cal-list-none {
	color: #8a8a8a;
	font-style: italic;
}

/* ------------------------------------------------------------------ *
 * Add to calendar (0.9.24)
 * ------------------------------------------------------------------ */

.chb-cal-ev--clickable { cursor: pointer; }

.chb-cal-list-add {
	flex: 0 0 auto;
	align-self: center;
	margin-left: auto;
	background: transparent;
	border: 1px solid var(--chb-cal-olive);
	color: var(--chb-cal-olive);
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 0.82em;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}
.chb-cal-list-add:hover,
.chb-cal-list-add:focus {
	background: var(--chb-cal-olive);
	color: #fff;
}

/* The popover is appended to <body>, outside .chb-cal, so it cannot use the
   calendar's scoped CSS variables — use literal colours here, and !important on
   the button visuals so a theme's own <a>/<button> rules can't override them. */
.chb-cal-popover {
	position: absolute;
	z-index: 99999;
	min-width: 220px;
	max-width: 300px;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
	padding: 14px;
	font-size: 15px;
	line-height: 1.4;
}
.chb-cal-pop-head { margin-bottom: 6px; }
.chb-cal-pop-title {
	display: block;
	color: #24352b;
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.3;
}
.chb-cal-pop-when {
	display: block;
	color: #666;
	font-size: 0.85em;
	margin-top: 2px;
}
.chb-cal-pop-desc {
	color: #444;
	font-size: 0.9em;
	margin: 6px 0 10px;
	white-space: pre-line;
}
.chb-cal-pop-label {
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #8a8a8a;
	margin-bottom: 8px;
}
.chb-cal-popover .chb-cal-pop-btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	-webkit-appearance: none;
	appearance: none;
	background: #6d7b3e !important;
	color: #fff !important;
	border: 1px solid #6d7b3e !important;
	border-radius: 6px;
	padding: 10px 12px;
	margin-top: 8px;
	font-size: 0.92em;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	line-height: 1.3;
}
.chb-cal-popover .chb-cal-pop-btn:hover,
.chb-cal-popover .chb-cal-pop-btn:focus {
	background: #24352b !important;
	border-color: #24352b !important;
	color: #fff !important;
}


/* Week view (0.16.5) ----------------------------------------------------- */
.chb-cal-week {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chb-cal-week-day {
	border: 1px solid var(--chb-cal-line);
	border-radius: 6px;
	padding: 10px 12px;
	background: #fff;
}

.chb-cal-week-day.is-today {
	border-color: var(--chb-cal-olive);
	box-shadow: 0 0 0 1px var(--chb-cal-olive);
}

.chb-cal-week-day.is-past {
	opacity: 0.7;
}

.chb-cal-week-head {
	font-weight: 700;
	color: var(--chb-cal-title);
	margin-bottom: 8px;
}

.chb-cal-week-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chb-cal-week-body .chb-cal-list-row {
	padding: 4px 0;
}

.chb-cal-week-none {
	color: #8a8a8a;
	font-style: italic;
}

/* "Make a booking" in week-view days — matches the "Add to calendar" outline. */
.chb-cal-week-book,
.chb-cal-week-book:link,
.chb-cal-week-book:visited {
	display: inline-block;
	align-self: flex-start;
	margin-top: 2px;
	background: transparent;
	border: 1px solid var(--chb-cal-olive);
	color: var(--chb-cal-olive) !important;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 0.82em;
	line-height: 1.2;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.chb-cal-week-book:hover,
.chb-cal-week-book:focus {
	background: var(--chb-cal-olive);
	color: #fff !important;
}

/* "Make a booking" in the event pop-up (kept as a solid button). */
.chb-cal-pop-book,
.chb-cal-pop-book:link,
.chb-cal-pop-book:visited,
.chb-cal-pop-book:hover,
.chb-cal-pop-book:focus {
	display: inline-block;
	align-self: stretch;
	text-align: center;
	margin-top: 6px;
	padding: 8px 14px;
	border-radius: 4px;
	background: var(--chb-cal-olive);
	color: #fff !important;
	font-weight: 600;
	text-decoration: none;
	font-size: 0.9rem;
}

.chb-cal-pop-book:hover,
.chb-cal-pop-book:focus {
	filter: brightness( 1.08 );
}

/* Mobile: stack the toolbar into tidy rows for the new centred layout. */
@media ( max-width: 640px ) {
	.chb-cal-tb-left,
	.chb-cal-tb-center,
	.chb-cal-tb-right {
		flex: 1 1 100%;
		justify-content: center;
		flex-wrap: wrap;
	}
	.chb-cal-tb-left {
		order: -1;
	}
	.chb-cal-tb-center {
		gap: 6px;
	}
	.chb-cal-views {
		margin-left: 0;
	}
}

/* Mobile: centre the month/week date, and drop the now-empty right column. */
@media ( max-width: 640px ) {
	.chb-cal-title {
		text-align: center;
	}
	.chb-cal-tb-right:empty {
		display: none;
	}
}
