/**
 * WP Elementor CPT Calendar - front-end styles.
 *
 * Sections:
 *  1.  Variables (design tokens)
 *  2.  Base & utilities
 *  3.  Button reset (robust against theme / Elementor Kit styles)
 *  4.  Toolbar (nav, title, view switcher)
 *  5.  Loading & messages
 *  6.  Events (chips)
 *  7.  Month view
 *  8.  Week view
 *  9.  Day view
 * 10.  List view
 * 11.  Modal
 * 12.  Popup content
 * 13.  Editor notice
 * 14.  Responsive
 * 15.  Reduced motion
 */

/* ==========================================================================
   1. Variables
   ========================================================================== */

.wecc-calendar {
	--wecc-primary: #2563eb;
	--wecc-text: #1f2937;
	--wecc-muted: #6b7280;
	--wecc-bg: #ffffff;
	--wecc-border: #e5e7eb;
	--wecc-radius: 10px;
	--wecc-gap: 12px;

	--wecc-header-bg: transparent;
	--wecc-header-color: var(--wecc-text);

	--wecc-btn-bg: #f3f4f6;
	--wecc-btn-color: var(--wecc-text);
	--wecc-btn-hover-bg: #e5e7eb;
	--wecc-btn-hover-color: var(--wecc-text);
	--wecc-btn-active-bg: var(--wecc-primary);
	--wecc-btn-active-color: #ffffff;
	--wecc-btn-radius: 6px;

	--wecc-weekday-bg: #f9fafb;
	--wecc-weekday-color: var(--wecc-muted);

	--wecc-cell-bg: #ffffff;
	--wecc-cell-color: var(--wecc-text);
	--wecc-cell-border: var(--wecc-border);
	--wecc-cell-min-height: 112px;
	--wecc-cell-padding: 6px;

	--wecc-today-bg: #eff6ff;
	--wecc-today-color: var(--wecc-primary);
	--wecc-outside-bg: #f9fafb;
	--wecc-outside-color: #9ca3af;

	--wecc-event-bg: var(--wecc-primary);
	--wecc-event-color: #ffffff;
	/* --wecc-event-hover-bg / --wecc-event-hover-color intentionally unset (fallbacks in the hover rules). */
	--wecc-event-radius: 4px;
	--wecc-event-padding: 3px 6px;
	--wecc-event-gap: 3px;
	--wecc-event-shadow: none;

	--wecc-overlay-bg: rgba(17, 24, 39, 0.6);
	--wecc-modal-bg: #ffffff;
	--wecc-modal-width: 560px;
	--wecc-modal-radius: 14px;
	--wecc-modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	--wecc-modal-padding: 28px;
	--wecc-modal-title-color: var(--wecc-text);
	--wecc-modal-meta-color: var(--wecc-muted);
	--wecc-modal-text-color: #374151;
	--wecc-modal-btn-bg: var(--wecc-primary);
	--wecc-modal-btn-color: #ffffff;
	--wecc-modal-btn-hover-bg: #1d4ed8;
	--wecc-modal-btn-hover-color: #ffffff;
	--wecc-modal-btn-radius: 8px;
}

/* ==========================================================================
   2. Base & utilities
   ========================================================================== */

.wecc-calendar {
	position: relative;
	box-sizing: border-box;
	max-width: 100%;
	color: var(--wecc-text);
	background: var(--wecc-bg);
	font-family: inherit;
	line-height: 1.5;
	text-align: start;
}

.wecc-calendar *,
.wecc-calendar *::before,
.wecc-calendar *::after {
	box-sizing: border-box;
}

.wecc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.wecc-icon {
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}

.wecc-body {
	position: relative;
	min-width: 0;
}

.wecc-view {
	min-width: 0;
}

/* Visible keyboard focus. */
.wecc-calendar :focus-visible {
	outline: 2px solid var(--wecc-primary);
	outline-offset: 2px;
}

html.wecc-modal-open {
	overflow: hidden;
}

/* ==========================================================================
   3. Button reset
   Specificity: 0,2,0 for base states, 0,3,0+ for :hover / :focus / :active
   so Hello Elementor and Elementor Kit button rules (up to 0,2,1) never win.
   ========================================================================== */

.wecc-calendar .wecc-nav,
.wecc-calendar .wecc-view-btn,
.wecc-calendar .wecc-event,
.wecc-calendar .wecc-day__more,
.wecc-calendar .wecc-modal__close,
.wecc-calendar .wecc-popup__button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	width: auto;
	min-height: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-align: start;
	text-decoration: none;
	white-space: normal;
	cursor: pointer;
}

