/* Events Calendar — month/year/day grids, birthdays overlay, index blocks.
 *
 * Fixed 8-colour accessible palette (ecal-c0..ecal-c7): every colour is a
 * dark, saturated tone paired with white chip text, chosen for >= 4.5:1
 * contrast against prosilver's light panel backgrounds (#FFFFFF / #F2F2F2).
 */

.ecal-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.ecal-nav,
.ecal-view-switch {
	display: flex;
	gap: 4px;
}

/* --- Grid layout (month + year mini-grids) --- */

.ecal-grid,
.ecal-mini-grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.ecal-grid th,
.ecal-grid td,
.ecal-mini-grid td {
	border: 1px solid #DDDDDD;
	vertical-align: top;
	padding: 4px;
}

.ecal-grid th {
	text-align: center;
	background: #F2F2F2;
	padding: 6px 4px;
}

.ecal-day {
	height: 90px;
	overflow: hidden;
}

.ecal-mini-day {
	text-align: center;
	height: auto;
	padding: 2px;
}

.ecal-mini-day a {
	display: block;
	text-decoration: none;
	position: relative;
}

.ecal-other-month {
	color: #AAAAAA;
	background: #FAFAFA;
}

.ecal-today {
	background: #FFFDE7;
}

.ecal-day-num {
	display: block;
	font-weight: bold;
	text-decoration: none;
	margin-bottom: 2px;
}

/* --- Event chips --- */

.ecal-chip {
	display: block;
	font-size: 0.85em;
	line-height: 1.3;
	padding: 1px 4px;
	margin-bottom: 2px;
	color: #FFFFFF;
	border-radius: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ecal-chip a {
	color: inherit;
	text-decoration: none;
}

.ecal-chip-time {
	font-weight: bold;
	margin-right: 3px;
}

.ecal-chip.ecal-special {
	border: 2px solid #000000;
	font-weight: bold;
}

/* Multi-day segment bars — server-rendered per-day chips, no JS positioning */
.ecal-chip.ecal-bar-start {
	border-radius: 3px 0 0 3px;
	margin-right: -1px;
}

.ecal-chip.ecal-bar-mid {
	border-radius: 0;
	margin-right: -1px;
	margin-left: -1px;
}

.ecal-chip.ecal-bar-end {
	border-radius: 0 3px 3px 0;
	margin-left: -1px;
}

/* Fixed accessible 8-colour palette (WCAG AA against white/#F2F2F2, white chip text) */
.ecal-c0 { background-color: #1A5FB4; } /* blue */
.ecal-c1 { background-color: #2E7D32; } /* green */
.ecal-c2 { background-color: #B91C1C; } /* red */
.ecal-c3 { background-color: #6A1B9A; } /* purple */
.ecal-c4 { background-color: #8A5A00; } /* amber/brown */
.ecal-c5 { background-color: #00695C; } /* teal */
.ecal-c6 { background-color: #AD1457; } /* magenta */
.ecal-c7 { background-color: #37474F; } /* slate */

/* --- Birthdays overlay --- */

.ecal-birthday-chip {
	display: block;
	font-size: 0.85em;
	color: #8A5A00;
	margin-bottom: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ecal-day-birthdays ul {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
}

/* --- Year view --- */

.ecal-year-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.ecal-mini-month h3 {
	margin-bottom: 4px;
}

.ecal-mini-dot {
	display: inline-block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #1A5FB4;
	margin-left: 2px;
}

.ecal-mini-dot-birthday {
	background: #8A5A00;
}

/* --- Index-page blocks (upcoming events / mini calendar) --- */

.ecal-index-upcoming .ecal-chip {
	display: inline-block;
	margin: 2px 0;
}

.ecal-index-mini .ecal-mini-grid {
	max-width: 260px;
}

/* --- Day view --- */

#ecal-day .ecal-day-events {
	list-style: none;
	margin: 0;
	padding: 0;
}

#ecal-day .ecal-day-events li {
	margin-bottom: 4px;
}
