/*
 * EERGC events: month calendar + calendar/list toggle.
 * Loaded on pages carrying [event_calendar] or [event_list_page].
 * Brand tokens from the Elementor kit: navy #141346, red #B12333, Montserrat.
 */

.eergc-events,
.eergc-cal {
	--eergc-navy: #141346;
	--eergc-red: #B12333;
	--eergc-ink: #1F1F2E;
	--eergc-muted: #65657A;
	--eergc-faint: #6E6E80;
	--eergc-past: #5F5F72;
	--eergc-past-bg: #F1F1F4;
	--eergc-line: #E4E4EC;
	--eergc-bg: #FFFFFF;
	--eergc-bg-other: #F7F7FA;
	--eergc-today: #FFF4F5;
	--eergc-general: #141346;
	--eergc-general-bg: #EDEFF8;
	--eergc-youth: #2F7A4F;
	--eergc-youth-bg: #EAF5EE;
	--eergc-women: #B12333;
	--eergc-women-bg: #FBEDEF;
	font-family: 'Montserrat', 'Segoe UI', sans-serif;
	-webkit-font-smoothing: antialiased;
}

.eergc-cal .cat-general { --c: var(--eergc-general); --cb: var(--eergc-general-bg); }
.eergc-cal .cat-youth   { --c: var(--eergc-youth);   --cb: var(--eergc-youth-bg); }
.eergc-cal .cat-women   { --c: var(--eergc-women);   --cb: var(--eergc-women-bg); }

.eergc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- page top: heading + view toggle ---------- */

.eergc-events__top {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 32px;
}

.eergc-events__toggle {
	display: inline-flex;
	padding: 4px;
	border: 1px solid var(--eergc-line);
	border-radius: 999px;
	background: #fff;
	margin-bottom: 10px;
	font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

.eergc-events__toggle a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
	line-height: 1;
	color: var(--eergc-navy);
	text-decoration: none;
	transition: background .2s ease, color .2s ease;
}

.eergc-events__toggle a svg {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
}

.eergc-events__toggle a:hover { background: #F1F1F6; color: var(--eergc-navy); }
.eergc-events__toggle a.is-active,
.eergc-events__toggle a.is-active:hover { background: var(--eergc-navy); color: #fff; }
.eergc-events__toggle a:focus-visible { outline: 2px solid var(--eergc-red); outline-offset: 2px; }

.eergc-events__panel[hidden] { display: none !important; }

/* ---------- calendar toolbar ---------- */

.eergc-cal { position: relative; }
.eergc-cal__inner { transition: opacity .18s ease; }
.eergc-cal.is-loading .eergc-cal__inner { opacity: .45; pointer-events: none; }

.eergc-cal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 18px;
}

.eergc-cal__nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.eergc-cal__title {
	margin: 0 8px;
	min-width: 220px;
	text-align: center;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--eergc-navy);
	text-transform: none;
}

.eergc-cal__title .eergc-cal__year {
	font-weight: 400;
	color: var(--eergc-muted);
}

.eergc-cal__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--eergc-line);
	background: #fff;
	color: var(--eergc-navy);
	font: inherit;
	line-height: 1;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.eergc-cal__arrow svg { width: 20px; height: 20px; }
a.eergc-cal__arrow:hover { background: var(--eergc-navy); border-color: var(--eergc-navy); color: #fff; }
.eergc-cal__arrow.is-disabled,
.eergc-cal__arrow.is-disabled:hover { opacity: .3; cursor: default; background: #fff; border-color: var(--eergc-line); color: var(--eergc-navy); }

.eergc-cal__today {
	margin-left: 8px;
	padding: 11px 16px;
	border: 1px solid var(--eergc-line);
	border-radius: 999px;
	background: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--eergc-navy);
	text-decoration: none;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.eergc-cal__today:hover { background: var(--eergc-navy); border-color: var(--eergc-navy); color: #fff; }

.eergc-cal__arrow:focus-visible,
.eergc-cal__today:focus-visible { outline: 2px solid var(--eergc-red); outline-offset: 2px; }

.eergc-cal__legend {
	display: flex;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	font-weight: 500;
	color: var(--eergc-muted);
}

.eergc-cal__legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
}

.eergc-cal__legend li::before {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--c);
}

/* ---------- month grid ---------- */

.eergc-cal__grid {
	width: 100%;
	margin: 0;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--eergc-line);
	border-radius: 14px;
	overflow: hidden;
	background: var(--eergc-bg);
	box-shadow: 0 10px 28px rgba(20, 19, 70, .07);
}