.wecc-calendar .wecc-nav:hover,
.wecc-calendar .wecc-nav:focus,
.wecc-calendar .wecc-nav:active,
.wecc-calendar .wecc-view-btn:hover,
.wecc-calendar .wecc-view-btn:focus,
.wecc-calendar .wecc-view-btn:active,
.wecc-calendar .wecc-event:hover,
.wecc-calendar .wecc-event:focus,
.wecc-calendar .wecc-event:active,
.wecc-calendar .wecc-event:visited,
.wecc-calendar .wecc-day__more:hover,
.wecc-calendar .wecc-day__more:focus,
.wecc-calendar .wecc-day__more:active,
.wecc-calendar .wecc-modal__close:hover,
.wecc-calendar .wecc-modal__close:focus,
.wecc-calendar .wecc-modal__close:active,
.wecc-calendar .wecc-popup__button:hover,
.wecc-calendar .wecc-popup__button:focus,
.wecc-calendar .wecc-popup__button:active,
.wecc-calendar .wecc-popup__button:visited {
	border: 0;
	box-shadow: none;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
}

/* ==========================================================================
   4. Toolbar
   ========================================================================== */

.wecc-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wecc-gap);
	margin: 0 0 var(--wecc-gap);
	padding: 6px 8px;
	background: var(--wecc-header-bg);
	border-radius: var(--wecc-radius);
}

.wecc-toolbar__nav,
.wecc-views {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.wecc-calendar .wecc-toolbar__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	color: var(--wecc-header-color);
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-transform: none;
}

/* Nav + view buttons (compact pills). */
.wecc-calendar .wecc-nav,
.wecc-calendar .wecc-view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 34px;
	padding: 0 14px;
	background-color: var(--wecc-btn-bg);
	color: var(--wecc-btn-color);
	border-radius: var(--wecc-btn-radius);
	font-size: 0.875em;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wecc-calendar .wecc-nav--prev,
.wecc-calendar .wecc-nav--next {
	width: 34px;
	padding: 0;
}

.wecc-calendar .wecc-nav:focus,
.wecc-calendar .wecc-nav:active,
.wecc-calendar .wecc-view-btn:focus,
.wecc-calendar .wecc-view-btn:active {
	background-color: var(--wecc-btn-bg);
	color: var(--wecc-btn-color);
}

.wecc-calendar .wecc-nav:hover,
.wecc-calendar .wecc-view-btn:hover {
	background-color: var(--wecc-btn-hover-bg);
	color: var(--wecc-btn-hover-color);
}

.wecc-calendar .wecc-view-btn.is-active,
.wecc-calendar .wecc-view-btn.is-active:hover,
.wecc-calendar .wecc-view-btn.is-active:focus,
.wecc-calendar .wecc-view-btn.is-active:active {
	background-color: var(--wecc-btn-active-bg);
	color: var(--wecc-btn-active-color);
}

.wecc-calendar .wecc-nav[disabled],
.wecc-calendar .wecc-nav[disabled]:hover,
.wecc-calendar .wecc-view-btn[disabled],
.wecc-calendar .wecc-view-btn[disabled]:hover {
	background-color: var(--wecc-btn-bg);
	color: var(--wecc-btn-color);
	opacity: 0.4;
	cursor: not-allowed;
}

/* ==========================================================================
   5. Loading & messages
   ========================================================================== */

