/**
 * Calendar — structural styles only.
 * All colour and typography is emitted inline per element instance.
 *
 * @package Launchpad_Avada_Elements
 * @version 1.24.0
 */

.lp-cal {
	--lp-cal-radius: 8px;
}

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

/* ------------------------------------------------------------- View toggle */

.lp-cal__toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.lp-cal--toggle-left .lp-cal__toolbar {
	justify-content: flex-start;
}

/* A segmented control: one recessed track, the active segment lifted out of it. */
.lp-cal__toggle {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: var(--lp-cal-radius);
	background: rgba(0, 0, 0, 0.05);
}

.lp-cal__toggle-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 32px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: calc(var(--lp-cal-radius) - 3px);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.lp-cal__toggle-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

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

.lp-cal__header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	margin-bottom: 28px;
}

.lp-cal__title {
	margin: 0;
	font-size: 1.75em;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
}

.lp-cal__nav--next {
	justify-self: end;
}

/* Month navigation is plain text — no button chrome. */
.lp-cal__nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95em;
	text-decoration: none;
	opacity: 0.85;
	transition: opacity 0.15s ease;
}

.lp-cal__nav-btn:hover {
	opacity: 1;
}

/* Inherits the nav link's colour; see LP_Calendar_View::arrow_icon(). */
.lp-cal__nav-arrow {
	flex: 0 0 auto;
}

/* View switching. With only one view present, data-view is ignored. */
.lp-cal--mode-both[data-view="calendar"] .lp-cal__list,
.lp-cal--mode-both[data-view="list"] .lp-cal__panes {
	display: none;
}

