/* Airtable Events Calendar — front end */

.aec,
.aec-modal {
	--aec-accent: #e040b0;
	--aec-cols: 3;
	--aec-gap: 16px;
	--aec-card-bg: #f7f7f7;
	--aec-text: #111;
	--aec-muted: #555;
	--aec-pill-bg: #ececec;
	--aec-link: #3b82f6;
	--aec-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-family: var(--aec-font);
	-webkit-font-smoothing: antialiased;
}

.aec *,
.aec *::before,
.aec *::after {
	box-sizing: border-box;
}

.aec .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Filters ---------- */

.aec-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}

.aec-dropdown {
	position: relative;
}

.aec-dropdown__toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px 12px 20px;
	font: inherit;
	font-size: 17px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.aec-dropdown__toggle:hover,
.aec-dropdown__toggle[aria-expanded="true"],
.aec-dropdown.is-active .aec-dropdown__toggle {
	border-color: rgba(255, 255, 255, 0.85);
}

.aec-dropdown.is-active .aec-dropdown__toggle {
	background: rgba(255, 255, 255, 0.08);
}

.aec-dropdown__toggle svg {
	width: 18px;
	height: 18px;
	transition: transform 0.15s;
}

.aec-dropdown__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.aec-dropdown__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 20;
	min-width: 220px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.aec-dropdown__menu li {
	margin: 0;
	padding: 10px 14px;
	font-size: 15px;
	color: var(--aec-text);
	border-radius: 6px;
	cursor: pointer;
}

.aec-dropdown__menu li:hover,
.aec-dropdown__menu li.is-focused {
	background: #f1f1f1;
}

.aec-dropdown__menu li[aria-selected="true"] {
	font-weight: 600;
	color: var(--aec-accent);
}

/* ---------- Grid / masonry ---------- */

.aec-grid {
	display: grid;
	grid-template-columns: repeat(var(--aec-cols), minmax(0, 1fr));
	gap: var(--aec-gap);
	align-items: start;
}

.aec-grid.is-masonry {
	display: flex;
	align-items: flex-start;
}

.aec-col {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: var(--aec-gap);
	min-width: 0;
}

@media (max-width: 1024px) {
	.aec-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.aec-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Card ---------- */

.aec-card {
	margin: 0;
	background: var(--aec-card-bg);
	animation: aec-fade-in 0.35s ease both;
}

.aec-card[hidden] {
	display: none;
}

@keyframes aec-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.aec-card__link {
	display: block;
	color: inherit;
	text-decoration: none !important;
	outline-offset: 3px;
}

.aec-card__media {
	position: relative;
	overflow: hidden;
	background: #1c1c1c;
}

.aec-card__media img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	transition: transform 0.4s ease;
}

.aec-card__link:hover .aec-card__media img,
.aec-card__link:focus-visible .aec-card__media img {
	transform: scale(1.03);
}

.aec-card--noimg .aec-card__media {
	min-height: 120px;
	background: linear-gradient(135deg, #222, #3a3a3a);
}

.aec-badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 92px;
	padding: 12px 6px 14px;
	color: #fff;
	text-align: center;
	text-transform: uppercase;
	background: var(--aec-accent);
}

.aec-badge__month {
	font-size: 16px;
	line-height: 1.1;
	letter-spacing: 0.02em;
}

.aec-badge__day {
	font-size: 46px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}

.aec-badge__weekday {
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.04em;
}

.aec-card__body {
	padding: 30px 26px 26px;
}

.aec-card__type {
	margin-bottom: 6px;
	font-size: 16px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.aec-card__title {
	margin: 0 0 20px !important;
	padding: 0;
	font-family: var(--aec-font) !important;
	font-size: 22px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: var(--aec-text) !important;
}

.aec-pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px 9px 12px;
	font-size: 16px;
	line-height: 1.2;
	color: var(--aec-text);
	background: var(--aec-pill-bg);
	border-radius: 999px;
}

.aec-pill svg {
	flex: none;
	width: 18px;
	height: 18px;
}

.aec-empty {
	padding: 40px 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 17px;
	text-align: center;
}

/* ---------- Modal ---------- */

