:root {
	--aec-accent: #1e6b3a;
	--aec-accent-soft: #e8f3ec;
	--aec-holiday: #b3261e;
	--aec-border: #d9dde1;
	--aec-text: #1d2327;
}

.aec-calendar,
.aec-upcoming {
	font-family: "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--aec-text);
	max-width: 100%;
}

.aec-calendar.aec-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

.aec-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	flex-wrap: wrap;
	margin-bottom: .5rem;
}

.aec-title { display: flex; align-items: center; gap: .4rem; font-size: 1.15rem; font-weight: 600; }
.aec-month-select, .aec-year-input {
	font: inherit;
	padding: .25rem .4rem;
	border: 1px solid var(--aec-border);
	border-radius: 6px;
	background: #fff;
	color: inherit;
}
.aec-year-input { width: 5.5rem; }

.aec-btn {
	font: inherit;
	cursor: pointer;
	padding: .35rem .8rem;
	border: 1px solid var(--aec-accent);
	background: #fff;
	color: var(--aec-accent);
	border-radius: 6px;
}
.aec-btn:hover, .aec-btn:focus-visible { background: var(--aec-accent); color: #fff; }

.aec-subtitle { color: #646970; font-size: .85rem; margin-bottom: .5rem; }

.aec-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border-top: 1px solid var(--aec-border);
	border-left: 1px solid var(--aec-border);
}
.aec-dow {
	background: var(--aec-accent);
	color: #fff;
	text-align: center;
	padding: .4rem .2rem;
	font-weight: 600;
	border-right: 1px solid var(--aec-border);
	border-bottom: 1px solid var(--aec-border);
}
.aec-cell {
	min-height: 5.5rem;
	padding: .25rem;
	border-right: 1px solid var(--aec-border);
	border-bottom: 1px solid var(--aec-border);
	background: #fff;
	overflow: hidden;
}
.aec-empty-cell { background: #f6f7f7; }
.aec-daynum { font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: .25rem; }
.aec-greg { font-size: .7rem; font-weight: 400; color: #8c8f94; }
.aec-today { background: var(--aec-accent-soft); outline: 2px solid var(--aec-accent); outline-offset: -2px; }
.aec-holiday .aec-daynum { color: var(--aec-holiday); }
.aec-holiday-name { font-size: .72rem; color: var(--aec-holiday); line-height: 1.2; }

.aec-day-events { list-style: none; margin: .2rem 0 0; padding: 0; }
.aec-day-events li { margin: 0 0 2px; }
.aec-event {
	display: block;
	font-size: .75rem;
	line-height: 1.25;
	padding: 1px 4px;
	background: var(--aec-accent);
	color: #fff;
	border-radius: 3px;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.aec-event:hover, .aec-event:focus-visible { filter: brightness(.8); color: #fff; }

.aec-month-heading { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.aec-list { list-style: none; margin: 0; padding: 0; }
.aec-list-item { padding: .45rem 0; border-bottom: 1px solid var(--aec-border); }
.aec-list-date { font-weight: 600; color: var(--aec-accent); margin-right: .4rem; }
.aec-list-meta { color: #646970; font-size: .9rem; }
.aec-empty { color: #646970; }

.aec-single-meta { list-style: none; padding: .75rem 1rem; margin: 0 0 1rem; background: var(--aec-accent-soft, #e8f3ec); border-left: 4px solid var(--aec-accent, #1e6b3a); border-radius: 4px; }

@media (max-width: 640px) {
	.aec-cell { min-height: 3.6rem; }
	.aec-greg, .aec-holiday-name { display: none; }
	.aec-event { font-size: .65rem; }
	.aec-dow { font-size: .75rem; }
	.aec-title { font-size: 1rem; }
}

/* Past events */
.aec-event-past { background: #8c8f94; }
.aec-event-past:hover, .aec-event-past:focus-visible { background: #646970; }
.aec-past { opacity: .65; }
.aec-past .aec-list-date { color: #646970; }

/* Archive tabs (/events/) */
.aec-archive-tabs { display: flex; gap: .5rem; margin: 0 0 1.25rem; flex-wrap: wrap; }
.aec-tab { padding: .35rem .9rem; border: 1px solid var(--aec-accent, #1e6b3a); border-radius: 999px; color: var(--aec-accent, #1e6b3a); text-decoration: none; }
.aec-tab:hover, .aec-tab-active { background: var(--aec-accent, #1e6b3a); color: #fff; }

/* Multi-day events read as one continuous bar */
.aec-day-events li.aec-ev-start { margin-right: -.25rem; }
.aec-day-events li.aec-ev-mid   { margin-left: -.25rem; margin-right: -.25rem; }
.aec-day-events li.aec-ev-end   { margin-left: -.25rem; }
.aec-ev-start .aec-event { border-radius: 3px 0 0 3px; }
.aec-ev-mid .aec-event   { border-radius: 0; }
.aec-ev-end .aec-event   { border-radius: 0 3px 3px 0; }

/* Automatic status badges */
.aec-badge { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.5; padding: 0 .55em; border-radius: 999px; vertical-align: middle; }
.aec-badge-upcoming { background: #e8f3ec; color: #14502a; }
.aec-badge-ongoing  { background: #fff3cd; color: #7a5600; }
.aec-badge-past     { background: #ececec; color: #50575e; }
.aec-group-title { margin: 1.25rem 0 .5rem; font-size: 1.1rem; }

/* Separate blocks: upcoming / past */
.aec-blocks { display: grid; gap: 1rem; margin: 1rem 0; font-family: "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--aec-text); }
.aec-blocks.aec-layout-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.aec-blocks.aec-layout-stacked { grid-template-columns: minmax(0, 1fr); }
.aec-block { border: 1px solid var(--aec-border); border-radius: 8px; background: #fff; overflow: hidden; }
.aec-block-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .9rem; color: #fff; background: var(--aec-accent); }
.aec-block-past .aec-block-head { background: #646970; }
.aec-block-title { margin: 0; font-size: 1.05rem; color: inherit; }
.aec-block-count { min-width: 1.7em; text-align: center; padding: 0 .5em; border-radius: 999px; background: rgba(255,255,255,.25); font-weight: 700; }
.aec-block-body { padding: .25rem .9rem .6rem; }
.aec-block .aec-list-item:last-child { border-bottom: 0; }
.aec-more { margin: .5rem 0 0; color: #646970; font-size: .9rem; }
@media (max-width: 720px) {
	.aec-blocks.aec-layout-columns { grid-template-columns: minmax(0, 1fr); }
}

/* Upcoming / Past as separate blocks on one page */
.aec-grouped { display: grid; gap: 1.25rem; font-family: "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", system-ui, sans-serif; color: var(--aec-text); }
.aec-layout-columns { grid-template-columns: 1fr; }
@media (min-width: 800px) { .aec-layout-columns { grid-template-columns: 1fr 1fr; align-items: start; } }
.aec-block { border: 1px solid var(--aec-border); border-radius: 8px; overflow: hidden; background: #fff; }
.aec-block-title { margin: 0; padding: .7rem 1rem; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; color: #fff; background: var(--aec-accent); }
.aec-block-past .aec-block-title { background: #646970; }
.aec-count { font-size: .8rem; font-weight: 600; padding: 0 .6em; line-height: 1.6; border-radius: 999px; background: rgba(255,255,255,.25); }
.aec-block-body { padding: .25rem 1rem .75rem; }
.aec-block .aec-upcoming .aec-list-item:last-child { border-bottom: 0; }
