/* ============================================================================
 * MPH BOOKINGS -- FRONT END
 * ============================================================================
 * Palette: orange #FAA61C, charcoal blue #353F51, dusk #465DAA,
 *          powder #A8B6DE, white. Fonts are the site's own.
 * Prefix: mphb-
 * ========================================================================= */

.mphb-wrap {
	--mphb-orange: #faa61c;
	--mphb-orange-deep: #de8c05;
	--mphb-navy: #353f51;
	--mphb-navy-deep: #262f3c;
	--mphb-blue: #465daa;
	--mphb-powder: #a8b6de;
	--mphb-powder-soft: rgba(168, 182, 222, 0.22);
	--mphb-white: #ffffff;
	--mphb-head: "Poppins", -apple-system, sans-serif;
	--mphb-body: "Glacial Indifference", "Poppins", -apple-system, sans-serif;
	--mphb-ease: cubic-bezier(0.16, 1, 0.3, 1);

	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: var(--mphb-body);
	color: var(--mphb-navy);
}
.mphb-wrap *,
.mphb-wrap *::before,
.mphb-wrap *::after {
	box-sizing: border-box;
}

.mphb-title {
	font-family: var(--mphb-head);
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.4px;
	margin: 0 0 10px;
}
.mphb-notice {
	margin: 0 0 20px;
	font-size: 15px;
	color: var(--mphb-blue);
	font-weight: 600;
}

/* ---- Calendar ---- */
.mphb-cal-mount {
	width: 100%;
}
.mphb-cal-mount.mphb-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.mphb-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.mphb-cal-title {
	margin: 0;
	font-family: var(--mphb-head);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.3px;
	text-align: center;
}
.mphb-nav-btn {
	font-family: var(--mphb-head);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--mphb-blue);
	background: var(--mphb-white);
	border: 1px solid var(--mphb-powder);
	border-radius: 100px;
	padding: 9px 18px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
/* Month arrows are buttons too: keep the theme's gold off them. */
button.mphb-nav-btn {
	-webkit-appearance: none;
	appearance: none;
	background-image: none !important;
	background-color: var(--mphb-white) !important;
	color: var(--mphb-blue) !important;
	border: 1px solid var(--mphb-powder) !important;
	border-radius: 100px !important;
	box-shadow: none !important;
	padding: 9px 18px !important;
	font-weight: 600 !important;
	letter-spacing: 0.5px !important;
}
button.mphb-nav-btn:hover {
	background-color: var(--mphb-navy) !important;
	border-color: var(--mphb-navy) !important;
	color: var(--mphb-white) !important;
}
.mphb-nav-off {
	opacity: 0.35;
	cursor: default;
}

.mphb-cal-head {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 6px;
	margin-bottom: 6px;
}
.mphb-dow {
	font-family: var(--mphb-head);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	text-align: center;
	color: var(--mphb-blue);
	padding: 4px 0;
}
.mphb-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	grid-auto-rows: minmax(84px, auto);
	gap: 6px;
	width: 100%;
}
.mphb-cell {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	min-height: 84px;
	padding: 8px 9px 9px;
	border: 1px solid var(--mphb-powder);
	border-radius: 8px;
	background: var(--mphb-white);
	font-family: var(--mphb-body);
	text-align: left;
	width: 100%;
}
.mphb-pad {
	background: var(--mphb-powder-soft);
	border-color: transparent;
}
.mphb-daynum {
	font-family: var(--mphb-head);
	font-size: 15px;
	font-weight: 700;
	color: var(--mphb-navy);
}
.mphb-state {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	color: var(--mphb-blue);
}

/* Free days are button elements, so the theme's own button styling -- gold
   fill, large radius, uppercase type, shadows -- lands on them and makes the
   calendar read as a grid of call-to-action buttons. Reset all of that: a
   date tile should look like a tile, matching the booked and unavailable
   cells, with orange reserved for the one date actually selected. */
