/*
 * Zetkin Activities v2 — Calendar + Modal
 * All classes namespaced under .zetkin-* to avoid theme conflicts.
 */

/* ── Calendar wrapper ─────────────────────────────────────────── */

.zetkin-cal {
	font-family: inherit;
	max-width: 100%;
}

/* ── Filter bar ───────────────────────────────────────────────── */

.zetkin-cal__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.zetkin-cal__filter-btn {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	border: 1px solid #d0d0d0;
	background: #f5f5f5;
	color: #444;
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
	line-height: 1.4;
}

.zetkin-cal__filter-btn:hover {
	border-color: #aaa;
	background: #eaeaea;
}

.zetkin-cal__filter-btn.is-active {
	background: #1a3a6b;
	border-color: #1a3a6b;
	color: #fff;
}

/* Fade out day cells that are fully filtered away */
.zetkin-cal__day--filtered-out {
	opacity: 0.35;
}

/* ── Navigation bar ───────────────────────────────────────────── */

.zetkin-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
	gap: 0.5rem;
}

.zetkin-cal__nav-title {
	font-size: 1.2rem;
	font-weight: 700;
	text-align: center;
	flex: 1;
}

.zetkin-cal__nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: #f0f0f0;
	color: inherit;
	text-decoration: none;
	font-size: 1.5rem;
	line-height: 1;
	transition: background 0.15s;
	flex-shrink: 0;
}

.zetkin-cal__nav-btn:hover {
	background: #e0e0e0;
	color: inherit;
	text-decoration: none;
}

/* ── Grid ─────────────────────────────────────────────────────── */

.zetkin-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

/* ── Weekday header cells ─────────────────────────────────────── */

.zetkin-cal__weekday {
	text-align: center;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #888;
	padding: 0.4rem 0.2rem;
}

/* ── Day cells ────────────────────────────────────────────────── */

.zetkin-cal__day {
	min-height: 5rem;
	background: #fafafa;
	border: 1px solid #e8e8e8;
	border-radius: 3px;
	padding: 0.3rem 0.35rem 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	align-items: flex-start;
}

.zetkin-cal__day--empty {
	background: transparent;
	border-color: transparent;
}

.zetkin-cal__day--today {
	border-color: #c0392b;
	background: #fff8f8;
}

.zetkin-cal__day--today .zetkin-cal__day-num {
	background: #c0392b;
	color: #fff;
}

/* ── Day number ───────────────────────────────────────────────── */

.zetkin-cal__day-num {
	font-size: 0.78rem;
	font-weight: 700;
	color: #555;
	width: 1.4em;
	height: 1.4em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	flex-shrink: 0;
	margin-bottom: 0.1rem;
}

/* ── Event chips (clickable buttons) ─────────────────────────── */

.zetkin-cal__event {
	display: block;
	width: 100%;
	text-align: left;
	background: #e8f0fe;
	color: #1a3a6b;
	border: none;
	border-radius: 3px;
	padding: 0.2rem 0.35rem;
	font-size: 0.72rem;
	line-height: 1.35;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zetkin-cal__event:hover,
.zetkin-cal__event:focus {
	background: #1a3a6b;
	color: #fff;
	outline: none;
}

.zetkin-cal__event-time {
	font-weight: 700;
	margin-right: 0.15em;
}

/* ── Responsive: tighten up on small screens ─────────────────── */

@media (max-width: 600px) {
	.zetkin-cal__day {
		min-height: 3.5rem;
		padding: 0.2rem 0.2rem 0.25rem;
	}
	.zetkin-cal__event {
		font-size: 0.65rem;
		padding: 0.15rem 0.2rem;
	}
	.zetkin-cal__event-time {
		display: none; /* hide time on tiny screens, keep label */
	}
	.zetkin-cal__day-num {
		font-size: 0.7rem;
	}
	.zetkin-cal__weekday {
		font-size: 0.62rem;
	}
}

/* ── Modal overlay ────────────────────────────────────────────── */

.zetkin-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.zetkin-modal[hidden] {
	display: none;
}

.zetkin-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.zetkin-modal__box {
	position: relative;
	background: #fff;
	border-radius: 8px;
	padding: 2rem 2rem 1.75rem;
	max-width: 480px;
	width: 100%;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	z-index: 1;
}

.zetkin-modal__close {
	position: absolute;
	top: 0.9rem;
	right: 1rem;
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
	transition: color 0.12s, background 0.12s;
}

.zetkin-modal__close:hover {
	color: #333;
	background: #f0f0f0;
}

.zetkin-modal__campaign {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #888;
	margin-bottom: 0.4rem;
}

.zetkin-modal__title {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	padding-right: 1.5rem; /* don't overlap close button */
}

.zetkin-modal__datetime {
	margin: 0 0 0.5rem;
	font-weight: 600;
	color: #333;
}

.zetkin-modal__location {
	margin: 0 0 0.75rem;
	color: #555;
	font-style: italic;
}

.zetkin-modal__desc {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: #444;
	white-space: pre-wrap;
}

/* Prevent body scroll when modal is open */
body.zetkin-modal-open {
	overflow: hidden;
}
