/* ============ Кольори (перевизначаються з налаштувань плагіна) ============ */

:root {
	--ce-primary: #0B1C80;
	--ce-primary-2: #3E5F8E;
	--ce-accent: #dc802a;
	--ce-text: #1a1a1a;
	--ce-text-muted: #6b6b6b; /* Контраст ≥ WCAG AA на світлих фонах. */
	--ce-bg-card: #fafafa;
	--ce-border: #e2e2e2;
}

/* ============ Блок списку подій (шорткод) ============ */

.ce-events-block {
	font-family: inherit;
	max-width: 100%;
}

.ce-events-list {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ce-events-month-label {
	margin: 18px 0 10px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ce-text-muted);
}

.ce-event-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	border: 1px solid var(--ce-border);
	border-radius: 8px;
	background: var(--ce-bg-card);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ce-event-card:hover {
	box-shadow: 0 2px 10px rgba(11, 28, 128, 0.1);
}

/* Подія сьогоднішнього дня — акцентна підсвітка. */
.ce-event-today {
	border: 2px solid var(--ce-accent);
	background: #fffdfa;
}

.ce-event-image {
	flex: 0 0 auto;
	width: 96px;
	aspect-ratio: 3 / 2; /* Стабільна пропорція — картки не стрибають при завантаженні фото. */
	border-radius: 6px;
	overflow: hidden;
	display: block;
}

.ce-event-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.ce-event-image:hover img {
	transform: scale(1.05);
}

.ce-event-date {
	flex: 0 0 auto;
	width: 78px; /* Ширше — під повні назви місяців ("листопада"). */
	text-align: center;
	line-height: 1.15;
}

.ce-event-weekday {
	display: block;
	font-size: 11px;
	color: var(--ce-text-muted);
}

.ce-event-day {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: var(--ce-primary);
}

.ce-event-month {
	display: block;
	font-size: 11px; /* На пункт менше — повна назва місяця вміщується в один рядок. */
	text-transform: uppercase;
	color: var(--ce-text-muted);
	letter-spacing: 0.03em;
}

.ce-event-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ce-event-badge {
	display: inline-block;
	margin-bottom: 4px;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	background: rgba(11, 28, 128, 0.08);
	color: var(--ce-primary);
}

.ce-event-badge-today {
	background: var(--ce-accent);
	color: #ffffff;
}

.ce-event-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
}

.ce-event-title a {
	color: var(--ce-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ce-event-title a:hover {
	color: var(--ce-accent);
	text-decoration: underline;
}

.ce-event-time {
	margin: 0;
	font-size: 13px;
	color: var(--ce-text-muted);
}

.ce-event-excerpt {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.45;
	color: #555;
}

.ce-events-empty {
	color: var(--ce-text-muted);
	font-style: italic;
}

.ce-events-section-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--ce-primary);
}

.ce-events-archive-title {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid var(--ce-border);
	color: var(--ce-text-muted);
}

/* Архів: приглушені зменшені картки, але з фото та описом. */
.ce-events-list-archive .ce-event-card {
	opacity: 0.7;
	background: #f2f2f2;
	padding: 10px 16px;
	gap: 12px;
}

.ce-events-list-archive .ce-event-card:hover {
	opacity: 0.95;
}

.ce-events-list-archive .ce-event-image {
	width: 72px;
}

.ce-events-list-archive .ce-event-date {
	width: 70px;
}

.ce-events-list-archive .ce-event-day {
	font-size: 18px;
	color: var(--ce-text);
}

.ce-events-list-archive .ce-event-title {
	font-size: 15px;
}

.ce-events-list-archive .ce-event-excerpt {
	font-size: 13px;
	margin-top: 4px;
}

.ce-events-all-link {
	display: inline-block;
	margin-top: 18px;
	padding: 10px 24px;
	background: linear-gradient(135deg, var(--ce-primary), var(--ce-primary-2));
	color: #ffffff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	transition: opacity 0.2s ease;
}

.ce-events-all-link:hover {
	opacity: 0.88;
	color: #ffffff;
}

/* ============ Доступність: видимий фокус для клавіатурної навігації ============ */