button.mphb-cell {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	width: 100%;
	font-family: inherit;
	font-size: inherit;
	font-weight: 400 !important;
	line-height: normal;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-align: left;
	text-shadow: none !important;
	text-decoration: none !important;
	cursor: pointer;
	transform: none;
	background-image: none !important;
	background-color: var(--mphb-white) !important;
	border: 1px solid var(--mphb-powder) !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	padding: 8px 9px 9px !important;
	color: var(--mphb-navy) !important;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}
button.mphb-cell:hover {
	background-color: rgba(168, 182, 222, 0.16) !important;
	border-color: var(--mphb-blue) !important;
	transform: none;
}
button.mphb-cell:focus-visible {
	outline: 2px solid var(--mphb-blue);
	outline-offset: 2px;
}
.mphb-free .mphb-state {
	color: rgba(53, 63, 81, 0.5);
	font-weight: 500;
}

/* The selected date is the only place colour is used. */
button.mphb-selected,
.mphb-selected {
	background-color: rgba(250, 166, 28, 0.16) !important;
	border-color: var(--mphb-orange) !important;
	box-shadow: inset 0 0 0 1px var(--mphb-orange) !important;
}
.mphb-selected .mphb-daynum {
	color: var(--mphb-navy-deep) !important;
}
.mphb-selected .mphb-state {
	color: var(--mphb-orange-deep) !important;
	font-weight: 700;
}

/* Booked days: the state word, an icon, and (Thyme for Dinner only) the
   group name. Adopt-a-Day never renders a name here. */
.mphb-taken {
	background: var(--mphb-powder-soft);
	border-style: dashed;
	justify-content: flex-start;
}
.mphb-taken .mphb-daynum {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	color: rgba(53, 63, 81, 0.6);
}
.mphb-icon {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
	color: var(--mphb-orange-deep);
}
.mphb-state-taken {
	margin-top: 4px;
	color: var(--mphb-orange-deep) !important;
	font-weight: 700;
}
.mphb-who {
	display: block;
	margin-top: 3px;
	font-size: 11px;
	line-height: 1.3;
	font-weight: 600;
	color: rgba(53, 63, 81, 0.72);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}

/* Inside the notice window: no booking, just how to reach the House. */
.mphb-soon {
	background: rgba(168, 182, 222, 0.1);
	border-color: rgba(168, 182, 222, 0.5);
}
.mphb-soon .mphb-daynum {
	color: rgba(53, 63, 81, 0.45);
}
.mphb-call {
	color: var(--mphb-blue) !important;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-size: 10px;
}
a.mphb-call:hover {
	text-decoration: underline;
}

/* Past and out-of-window days: the number only. */
.mphb-past,
.mphb-beyond {
	background: rgba(168, 182, 222, 0.06);
	border-color: rgba(168, 182, 222, 0.35);
}
.mphb-past .mphb-daynum,
.mphb-beyond .mphb-daynum {
	color: rgba(53, 63, 81, 0.3);
}

/* A past day that was booked still shows what happened. */
.mphb-taken .mphb-icon {
	color: var(--mphb-orange-deep);
}

