/*
 * Willow Haven Calendar Sync – public calendar.
 * Matches the Willow Haven theme: Bressay Display headings, Proxima Nova body,
 * DIN Condensed uppercase labels, gold / taupe / beige palette, fine gold rules.
 * Fonts are loaded by the theme (willow-center-core); fallbacks are listed.
 * Override any --whcs-* property from Elementor custom CSS if needed.
 */
.whcs-calendar {
	--whcs-gold: #ceaa78;
	--whcs-gold-soft: rgba(206, 170, 120, .18);
	--whcs-taupe: #74675d;
	--whcs-beige: #eae7e0;
	--whcs-ink: #282720;
	--whcs-grey: #54595f;
	--whcs-muted: #b9b3aa;
	--whcs-bg: #ffffff;
	--whcs-font-heading: "Bressay Display", "Playfair Display", Georgia, "Times New Roman", serif;
	--whcs-font-body: "Proxima Nova", "Montserrat", "Lato", system-ui, sans-serif;
	--whcs-font-label: "DIN Condensed Web", "DIN Condensed", "Jost", "Arial Narrow", sans-serif;

	box-sizing: border-box;
	position: relative;
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	padding: 40px 36px 32px;
	background: var(--whcs-bg);
	color: var(--whcs-ink);
	border: 1px solid var(--whcs-gold);
	font-family: var(--whcs-font-body);
	font-size: 16px;
	line-height: 1.5;
}
/* Inner hairline frame, echoing the theme's framed boxes. */
.whcs-calendar::before {
	content: "";
	position: absolute;
	inset: 6px;
	border: 1px solid var(--whcs-gold-soft);
	pointer-events: none;
}
.whcs-calendar *,
.whcs-calendar *::before,
.whcs-calendar *::after { box-sizing: inherit; }

/* Header ------------------------------------------------------------------ */
.whcs-calendar__header { text-align: center; margin-bottom: 28px; }
.whcs-calendar .whcs-calendar__heading {
	margin: 0;
	font-family: var(--whcs-font-heading);
	font-size: 34px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--whcs-grey);
	letter-spacing: 0;
	text-transform: none;
}
/* Gold flourish under the heading. */
.whcs-calendar .whcs-calendar__heading::after {
	content: "";
	display: block;
	width: 64px;
	height: 1px;
	margin: 14px auto 0;
	background: var(--whcs-gold);
}
.whcs-calendar__subtitle {
	margin: 12px auto 0;
	max-width: 440px;
	font-size: 16px;
	font-weight: 300;
	line-height: 1.7;
	color: var(--whcs-grey);
}

/* Year tabs ---------------------------------------------------------------- */
.whcs-calendar__tabs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 24px;
}
.whcs-calendar .whcs-calendar__tab {
	min-width: 112px;
	min-height: 44px;
	margin: 0 0 0 -1px; /* Shared borders between tabs. */
	padding: 12px 26px 10px;
	border: 1px solid var(--whcs-gold);
	border-radius: 0;
	background: transparent;
	color: var(--whcs-taupe);
	box-shadow: none;
	font-family: var(--whcs-font-label);
	font-size: 18px;
	font-weight: 400;
	letter-spacing: .16em;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.whcs-calendar .whcs-calendar__tab:first-child { margin-left: 0; }
.whcs-calendar .whcs-calendar__tab:hover:not(:disabled):not([aria-selected="true"]) { background: var(--whcs-gold-soft); }
.whcs-calendar .whcs-calendar__tab[aria-selected="true"] {
	position: relative;
	z-index: 1;
	background: var(--whcs-gold);
	color: var(--whcs-ink);
}
.whcs-calendar .whcs-calendar__tab:disabled {
	border-color: var(--whcs-beige);
	color: var(--whcs-muted);
	cursor: not-allowed;
}
.whcs-calendar .whcs-calendar__tab:focus-visible {
	z-index: 2;
	outline: 2px solid var(--whcs-taupe);
	outline-offset: 2px;
}

/* Month navigation ------------------------------------------------------- */
.whcs-calendar__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.whcs-calendar .whcs-calendar__title {
	flex: 1;
	margin: 0;
	font-family: var(--whcs-font-heading);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--whcs-taupe);
	text-align: center;
	letter-spacing: 0;
	text-transform: none;
}
.whcs-calendar .whcs-calendar__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--whcs-gold);
	border-radius: 0;
	background: transparent;
	color: var(--whcs-gold);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.whcs-calendar .whcs-calendar__btn:hover:not(:disabled) {
	background: var(--whcs-gold);
	color: #fff;
}
.whcs-calendar .whcs-calendar__btn:disabled {
	border-color: var(--whcs-beige);
	color: var(--whcs-muted);
	background: transparent;
	cursor: not-allowed;
}
.whcs-calendar .whcs-calendar__btn svg { display: block; }
.whcs-calendar .whcs-calendar__btn:focus-visible,
.whcs-calendar .whcs-calendar__retry:focus-visible,
.whcs-calendar .whcs-calendar__cta-btn:focus-visible {
	outline: 2px solid var(--whcs-taupe);
	outline-offset: 3px;
}

