/**
 * Area 53 Events Calendar — front-end styles.
 * Designed to be colorblind-friendly: meaning is always carried by text/icons/shape,
 * with color as reinforcement only. High contrast throughout.
 */

.cec-form,
.cec-calendar,
.cec-list,
.cec-single,
.cec-carousel {
	/* Colors come from the active theme (Area 53 Block theme.json presets), so the
	   calendar matches it and follows its light/dark mode. Fallbacks keep it
	   readable on any other theme. */
	--cec-ink: var(--wp--preset--color--contrast, #0d2436);
	--cec-muted: var(--wp--preset--color--muted, #3f5563);
	--cec-line: var(--wp--preset--color--border, #e2e8f0);
	--cec-bg-soft: var(--wp--preset--color--sky-light, #e3f7fc);
	--cec-surface: var(--wp--preset--color--surface, #ffffff);
	--cec-base: var(--wp--preset--color--base, #f7fbfd);
	--cec-primary: var(--wp--preset--color--primary, #0e7690);
	--cec-primary-dark: var(--wp--preset--color--primary-dark, #0b6178);
	--cec-primary-ink: var(--wp--preset--color--on-primary, #ffffff);
	--cec-accent: #b25a00;       /* amber: status markers only, distinct from blue for colour-blind visitors */
	/* Blue TEXT uses the theme's link colour: the Area 53 Block theme swaps it to a
	   light blue in dark mode, while Blue 700/800 stay the same (fine for filled
	   buttons, too faint as text on the dark background). */
	--cec-link: var(--wp--preset--color--link, var(--cec-primary));
	--cec-focus: var(--wp--preset--color--link, #0b6178);
	--cec-radius: var(--wp--custom--radius--small, 10px);
	--cec-radius-lg: var(--wp--custom--radius--medium, 14px);
	--cec-gap: var(--wp--preset--spacing--30, 1rem);
	/* Status colours are not part of the theme palette; tints are mixed from the
	   theme's surface colour so they also work in dark mode. */
	--cec-error: #b00020;
	--cec-success: #1a7a44;
	--cec-error-soft: color-mix(in srgb, var(--cec-error) 9%, var(--cec-surface));
	--cec-success-soft: color-mix(in srgb, var(--cec-success) 9%, var(--cec-surface));
	--cec-overlay: color-mix(in srgb, var(--cec-ink) 55%, transparent);
	--cec-shadow: 0 10px 40px color-mix(in srgb, var(--cec-ink) 28%, transparent);
	--cec-font: inherit;
	color: var(--cec-ink);
	font-size: 16px;
	line-height: 1.5;
	max-width: 820px;
}

/* ---------- Notices ---------- */
.cec-notice {
	border: 2px solid var(--cec-line);
	border-left-width: 6px;
	border-radius: 6px;
	padding: 14px 16px;
	margin: 0 0 18px;
	background: var(--cec-surface);
}
.cec-notice-icon { font-weight: 700; margin-right: 6px; }
.cec-notice-success { border-color: var(--cec-success); background: var(--cec-success-soft); }
.cec-notice-error   { border-color: var(--cec-error); background: var(--cec-error-soft); }
.cec-notice-info    { border-color: var(--cec-primary); background: var(--cec-bg-soft); }
.cec-notice ul { margin: 8px 0 0 20px; }
.cec-inline-error { color: var(--cec-error); font-weight: 600; margin: 6px 0 0; }

/* ---------- Form ---------- */
.cec-form { background: var(--cec-surface); }
.cec-form-heading { margin: 0 0 6px; font-size: 1.5rem; }
.cec-form-intro { margin: 0 0 20px; color: var(--cec-muted); }
.cec-subheading { margin: 4px 0; font-size: 1.15rem; }
.cec-help { margin: 0 0 12px; color: var(--cec-muted); font-size: 0.9rem; }
.cec-divider { border: none; border-top: 1px solid var(--cec-line); margin: 24px 0 16px; }

.cec-field { margin: 0 0 16px; }
.cec-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.cec-field input[type="text"],
.cec-field input[type="email"],
.cec-field input[type="url"],
.cec-field input[type="date"],
.cec-field input[type="time"],
.cec-field select,
.cec-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 2px solid var(--cec-line);
	border-radius: 6px;
	font-size: 1rem;
	font-family: inherit;
	background: var(--cec-surface);
	color: var(--cec-ink);
}
.cec-field input:focus,
.cec-field select:focus,
.cec-field textarea:focus {
	outline: 3px solid var(--cec-focus);
	outline-offset: 1px;
	border-color: var(--cec-focus);
}
.cec-field.cec-checkbox label,
.cec-field.cec-confirm label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-weight: 500;
	cursor: pointer;
}
.cec-field.cec-checkbox input,
.cec-field.cec-confirm input { margin-top: 4px; width: auto; }
.cec-req { color: var(--cec-accent); font-weight: 700; }
.cec-invalid { border-color: var(--cec-error) !important; background: var(--cec-error-soft); }

.cec-row { display: flex; gap: 16px; }
.cec-row .cec-field { flex: 1; }
.cec-time-field { max-width: 40%; }

.cec-confirm {
	background: var(--cec-bg-soft);
	border: 2px solid var(--cec-line);
	border-radius: 6px;
	padding: 14px 16px;
	margin: 18px 0;
}

/* Honeypot — visually hidden but present for bots. */
.cec-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px; overflow: hidden;
}

/* Steps */
.cec-step[hidden] { display: none; }

/* Buttons */
.cec-actions { margin-top: 20px; }
.cec-actions-split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* Low priority (:where) so the theme's own button style wins when it has one. */
:where(.cec-btn) {
	display: inline-block;
	font-size: 1rem;
	font-weight: 600;
	padding: 12px 20px;
	border-radius: 6px;
	border: 2px solid transparent;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}
.cec-btn.wp-element-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
:where(.cec-btn-primary) { background: var(--cec-primary); color: var(--cec-primary-ink); border-color: var(--cec-primary); }
:where(.cec-btn-primary):hover { background: var(--cec-primary-dark); }
.cec-btn-secondary { background: var(--cec-surface); color: var(--cec-link); border-color: var(--cec-primary); }
.cec-btn-secondary:hover { background: var(--cec-bg-soft); }
.cec-btn:focus { outline: 3px solid var(--cec-focus); outline-offset: 2px; }

/* Preview card */
.cec-preview-card {
	border: 2px solid var(--cec-line);
	border-radius: var(--cec-radius);
	padding: 18px 20px;
	background: var(--cec-bg-soft);
}
.cec-preview-dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.cec-preview-dl dt { font-weight: 700; color: var(--cec-muted); }
.cec-preview-dl dd { margin: 0; }
.cec-tag {
	display: inline-block;
	background: var(--cec-bg-soft);
	border: 1px solid var(--cec-primary);
	color: var(--cec-link);
	border-radius: 999px;
	padding: 1px 10px;
	font-size: 0.8rem;
	font-weight: 600;
}

/* ---------- Calendar ---------- */
.cec-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.cec-cal-title { margin: 0; font-size: 1.5rem; text-align: center; flex: 1; }
.cec-cal-nav {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 14px;
	border: 2px solid var(--cec-primary);
	border-radius: 6px;
	color: var(--cec-link);
	text-decoration: none;
	font-weight: 600;
	background: var(--cec-surface);
	white-space: nowrap;
}
.cec-cal-nav:hover { background: var(--cec-bg-soft); }
.cec-cal-nav:focus { outline: 3px solid var(--cec-focus); outline-offset: 2px; }

.cec-cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cec-cal-table th {
	background: var(--cec-primary);
	color: var(--cec-primary-ink);
	padding: 8px 4px;
	font-size: 0.85rem;
	border: 1px solid var(--cec-primary-dark);
	text-align: center;
}
.cec-cal-table td {
	border: 1px solid var(--cec-line);
	vertical-align: top;
	height: 96px;
	padding: 4px;
	background: var(--cec-surface);
}
.cec-cal-empty { background: var(--cec-base) !important; }
.cec-cal-day.cec-is-today { background: var(--cec-bg-soft); outline: 2px solid var(--cec-accent); outline-offset: -2px; }
.cec-day-num { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; color: var(--cec-muted); }
.cec-today-tag {
	display: inline-block; font-size: 0.65rem; font-weight: 700;
	background: var(--cec-accent); color: var(--cec-primary-ink); border-radius: calc(var(--cec-radius) * 0.4); padding: 0 5px; vertical-align: middle;
}

.cec-day-events { list-style: none; margin: 0; padding: 0; }
.cec-day-event { margin: 0 0 3px; }
.cec-event-chip {
	display: flex;
	align-items: baseline;
	gap: 5px;
	width: 100%;
	text-align: left;
	background: var(--cec-bg-soft);
	border: 1px solid var(--cec-primary);
	border-left: 4px solid var(--cec-primary);
	border-radius: 4px;
	padding: 3px 6px;
	font-size: 0.78rem;
	line-height: 1.25;
	cursor: pointer;
	color: var(--cec-link);
}
.cec-event-chip:hover { background: var(--cec-bg-soft); }
.cec-event-chip:focus { outline: 2px solid var(--cec-focus); outline-offset: 1px; }
.cec-chip-marker { font-size: 0.7rem; }
.cec-chip-time { font-weight: 700; white-space: nowrap; }
.cec-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cec-cal-foot { text-align: center; margin-top: 12px; }

/* ---------- Modal ---------- */
body.cec-modal-open { overflow: hidden; }
.cec-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.cec-modal[hidden] { display: none; }
.cec-modal-overlay { position: absolute; inset: 0; background: var(--cec-overlay); }
.cec-modal-box {
	position: relative;
	background: var(--cec-surface);
	max-width: 520px;
	width: calc(100% - 40px);
	max-height: 85vh;
	overflow: auto;
	border-radius: 10px;
	padding: 28px 26px 24px;
	box-shadow: var(--cec-shadow);
}
.cec-modal-close {
	position: absolute; top: 10px; right: 12px;
	background: none; border: none; font-size: 1.8rem; line-height: 1;
	cursor: pointer; color: var(--cec-muted);
}
.cec-modal-close:focus { outline: 3px solid var(--cec-focus); }
.cec-modal-title { margin: 0 30px 14px 0; font-size: 1.4rem; }
.cec-modal-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 0 0 14px; }
.cec-modal-dl dt { font-weight: 700; color: var(--cec-muted); }
.cec-modal-dl dd { margin: 0; }
.cec-modal-desc { border-top: 1px solid var(--cec-line); padding-top: 12px; }

/* ---------- List ---------- */
.cec-list-items { list-style: none; margin: 0; padding: 0; }
.cec-list-item {
	display: flex;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--cec-line);
}
.cec-list-when {
	flex: 0 0 190px;
	font-weight: 700;
	color: var(--cec-link);
}
.cec-list-title { font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.cec-list-loc { color: var(--cec-muted); font-size: 0.9rem; margin-top: 4px; }
.cec-list-empty { color: var(--cec-muted); font-style: italic; }

/* ---------- Single event page ---------- */
.cec-single { margin: 0 0 28px; }
.cec-single-details {
	border: 1px solid var(--cec-line);
	border-left: 5px solid var(--cec-primary);
	border-radius: var(--cec-radius);
	background: var(--cec-bg-soft);
	padding: 20px 24px;
}
.cec-single-heading {
	margin: 0 0 14px;
	font-size: 1.1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cec-link);
}
.cec-single-dl {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 10px 20px;
	margin: 0;
}
.cec-single-dl dt {
	font-weight: 700;
	color: var(--cec-muted);
	display: flex;
	align-items: center;
	gap: 6px;
}
.cec-single-dl dt .dashicons { color: var(--cec-link); }
.cec-single-dl dd { margin: 0; }
.cec-map-link { font-size: 0.9rem; font-weight: 600; }
.cec-single-cta { margin: 18px 0 0; }

@media (max-width: 640px) {
	.cec-single-dl { grid-template-columns: 1fr; gap: 3px 0; }
	.cec-single-dl dt { margin-top: 10px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.cec-row { flex-direction: column; gap: 0; }
	.cec-time-field { max-width: 100%; }
	.cec-preview-dl,
	.cec-modal-dl { grid-template-columns: 1fr; gap: 2px 0; }
	.cec-preview-dl dt,
	.cec-modal-dl dt { margin-top: 8px; }
	.cec-list-item { flex-direction: column; gap: 4px; }
	.cec-list-when { flex-basis: auto; }
	.cec-nav-text { display: none; }

	/* Calendar becomes a stacked agenda on small screens. */
	.cec-cal-table, .cec-cal-table tbody, .cec-cal-table tr { display: block; width: 100%; }
	.cec-cal-table thead { display: none; }
	.cec-cal-table td {
		display: block; width: 100%; box-sizing: border-box; height: auto; min-height: 0;
	}
	.cec-cal-empty { display: none !important; }
	.cec-cal-day { border-bottom: none; }
	.cec-cal-day.cec-has-events { padding-bottom: 8px; }
	.cec-cal-day:not(.cec-has-events) .cec-day-num { opacity: 0.5; }
	.cec-event-chip { font-size: 0.9rem; }
}


/* =====================================================================
   Flyers (v1.3)
   ===================================================================== */

/* Visually hidden, still read by screen readers (in case the theme lacks it). */
.cec-frontend .screen-reader-text,
.cec-carousel .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Form ---------- */
.cec-field input[type="file"] {
	display: block; width: 100%; box-sizing: border-box;
	padding: 10px; border: 2px dashed var(--cec-line); border-radius: 6px; background: var(--cec-bg-soft);
	font-size: 1rem;
}
.cec-field input[type="file"]:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }
.cec-field input[type="file"].cec-invalid { border-color: var(--cec-error); border-style: solid; }
.cec-flyer-preview { margin-top: 8px; }
.cec-flyer-preview img,
.cec-preview-flyer { display: block; max-width: 220px; max-height: 300px; width: auto; height: auto; border: 1px solid var(--cec-line); border-radius: 6px; }

/* ---------- Popup, single page, list ---------- */
.cec-modal-flyer { border-top: 1px solid var(--cec-line); margin-top: 12px; padding-top: 12px; }
.cec-modal-flyer img { display: block; max-width: 100%; max-height: 50vh; width: auto; height: auto; margin: 0 auto 8px; border-radius: 6px; }
.cec-single-flyer { margin: 0 0 20px; text-align: center; }
.cec-single-flyer img { display: block; max-width: 100%; max-height: 80vh; width: auto; height: auto; margin: 0 auto 10px; border-radius: 6px; border: 1px solid var(--cec-line); }
.cec-list-flyer { margin-top: 4px; font-size: 0.95rem; }

/* ---------- Carousel ---------- */
.cec-carousel { max-width: 1100px; margin: 0 auto 24px; position: relative; }
.cec-carousel-heading { margin: 0 0 12px; font-size: 1.5rem; }
.cec-carousel-empty { color: var(--cec-muted); }

.cec-carousel-controls { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.cec-carousel-btn {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 44px; min-width: 44px; padding: 8px 14px;
	font: inherit; font-weight: 600; cursor: pointer;
	color: var(--cec-link); background: var(--cec-surface);
	border: 2px solid var(--cec-primary); border-radius: 6px;
}
.cec-carousel-btn:hover { background: var(--cec-bg-soft); }
.cec-carousel-btn:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }
.cec-carousel-btn:disabled { opacity: 0.45; cursor: default; }
.cec-carousel-icon { font-size: 1.1em; line-height: 1; }

.cec-carousel-track {
	display: flex; gap: 16px;
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
	padding: 4px 4px 12px; margin: 0 -4px;
}
.cec-carousel-track:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }
.cec-carousel--js .cec-carousel-track { scrollbar-width: none; }
.cec-carousel--js .cec-carousel-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) { .cec-carousel-track { scroll-behavior: auto; } }

.cec-slide {
	flex: 0 0 100%; box-sizing: border-box; scroll-snap-align: start;
	display: flex; flex-direction: column;
	background: var(--cec-surface); border: 1px solid var(--cec-line); border-radius: var(--cec-radius); overflow: hidden;
}
@media (min-width: 640px) {
	.cec-carousel--cols-2 .cec-slide,
	.cec-carousel--cols-3 .cec-slide { flex-basis: calc((100% - 16px) / 2); }
}
@media (min-width: 1000px) {
	.cec-carousel--cols-3 .cec-slide { flex-basis: calc((100% - 32px) / 3); }
}

.cec-slide-media {
	display: flex; align-items: center; justify-content: center;
	aspect-ratio: 3 / 4; background: var(--cec-bg-soft); text-decoration: none;
}
.cec-slide-media:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: -3px; }
.cec-slide-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cec-slide-pdf { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; text-align: center; color: var(--cec-ink); }
.cec-slide-pdf .dashicons { font-size: 56px; width: 56px; height: 56px; color: var(--cec-link); }
.cec-slide-pdf-title { font-weight: 700; font-size: 1.1rem; }
.cec-slide-pdf-note { color: var(--cec-muted); }

.cec-slide-caption { padding: 12px 14px 14px; }
.cec-slide-title { margin: 0 0 6px; font-size: 1.1rem; line-height: 1.3; }
.cec-slide-title a { color: var(--cec-ink); }
.cec-slide-when,
.cec-slide-loc { margin: 0 0 4px; color: var(--cec-muted); font-size: 0.95rem; display: flex; gap: 6px; align-items: flex-start; }
.cec-slide-links { margin: 8px 0 0; font-weight: 600; }

.cec-carousel-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cec-carousel-dot {
	/* 24px target with a visible 12px dot inside. Current dot is a filled, larger
	   square so it doesn't rely on color alone. */
	width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.cec-carousel-dot::before {
	content: ""; width: 10px; height: 10px; border-radius: 50%;
	border: 2px solid var(--cec-primary); background: var(--cec-surface); box-sizing: border-box;
}
.cec-carousel-dot[aria-current="true"]::before { width: 14px; height: 14px; border-radius: calc(var(--cec-radius) * 0.4); background: var(--cec-primary); }
.cec-carousel-dot:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 1px; border-radius: 4px; }


/* =====================================================================
   Repeating events (v1.4)
   ===================================================================== */
.cec-repeat { border: 1px solid var(--cec-line); border-radius: 6px; padding: 12px 14px 4px; margin: 0 0 16px; }
.cec-repeat legend { font-weight: 700; padding: 0 6px; }
.cec-repeat select, .cec-repeat input[type="number"] { max-width: 100%; }
.cec-repeat [hidden] { display: none !important; }


/* =====================================================================
   Calendar layout, fitted to the Area 53 Block theme (v1.7)
   ===================================================================== */
.cec-calendar { font-family: inherit; color: var(--cec-ink); }

/* Toolbar: month name left; month controls and the submit button right. */
.cec-cal-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: var(--cec-gap) calc(var(--cec-gap) * 1.5);
	margin: 0 0 calc(var(--cec-gap) * 1.25);
}
.cec-cal-title {
	margin: 0; flex: 0 1 auto; text-align: left;
	font-size: var(--wp--preset--font-size--x-large, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em;
	color: var(--cec-ink);
}
.cec-cal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--cec-gap) * 0.75); }
.cec-cal-navgroup { display: inline-flex; border: 1px solid var(--cec-line); border-radius: var(--cec-radius); overflow: hidden; background: var(--cec-surface); }
.cec-cal-nav {
	display: inline-flex; align-items: center; gap: 0.35rem;
	min-height: 44px; padding: 0.5rem 0.9rem; margin: 0;
	border: 0; border-radius: 0; background: transparent;
	color: var(--cec-link); font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
}
.cec-cal-nav + .cec-cal-nav { border-left: 1px solid var(--cec-line); }
.cec-cal-nav:hover { background: var(--cec-bg-soft); color: var(--cec-link); }
.cec-cal-nav:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: -3px; }
.cec-cal-submit { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; white-space: nowrap; }
/* Fallback look only; the theme's button style (theme.json "button") wins when present. */
:where(.cec-cal-submit) {
	padding: 0.65rem 1.25rem; border-radius: var(--cec-radius);
	background: var(--cec-primary); color: var(--cec-primary-ink);
	font-weight: 700; font-size: 1rem;
}
:where(.cec-cal-submit):hover { background: var(--cec-primary-dark); color: var(--cec-primary-ink); }
.cec-cal-submit:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }

