/* Simple Event Calendar
 * Defaults pick up Blocksy's palette when present, then fall back to neutral values.
 * Every --sec-* variable can be overridden from the Elementor widget's Style tab.
 */

.sec-calendar,
.sec-modal {
	--sec-bg: #ffffff;
	--sec-heading: var(--theme-headings-color, #1b1f24);
	--sec-day: var(--theme-text-color, #3d434b);
	--sec-day-bg: transparent;
	--sec-weekday: #8a9099;
	--sec-border: var(--theme-border-color, #e5e7eb);
	--sec-nav: var(--theme-headings-color, #1b1f24);
	--sec-nav-hover-bg: rgba(0, 0, 0, 0.05);
	--sec-today: var(--theme-palette-color-1, #2b6cb0);
	--sec-event-bg: var(--theme-palette-color-1, #2b6cb0);
	--sec-event-text: #ffffff;
	--sec-event-hover-bg: var(--theme-palette-color-2, #1f4f82);
	--sec-event-hover-text: #ffffff;
	--sec-dot: #ffffff;
	--sec-gap: 6px;
	--sec-cell-radius: 8px;
	--sec-popup-bg: #ffffff;
	--sec-popup-heading: var(--theme-headings-color, #1b1f24);
	--sec-popup-text: var(--theme-text-color, #4b525b);
	--sec-popup-accent: var(--theme-palette-color-1, #2b6cb0);
	--sec-popup-radius: 12px;
}

/* ---------- Calendar ---------- */

.sec-calendar {
	--sec-cell-height-default: 52px;
	box-sizing: border-box;
	width: 100%;
	background: var(--sec-bg);
	color: var(--sec-day);
	border: 1px solid var(--sec-border);
	border-radius: 12px;
	padding: 20px;
	line-height: 1.4;
}

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

.sec-calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.sec-calendar__title {
	margin: 0;
	padding: 0;
	flex: 1;
	text-align: center;
	font-size: 1.15em;
	font-weight: 600;
	color: var(--sec-heading);
	letter-spacing: 0;
}

/* Strong button resets so theme and Elementor kit button styles do not leak in. */
.sec-calendar button.sec-calendar__nav,
.sec-calendar button.sec-calendar__day,
.sec-modal button.sec-modal__close {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	min-height: 0;
	min-width: 0;
	border: 0;
	box-shadow: none;
	text-transform: none;
	text-decoration: none;
	letter-spacing: normal;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sec-calendar button.sec-calendar__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: transparent;
	color: var(--sec-nav);
}

.sec-calendar button.sec-calendar__nav:hover,
.sec-calendar button.sec-calendar__nav:focus {
	background: var(--sec-nav-hover-bg);
	color: var(--sec-nav);
}

.sec-calendar button.sec-calendar__nav svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sec-calendar__weekdays,
.sec-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: var(--sec-gap);
}

.sec-calendar__weekdays {
	margin-bottom: 8px;
}

.sec-calendar__weekday {
	text-align: center;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sec-weekday);
	padding: 4px 0;
}

.sec-calendar .sec-calendar__day,
.sec-calendar button.sec-calendar__day {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--sec-cell-height, var(--sec-cell-height-default));
	border-radius: var(--sec-cell-radius);
	background: var(--sec-day-bg);
	color: var(--sec-day);
	font-size: 0.95em;
	font-variant-numeric: tabular-nums;
}

.sec-calendar .sec-calendar__day--empty {
	background: transparent;
}

.sec-calendar .sec-calendar__day--today {
	box-shadow: inset 0 0 0 2px var(--sec-today);
	font-weight: 600;
}

.sec-calendar button.sec-calendar__day--event {
	background: var(--sec-event-bg);
	color: var(--sec-event-text);
	font-weight: 600;
}

.sec-calendar button.sec-calendar__day--event:hover,
.sec-calendar button.sec-calendar__day--event:focus {
	background: var(--sec-event-hover-bg);
	color: var(--sec-event-hover-text);
}

.sec-calendar button.sec-calendar__day--event:focus-visible {
	outline: 2px solid var(--sec-event-bg);
	outline-offset: 2px;
}

.sec-calendar button.sec-calendar__day--today.sec-calendar__day--event {
	box-shadow: inset 0 0 0 2px var(--sec-bg);
	outline: 2px solid var(--sec-today);
	outline-offset: 0;
}

.sec-calendar__dot {
	position: absolute;
	left: 50%;
	bottom: 18%;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--sec-dot);
	opacity: 0.85;
}

@media (max-width: 600px) {
	.sec-calendar {
		--sec-cell-height-default: 40px;
		padding: 14px;
	}
	.sec-calendar__weekday {
		font-size: 0.68em;
		letter-spacing: 0.02em;
	}
	.sec-calendar__dot {
		bottom: 12%;
	}
}

/* ---------- Pop-up ---------- */

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

.sec-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(17, 20, 24, 0.5);
	opacity: 0;
	transition: opacity 0.2s ease;
	box-sizing: border-box;
}

.sec-modal[hidden] {
	display: none;
}

.sec-modal.is-open {
	opacity: 1;
}

.sec-modal *,
.sec-modal *::before,
.sec-modal *::after {
	box-sizing: border-box;
}

.sec-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 28px 28px 24px;
	background: var(--sec-popup-bg);
	color: var(--sec-popup-text);
	border-radius: var(--sec-popup-radius);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
	transform: translateY(8px);
	transition: transform 0.2s ease;
	line-height: 1.5;
	font-size: 15px;
}

.sec-modal.is-open .sec-modal__dialog {
	transform: translateY(0);
}

.sec-modal button.sec-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: transparent;
	color: var(--sec-popup-text);
}

.sec-modal button.sec-modal__close:hover,
.sec-modal button.sec-modal__close:focus {
	background: rgba(0, 0, 0, 0.06);
	color: var(--sec-popup-heading);
}

.sec-modal button.sec-modal__close svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.sec-modal__date {
	margin: 0 40px 18px 0;
	font-size: 0.78em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--sec-popup-accent);
}

.sec-modal__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sec-modal__event {
	margin: 0;
	padding: 16px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sec-modal__event:first-child {
	padding-top: 0;
	border-top: 0;
}

.sec-modal__event:last-child {
	padding-bottom: 0;
}

.sec-modal__title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sec-popup-heading);
}

.sec-modal__meta {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 6px 0 0;
	color: var(--sec-popup-text);
}

.sec-modal__meta svg {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 3px;
	fill: none;
	stroke: var(--sec-popup-accent);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

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

@media (prefers-reduced-motion: reduce) {
	.sec-modal,
	.sec-modal__dialog,
	.sec-calendar button {
		transition: none;
	}
}