/* Grid -------------------------------------------------------------------- */
.whcs-calendar__body { position: relative; transition: opacity .2s; }
.whcs-calendar__body.is-loading { opacity: .4; }

.whcs-calendar .whcs-grid {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 6px;
	table-layout: fixed;
	background: none;
}
.whcs-calendar .whcs-grid th {
	padding: 8px 0 6px;
	border: 0;
	background: none;
	font-family: var(--whcs-font-label);
	font-size: 15px;
	font-weight: 400;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-align: center;
	color: var(--whcs-taupe);
}
.whcs-calendar .whcs-grid th abbr { text-decoration: none; border: 0; cursor: default; }
.whcs-calendar .whcs-grid td {
	padding: 0;
	border: 0;
	background: none;
	vertical-align: middle;
}

.whcs-day__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	border: 1px solid transparent;
	font-size: 16px;
	font-weight: 400;
	transition: background-color .2s, border-color .2s;
}
.whcs-day--empty .whcs-day__inner { display: none; }

/* Available: clean white tile with a gold outline. */
.whcs-day--available .whcs-day__inner {
	background: var(--whcs-bg);
	border-color: var(--whcs-gold);
	color: var(--whcs-ink);
	font-weight: 600;
}
.whcs-day--available:hover .whcs-day__inner { background: var(--whcs-gold-soft); }

/* Limited: half-tinted tile. */
.whcs-day--partial .whcs-day__inner {
	background: linear-gradient(135deg, var(--whcs-bg) 50%, rgba(206, 170, 120, .45) 50%);
	border-color: var(--whcs-gold);
	color: var(--whcs-ink);
	font-weight: 600;
}

/* Booked: soft beige with fine hatching and a struck-through number
   (status is never conveyed by colour alone). */
.whcs-day--booked .whcs-day__inner {
	background:
		repeating-linear-gradient(-45deg, transparent 0 6px, rgba(116, 103, 93, .14) 6px 7px),
		var(--whcs-beige);
	border-color: var(--whcs-beige);
	color: var(--whcs-taupe);
}
.whcs-day--booked .whcs-day__num { text-decoration: line-through; text-decoration-color: rgba(116, 103, 93, .6); }

/* Past dates fade away. */
.whcs-day--past .whcs-day__inner { color: var(--whcs-muted); font-weight: 300; }

/* Today. */
.whcs-day[aria-current="date"] .whcs-day__inner { position: relative; }
.whcs-day[aria-current="date"] .whcs-day__inner::after {
	content: "";
	position: absolute;
	bottom: 7px;
	left: 50%;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--whcs-taupe);
}

/* Live update: dates that just changed pulse for a moment. */
.whcs-day--changed .whcs-day__inner {
	animation: whcs-pulse 1.6s ease-out 2;
}
@keyframes whcs-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(206, 170, 120, .9); }
	70%  { box-shadow: 0 0 0 10px rgba(206, 170, 120, 0); }
	100% { box-shadow: 0 0 0 0 rgba(206, 170, 120, 0); }
}

