/**
 * Wix Events calendar: List, Month, Week, Day and Photo views, the Events
 * Bar and the single-event extras.
 *
 * Theme-friendly: fonts are inherited and colours, radii and the focus ring
 * come from the storefront design tokens (wixhc-tokens.css, a dependency);
 * the older --wixhc-ev-* names still override them. Structural rules apply always;
 * the skin (colours, radii, typography) sits under
 * `:not(.wixhc-events--skeleton)`, so the "Skeleton" stylesheet setting
 * keeps only the layout.
 *
 * @package Headless_Connect_For_Wix
 */

.wixhc-events {
	--wixhc-ev-gap: var(--wixhc-space-4, 16px);
	font-family: inherit;
	box-sizing: border-box;
}

.wixhc-events *,
.wixhc-events *::before,
.wixhc-events *::after {
	box-sizing: inherit;
}

.wixhc-events-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wixhc-events [tabindex="-1"]:focus {
	outline: none;
}

/* The keyboard focus ring is the shared one (wixhc-tokens.css). */

.wixhc-events[aria-busy="true"] .wixhc-events__body {
	opacity: 0.55;
	transition: opacity 0.15s;
}

/* Events Bar -------------------------------------------------------------- */

.wixhc-events-bar-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px var(--wixhc-ev-gap);
	margin: 0 0 var(--wixhc-ev-gap);
}

.wixhc-events-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 12px;
	flex: 1 1 100%;
}

.wixhc-events-bar p {
	margin: 0;
}

.wixhc-events-bar__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wixhc-events-bar__field--q {
	flex: 1 1 200px;
}

.wixhc-events-bar label {
	font-size: 0.85em;
}

.wixhc-events-bar input,
.wixhc-events-bar select,
.wixhc-events-bar button {
	font: inherit;
	min-height: 40px;
}

.wixhc-events-nav ul,
.wixhc-events-views ul,
.wixhc-events-pagination ul,
.wixhc-events-legend,
.wixhc-events-subscribe ul,
.wixhc-event-extras__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-views {
	margin-left: auto;
}

.wixhc-events-nav a,
.wixhc-events-views a,
.wixhc-events-pagination a {
	display: inline-block;
	padding: 6px 12px;
	text-decoration: none;
}

.wixhc-events-pagination ul {
	justify-content: space-between;
	margin-top: var(--wixhc-ev-gap);
}

.wixhc-events-pagination__next {
	margin-left: auto;
}

.wixhc-events__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wixhc-ev-gap);
	margin-top: calc(var(--wixhc-ev-gap) * 1.5);
}

.wixhc-events-subscribe summary {
	cursor: pointer;
}

.wixhc-events-subscribe ul {
	flex-direction: column;
	margin-top: 8px;
}

.wixhc-events-legend li a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.wixhc-events-legend__swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.wixhc-events-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 6px 0;
}

.wixhc-events-chip {
	display: inline-block;
	padding: 1px 8px;
	font-size: 0.8em;
	line-height: 1.6;
}

/* List -------------------------------------------------------------------- */

.wixhc-events-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-item {
	display: flex;
	gap: var(--wixhc-ev-gap);
	padding: var(--wixhc-ev-gap) 0;
}

.wixhc-events-item__badge {
	display: flex;
	flex: 0 0 56px;
	flex-direction: column;
	align-items: center;
	text-align: center;
	line-height: 1.1;
}

.wixhc-events-item__month {
	font-size: 0.8em;
	text-transform: uppercase;
}

.wixhc-events-item__day {
	font-size: 1.6em;
	font-weight: 700;
}

.wixhc-events-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.wixhc-events-item__title,
.wixhc-events-card__title {
	margin: 0 0 4px;
	font-size: 1.2em;
}

.wixhc-events-item__when,
.wixhc-events-item__venue,
.wixhc-events-item__excerpt,
.wixhc-events-card__when,
.wixhc-events-card__venue {
	margin: 0 0 4px;
}

