/**
 * SPICMF Festival Manager — front-end styles.
 *
 * Neutral, functional defaults. Colors, typography, and spacing are meant to
 * be overridden via the Elementor widget Style tabs (which set CSS on the
 * widget wrapper) or the theme.
 */

.spicmf-schedule {
	--spicmf-timeline-color: #b8860b;
}

/* --- Day tabs -------------------------------------------------------- */

.spicmf-schedule__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1.75rem;
	margin-bottom: 1.75rem;
	border-bottom: 1px solid var(--spicmf-tab-divider-color, rgba(0, 0, 0, 0.12));
}

/*
 * Text-only tabs. The tabs are spans with role="tab" — deliberately not
 * <button> elements, because theme stylesheets style buttons (gradients,
 * pill shapes, borders) with specificity we can't reliably beat. The reset
 * below is kept as insurance against aggressive global styles. The active
 * day is marked by an underline bar plus caret drawn with pseudo-elements,
 * colored via --spicmf-tab-indicator-color.
 */
.spicmf-schedule__tab,
.spicmf-schedule__tab:hover,
.spicmf-schedule__tab:focus,
.spicmf-schedule__tab:active {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	text-transform: none;
	text-decoration: none;
	color: inherit;
}

.spicmf-schedule__tab {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	padding: 0.25rem 0.25rem 0.85rem;
	margin-bottom: -1px;
	cursor: pointer;
	line-height: 1.2;
	opacity: 0.65;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: opacity 0.15s ease, color 0.15s ease;
}

.spicmf-schedule__tab:hover,
.spicmf-schedule__tab:focus,
.spicmf-schedule__tab.is-active {
	opacity: 1;
}

.spicmf-schedule__tab:focus-visible {
	outline: 2px solid var(--spicmf-tab-indicator-color, var(--spicmf-timeline-color));
	outline-offset: 2px;
}

/* Underline bar: reserved on every tab so switching never shifts layout. */
.spicmf-schedule__tab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	background: transparent;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

/* Faint underline on hover/focus: signals "clickable" without button chrome. */
.spicmf-schedule__tab:hover::after,
.spicmf-schedule__tab:focus-visible::after {
	background: var(--spicmf-tab-indicator-color, var(--spicmf-timeline-color));
	opacity: 0.35;
}

.spicmf-schedule__tab.is-active::after {
	background: var(--spicmf-tab-indicator-color, var(--spicmf-timeline-color));
	opacity: 1;
}

/* Caret under the active tab's underline. */
.spicmf-schedule__tab.is-active::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -8px;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid var(--spicmf-tab-indicator-color, var(--spicmf-timeline-color));
}

/* Weekday-first: attendees think "Saturday", not "20 Sep". */
.spicmf-schedule__tab-day {
	font-weight: 700;
}

.spicmf-schedule__tab-date {
	font-size: 0.8em;
}

@media (max-width: 767px) {
	.spicmf-schedule__tabs {
		gap: 1rem;
	}

	.spicmf-schedule__tab {
		font-size: 0.9em;
	}
}

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

.spicmf-schedule--tabs .spicmf-schedule__panel {
	display: none;
}

.spicmf-schedule--tabs .spicmf-schedule__panel.is-active {
	display: block;
}

.spicmf-schedule__day-heading {
	margin: 2rem 0 1rem;
}

/* --- Timeline event rows --------------------------------------------- */

.spicmf-schedule__events {
	position: relative;
	padding-left: 2rem;
}

.spicmf-schedule__events::before {
	content: "";
	position: absolute;
	left: 0.45rem;
	top: 0.5rem;
	bottom: 0.5rem;
	width: 2px;
	background: var(--spicmf-timeline-color);
}

/*
 * Row hierarchy (three levels, per design discussion):
 *   1. start time + event title  — the two questions a schedule answers
 *   2. venue                     — small, muted
 *   3. description + more link   — smallest
 * Times sit in a fixed-width left column so the eye can scan a day
 * chronologically; the timeline dot aligns with the time.
 */
.spicmf-event-row {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.spicmf-event-row::before {
	content: "";
	position: absolute;
	left: -1.95rem;
	top: 1.15rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--spicmf-timeline-color);
}

.spicmf-event-row__time {
	flex: 0 0 var(--spicmf-time-col, 5.5em);
	display: flex;
	flex-direction: column;
	padding-top: 0.9rem;
	line-height: 1.25;
}