.mphb-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin-top: 14px;
	font-size: 13px;
	color: rgba(53, 63, 81, 0.75);
}
.mphb-key {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.mphb-key::before {
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 4px;
	border: 1px solid var(--mphb-powder);
	background: var(--mphb-white);
}
.mphb-key-taken::before {
	background: var(--mphb-powder-soft);
	border-style: dashed;
}
.mphb-key-taken .mphb-icon {
	width: 14px;
	height: 14px;
}

/* ---- Form ---- */
.mphb-form {
	display: none;
	margin-top: 34px;
	padding: 30px 30px 32px;
	background: var(--mphb-white);
	border: 1px solid var(--mphb-powder);
	border-left: 5px solid var(--mphb-orange);
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(38, 47, 60, 0.08);
}
.mphb-form.mphb-form-open {
	display: block;
	animation: mphb-reveal 0.28s var(--mphb-ease) both;
}
@keyframes mphb-reveal {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.mphb-form.mphb-form-open { animation: none; }
}

.mphb-form-title {
	margin: 0 0 8px;
	font-family: var(--mphb-head);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.2px;
}
.mphb-chosen {
	margin: 0 0 22px;
	font-size: 15px;
	color: rgba(53, 63, 81, 0.7);
}
.mphb-chosen-set {
	color: var(--mphb-blue);
	font-weight: 600;
}
.mphb-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 22px;
}
.mphb-field {
	display: flex;
	flex-direction: column;
}
.mphb-field-message,
.mphb-field-organisation {
	grid-column: 1 / -1;
}
.mphb-field label {
	font-family: var(--mphb-head);
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--mphb-navy);
}
.mphb-req {
	color: var(--mphb-orange-deep);
}
.mphb-field input {
	width: 100%;
	font-family: var(--mphb-body);
	font-size: 16px;
	color: #2c2c2c;
	-webkit-text-fill-color: #2c2c2c;
	background-color: var(--mphb-white);
	border: 1px solid var(--mphb-powder);
	border-radius: 6px;
	padding: 12px 14px;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.mphb-field input:focus {
	outline: none;
	border-color: var(--mphb-orange);
	box-shadow: 0 0 0 3px rgba(250, 166, 28, 0.18);
}
.mphb-hint {
	margin-top: 6px;
	font-size: 13px;
	color: rgba(44, 44, 44, 0.6);
}
.mphb-counter-low {
	color: var(--mphb-orange-deep);
	font-weight: 600;
}

.mphb-actions {
	margin-top: 24px;
}
/* The submit button is the one real call to action, styled to match the
   site's own buttons rather than whatever the theme applies. */
button.mphb-submit {
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--mphb-head);
	font-size: 14px;
	font-weight: 600 !important;
	letter-spacing: 0.8px !important;
	text-transform: uppercase !important;
	color: var(--mphb-navy-deep) !important;
	background-image: none !important;
	background-color: var(--mphb-orange) !important;
	border: 2px solid var(--mphb-orange) !important;
	border-radius: 4px !important;
	box-shadow: none !important;
	padding: 15px 34px !important;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
button.mphb-submit:hover:not(:disabled) {
	background-color: var(--mphb-orange-deep) !important;
	border-color: var(--mphb-orange-deep) !important;
	transform: translateY(-2px);
}
.mphb-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.mphb-message {
	margin-top: 20px;
	font-size: 16px;
	line-height: 1.6;
}
.mphb-message-ok {
	padding: 16px 18px;
	border-radius: 8px;
	background: rgba(250, 166, 28, 0.12);
	border-left: 4px solid var(--mphb-orange);
	color: var(--mphb-navy);
}
.mphb-message-error {
	padding: 16px 18px;
	border-radius: 8px;
	background: rgba(192, 57, 43, 0.08);
	border-left: 4px solid #c0392b;
	color: #a5342a;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.mphb-grid {
		grid-auto-rows: minmax(72px, auto);
	}
	.mphb-cell,
	button.mphb-cell {
		min-height: 72px;
	}
	.mphb-state {
		font-size: 10px;
	}
}
@media (max-width: 700px) {
	.mphb-fields {
		grid-template-columns: 1fr;
	}
	.mphb-cal-title {
		font-size: 20px;
	}
	.mphb-nav-btn {
		padding: 8px 13px;
		font-size: 12px;
	}
	.mphb-state {
		display: none;
	}
	.mphb-state-taken,
	.mphb-who {
		display: none;
	}
	.mphb-call {
		display: none;
	}
	.mphb-taken .mphb-daynum {
		justify-content: center;
		gap: 4px;
	}
	.mphb-cell,
	button.mphb-cell {
		min-height: 56px;
		align-items: center;
		justify-content: center;
		padding: 6px !important;
	}
	.mphb-grid {
		grid-auto-rows: minmax(56px, auto);
		gap: 4px;
	}
	.mphb-form {
		padding: 22px 18px 24px;
	}
	.mphb-submit {
		width: 100%;
	}
}