/* Grid */
.cec-cal-table { border: 1px solid var(--cec-line); border-radius: var(--cec-radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--cec-surface); }
.cec-cal-table th {
	background: var(--cec-base); color: var(--cec-muted);
	font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
	padding: 0.6rem 0.5rem; text-align: left; border: 0; border-bottom: 1px solid var(--cec-line);
}
.cec-cal-table td {
	height: 8.5rem; padding: 0.45rem; vertical-align: top;
	border: 0; border-right: 1px solid var(--cec-line); border-bottom: 1px solid var(--cec-line);
	background: var(--cec-surface);
}
.cec-cal-table tr td:last-child { border-right: 0; }
.cec-cal-table tbody tr:last-child td { border-bottom: 0; }
.cec-cal-empty { background: var(--cec-base) !important; }
.cec-day-num { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.35rem; font-size: 0.875rem; font-weight: 700; color: var(--cec-muted); }
.cec-cal-day.cec-is-today { background: var(--cec-bg-soft); outline: 0; }
.cec-cal-day.cec-is-today .cec-day-num { color: var(--cec-link); }
.cec-today-tag {
	font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
	padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--cec-primary); color: var(--cec-primary-ink);
}

/* Event chips: time on a small first line, then the name on up to two lines. */
.cec-day-event { margin: 0 0 0.3rem; }
.cec-event-chip {
	display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 0.3rem; row-gap: 0.05rem;
	width: 100%; padding: 0.3rem 0.45rem; margin: 0;
	border: 1px solid var(--cec-line); border-left: 3px solid var(--cec-primary); border-radius: var(--cec-radius);
	background: var(--cec-surface); color: var(--cec-ink);
	font: inherit; font-size: 0.8125rem; line-height: 1.25; text-align: left; text-transform: none; letter-spacing: 0;
	cursor: pointer;
}
.cec-event-chip:hover { background: var(--cec-bg-soft); border-color: var(--cec-primary); }
.cec-event-chip:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 1px; }
.cec-chip-marker { grid-column: 1; font-size: 0.65rem; color: var(--cec-link); }
.cec-chip-time { grid-column: 2; font-weight: 700; color: var(--cec-link); text-transform: none; white-space: nowrap; }
.cec-chip-title {
	grid-column: 1 / -1; font-weight: 600;
	white-space: normal; overflow: hidden; text-overflow: ellipsis;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Busy days: show a few, then "+N more" (only when JavaScript is running). */
.cec-js .cec-day-event--extra { display: none; }
.cec-js .cec-day--expanded .cec-day-event--extra { display: block; }
.cec-day-more { display: none; }
.cec-js .cec-day-more {
	display: inline-block; margin: 0.1rem 0 0; padding: 0.2rem 0.3rem;
	border: 0; background: transparent; color: var(--cec-link); cursor: pointer;
	font: inherit; font-size: 0.8125rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px;
}
.cec-day-more:hover { color: var(--cec-ink); }
.cec-day-more:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 1px; border-radius: 4px; }