.spicmf-event-row__time-start {
	font-weight: 700;
	font-size: 1.05em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.spicmf-event-row__time-end {
	font-size: 0.8em;
	opacity: 0.65;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.spicmf-event-row__card {
	flex: 1 1 auto;
	min-width: 0;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	padding: 0.9rem 1.25rem;
}

.spicmf-event-row__title {
	margin: 0 0 0.3rem;
}

.spicmf-event-row__title a {
	text-decoration: none;
	color: inherit;
}

.spicmf-event-row__venue {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 0.35rem;
	font-size: 0.85em;
	opacity: 0.75;
}

.spicmf-event-row__pin {
	flex-shrink: 0;
}

.spicmf-event-row__description {
	margin: 0 0 0.4rem;
	font-size: 0.9em;
	opacity: 0.85;
}

.spicmf-event-row__more {
	font-size: 0.85em;
	font-weight: 600;
	opacity: 0.8;
}

/*
 * Small screens: shrink the fixed costs (timeline gutter, gaps, card
 * padding) so nearly all the saved width goes to the text column, keeping
 * the two-column time layout comfortable down to ~360px devices.
 */
@media (max-width: 500px) {
	.spicmf-schedule__events {
		padding-left: 1.4rem;
	}

	.spicmf-schedule__events::before {
		left: 0.35rem;
	}

	.spicmf-event-row {
		gap: 0.5rem;
	}

	.spicmf-event-row::before {
		width: 10px;
		height: 10px;
		left: -1.3rem;
		top: 1.2rem;
	}

	.spicmf-event-row__card {
		padding: 0.8rem 0.85rem;
	}

	.spicmf-event-row__time {
		flex-basis: var(--spicmf-time-col, 4.4em);
	}
}

.spicmf-schedule__empty,
.spicmf-performers-grid__empty {
	text-align: center;
	font-style: italic;
	padding: 2rem 0;
}

/* --- Performers grid (masonry) --------------------------------------- */

/*
 * CSS multi-column masonry: photos keep their natural aspect ratio and
 * columns pack to different heights (Pinterest-style). Item flow order is
 * column-by-column, which is irrelevant here — the query order is random
 * by design so no performer position implies a ranking.
 */
.spicmf-performers-grid {
	columns: 3;
	column-gap: var(--spicmf-grid-gap, 1.5rem);
}

@media (max-width: 1024px) {
	.spicmf-performers-grid {
		columns: 2;
	}
}

.spicmf-performer-card {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin-bottom: var(--spicmf-grid-gap, 1.5rem);
	background: #fff;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.spicmf-performer-card__image {
	display: block;
}

.spicmf-performer-card__image img {
	display: block;
	width: 100%;
	height: auto;
}

.spicmf-performer-card__caption {
	padding: 0.75rem 1rem;
	text-align: center;
}

.spicmf-performer-card__name {
	margin: 0;
	font-size: 1em;
	font-weight: 600;
}

.spicmf-performer-card__name a {
	text-decoration: none;
	color: inherit;
}

.spicmf-performer-card__bio {
	margin: 0.5rem 0 0;
	font-size: 0.9em;
}

.spicmf-performers-preview__footer {
	margin-top: 1.25rem;
	text-align: center;
}

.spicmf-performers-preview__button {
	display: inline-block;
	padding: 0.55rem 1.6rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
}

/* --- Fallback templates ---------------------------------------------- */

.spicmf-template {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem;
	/* Sticky footer: when the theme/body is a flex column (site-wide
	   min-height CSS), the plugin template absorbs leftover viewport
	   height so the footer sits at the bottom on short pages. */
	flex: 1 0 auto;
	width: 100%;
}

.spicmf-single-event__facts {
	list-style: none;
	padding: 0;
	margin: 1rem 0;
}

.spicmf-single-event__facts li {
	margin-bottom: 0.25rem;
}

.spicmf-button {
	display: inline-block;
	padding: 0.6rem 1.4rem;
	border-radius: 6px;
	background: #b8860b;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
}

.spicmf-button:hover,
.spicmf-button:focus {
	color: #fff;
	opacity: 0.9;
}

.spicmf-map-embed {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	margin-bottom: 1rem;
}

.spicmf-map-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- Performer hero (blur-fill) -------------------------------------- */

.spicmf-performer-hero {
	position: relative;
	height: 480px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.spicmf-performer-hero__backdrop {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: blur(var(--spicmf-hero-blur, 14px));
	/* Slight zoom hides the transparent fringe blur creates at the edges. */
	transform: scale(1.12);
}

.spicmf-performer-hero__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.35);
}

.spicmf-performer-hero img.spicmf-performer-hero__photo {
	position: relative;
	z-index: 1;
	width: auto;
	height: auto;
	max-width: calc(100% - 2 * var(--spicmf-hero-photo-pad, 24px));
	max-height: calc(100% - 2 * var(--spicmf-hero-photo-pad, 24px));
	object-fit: contain;
}

.spicmf-performer-hero__name {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 1.25rem;
	margin: 0;
	text-align: center;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.spicmf-editor-notice {
	padding: 1rem;
	background: #fcf9e8;
	border: 1px dashed #c9a227;
	text-align: center;
}

/* --- Single-event widgets (Event Info / Map / Performers) ------------- */

.spicmf-event-info__facts {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.spicmf-event-info__facts li {
	margin-bottom: 0.35rem;
}

.spicmf-event-info__label {
	font-weight: 700;
	margin-right: 0.35rem;
}

.spicmf-event-info__tickets,
.spicmf-event-map__directions {
	display: inline-block;
	padding: 0.55rem 1.6rem;
	background: #b8860b;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
}

.spicmf-event-info__tickets:hover,
.spicmf-event-info__tickets:focus,
.spicmf-event-map__directions:hover,
.spicmf-event-map__directions:focus {
	color: #fff;
	opacity: 0.9;
}

.spicmf-event-map__embed {
	position: relative;
	height: 350px;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1rem;
}

.spicmf-event-map__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.spicmf-event-performers--list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.spicmf-event-performers--list li {
	margin-bottom: 0.4rem;
}

.spicmf-event-performers--list a {
	text-decoration: none;
	font-weight: 600;
}

.spicmf-event-performers--chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.spicmf-event-performers__chip {
	display: inline-block;
	padding: 0.35rem 1rem;
	background: rgba(0, 0, 0, 0.07);
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	color: inherit;
}

.spicmf-event-performers__chip:hover,
.spicmf-event-performers__chip:focus {
	background: rgba(0, 0, 0, 0.12);
}

.spicmf-archive-events__list {
	list-style: none;
	padding: 0;
}

.spicmf-archive-events__item {
	margin-bottom: 0.6rem;
}
