/**
 * COD Cambridge - Event "Add to calendar" ([cod_add_to_calendar])
 *
 * Designed to sit inside the green Event Details card on single events.
 * Colours follow the COD design system:
 *   green #154734 · lime #C7EA46 · off-white #E5E1DA · dark #101512
 *
 * Selectors are deliberately two classes deep so the site kit's global
 * button and link styles (padding, background, 1.5px letter-spacing,
 * hover font-size) cannot leak in or cause hover "pop".
 */

.cod-atc {
	position: relative;
	display: inline-block;
	max-width: 100%;
	font-family: gotham-black, sans-serif;
}

/* ---------- Trigger ---------- */

.cod-atc .cod-atc__toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 6px 2px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: #E5E1DA;
	font-family: gotham-black, sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.cod-atc .cod-atc__toggle:hover,
.cod-atc .cod-atc__toggle:focus,
.cod-atc.is-open .cod-atc__toggle {
	background: transparent;
	color: #C7EA46;
	border-radius: 6px;
}

.cod-atc .cod-atc__toggle:focus {
	outline: none;
}

.cod-atc .cod-atc__toggle:focus-visible {
	outline: 2px solid #C7EA46;
	outline-offset: 3px;
}

.cod-atc .cod-atc__icon,
.cod-atc .cod-atc__chevron {
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cod-atc .cod-atc__chevron {
	display: none;
	transition: transform 0.2s ease;
}

.cod-atc.is-enhanced .cod-atc__chevron {
	display: block;
}

.cod-atc.is-open .cod-atc__chevron {
	transform: rotate(180deg);
}

/* ---------- Menu ---------- */

.cod-atc .cod-atc__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cod-atc .cod-atc__menu[hidden] {
	display: none;
}

/* Enhanced (JavaScript) version: a small popover that opens DOWNWARDS, below the trigger. */
.cod-atc.is-enhanced .cod-atc__menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 30;
	min-width: 230px;
	max-width: calc(100vw - 40px);
	padding: 6px;
	border-radius: 12px;
	background: #FFFFFF;
	box-shadow: 0 14px 36px rgba(16, 21, 18, 0.22);
}

/*
 * While the menu is open, lift the containers that hold it (including the
 * sticky Event Details card, which creates its own stacking context) above
 * the content that follows, such as the footer, and make sure none of them
 * clip the menu. z-index only affects positioned elements and flex/grid
 * items, and these rules only apply while the menu is open.
 */
:is(.e-con, .elementor-element):has(.cod-atc.is-open) {
	z-index: 40;
	overflow: visible;
}

.cod-atc .cod-atc__menu li {
	margin: 0;
	padding: 0;
}

.cod-atc .cod-atc__menu .cod-atc__item {
	display: block;
	padding: 6px 2px;
	border-radius: 8px;
	color: #E5E1DA;
	font-family: gotham-black, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cod-atc.is-enhanced .cod-atc__menu .cod-atc__item {
	padding: 10px 12px;
	color: #101512;
	text-decoration: none;
}

.cod-atc .cod-atc__menu .cod-atc__item:hover,
.cod-atc .cod-atc__menu .cod-atc__item:focus {
	color: #C7EA46;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: 0;
}

.cod-atc.is-enhanced .cod-atc__menu .cod-atc__item:hover,
.cod-atc.is-enhanced .cod-atc__menu .cod-atc__item:focus {
	background: rgba(199, 234, 70, 0.22);
	color: #154734;
}

.cod-atc .cod-atc__menu .cod-atc__item:focus {
	outline: none;
}

.cod-atc .cod-atc__menu .cod-atc__item:focus-visible {
	outline: 2px solid #154734;
	outline-offset: -2px;
}

/* Visually hidden "(opens in a new tab)" text, in case the theme lacks the utility class. */
.cod-atc .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.cod-atc .cod-atc__toggle,
	.cod-atc .cod-atc__chevron,
	.cod-atc .cod-atc__menu .cod-atc__item {
		transition: none;
	}
}