.eergc-cal__grid th {
	padding: 13px 6px;
	border: 0;
	border-bottom: 1px solid var(--eergc-line);
	background: #FBFBFD;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-align: center;
	color: var(--eergc-muted);
}

.eergc-cal__grid th abbr { text-decoration: none; border: 0; cursor: default; }

/* hello-elementor's reset draws its own top rule on the first header row. */
.eergc-cal__grid thead:first-child tr:first-child th { border-top: 0; border-block-start: 0; }
.eergc-cal__grid tbody tr > td.eergc-cal__day { border-top: 0; border-left: 0; border-block-start: 0; border-inline-start: 0; }

.eergc-cal__day {
	vertical-align: top;
	height: 126px;
	padding: 8px 8px 10px;
	border: 0;
	border-right: 1px solid var(--eergc-line);
	border-bottom: 1px solid var(--eergc-line);
	background: var(--eergc-bg);
	transition: background .15s ease;
}

.eergc-cal__grid tr > .eergc-cal__day:last-child { border-right: 0; }
.eergc-cal__grid tbody tr:last-child > .eergc-cal__day { border-bottom: 0; }

/* The theme stripes odd table rows with a 7% grey; a calendar must not, so
   these carry enough specificity to win over that rule. */
.eergc-cal__grid tbody tr:nth-child(odd) > .eergc-cal__day,
.eergc-cal__grid tbody tr:nth-child(even) > .eergc-cal__day { background: var(--eergc-bg); }
.eergc-cal__grid tbody tr > .eergc-cal__day.is-other { background: var(--eergc-bg-other); }
.eergc-cal__grid tbody tr > .eergc-cal__day.is-today { background: var(--eergc-today); }

.eergc-cal__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 13px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: var(--eergc-ink);
}

