/* Douze CF7 Calendar — frontend, styled to match DouzeRocks (style.css).
   Tokens: body 'Noto Serif', Georgia, serif #1a1a1a / headings+buttons 'Fjalla One'
   uppercase / accent #E2001A / borders #d1d1d1 + 2px #000 inputs / radius 1-2px. */

.douze-cal {
	max-width: 640px;
	background: #fff;
	color: #1a1a1a;
	font-family: 'Noto Serif', Georgia, serif;
	font-size: 0.95rem;
	line-height: 1.75;
	border: 1px solid #d1d1d1;
	border-top: 4px solid #1a1a1a;
	border-radius: 2px;
	padding: 1em 1em 0.5em;
}

.douze-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin-bottom: 0.875em;
}

.douze-cal-title {
	font-family: 'Fjalla One', "Helvetica Neue", sans-serif;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.046875em;
	line-height: 1.3125;
	text-transform: uppercase;
}

/* Theme buttons: black bg, white Fjalla uppercase, red hover. */
.douze-cal-head button {
	background: #1a1a1a;
	border: 0;
	border-radius: 2px;
	color: #fff;
	font-family: 'Fjalla One', "Helvetica Neue", sans-serif;
	font-weight: 700;
	letter-spacing: 0.046875em;
	line-height: 1;
	padding: 0.6em 0.8em;
	text-transform: uppercase;
	cursor: pointer;
}

.douze-cal-head button:hover,
.douze-cal-head button:focus {
	background: #E2001A;
	color: #fff;
}

.douze-cal-head button:focus {
	outline: thin dotted;
	outline-offset: -4px;
}

/* Constrained navigation (months=/from/to): boundary arrows are disabled. */
.douze-cal-head button:disabled {
	background: #d1d1d1;
	color: #fff;
	cursor: not-allowed;
}

.douze-cal-head button:disabled:hover,
.douze-cal-head button:disabled:focus {
	background: #d1d1d1;
	color: #fff;
}

.douze-cal-weekdays,
.douze-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
	transition: opacity 0.15s ease;
}

/* Month change in flight: dim the grid + wait cursor so the click feels
   acknowledged even before the response arrives. */
.douze-cal.is-loading .douze-cal-grid {
	opacity: 0.5;
}

.douze-cal.is-loading .douze-cal-head button {
	cursor: wait;
}

.douze-cal-grid {
	align-items: stretch;
}

/* Optional half-width weekend columns (Sat + Sun), e.g. weekends="narrow". */
.douze-cal.narrow-weekends .douze-cal-weekdays,
.douze-cal.narrow-weekends .douze-cal-grid {
	grid-template-columns: repeat(5, 1fr) 0.5fr 0.5fr;
}

.douze-cal.narrow-weekends .douze-cal-day {
	padding: 0.4375em 0.25em;
}

.douze-cal-wd {
	font-family: 'Fjalla One', "Helvetica Neue", sans-serif;
	font-size: 13px;
	font-size: 0.8125rem;
	letter-spacing: 0.076923077em;
	line-height: 1.6153846154;
	text-transform: uppercase;
	text-align: center;
	color: #1a1a1a;
	padding: 0.3em 0;
}

.douze-cal-wd.is-weekend {
	color: #E2001A;
}

/* Day cells: theme table/input language — 1px grey borders, square corners.
   NOTE: the border width never changes (hover/selected/free states use
   box-shadow insets instead) so cells keep identical width + height. */
.douze-cal-day {
	box-sizing: border-box;
	width: 100%;
	min-height: 84px;
	height: 100%;
	border: 1px solid #d1d1d1;
	border-radius: 2px;
	background: #fff;
	color: #1a1a1a;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 3px;
	padding: 0.4375em;
	font: inherit;
	text-align: left;
}

.douze-cal-empty {
	box-sizing: border-box;
	min-height: 84px;
}

.douze-cal-day.is-weekend {
	background: #faf6ec;
}

.douze-cal-day.has-free {
	border-color: #1a1a1a;
	box-shadow: inset 0 0 0 1px #1a1a1a;
	cursor: pointer;
	background: #fff;
}

/* Hover on plain days: ONLY the date number changes color — cell size,
   border, fill and badges never move. */
.douze-cal-day:hover .douze-cal-num {
	/*color: #E2001A;*/
}

.douze-cal-day.has-free:focus {
	outline: thin dotted;
	outline-offset: -4px;
	border-color: #E2001A;
	box-shadow: inset 0 0 0 1px #E2001A;
}

/* Selected: red frame via border-color + inset shadows (no layout shift). */
.douze-cal-day.is-selected {
	border-color: #E2001A;
	box-shadow: inset 0 0 0 1px #E2001A, inset 0 0 0 3px #E2001A;
	background: #fff;
}

/* Booked-only days: visible but muted grey, not selectable. */
.douze-cal-day.has-booked:not(.has-free) {
	background: #f1f1f1;
	border-color: #d1d1d1;
	color: #686868;
	cursor: not-allowed;
}

/* Hover on ANY event cell (free or booked, selected or not): always the
   same red thick frame. Inset shadow only — the cell never changes size. */
.douze-cal-day.has-free:hover,
.douze-cal-day.has-booked:hover {
	border-color: #E2001A;
	box-shadow: inset 0 0 0 2px #E2001A;
}

/* Non-selectable cells use aria-disabled (not the disabled attribute) so
   hover highlight + title tooltips keep working — native disabled buttons
   fire no mouse events. They stay out of tab order via tabindex="-1" and
   have no click handler. This also shields them from the theme's global
   button[disabled]{opacity:.5} rule. */
.douze-cal-day[aria-disabled="true"] {
	opacity: 1;
	cursor: not-allowed;
}

.douze-cal-num {
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.4;
}

.douze-cal-badge {
	display: block;
	font-family: 'Fjalla One', "Helvetica Neue", sans-serif;
	font-size: 11px;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
	text-align: center;
	border-radius: 2px;
	padding: 2px 4px;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
}

.douze-cal-badge.is-free {
	background: #E2001A;
	color: #fff;
}

.douze-cal-day.is-selected .douze-cal-badge.is-free {
	background: #1a1a1a;
}

.douze-cal-badge.is-booked {
	background: #686868;
	color: #fff;
}

.douze-cal-hint {
	font-size: 0.8125rem;
	line-height: 1.6;
	color: #686868;
	margin: 0.875em 0 0;
}

/* Selected summary echoes the theme blockquote accent. */
.douze-cal-selection {
	font-size: 0.95rem;
	color: #1a1a1a;
	border-left: 4px solid #E2001A;
	padding-left: 0.75em;
	margin: 0.5em 0 1em;
}

.douze-cal-selection:empty {
	display: none;
}

@media (max-width: 600px) {
	.douze-cal {
		padding: 0.75em 0.75em 0.25em;
	}

	.douze-cal-day,
	.douze-cal-empty {
		min-height: 64px;
	}

	.douze-cal-day {
		padding: 0.25em;
	}

	.douze-cal-badge {
		font-size: 10px;
	}
}