.wecc-calendar.is-loading .wecc-body {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.wecc-calendar .wecc-body::before {
	content: "";
	position: absolute;
	z-index: 2;
	inset-block-start: 0;
	inset-inline: 0;
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(var(--wecc-primary), var(--wecc-primary)) no-repeat 0 0 / 35% 100%;
	opacity: 0;
	pointer-events: none;
}

.wecc-calendar.is-loading .wecc-body::before {
	opacity: 1;
	animation: wecc-progress 0.9s ease-in-out infinite alternate;
}

@keyframes wecc-progress {
	from {
		background-position: 0 0;
	}
	to {
		background-position: 100% 0;
	}
}

.wecc-calendar .wecc-empty {
	margin: 0;
	padding: 24px;
	color: var(--wecc-muted);
	text-align: center;
}

.wecc-calendar .wecc-error {
	margin: 0 0 var(--wecc-gap);
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	font-size: 0.9em;
}

/* ==========================================================================
   6. Events (chips)
   ========================================================================== */

.wecc-calendar .wecc-event {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 4px;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding: var(--wecc-event-padding);
	background-color: var(--wecc-event-bg);
	color: var(--wecc-event-color);
	border-radius: var(--wecc-event-radius);
	box-shadow: var(--wecc-event-shadow);
	font-size: 0.8em;
	font-weight: 400;
	line-height: 1.3;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.wecc-calendar div.wecc-event {
	cursor: default;
}

.wecc-calendar .wecc-event:focus,
.wecc-calendar .wecc-event:active,
.wecc-calendar .wecc-event:visited {
	background-color: var(--wecc-event-bg);
	color: var(--wecc-event-color);
	box-shadow: var(--wecc-event-shadow);
}

.wecc-calendar .wecc-event:hover {
	background-color: var(--wecc-event-hover-bg, var(--wecc-event-bg));
	color: var(--wecc-event-hover-color, var(--wecc-event-color));
	box-shadow: var(--wecc-event-shadow);
	filter: brightness(0.95);
	transform: translateY(-1px);
}

.wecc-calendar div.wecc-event:hover {
	filter: none;
	transform: none;
}

.wecc-event__time {
	flex-shrink: 0;
	font-weight: 600;
}

.wecc-event__title {
	flex: 0 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.wecc-event__badge {
	display: none;
	flex-shrink: 0;
	padding: 1px 7px;
	background: rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

/* Multi-day continuity (logical properties for RTL). */
.wecc-calendar .wecc-event.is-multi-day.is-continuation {
	border-start-start-radius: 0;
	border-end-start-radius: 0;
}

.wecc-calendar .wecc-event.is-multi-day:not(.is-end) {
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

.wecc-calendar .wecc-event.is-past {
	opacity: 0.6;
}

/* Overflow events are collapsed until the day is expanded. */
.wecc-calendar .wecc-event.is-overflow {
	display: none;
}

.wecc-calendar .wecc-day.is-expanded .wecc-event.is-overflow {
	display: flex;
}

/* ==========================================================================
   7. Month view
   ========================================================================== */

.wecc-month {
	overflow: hidden;
	border: 1px solid var(--wecc-cell-border);
	border-radius: var(--wecc-radius);
	background: var(--wecc-cell-bg);
}

.wecc-weekdays,
.wecc-month .wecc-week {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.wecc-weekdays {
	background: var(--wecc-weekday-bg);
	border-bottom: 1px solid var(--wecc-cell-border);
}

.wecc-weekday {
	min-width: 0;
	padding: 8px 4px;
	color: var(--wecc-weekday-color);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-align: center;
	text-transform: uppercase;
}

.wecc-weekday + .wecc-weekday {
	border-inline-start: 1px solid var(--wecc-cell-border);
}

.wecc-weekday__short {
	display: none;
}

.wecc-month .wecc-week + .wecc-week {
	border-top: 1px solid var(--wecc-cell-border);
}

.wecc-day {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--wecc-cell-padding);
	background-color: var(--wecc-cell-bg);
	color: var(--wecc-cell-color);
}

.wecc-month .wecc-day {
	min-height: var(--wecc-cell-min-height);
}

.wecc-month .wecc-day + .wecc-day {
	border-inline-start: 1px solid var(--wecc-cell-border);
}

.wecc-day.is-weekend:not(.is-today):not(.is-outside) {
	background-image: linear-gradient(rgba(17, 24, 39, 0.02), rgba(17, 24, 39, 0.02));
}

.wecc-day.is-outside {
	background-color: var(--wecc-outside-bg);
	color: var(--wecc-outside-color);
}

.wecc-day.is-today {
	background-color: var(--wecc-today-bg);
}

.wecc-day__header {
	display: flex;
	align-items: center;
	margin-bottom: 4px;
}

.wecc-day__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 4px;
	border-radius: 999px;
	color: var(--wecc-cell-color);
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1;
}

.wecc-day.is-outside .wecc-day__number {
	color: var(--wecc-outside-color);
}

.wecc-day.is-today .wecc-day__number {
	background: var(--wecc-today-color);
	color: #ffffff;
	font-weight: 600;
}

.wecc-day__events {
	display: flex;
	flex-direction: column;
	gap: var(--wecc-event-gap);
	min-width: 0;
}

/* Timed events in month view: dot + time + title, no fill. */
.wecc-calendar .wecc-event--month .wecc-event__title {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow-wrap: normal;
}

.wecc-calendar .wecc-event--month.is-timed:not(.is-multi-day),
.wecc-calendar .wecc-event--month.is-timed:not(.is-multi-day):focus,
.wecc-calendar .wecc-event--month.is-timed:not(.is-multi-day):active,
.wecc-calendar .wecc-event--month.is-timed:not(.is-multi-day):visited {
	background-color: transparent;
	color: var(--wecc-text);
}

.wecc-calendar .wecc-event--month.is-timed:not(.is-multi-day):hover {
	background-color: rgba(17, 24, 39, 0.06);
	color: var(--wecc-text);
	filter: none;
	transform: none;
}

.wecc-event--month.is-timed:not(.is-multi-day)::before {
	content: "";
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wecc-event-bg);
}

.wecc-day.is-outside .wecc-event--month.is-timed:not(.is-multi-day) {
	color: var(--wecc-outside-color);
}

/* "+N more" toggle. */
.wecc-calendar .wecc-day__more {
	align-self: flex-start;
	margin-top: 3px;
	padding: 1px 2px;
	background: none;
	color: var(--wecc-primary);
	font-size: 0.75em;
	font-weight: 500;
	line-height: 1.4;
}

.wecc-calendar .wecc-day__more:focus,
.wecc-calendar .wecc-day__more:active {
	background: none;
	color: var(--wecc-primary);
}

.wecc-calendar .wecc-day__more:hover {
	background: none;
	color: var(--wecc-primary);
	text-decoration: underline;
}

/* ==========================================================================
   8. Week view
   ========================================================================== */

.wecc-week-view__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	overflow: hidden;
	border: 1px solid var(--wecc-cell-border);
	border-radius: var(--wecc-radius);
	background: var(--wecc-cell-bg);
}

.wecc-day--column {
	min-height: 220px;
}

.wecc-week-view__grid .wecc-day--column + .wecc-day--column {
	border-inline-start: 1px solid var(--wecc-cell-border);
}

.wecc-day--column .wecc-day__header {
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	margin-bottom: 8px;
}

.wecc-day__weekday {
	color: var(--wecc-weekday-color);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wecc-day--column .wecc-day__number {
	min-width: 36px;
	height: 36px;
	font-size: 1.5em;
	font-weight: 600;
}

.wecc-calendar .wecc-event--week,
.wecc-calendar .wecc-event--day {
	flex-wrap: wrap;
	align-items: baseline;
}

.wecc-calendar .wecc-event--week {
	font-size: 0.85em;
}

.wecc-event--week .wecc-event__badge,
.wecc-event--day .wecc-event__badge {
	display: inline-block;
}

/* ==========================================================================
   9. Day view
   ========================================================================== */

.wecc-day-view {
	padding: 16px;
	border: 1px solid var(--wecc-cell-border);
	border-radius: var(--wecc-radius);
	background: var(--wecc-cell-bg);
}

.wecc-day-view.is-today {
	background: var(--wecc-today-bg);
}

.wecc-day-view__section + .wecc-day-view__section {
	margin-top: 20px;
}

.wecc-calendar .wecc-day-view__heading {
	margin: 0 0 8px;
	color: var(--wecc-muted);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-transform: uppercase;
}

.wecc-day-view__events {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wecc-calendar .wecc-event--day {
	padding: 10px 12px;
	font-size: 0.95em;
	gap: 4px 12px;
}

.wecc-event--day .wecc-event__time {
	min-width: 5.5em;
}

.wecc-event--day .wecc-event__title {
	flex: 1 1 10em;
}

/* ==========================================================================
   10. List view
   ========================================================================== */

.wecc-calendar .wecc-list__items {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wecc-calendar .wecc-list__item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin: 0;
	padding: 14px;
	background: var(--wecc-cell-bg);
	border: 1px solid var(--wecc-border);
	border-radius: var(--wecc-radius);
	list-style: none;
	transition: border-color 0.15s ease;
}

.wecc-calendar .wecc-list__item::marker {
	content: none;
}

.wecc-calendar .wecc-list__item:hover,
.wecc-calendar .wecc-list__item:focus-within {
	border-color: var(--wecc-primary);
}

.wecc-list__date {
	display: flex;
	flex: 0 0 56px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: var(--wecc-event-bg);
	color: var(--wecc-event-color);
	border-radius: 8px;
	line-height: 1;
	text-align: center;
}

.wecc-list__day {
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1;
}

.wecc-list__month {
	margin-top: 3px;
	font-size: 0.7em;
	font-weight: 600;
	letter-spacing: 0.05em;
	line-height: 1;
	text-transform: uppercase;
}

.wecc-list__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}

.wecc-list__status {
	display: inline-block;
	padding: 1px 8px;
	background: #dcfce7;
	border-radius: 999px;
	color: #166534;
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1.5;
}

/* In the list the event is plain text, not a coloured chip. */
.wecc-calendar .wecc-event--list,
.wecc-calendar .wecc-event--list:focus,
.wecc-calendar .wecc-event--list:active,
.wecc-calendar .wecc-event--list:visited,
.wecc-calendar .wecc-event--list:hover {
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: auto;
	max-width: 100%;
	padding: 0;
	background-color: transparent;
	color: var(--wecc-text);
	border-radius: 0;
	box-shadow: none;
	filter: none;
	transform: none;
	font-size: 1em;
}

.wecc-calendar .wecc-event--list:hover .wecc-event__title {
	color: var(--wecc-primary);
}

.wecc-event--list .wecc-event__title {
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.35;
}

.wecc-event--list .wecc-event__date {
	color: var(--wecc-muted);
	font-size: 0.9em;
}

.wecc-event--list .wecc-event__badge {
	display: inline-block;
	margin-top: 2px;
	background: var(--wecc-event-bg);
	color: var(--wecc-event-color);
}

/* ==========================================================================
   11. Modal
   ========================================================================== */

.wecc-calendar .wecc-modal {
	position: fixed;
	inset: 0;
	display: none;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 16px;
	overflow: hidden;
	box-sizing: border-box;
	background: transparent;
	border: 0;
	color: var(--wecc-modal-text-color);
}

.wecc-calendar .wecc-modal[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wecc-modal::backdrop {
	background: transparent;
}

.wecc-modal__overlay {
	position: absolute;
	inset: 0;
	background: var(--wecc-overlay-bg);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.wecc-modal.is-open .wecc-modal__overlay {
	opacity: 1;
}

.wecc-modal__box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--wecc-modal-width);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	padding: var(--wecc-modal-padding);
	background: var(--wecc-modal-bg);
	border-radius: var(--wecc-modal-radius);
	box-shadow: var(--wecc-modal-shadow);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.wecc-modal.is-open .wecc-modal__box {
	opacity: 1;
	transform: none;
}

.wecc-calendar .wecc-modal__close {
	position: absolute;
	z-index: 2;
	inset-block-start: 12px;
	inset-inline-end: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background-color: transparent;
	border-radius: 50%;
	color: var(--wecc-modal-title-color);
	line-height: 1;
	transition: background-color 0.15s ease;
}

.wecc-calendar .wecc-modal__close:focus,
.wecc-calendar .wecc-modal__close:active {
	background-color: transparent;
	color: var(--wecc-modal-title-color);
}

.wecc-calendar .wecc-modal__close:hover {
	background-color: rgba(0, 0, 0, 0.06);
	color: var(--wecc-modal-title-color);
}

.wecc-modal__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 160px;
}

.wecc-spinner {
	display: block;
	width: 32px;
	height: 32px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--wecc-primary);
	border-radius: 50%;
	animation: wecc-spin 0.7s linear infinite;
}

@keyframes wecc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   12. Popup content
   ========================================================================== */

.wecc-popup {
	color: var(--wecc-modal-text-color);
}

.wecc-popup__header {
	margin-inline-end: 40px;
}

.wecc-popup__badge {
	display: inline-block;
	padding: 2px 10px;
	background: var(--wecc-event-bg);
	border-radius: 999px;
	color: var(--wecc-event-color);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.6;
	text-transform: uppercase;
}

.wecc-calendar .wecc-popup__title {
	margin: 0.4em 0 0.6em;
	padding: 0;
	color: var(--wecc-modal-title-color);
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.25;
	text-transform: none;
}

.wecc-popup__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--wecc-modal-meta-color);
	font-size: 0.95em;
}