/* "Get tickets" / "RSVP" on list and photo items (upcoming, joinable events only). */
.wixhc-events-item__cta,
.wixhc-events-card__cta {
	margin: 10px 0 0;
}
.wixhc-events .wixhc-events-btn {
	display: inline-flex;
	align-items: center;
	min-height: var(--wixhc-control-h-s);
	padding: 0 var(--wixhc-space-4);
	box-sizing: border-box;
	border-radius: var(--wixhc-radius-control);
	background: var(--wixhc-brand);
	color: var(--wixhc-on-brand);
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
	transition: background-color var(--wixhc-duration) ease;
}
.wixhc-events .wixhc-events-btn:hover,
.wixhc-events .wixhc-events-btn:focus-visible {
	background: var(--wixhc-brand-hover);
	color: var(--wixhc-on-brand);
	text-decoration: none;
}

/* Photo ------------------------------------------------------------------- */

.wixhc-events-photo {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--wixhc-ev-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wixhc-events-card__media img,
.wixhc-events-card__placeholder {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.wixhc-events-card__body {
	padding: var(--wixhc-space-4);
}

/* Month ------------------------------------------------------------------- */

.wixhc-events-month {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.wixhc-events-month th {
	padding: 6px 4px;
	font-weight: 600;
	text-align: left;
}

.wixhc-events-month abbr {
	text-decoration: none;
	border: 0;
}

.wixhc-events-month td {
	height: 110px;
	padding: 4px;
	vertical-align: top;
}

.wixhc-events-month__daynum a,
.wixhc-events-month__daynum span {
	display: inline-block;
	min-width: 1.8em;
	padding: 2px 4px;
	text-align: center;
	text-decoration: none;
}

.wixhc-events-month__events {
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-month__event a {
	display: block;
	margin: 0 0 3px;
	padding: 1px 4px;
	overflow: hidden;
	font-size: 0.85em;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-decoration: none;
	border-left: 3px solid var(--wixhc-ev-cat, var(--wixhc-brand));
}

.wixhc-events-month__more {
	margin: 2px 0 0;
	font-size: 0.8em;
}

/* Week and Day ------------------------------------------------------------ */

.wixhc-events-week {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-week__heading,
.wixhc-events-day__hour {
	margin: 0 0 6px;
	font-size: 1em;
}

.wixhc-events-week__events,
.wixhc-events-day__events {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wixhc-events-week__empty {
	margin: 0;
	font-size: 0.85em;
}

.wixhc-events-mini {
	margin: 0 0 8px;
	padding: 2px 0 2px 8px;
	border-left: 3px solid var(--wixhc-ev-cat, var(--wixhc-brand));
}

.wixhc-events-mini__time,
.wixhc-events-mini__venue {
	display: block;
	font-size: 0.85em;
}

.wixhc-events-day__group {
	margin: 0 0 var(--wixhc-ev-gap);
}

/* Single-event extras ------------------------------------------------------ */

.wixhc-event-extras {
	margin-top: calc(var(--wixhc-ev-gap) * 2);
}

.wixhc-event-extras > section,
.wixhc-event-extras > details {
	margin: 0 0 var(--wixhc-ev-gap);
}

.wixhc-event-extras h2 {
	font-size: 1.2em;
}

.wixhc-event-extras p {
	margin: 0 0 4px;
}

.wixhc-events-map iframe {
	display: block;
	width: 100%;
	height: 300px;
	margin-top: 8px;
	border: 0;
}

.wixhc-event-extras__nav ul {
	justify-content: space-between;
}

/* Skin (not in "Skeleton" mode) ------------------------------------------- */

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar input,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar select {
	min-height: var(--wixhc-control-h);
	padding: 8px 12px;
	color: var(--wixhc-ink);
	background: var(--wixhc-surface);
	border: 1px solid var(--wixhc-border-strong);
	border-radius: var(--wixhc-radius-control);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar button {
	min-height: var(--wixhc-control-h);
	padding: 0 var(--wixhc-space-5);
	color: var(--wixhc-on-brand);
	font-weight: 600;
	cursor: pointer;
	background: var(--wixhc-brand);
	border: 1px solid var(--wixhc-brand);
	border-radius: var(--wixhc-radius-control);
	transition: background-color var(--wixhc-duration) ease;
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar button:hover {
	background: var(--wixhc-brand-hover);
	border-color: var(--wixhc-brand-hover);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-nav a,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-views a,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-pagination a {
	color: inherit;
	border: 1px solid var(--wixhc-border);
	border-radius: var(--wixhc-radius-control);
	transition: background-color var(--wixhc-duration) ease, border-color var(--wixhc-duration) ease;
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-nav a:hover,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-views a:hover,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-pagination a:hover {
	background: var(--wixhc-surface-alt);
	border-color: currentColor;
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-views a[aria-current="page"] {
	color: var(--wixhc-on-brand);
	background: var(--wixhc-brand);
	border-color: var(--wixhc-brand);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-item + .wixhc-events-item {
	border-top: 1px solid var(--wixhc-border);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-item__badge {
	padding: var(--wixhc-space-2) 0;
	border-radius: var(--wixhc-radius-m);
	background: var(--wixhc-surface-alt);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-item__month,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-item__when,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-item__venue,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-card__when,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-mini__time,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-mini__venue,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-week__empty,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month__time {
	color: var(--wixhc-muted);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-chip {
	background: var(--wixhc-surface-alt);
	border-radius: var(--wixhc-radius-pill);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-chip--cat {
	border-left: 3px solid var(--wixhc-ev-cat, var(--wixhc-brand));
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-chip--featured {
	color: var(--wixhc-on-brand);
	background: var(--wixhc-brand);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-chip--status {
	color: #fff;
	background: var(--wixhc-danger);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-chip--status.is-postponed {
	background: var(--wixhc-warning);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-card {
	border: 1px solid var(--wixhc-border);
	border-radius: var(--wixhc-radius-l);
	background: var(--wixhc-surface);
	color: var(--wixhc-ink);
	box-shadow: var(--wixhc-shadow-s);
	transition: box-shadow var(--wixhc-duration) ease;
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-card:hover {
	box-shadow: var(--wixhc-shadow);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-card__placeholder {
	background: var(--wixhc-surface-alt);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month th,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month td {
	border: 1px solid var(--wixhc-border);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month th {
	color: var(--wixhc-muted);
	font-size: var(--wixhc-font-size-s);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month td.is-other-month {
	background: var(--wixhc-surface-alt);
	color: var(--wixhc-muted);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month td.is-today .wixhc-events-month__daynum a,
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month td.is-today .wixhc-events-month__daynum span {
	color: var(--wixhc-on-brand);
	background: var(--wixhc-brand);
	border-radius: var(--wixhc-radius-pill);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-month__event a {
	color: inherit;
	background: var(--wixhc-surface-alt);
	border-radius: var(--wixhc-radius-s);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-week__day {
	padding: var(--wixhc-space-2);
	border: 1px solid var(--wixhc-border);
	border-radius: var(--wixhc-radius-l);
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-week__day.is-today {
	border-color: var(--wixhc-brand);
	box-shadow: 0 0 0 1px var(--wixhc-brand) inset;
}

.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-notice {
	padding: var(--wixhc-space-3) var(--wixhc-space-4);
	background: var(--wixhc-surface-alt);
	border-left: 4px solid var(--wixhc-brand);
	border-radius: 0 var(--wixhc-radius-m) var(--wixhc-radius-m) 0;
}

/* Small screens ------------------------------------------------------------ */

@media (max-width: 767px) {
	.wixhc-events-views {
		margin-left: 0;
	}

	/* The month grid becomes a stacked list of the days that have events. */
	.wixhc-events-month,
	.wixhc-events-month tbody,
	.wixhc-events-month tr,
	.wixhc-events-month td {
		display: block;
		width: 100%;
	}

	.wixhc-events-month thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.wixhc-events-month td {
		height: auto;
	}

	.wixhc-events-month td:not(.has-events) {
		display: none;
	}

	.wixhc-events-month__event a {
		white-space: normal;
	}

	.wixhc-events-week {
		grid-template-columns: 1fr;
	}

	.wixhc-events-week__day:not(.has-events):not(.is-today) {
		display: none;
	}
}

/* ---------- Calendar archive page in a block theme ----------
   templates/events/archive.php puts the calendar straight into
   .wp-site-blocks, outside any constrained layout, so `alignwide` gave it
   neither a width nor side gutters: it ran edge to edge. Give it the
   theme's wide width, its root padding as gutters, and room above. */
.wp-site-blocks > .wixhc-events-main {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--wp--style--global--wide-size, 1200px) + 2 * max(16px, var(--wp--style--root--padding-left, 24px)));
	margin-inline: auto;
	padding: var(--wp--preset--spacing--50, 3rem) max(16px, var(--wp--style--root--padding-right, 24px)) var(--wp--preset--spacing--60, 4rem) max(16px, var(--wp--style--root--padding-left, 24px));
}

/* Single-event extras: "Add to calendar" as a secondary button that opens
   a short menu, and the back / next links as a quiet footer row. */
.wixhc-events:not(.wixhc-events--skeleton).wixhc-event-extras {
	display: flex;
	flex-direction: column;
	gap: var(--wixhc-space-5);
	margin-top: var(--wixhc-space-5);
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar > summary {
	display: inline-flex;
	align-items: center;
	gap: var(--wixhc-space-2);
	min-height: var(--wixhc-control-h-s);
	padding: 6px var(--wixhc-space-4);
	border: 1px solid var(--wixhc-border-strong);
	border-radius: var(--wixhc-radius-control);
	font-size: var(--wixhc-font-size-s);
	font-weight: 600;
	list-style: none;
	transition: background-color var(--wixhc-duration) ease, border-color var(--wixhc-duration) ease;
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar > summary::-webkit-details-marker { display: none; }
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar > summary::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar > summary:hover { border-color: currentColor; background: var(--wixhc-surface-alt); }
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar ul {
	gap: 2px;
	width: max-content;
	min-width: 200px;
	margin-top: var(--wixhc-space-2);
	padding: var(--wixhc-space-2);
	border: 1px solid var(--wixhc-border);
	border-radius: var(--wixhc-radius-m);
	background: var(--wixhc-surface);
	box-shadow: var(--wixhc-shadow);
	font-size: var(--wixhc-font-size-s);
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar li a {
	display: block;
	padding: 6px 10px;
	border-radius: var(--wixhc-radius-s);
	color: inherit;
	text-decoration: none;
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__calendar li a:hover { background: var(--wixhc-surface-alt); }
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__nav {
	padding-top: var(--wixhc-space-4);
	border-top: 1px solid var(--wixhc-border);
	font-size: var(--wixhc-font-size-s);
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__nav a {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras__nav a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-event-extras h2 { margin: 0 0 var(--wixhc-space-2); font-size: 1.15em; }

/* Calendar bar: labels in the storefront's field-label style, one chevron on
   the select (no native arrow beside skinned inputs), every control one
   height so the row lines up. */
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar label {
	font-size: var(--wixhc-font-size-s);
	font-weight: 600;
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar :is(input, select, button) {
	box-sizing: border-box;
	height: var(--wixhc-control-h);
	font-size: max(16px, 0.95em);
}
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-bar select {
	-webkit-appearance: none;
	appearance: none;
	min-width: 140px;
	padding-right: 40px;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	cursor: pointer;
}
/* Event titles: links without a permanent underline (it shows on hover). */
.wixhc-events:not(.wixhc-events--skeleton) :is(.wixhc-events-item__title, .wixhc-events-card__title) a {
	color: inherit;
	text-decoration: none;
}
.wixhc-events:not(.wixhc-events--skeleton) :is(.wixhc-events-item__title, .wixhc-events-card__title) a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
/* "Subscribe to calendar" opens like "Add to calendar". */
.wixhc-events:not(.wixhc-events--skeleton) .wixhc-events-subscribe:not(.wixhc-event-extras__calendar) > summary {
	font-size: var(--wixhc-font-size-s);
	font-weight: 600;
}