.eergc-cal__day.is-other .eergc-cal__num { color: var(--eergc-faint); font-weight: 500; }
.eergc-cal__day.is-past .eergc-cal__num { color: var(--eergc-muted); }
.eergc-cal__day.is-today .eergc-cal__num { background: var(--eergc-red); color: #fff; }

.eergc-cal__events {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.eergc-cal__events li { margin: 0; padding: 0; }

.eergc-cal__event {
	display: block;
	padding: 5px 8px 6px 9px;
	border-left: 3px solid var(--c);
	border-radius: 6px;
	background: var(--cb);
	color: var(--c);
	text-decoration: none;
	line-height: 1.25;
	transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.eergc-cal__event:hover,
.eergc-cal__event:focus-visible {
	background: var(--c);
	color: #fff;
	box-shadow: 0 4px 12px rgba(20, 19, 70, .18);
	transform: translateY(-1px);
	opacity: 1;
}

.eergc-cal__event:focus-visible { outline: 2px solid var(--eergc-red); outline-offset: 1px; }

.eergc-cal__time {
	display: block;
	margin-bottom: 1px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .03em;
}

.eergc-cal__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-size: 12.5px;
	font-weight: 600;
}

/* Past events go grey instead of faded, so the text stays readable. */
.eergc-cal__day.is-past .eergc-cal__event { --c: var(--eergc-past); --cb: var(--eergc-past-bg); }

/* ---------- empty month ---------- */

.eergc-cal__empty {
	margin: 18px 0 0;
	padding: 16px 18px;
	border-radius: 10px;
	background: #F7F7FA;
	font-size: 14px;
	line-height: 1.5;
	color: var(--eergc-muted);
}

.eergc-cal .eergc-cal__empty a { color: var(--eergc-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.eergc-cal .eergc-cal__empty a:hover { color: var(--eergc-red); }

/* Tablets: seven columns get tight, so trim the chips a little. */
@media (min-width: 768px) and (max-width: 1024px) {
	.eergc-cal__day { padding: 6px 5px 8px; }
	.eergc-cal__event { padding: 4px 6px 5px 7px; }
	.eergc-cal__time { font-size: 10px; }
	.eergc-cal__name { font-size: 12px; }
}

/* ---------- agenda (phones only) ---------- */

.eergc-cal__agenda { display: none; }

@media (max-width: 767px) {
	.eergc-events__top { margin-bottom: 22px; gap: 16px; }
	.eergc-events__toggle { margin-bottom: 0; }
	.eergc-events__toggle a { padding: 9px 14px; font-size: 12.5px; }

	.eergc-cal__bar { margin-bottom: 14px; }
	.eergc-cal__nav { width: 100%; }
	.eergc-cal__title { flex: 1; min-width: 0; font-size: 20px; margin: 0 4px; }
	.eergc-cal__arrow { width: 36px; height: 36px; }
	.eergc-cal__today { padding: 10px 12px; margin-left: 4px; }
	.eergc-cal__legend { gap: 14px; font-size: 11.5px; }

	.eergc-cal__grid { border-radius: 10px; box-shadow: none; }
	.eergc-cal__grid th { padding: 9px 2px; font-size: 10px; letter-spacing: .06em; }

	.eergc-cal__day {
		height: auto;
		min-height: 54px;
		padding: 6px 2px 7px;
		text-align: center;
	}

	.eergc-cal__day.has-events { cursor: pointer; }
	.eergc-cal__grid tbody tr > .eergc-cal__day.has-events:active { background: #F1F1F6; }

	.eergc-cal__num { min-width: 24px; height: 24px; padding: 0; font-size: 12.5px; }

	.eergc-cal__events {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		gap: 3px;
		margin-top: 5px;
	}

	.eergc-cal__event {
		width: 7px;
		height: 7px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--c);
		color: transparent;
		font-size: 0;
		overflow: hidden;
		pointer-events: none;
	}

	.eergc-cal__event:hover,
	.eergc-cal__event:focus-visible { transform: none; box-shadow: none; background: var(--c); }
	.eergc-cal__time,
	.eergc-cal__name { display: none; }
	.eergc-cal__events li:nth-child(n+4) { display: none; }

	.eergc-cal__agenda { display: block; margin-top: 22px; }

	.eergc-cal__agenda-title {
		margin: 0 0 6px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: .12em;
		text-transform: uppercase;
		color: var(--eergc-muted);
	}

	.eergc-cal__agenda-list { list-style: none; margin: 0; padding: 0; }

	.eergc-cal__agenda-day {
		display: flex;
		gap: 12px;
		margin: 0;
		padding: 14px 4px;
		border-top: 1px solid var(--eergc-line);
		border-radius: 8px;
		scroll-margin-top: 96px;
		transition: background .4s ease;
	}

	.eergc-cal__agenda-day.is-flash { background: var(--eergc-today); }

	.eergc-cal__agenda-date { flex: 0 0 44px; text-align: center; padding-top: 2px; }
	.eergc-cal__agenda-dnum { display: block; font-size: 22px; font-weight: 700; line-height: 1; color: var(--eergc-navy); }
	.eergc-cal__agenda-day.is-today .eergc-cal__agenda-dnum { color: var(--eergc-red); }
	.eergc-cal__agenda-dow {
		display: block;
		margin-top: 4px;
		font-size: 10.5px;
		font-weight: 600;
		letter-spacing: .08em;
		text-transform: uppercase;
		color: var(--eergc-muted);
	}

	.eergc-cal__agenda-events {
		flex: 1;
		min-width: 0;
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.eergc-cal__agenda-events li { margin: 0; padding: 0; }

	.eergc-cal__agenda-event {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "name go" "meta go";
		align-items: center;
		column-gap: 12px;
		padding: 10px 12px 11px 14px;
		border-left: 3px solid var(--c);
		border-radius: 8px;
		background: var(--cb);
		color: var(--eergc-ink);
		text-decoration: none;
	}

	.eergc-cal__agenda-name { grid-area: name; font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--c); }
	.eergc-cal__agenda-meta { grid-area: meta; margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--eergc-muted); }
	.eergc-cal__agenda-go {
		grid-area: go;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: .08em;
		text-transform: uppercase;
		white-space: nowrap;
		color: var(--c);
	}
	.eergc-cal__agenda-go::after { content: ' \203A'; }
	.eergc-cal__agenda-day.is-past .eergc-cal__agenda-event { --c: var(--eergc-past); --cb: var(--eergc-past-bg); }
}