/* Legend ------------------------------------------------------------------ */
.whcs-calendar .whcs-calendar__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 28px;
	margin: 22px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--whcs-beige);
	list-style: none;
	font-family: var(--whcs-font-label);
	font-size: 15px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--whcs-taupe);
}
.whcs-calendar .whcs-calendar__legend li {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	line-height: 1;
}
.whcs-calendar .whcs-calendar__legend li::before { content: none; }
.whcs-swatch { display: inline-block; width: 18px; height: 18px; border: 1px solid transparent; }
.whcs-swatch--available { background: var(--whcs-bg); border-color: var(--whcs-gold); }
.whcs-swatch--partial { background: linear-gradient(135deg, var(--whcs-bg) 50%, rgba(206, 170, 120, .45) 50%); border-color: var(--whcs-gold); }
.whcs-swatch--booked { background: repeating-linear-gradient(-45deg, transparent 0 3px, rgba(116, 103, 93, .25) 3px 4px), var(--whcs-beige); }

/* Status, notices, CTA ----------------------------------------------------- */
.whcs-calendar__status {
	min-height: 1.5em;
	margin-top: 10px;
	text-align: center;
	font-size: 14px;
	color: var(--whcs-taupe);
}
.whcs-calendar__status:empty { min-height: 0; margin: 0; }
.whcs-calendar__status--error { color: #8e2d2d; }
.whcs-calendar .whcs-calendar__retry {
	margin-left: 6px;
	padding: 6px 14px;
	border: 1px solid currentColor;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-family: var(--whcs-font-label);
	font-size: 13px;
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
}

.whcs-calendar__notice {
	padding: 24px;
	background: var(--whcs-beige);
	text-align: center;
	color: var(--whcs-grey);
	font-weight: 300;
}
.whcs-calendar__notice small { color: #8e2d2d; }

.whcs-calendar__cta { margin: 26px 0 0; text-align: center; }
.whcs-calendar .whcs-calendar__cta-btn {
	display: inline-block;
	padding: 14px 34px;
	border: 1px solid var(--whcs-gold);
	background: var(--whcs-gold);
	color: var(--whcs-ink);
	font-family: var(--whcs-font-label);
	font-size: 15px;
	letter-spacing: .14em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}
.whcs-calendar .whcs-calendar__cta-btn:hover { background: transparent; color: var(--whcs-taupe); }

.whcs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 600px) {
	.whcs-calendar { padding: 28px 14px 22px; }
	.whcs-calendar .whcs-calendar__heading { font-size: 28px; }
	.whcs-calendar .whcs-calendar__title { font-size: 22px; }
	.whcs-calendar .whcs-grid { border-spacing: 3px; }
	.whcs-calendar .whcs-grid th { font-size: 13px; letter-spacing: .06em; }
	.whcs-day__inner { height: 42px; font-size: 15px; }
	.whcs-calendar .whcs-calendar__legend { gap: 10px 18px; font-size: 13px; }
	.whcs-calendar .whcs-calendar__tab { min-width: 0; flex: 1; padding: 12px 8px 10px; font-size: 16px; }
}
@media (max-width: 360px) {
	.whcs-calendar { padding: 22px 8px 18px; }
	.whcs-calendar::before { inset: 4px; }
	.whcs-calendar .whcs-grid { border-spacing: 2px; }
	.whcs-day__inner { height: 36px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.whcs-calendar *,
	.whcs-calendar__body { transition: none; }
	.whcs-day--changed .whcs-day__inner { animation: none; outline: 2px solid var(--whcs-gold); outline-offset: 2px; }
}

/* Elementor widget: "Gold frame" switched off. */
.elementor-widget-willow_available_dates:not(.whcs-frame-yes) .whcs-calendar { border-color: transparent; padding-left: 0; padding-right: 0; }
.elementor-widget-willow_available_dates:not(.whcs-frame-yes) .whcs-calendar::before { content: none; }