/* Link to the donation form, shown alongside the redirect. */
.mphb-pay-link {
	display: inline-block;
	margin-top: 10px;
	font-family: var(--mphb-head);
	font-size: 14px;
	font-weight: 700;
	color: var(--mphb-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ============================================================
   PAYMENT DIALOG (Adopt-a-Day)
   ============================================================
   Shown after booking, because the donation is effectively required and a
   line of text on the page is too easy to scroll past. Styles are scoped to
   .mphb-modal and set explicitly, since the dialog is appended to the page body and
   so sits outside the .mphb-wrap variable scope.
   ============================================================ */

.mphb-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(38, 47, 60, 0.72);
	font-family: "Glacial Indifference", "Poppins", -apple-system, sans-serif;
	animation: mphb-fade 0.2s ease both;
	overflow-y: auto;
}
@keyframes mphb-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.mphb-modal-card {
	width: 100%;
	max-width: 460px;
	box-sizing: border-box;
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 30px 70px rgba(38, 47, 60, 0.35);
	padding: 34px 32px 28px;
	text-align: center;
	animation: mphb-rise 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes mphb-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.mphb-modal, .mphb-modal-card { animation: none; }
}

.mphb-modal-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(250, 166, 28, 0.16);
	color: #de8c05;
}
.mphb-modal-icon svg {
	width: 28px;
	height: 28px;
}
.mphb-modal-title {
	margin: 0 0 10px;
	font-family: "Poppins", sans-serif;
	font-size: 25px;
	font-weight: 700;
	letter-spacing: -0.3px;
	color: #353f51;
}
.mphb-modal-lead {
	margin: 0 0 20px;
	font-size: 16px;
	line-height: 1.6;
	color: rgba(53, 63, 81, 0.85);
}
.mphb-modal-rows {
	border: 1px solid #a8b6de;
	border-radius: 10px;
	background: rgba(168, 182, 222, 0.14);
	padding: 4px 16px;
	margin-bottom: 14px;
	text-align: left;
}
.mphb-modal-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px solid rgba(168, 182, 222, 0.5);
}
.mphb-modal-row:last-child {
	border-bottom: 0;
}
.mphb-modal-key {
	font-family: "Poppins", sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.1px;
	text-transform: uppercase;
	color: #465daa;
}
.mphb-modal-val {
	font-size: 18px;
	font-weight: 700;
	color: #353f51;
}
.mphb-modal-ref {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 16px;
	letter-spacing: 0.5px;
}
.mphb-modal-note {
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.55;
	color: rgba(44, 44, 44, 0.7);
}

a.mphb-modal-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	font-family: "Poppins", sans-serif;
	font-size: 15px;
	font-weight: 700 !important;
	letter-spacing: 0.6px !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	text-align: center;
	color: #262f3c !important;
	background-image: none !important;
	background-color: #faa61c !important;
	border: 2px solid #faa61c !important;
	border-radius: 6px !important;
	box-shadow: none !important;
	padding: 16px 22px !important;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
a.mphb-modal-btn:hover {
	background-color: #de8c05 !important;
	border-color: #de8c05 !important;
	transform: translateY(-2px);
}
a.mphb-modal-btn:focus-visible {
	outline: 3px solid #465daa;
	outline-offset: 3px;
}
button.mphb-modal-later {
	-webkit-appearance: none;
	appearance: none;
	display: inline-block;
	margin-top: 14px;
	font-family: "Poppins", sans-serif;
	font-size: 13.5px;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: rgba(53, 63, 81, 0.65) !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 6px 8px !important;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}
button.mphb-modal-later:hover {
	color: #353f51 !important;
}
.mphb-modal-fine {
	margin: 14px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: rgba(53, 63, 81, 0.55);
}
.mphb-pay-warn {
	color: #a5342a;
	font-weight: 600;
}

@media (max-width: 520px) {
	.mphb-modal {
		padding: 14px;
		align-items: flex-start;
	}
	.mphb-modal-card {
		padding: 26px 20px 22px;
		margin-top: 18px;
	}
	.mphb-modal-title {
		font-size: 21px;
	}
	.mphb-modal-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}
}