.wecc-popup__date {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.wecc-popup__meta .wecc-icon {
	color: currentColor;
}

.wecc-popup__description {
	margin-top: 16px;
	color: var(--wecc-modal-text-color);
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.wecc-popup__description > :first-child {
	margin-top: 0;
}

.wecc-popup__description > :last-child {
	margin-bottom: 0;
}

.wecc-popup__description p {
	margin: 0 0 1em;
}

.wecc-popup__description h2,
.wecc-popup__description h3,
.wecc-popup__description h4,
.wecc-popup__description h5,
.wecc-popup__description h6 {
	margin: 1.2em 0 0.5em;
	color: var(--wecc-modal-title-color);
	line-height: 1.3;
}

.wecc-popup__description ul,
.wecc-popup__description ol {
	margin: 0 0 1em;
	padding-inline-start: 1.4em;
}

.wecc-popup__description blockquote {
	margin: 0 0 1em;
	padding-inline-start: 1em;
	border-inline-start: 3px solid var(--wecc-border);
	color: var(--wecc-modal-meta-color);
}

.wecc-popup__description img,
.wecc-popup__description video,
.wecc-popup__description iframe {
	max-width: 100%;
	height: auto;
}

.wecc-popup__description a {
	color: var(--wecc-primary);
	text-decoration: underline;
}

.wecc-popup__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	margin-top: 24px;
}

.wecc-calendar .wecc-popup__button,
.wecc-calendar a.wecc-popup__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	background-color: var(--wecc-modal-btn-bg);
	border-radius: var(--wecc-modal-btn-radius);
	color: var(--wecc-modal-btn-color);
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wecc-calendar .wecc-popup__button:focus,
.wecc-calendar .wecc-popup__button:active,
.wecc-calendar a.wecc-popup__button:visited {
	background-color: var(--wecc-modal-btn-bg);
	color: var(--wecc-modal-btn-color);
	text-decoration: none;
}

.wecc-calendar .wecc-popup__button:hover,
.wecc-calendar a.wecc-popup__button:hover {
	background-color: var(--wecc-modal-btn-hover-bg);
	color: var(--wecc-modal-btn-hover-color);
	text-decoration: none;
}

/* ==========================================================================
   13. Editor notice (Elementor preview, widget not configured)
   ========================================================================== */

.wecc-editor-notice {
	padding: 20px;
	border: 2px dashed var(--wecc-border, #e5e7eb);
	border-radius: 8px;
	color: var(--wecc-muted, #6b7280);
	text-align: center;
}

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.wecc-calendar {
		--wecc-cell-min-height: 92px;
	}

	.wecc-day--column {
		min-height: 180px;
	}
}

@media (max-width: 767px) {
	/* Toolbar: title first (full width), then nav + views on one row. */
	.wecc-toolbar {
		justify-content: space-between;
		gap: 8px;
	}

	.wecc-calendar .wecc-toolbar__title {
		flex: 1 0 100%;
		order: -1;
		font-size: 1.1em;
	}

	/* Month view: compact cells, short weekday labels. */
	.wecc-weekday__long {
		display: none;
	}

	.wecc-weekday__short {
		display: inline;
	}

	.wecc-month .wecc-day {
		min-height: 64px;
	}

	.wecc-calendar .wecc-event--month .wecc-event__time,
	.wecc-calendar .wecc-event--month .wecc-event__badge {
		display: none;
	}

	/* Week view: stack the days. */
	.wecc-week-view__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.wecc-day--column {
		min-height: 0;
	}

	.wecc-week-view__grid .wecc-day--column + .wecc-day--column {
		border-inline-start: 0;
		border-top: 1px solid var(--wecc-cell-border);
	}

	.wecc-day--column .wecc-day__header {
		flex-direction: row;
		align-items: center;
		gap: 10px;
		margin-bottom: 6px;
	}

	.wecc-day--column .wecc-day__number {
		min-width: 30px;
		height: 30px;
		font-size: 1.15em;
	}

	.wecc-day--column:not(.has-events) .wecc-day__header {
		margin-bottom: 0;
	}

	.wecc-day-view {
		padding: 12px;
	}

	.wecc-calendar .wecc-list__item {
		gap: 12px;
		padding: 12px;
	}

	.wecc-calendar .wecc-modal__box {
		padding: min(var(--wecc-modal-padding), 20px);
	}
}

/* ==========================================================================
   15. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.wecc-calendar,
	.wecc-calendar *,
	.wecc-calendar *::before,
	.wecc-calendar *::after {
		transition: none !important;
		animation: none !important;
	}

	.wecc-calendar .wecc-event:hover {
		transform: none;
	}
}