.ce-event-title a:focus-visible,
.ce-event-image:focus-visible,
.ce-events-all-link:focus-visible,
.ce-gallery-slide:focus-visible,
.ce-lightbox-close:focus-visible,
.ce-lightbox-nav:focus-visible {
	outline: 3px solid var(--ce-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ============ Сторінка окремої події: галерея 1/4 + контент 3/4 ============ */

.ce-single-event {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

.ce-single-gallery {
	flex: 0 0 25%;
	max-width: 25%;
	overflow-y: auto;
	/* max-height ставить JS: мінімум один слайд, далі підганяється під висоту тексту. */
	scrollbar-width: thin;
	border-radius: 10px;
}

.ce-gallery-track {
	display: flex;
	flex-direction: column;
	gap: 12px; /* Має збігатись із GAP у gallery.js. */
}

.ce-gallery-slide {
	display: block;
	cursor: zoom-in;
	border-radius: 10px;
	overflow: hidden;
	flex: 0 0 auto;
}

.ce-gallery-slide img {
	width: 100%;
	aspect-ratio: 4 / 3; /* Стабільна висота слайда — без стрибків при завантаженні. */
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.ce-gallery-slide:hover img {
	transform: scale(1.03);
}

.ce-single-info {
	flex: 1 1 75%;
	min-width: 0;
}

.ce-single-info-full {
	flex-basis: 100%;
}

.ce-single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 18px;
	font-size: 16px;
	font-weight: 600;
	color: var(--ce-primary);
}

.ce-single-content {
	font-size: 16px;
	line-height: 1.6;
}

/* ============ Адаптивність ============ */

/* Планшети */
@media (max-width: 900px) {
	.ce-single-event {
		gap: 20px;
	}

	.ce-single-gallery {
		flex-basis: 35%;
		max-width: 35%;
	}
}

/* Мобільні */
@media (max-width: 640px) {
	/* Картки списку: фото зверху на всю ширину, дата й текст під ним */
	.ce-event-card {
		flex-wrap: wrap;
		align-items: flex-start;
	}

	.ce-event-image {
		width: 100%;
		aspect-ratio: 16 / 7;
		order: -1;
	}

	.ce-event-date {
		width: 64px;
	}

	.ce-event-day {
		font-size: 18px;
	}

	.ce-event-excerpt {
		font-size: 13px;
	}

	/* Сторінка події: колонки в стовпчик */
	.ce-single-event {
		flex-direction: column;
	}

	.ce-single-gallery,
	.ce-single-info {
		flex-basis: 100%;
		max-width: 100%;
		width: 100%;
	}

	/* Мобільна галерея: горизонтальна стрічка зі свайпом і прив'язкою слайдів. */
	.ce-single-gallery {
		max-height: none !important; /* Скасовуємо інлайн-висоту від JS. */
		overflow-y: visible;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
	}

	.ce-gallery-track {
		flex-direction: row;
	}

	.ce-gallery-slide {
		flex: 0 0 82%;
		scroll-snap-align: center;
	}

	.ce-gallery-slide img {
		aspect-ratio: 4 / 3;
	}

	.ce-single-meta {
		gap: 12px;
		font-size: 15px;
	}
}

/* ============ Лайтбокс ============ */

.ce-lightbox-trigger {
	display: block;
	cursor: zoom-in;
}

.ce-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(4, 10, 46, 0.88); /* Затемнення у відтінку основного синього. */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	transition: opacity 0.2s ease;
	cursor: zoom-out;
}

.ce-lightbox-visible {
	opacity: 1;
}

.ce-lightbox-img {
	max-width: 95vw;
	max-height: 92vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.ce-lightbox-close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.ce-lightbox-close:hover {
	background: var(--ce-accent);
}

.ce-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
	z-index: 1;
}

.ce-lightbox-nav:hover {
	background: var(--ce-accent);
}

.ce-lightbox-prev {
	left: 20px;
}

.ce-lightbox-next {
	right: 20px;
}

.ce-lightbox-counter {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	letter-spacing: 0.05em;
}

@media (max-width: 640px) {
	.ce-lightbox-nav {
		width: 42px;
		height: 42px;
		font-size: 20px;
	}

	.ce-lightbox-prev {
		left: 10px;
	}

	.ce-lightbox-next {
		right: 10px;
	}
}