/* Popup: neutral close button (the theme keeps red for one key action per page). */
.cec-modal-box { border-radius: var(--cec-radius-lg); font-family: inherit; color: var(--cec-ink); }
.cec-modal-close {
	background: var(--cec-surface) !important; color: var(--cec-ink) !important;
	border: 1px solid var(--cec-line) !important; border-radius: var(--cec-radius) !important;
	min-width: 44px; min-height: 44px; font-size: 1.5rem; line-height: 1;
}
.cec-modal-close:hover { background: var(--cec-bg-soft) !important; }
.cec-modal-close:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }

/* Phones: the existing list layout, with the toolbar stacked neatly. */
@media (max-width: 640px) {
	.cec-cal-toolbar { flex-direction: column; align-items: stretch; }
	.cec-cal-title { text-align: center; font-size: var(--wp--preset--font-size--large, 1.4rem); }
	.cec-cal-controls { flex-direction: column; align-items: stretch; }
	.cec-cal-navgroup { width: 100%; }
	.cec-cal-nav { flex: 1; justify-content: center; padding: 0.5rem; }
	.cec-cal-submit { justify-content: center; }
	.cec-cal-table { border-radius: var(--cec-radius); }
	.cec-cal-table td { height: auto; border-right: 0; }
	.cec-event-chip { font-size: 0.9375rem; }
}