.aec-modal-open {
	overflow: hidden;
}

.aec-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.72);
	font-family: var(--aec-font);
	-webkit-font-smoothing: antialiased;
	animation: aec-backdrop 0.2s ease both;
	overscroll-behavior: contain;
}

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

@keyframes aec-backdrop {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.aec-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 760px;
	margin: auto 0;
	color: var(--aec-text, #111);
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: aec-pop 0.22s ease both;
}

@keyframes aec-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

.aec-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: #333;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.aec-modal__close:hover {
	background: #f0f0f0;
}

.aec-modal__header {
	padding: 28px 60px 24px;
	text-align: center;
}

.aec-modal__type {
	margin-bottom: 4px;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.aec-modal__title {
	margin: 0 !important;
	padding: 0;
	font-family: var(--aec-font) !important;
	font-size: 26px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: #111 !important;
}

.aec-modal__image {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	background: #111;
}

.aec-modal__content {
	padding: 40px 64px 48px;
	font-size: 17px;
	line-height: 1.6;
}

.aec-modal__description {
	margin-bottom: 36px;
}

.aec-modal__description > :first-child {
	margin-top: 0;
}

.aec-modal__description > :last-child {
	margin-bottom: 0;
}

.aec-modal__description p {
	margin: 0 0 1em;
	color: #222;
}

.aec-modal__description a {
	color: var(--aec-link);
}

.aec-section {
	margin-top: 32px;
}

.aec-section__heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px !important;
	font-family: var(--aec-font) !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	letter-spacing: 0.04em !important;
	line-height: 1.2 !important;
	text-transform: uppercase !important;
	color: #111 !important;
}

.aec-section__heading svg {
	width: 18px;
	height: 18px;
}

.aec-when {
	margin: 0 0 6px;
}

.aec-addcal {
	position: relative;
	display: inline-block;
}

.aec-linkbtn {
	padding: 0;
	font: inherit;
	color: var(--aec-link);
	background: none;
	border: 0;
	cursor: pointer;
}

.aec-linkbtn:hover {
	text-decoration: underline;
}

.aec-addcal__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 2;
	min-width: 220px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.aec-addcal__menu[hidden] {
	display: none;
}

.aec-addcal__menu li {
	margin: 0;
}

.aec-addcal__menu a {
	display: block;
	padding: 9px 12px;
	font-size: 15px;
	color: #111;
	text-decoration: none;
	border-radius: 6px;
}

.aec-addcal__menu a:hover,
.aec-addcal__menu a:focus-visible {
	background: #f2f2f2;
}

.aec-share {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.aec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 12px 20px;
	font: inherit;
	font-size: 17px;
	color: #111 !important;
	text-decoration: none !important;
	background: #fff;
	border: 1px solid #d4d4d4;
	border-radius: 999px;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.aec-btn:hover {
	background: #f6f6f6;
	border-color: #aaa;
}

.aec-btn svg {
	flex: none;
	width: 20px;
	height: 20px;
}

.aec-btn--primary {
	width: 100%;
	color: #fff !important;
	background: var(--aec-accent);
	border-color: var(--aec-accent);
}

.aec-btn--primary:hover {
	background: var(--aec-accent);
	border-color: var(--aec-accent);
	filter: brightness(1.08);
}

.aec-btn.is-done {
	border-color: #22a06b;
	color: #167a50 !important;
}

@media (max-width: 640px) {
	.aec-modal {
		padding: 0;
	}

	.aec-modal__dialog {
		min-height: 100%;
		margin: 0;
	}

	.aec-modal__header {
		padding: 22px 56px 18px 20px;
		text-align: left;
	}

	.aec-modal__title {
		font-size: 22px !important;
	}

	.aec-modal__content {
		padding: 28px 22px 36px;
		font-size: 16px;
	}

	.aec-share {
		grid-template-columns: 1fr;
	}

	.aec-badge {
		width: 80px;
	}

	.aec-badge__day {
		font-size: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aec-card,
	.aec-modal,
	.aec-modal__dialog {
		animation: none;
	}

	.aec-card__media img {
		transition: none;
	}
}
