/*
 * calendar.css — "Add to calendar" / "Subscribe" disclosure menu.
 *
 * Depends on chrome.css for .ce-btn variants and tokens.css for the OKLCH
 * palette (both load before this file). Loaded only on event_instance and
 * event_series singulars.
 */

.ce-cal {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ce-cal__toggle {
	white-space: nowrap;
}

.ce-cal__chevron {
	display: inline-flex;
	transition: transform 120ms;
}

.ce-cal__toggle[aria-expanded="true"] .ce-cal__chevron {
	transform: rotate(180deg);
}

.ce-cal__icon {
	display: inline-flex;
}

/* ── Menu ────────────────────────────────────────────────────────────────── */

/* Anchored to the right edge of the toggle, opening upward.
 *
 * Right: both hero CTA rows are themselves right-aligned, so a left-anchored
 * menu runs off the viewport and clips the note text.
 *
 * Upward: .ce-hero is overflow:hidden (it clips the cover image and vignette),
 * and the CTA row sits at the bottom of it, so a downward menu is cut off after
 * the first item. The hero is at least 70vh, which is ample room above. */
.ce-cal__menu {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	z-index: 30;
	min-width: 232px;
	padding: 6px;
	background: var(--bg-2);
	border: 1px solid var(--line-2);
	border-radius: 10px;
	box-shadow: 0 12px 32px oklch(0% 0 0 / 0.45);
}

.ce-cal__menu[hidden] {
	display: none;
}

.ce-cal__item {
	display: block;
	width: 100%;
	padding: 9px 12px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--fg-2);
	font-family: inherit;
	font-size: 13px;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.ce-cal__item:hover,
.ce-cal__item:focus-visible {
	background: var(--bg-3);
	color: var(--fg);
}

.ce-cal__item--copy {
	border-top: 1px solid var(--line);
	border-radius: 0 0 6px 6px;
	margin-top: 4px;
	padding-top: 12px;
}

.ce-cal__note {
	margin: 6px 0 2px;
	padding: 0 12px;
	color: var(--fg-4);
	font-size: 11px;
	line-height: 1.4;
}

.ce-cal__status {
	color: var(--accent);
	font-size: 11px;
	white-space: nowrap;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {

	.ce-cal__menu {
		min-width: 210px;
	}
}
