/* Availability Calendar (Private Feed) block styles */

.ble-avfeed {
	--avfeed-booked: var(--color-sage);
	--avfeed-unavailable: var(--color-champagne);
	--avfeed-muted: color-mix(in srgb, var(--color-charcoal) 72%, var(--color-ivory));
	padding-block: 4rem;
	background-color: var(--color-ivory);
}

.editor-styles-wrapper .wp-block-acf-availability-feed {
	width: 100% !important;
	max-width: none !important;
}

/* Header */
.ble-avfeed__header {
	margin-bottom: 2.5rem;
}

.ble-avfeed__heading {
	font-size: clamp(2rem, 5vw, 3rem);
	margin: 0 0 0.75rem;
}

.ble-avfeed__tagline {
	margin: 0 auto;
	max-width: 40rem;
	font-size: 1.0625rem;
	color: var(--avfeed-muted);
}

/* Navigation (shown by view.js) */
.ble-avfeed__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.ble-avfeed__nav[hidden] {
	display: none;
}

.ble-avfeed__range {
	margin: 0;
	font-size: 1.375rem;
	color: var(--color-charcoal);
	text-align: center;
}

.ble-avfeed__nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--color-sage);
	border-radius: 50%;
	background: transparent;
	color: var(--color-sage);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ble-avfeed__nav-btn:hover:not(:disabled),
.ble-avfeed__nav-btn:focus-visible {
	background-color: var(--color-sage);
	color: #fff;
}

.ble-avfeed__nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.ble-avfeed__nav-btn:focus-visible {
	outline: 2px solid var(--color-sage);
	outline-offset: 3px;
}

/* Months: stacked without JS; JS shows one (mobile) or two (desktop). */
.ble-avfeed__months {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

.ble-avfeed.is-enhanced .ble-avfeed__month {
	display: none;
}

.ble-avfeed.is-enhanced .ble-avfeed__month.is-current {
	display: block;
}

@media (min-width: 900px) {
	.ble-avfeed__months {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 3rem;
	}

	.ble-avfeed.is-enhanced .ble-avfeed__month.is-next {
		display: block;
	}
}

.ble-avfeed__month {
	background-color: #fff;
	padding: 1.5rem;
	border-top: 2px solid var(--color-sage);
}

.ble-avfeed__month-title {
	margin: 0 0 1rem;
	font-size: 1.375rem;
	font-weight: 400;
	text-align: center;
	color: var(--color-charcoal);
}

/* Once paged, avoid saying the month twice: on mobile the nav label names
   the single month shown; on desktop each month card keeps its own title and
   the nav label is kept for screen readers only. */
@media (max-width: 899px) {
	.ble-avfeed.is-enhanced .ble-avfeed__month-title {
		display: none;
	}
}

@media (min-width: 900px) {
	.ble-avfeed.is-enhanced .ble-avfeed__range {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/* Grid */
.ble-avfeed__grid {
	width: 100%;
	border-collapse: separate;
	border-spacing: 4px;
	table-layout: fixed;
	font-family: var(--font-sans);
}

.ble-avfeed__grid th {
	padding: 0 0 0.375rem;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--avfeed-muted);
	text-align: center;
}

.ble-avfeed__grid abbr {
	text-decoration: none;
	cursor: default;
}

.ble-avfeed__grid td {
	padding: 0;
	text-align: center;
	vertical-align: middle;
	border-radius: 2px;
}

.ble-avfeed__day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	font-size: 0.9375rem;
	line-height: 1;
}

/* Open dates stay quiet (white + hairline) so the few taken dates stand
   out. Taken dates are solid brand colours and also struck through, so
   status never depends on colour alone. */
td.is-available {
	background-color: #fff;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-champagne) 55%, #fff);
	color: var(--color-charcoal);
}

td.is-booked {
	background-color: var(--avfeed-booked);
	color: #fff;
}

td.is-unavailable {
	background-color: var(--avfeed-unavailable);
	color: var(--color-charcoal);
}

td.is-booked .ble-avfeed__day,
td.is-unavailable .ble-avfeed__day {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

td.is-past {
	background-color: transparent;
	color: color-mix(in srgb, var(--color-charcoal) 35%, #fff);
}

td.is-today .ble-avfeed__day {
	box-shadow: inset 0 0 0 1.5px var(--color-charcoal);
	border-radius: 2px;
	font-weight: 600;
}

/* Legend */
.ble-avfeed__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 2rem;
	margin: 1.75rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	color: var(--color-charcoal);
}

.ble-avfeed__legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.ble-avfeed__swatch {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border-radius: 2px;
}

.ble-avfeed__swatch.is-available {
	background-color: #fff;
	box-shadow: inset 0 0 0 1px var(--color-champagne);
}

.ble-avfeed__swatch.is-booked {
	background-color: var(--avfeed-booked);
}

.ble-avfeed__swatch.is-unavailable {
	background-color: var(--avfeed-unavailable);
}

.ble-avfeed__note {
	margin: 1.25rem auto 0;
	max-width: 36rem;
	font-size: 0.875rem;
	text-align: center;
	color: var(--avfeed-muted);
}

.ble-avfeed__error,
.ble-avfeed__placeholder {
	padding: 1.5rem;
	border: 1px dashed var(--color-taupe);
	text-align: center;
	color: var(--avfeed-muted);
	font-size: 0.9375rem;
}

@media (max-width: 479px) {
	.ble-avfeed__month {
		padding: 1rem 0.75rem;
	}

	.ble-avfeed__grid {
		border-spacing: 3px;
	}

	.ble-avfeed__day {
		font-size: 0.8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ble-avfeed__nav-btn {
		transition: none;
	}
}

.ble-avfeed .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