/* Month swap in flight: dim, and swallow clicks on stale content. */
.lp-cal.is-loading .lp-cal__header,
.lp-cal.is-loading .lp-cal__panes,
.lp-cal.is-loading .lp-cal__list {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ---------------------------------------------------------- Two-pane layout */

.lp-cal__panes {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

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

.lp-cal__grid {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
}

.lp-cal__grid th,
.lp-cal__cell {
	width: 14.2857142857%;
	text-align: center;
	vertical-align: middle;
	border: 1px solid;
}

.lp-cal__grid th {
	padding: 0 8px 4px;
	height: 3.4em;
	font-size: 0.95em;
	font-weight: 500;
}

.lp-cal__grid th abbr {
	text-decoration: none;
	border: 0;
	cursor: default;
}

.lp-cal__cell {
	position: relative;
	padding: 0;
	font-weight: 500;
}

/*
 * Square day tiles. The percentage resolves against the cell's own width, so the
 * height tracks the column and each tile stays square at any container width —
 * which is what keeps the selected day a square block rather than a rectangle.
 */
.lp-cal__cell::before {
	content: "";
	display: block;
	padding-top: 100%;
}

/*
 * The day number is centred in the cell and the dot hangs beneath it, both
 * absolutely positioned. Laying them out in flow instead would push the number
 * off-centre on days that have a dot, and the numbers would stop lining up
 * across rows.
 */
.lp-cal__day {
	position: absolute;
	top: 50%;
	left: 50%;
	line-height: 1;
	transform: translate(-50%, -50%);
}

/*
 * A day carries one dot per distinct event type. The row is centred beneath the
 * day number and positioned off the number's own centre, so adding a second dot
 * never nudges the number.
 */
.lp-cal__dots {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	gap: 4px;
	transform: translate(-50%, 1.1em);
}

.lp-cal__dot {
	display: block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

/* Fills its cell edge to edge, so the selected day is a solid block of colour. */
.lp-cal__day-btn {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.lp-cal__day-btn:hover {
	background-color: rgba(0, 0, 0, 0.04);
}

.lp-cal__day-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -3px;
}

/* ------------------------------------------------------------------ Panels */

.lp-cal__panel-title {
	margin: 0 0 20px;
	padding-bottom: 18px;
	font-size: 1.5em;
	font-weight: 400;
	line-height: 1.2;
	border-bottom: 1px solid;
}

.lp-cal__events {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lp-cal__event {
	padding: 20px 0;
	border-bottom: 1px solid;
}

.lp-cal__event:last-child {
	border-bottom: 0;
}

.lp-cal__event-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}

.lp-cal__event-date {
	font-size: 0.85em;
	opacity: 0.75;
}

.lp-cal__event-more {
	flex: 0 0 auto;
	font-size: 0.85em;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lp-cal__event-title {
	display: block;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.lp-cal__event-swatch {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 8px;
	border-radius: 50%;
	vertical-align: middle;
}

.lp-cal__event-types {
	margin-top: 4px;
	font-size: 0.8em;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	opacity: 0.6;
}

/* --------------------------------------------- Grouped list (meal menus) */

.lp-cal__list-day {
	padding: 22px 0;
	border-bottom: 1px solid;
}

.lp-cal__list-day:first-child {
	padding-top: 0;
}

.lp-cal__list-day:last-child {
	border-bottom: 0;
}

/* The prominent per-day heading: weekday, month, day, year. */
.lp-cal__list-date {
	margin: 0 0 10px;
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.2;
}

.lp-cal__list--grouped .lp-cal__event {
	padding: 0;
	border-bottom: 0;
}

/* -------------------------------------------------- Meal menu: rich body */

.lp-cal__event-body {
	margin-top: 6px;
}

.lp-cal__event-body > *:first-child {
	margin-top: 0;
}

.lp-cal__event-body > *:last-child {
	margin-bottom: 0;
}

/*
 * Language toggle. Both bodies are in the DOM; the wrapper's language class picks
 * which shows, so switching is instant and both print. Spanish hides by default
 * (English-only menus have no Spanish body anyway).
 */
.lp-cal__event-body[data-lp-lang="es"] {
	display: none;
}

.lp-cal--lang-es .lp-cal__event-body[data-lp-lang="es"] {
	display: block;
}

.lp-cal--lang-es .lp-cal__event-body[data-lp-lang="en"] {
	display: none;
}

/* ------------------------------------------------ Meal menu: control bar */

.lp-cal__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-right: auto;
}

.lp-cal__switcher,
.lp-cal__langs {
	display: inline-flex;
	border-radius: var(--lp-cal-radius);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.lp-cal__switch-btn,
.lp-cal__lang-btn {
	padding: 7px 16px;
	background: none;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, 0.12);
	cursor: pointer;
	font: inherit;
	font-size: 0.9em;
}

.lp-cal__switch-btn:first-child,
.lp-cal__lang-btn:first-child {
	border-left: 0;
}

.lp-cal__switch-btn[aria-pressed="true"],
.lp-cal__lang-btn[aria-pressed="true"] {
	background: rgba(0, 0, 0, 0.06);
	font-weight: 700;
}

.lp-cal__print {
	display: inline-flex;
	gap: 8px;
}

.lp-cal__print-btn {
	padding: 7px 16px;
	background: none;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: var(--lp-cal-radius);
	cursor: pointer;
	font: inherit;
	font-size: 0.9em;
}

.lp-cal__print-btn:hover {
	background: rgba(0, 0, 0, 0.05);
}

/* The print window strips the toolbar; keep the month title and grid clean. */
.lp-cal--print {
	border: 0 !important;
}

a.lp-cal__event-title:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lp-cal__event-time {
	margin-top: 6px;
	font-size: 0.9em;
	opacity: 0.75;
}

.lp-cal__event-venue {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 8px;
	font-size: 0.9em;
	opacity: 0.85;
}

.lp-cal__pin {
	flex: 0 0 auto;
	margin-top: 0.25em;
}

.lp-cal__empty {
	margin: 0;
	padding: 28px 0;
}

/* ------------------------------------------------------------------ Mobile */

/*
 * The pane collapse itself is emitted per-instance, keyed to Avada's medium
 * breakpoint. Below 767px the grid sheds its lines: with no cell borders a
 * filled square has nothing to sit inside, so the selected day becomes a
 * circle and the dots — now redundant against the muted numbers — drop away.
 */
@media screen and (max-width: 767px) {
	.lp-cal__title {
		font-size: 1.4em;
	}

	/* Arrows alone; the month names no longer fit either side of the title. */
	.lp-cal__nav-label {
		display: none;
	}

	.lp-cal__grid th,
	.lp-cal__cell {
		border: 0;
	}

	.lp-cal__grid th {
		font-size: 0.85em;
	}

	.lp-cal__dots {
		display: none;
	}

	.lp-cal__day-btn {
		width: 78%;
		height: 78%;
		inset: auto;
		position: absolute;
		top: 50%;
		left: 50%;
		border-radius: 50%;
		transform: translate(-50%, -50%);
	}

	.lp-cal__event-meta {
		flex-direction: column;
		gap: 4px;
	}
}