/* v1.8.1: the submit button always reads clearly, whatever the theme does to
   links and buttons (colours still come from the theme palette). */
.cec-calendar a.cec-cal-submit,
.cec-calendar a.cec-cal-submit:visited {
	background: var(--cec-primary); color: var(--cec-primary-ink);
	padding: 0.65rem 1.25rem; border: 0; border-radius: var(--cec-radius);
	font-weight: 700; font-size: 1rem; line-height: 1.2;
}
.cec-calendar a.cec-cal-submit:hover,
.cec-calendar a.cec-cal-submit:focus-visible { background: var(--cec-primary-dark); color: var(--cec-primary-ink); }

/* Long words (e.g. "Correctional") hyphenate instead of breaking oddly. */
.cec-chip-title { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; word-break: normal; }
@media (min-width: 641px) and (max-width: 1100px) {
	.cec-event-chip { font-size: 0.75rem; }
}


/* v1.9.3: [cec_submit_button], same look as the calendar's submit button. */
.cec-submit-button-wrap { margin: 0 0 var(--cec-gap); }
a.cec-submit-button,
a.cec-submit-button:visited {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
	background: var(--cec-primary); color: var(--cec-primary-ink);
	padding: 0.65rem 1.25rem; border: 0; border-radius: var(--cec-radius);
	font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none;
}
a.cec-submit-button:hover,
a.cec-submit-button:focus-visible { background: var(--cec-primary-dark); color: var(--cec-primary-ink); }
a.cec-submit-button:focus-visible { outline: 3px solid var(--cec-focus); outline-offset: 2px; }


/* =====================================================================
   v1.9.6: event descriptions adapt to the screen
   Images and flyers (including ones imported from the old calendar with
   fixed sizes) shrink to fit, keep their shape, and never get taller than
   the screen; videos and embedded PDFs scale to the width.
   ===================================================================== */
.cec-event-body { max-width: 100%; overflow-wrap: break-word; }
.cec-event-body figure { margin: var(--cec-gap) 0; max-width: 100%; }
.cec-event-body img,
.cec-single-flyer img {
	display: block; max-width: 100%; width: auto; height: auto;
	max-height: 90vh; object-fit: contain; margin-inline: auto;
	border-radius: var(--cec-radius);
}
.cec-event-body figure a { display: block; }
.cec-event-body iframe,
.cec-event-body video,
.cec-event-body embed,
.cec-event-body object { display: block; max-width: 100%; }
.cec-event-body iframe[src*="youtube"],
.cec-event-body iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.cec-event-body table { display: block; max-width: 100%; overflow-x: auto; }
@media (min-width: 900px) {
	/* On wide screens a portrait flyer doesn't need to fill the whole column. */
	.cec-event-body img,
	.cec-single-flyer img { max-width: min(100%, 640px); }
}
