
.top-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 32px;
	border-bottom: var(--border);
	background: var(--shaded-background);
	position: sticky;
	top: 0;
	z-index: 100;
}
.top-bar h1 {
	font-size: 22px;
	flex: 1;
	letter-spacing: 0.02em;
}
.view-toggle {
	display: flex;
	border: var(--border);
	border-radius: 8px;
	padding: 3px;
	gap: 2px;
}
.view-btn {
	background: none;
	border: none;
	padding: 7px 18px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.2s;
	letter-spacing: 0.03em;
}
.view-btn.active {
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ---- FILTERS ---- */
.filters-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 32px;
	border-bottom: var(--border);
	flex-wrap: wrap;
}
.filter-label {
	font-size: 12px;
	color: var(--text-link);
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.filter-select, .filter-search {
	border: var(--border);
	padding: 7px 12px;
	border-radius: 7px;
	font-size: 13px;
	outline: none;
	cursor: pointer;
	transition: border-color 0.2s;
	appearance: none;
	-webkit-appearance: none;
	min-width: 140px;
}
.filter-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7490'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center; background-color: transparent; padding-right: 28px; border: var(--border); }
.filter-select:hover, .filter-select:focus, .filter-search:focus, .filter-search:focus { border: var(--border-dark); }
.filter-search { min-width: 200px; border: var(--border);}
.filter-search::placeholder { color: var(--text-accent); }

.cal-controls {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 32px 8px;
}
.cal-nav-btn {
	color: var(--text-dark);
	background: var(--muted-background);
	border: var(--border);
	width: 36px; height: 36px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	display: flex; align-items: center; justify-content: center;
	text-decoration: none;
}
.cal-nav-btn:hover { background: var(--muted-background); border: var(--border-dark); }
.cal-month-label {
	font-size: 17px;
	min-width: 160px;
}

#view-calendar { display: block; }
#view-list { display: none; }

.months-wrapper {
	padding: 0 32px 48px;
}
.month-block {
	margin-bottom: 40px;
}
.month-title {
	font-size: 20px;
	color: var(--text-accent);
	padding: 12px 0 6px;
	border-bottom: var(--border);
	margin-bottom: 0;
}

/* Day-of-week header */
.cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-accent);
	padding: 8px 4px;
	text-align: center;
	border-bottom: var(--border);
}

/* Weeks as rows */
.cal-week {
	display: contents;
}
.cal-day {
	min-height: 80px;
	border-right: var(--border);
	border-bottom: var(--border);
	padding: 4px 2px 2px;
	position: relative;
	overflow: hidden;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.other-month .day-num { opacity: 0.25; }
.cal-day.today { background: rgba(200, 169, 110, 0.05); }
.cal-day.today .day-num { color: var(--text-accent); font-weight: 600; }

.day-num {
	font-size: 12px;
	font-weight: 500;
	color: var(--text-accent);
	display: block;
	text-align: right;
	padding-right: 4px;
	margin-bottom: 2px;
}

/* Event bars */
.cal-event-bar {
	display: block;
	height: 24px;
	line-height: 24px;
	border-radius: 3px;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 5px;
	margin-bottom: 2px;
	cursor: pointer;
	position: relative;
	transition: opacity 0.15s;
	z-index: 2;
}
.cal-event-bar:hover { opacity: 0.85; cursor: pointer; }

/* spans: left/middle/right of multi-day */
.cal-event-bar.span-start { border-radius: 3px 0 0 3px; }
.cal-event-bar.span-middle { border-radius: 0; margin-left: -1px; margin-right: -1px; text-indent: -9999px; }
.cal-event-bar.span-end { border-radius: 0 3px 3px 0; text-indent: -9999px; }

/* Mobile: dot */
.cal-dot {
	display: none;
	width: 6px; height: 6px;
	border-radius: 50%;
	margin: 2px auto 1px;
}

/* ---- POPOUT ---- */
.event-popout {
	display: none;
	position: fixed;
	z-index: 1000;
	background: var(--shaded-background);
	border: 1px solid var(--border-dark);
	border-radius: 4px;
	box-shadow: var(--shadow);
	color: var(--text-dark);
	min-width: 280px;
	max-width: 360px;
	padding: 0;
	overflow: hidden;
	animation: pop-in 0.18s ease;
}
@keyframes pop-in {
	from { opacity: 0; transform: scale(0.94) translateY(-4px); }
	to { opacity: 1; transform: scale(1) translateY(0); }
}
.popout-close {
	position: absolute;
	top: 10px; right: 12px;
	background: none; border: none; color: var(--text-accent);
	font-size: 18px; cursor: pointer; line-height: 1;
	z-index: 10;
	transition: color 0.15s;
}
.popout-img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	display: block;
}
.popout-body {
	padding: 14px 16px 16px;
}
.popout-cat-tag {
	display: inline-block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 8px;
}
.popout-title {
	font-size: 17px;
	margin-bottom: 6px;
	line-height: 1.3;
}
.popout-dates {
	font-size: 12px;
	color: var(--text-accent);
	margin-bottom: 8px;
}
.popout-preview {
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 12px;
	max-height: 80px;
	overflow: hidden;
}
.popout-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 6px;
	transition: all 0.2s;
	&:hover {
		opacity: 0.85;
	}
}

/* Mobile day popout — list of events */
.day-popout-events { display: flex; flex-direction: column; gap: 10px; }
.day-event-item { display: flex; flex-direction: column; gap: 3px; border-top: var(--border); padding-top: 10px; }
.day-event-item:first-child { border-top: none; padding-top: 0; }

/* ---- LIST VIEW ---- */
.list-wrapper {
	padding: 0 32px 48px;
	max-width: 100%;
}
.list-month-header {
	font-size: 22px;
	padding: 28px 10px 10px 10px;
	border-bottom: var(--border);
	margin-bottom: 0;
	position: sticky;
	top: 110px;
	background: var(--shaded-background);
	z-index: 5;
}
.list-event {
	display: grid;
	grid-template-columns: 64px 100px 1fr;
	gap: 20px;
	align-items: start;
	padding: 18px 0;
	border-bottom: var(--border);
	transition: background 0.15s;
}
.list-event:hover { background: rgba(255, 255, 255, 0.02); border-radius: 8px; }
.list-date-col {
	text-align: center;
}
.list-date-day {
	font-size: 30px;
	line-height: 1;
}
.list-date-mon {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-accent);
}
.list-img {
	width: 100px; height: 70px;
	object-fit: cover;
	border-radius: 6px;
}
.list-img-placeholder {
	width: 100px; height: 70px;
	background: var(--muted-background);
	border-radius: 6px;
	display: flex; align-items: center; justify-content: center;
	font-size: 22px;
	color: var(--border);
}
.list-content {}
.list-cat-tag {
	display: inline-block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 4px;
	margin-bottom: 5px;
}
.list-title {
	font-size: 17px;
	text-decoration: none;
	display: block;
	margin-bottom: 4px;
	line-height: 1.3;
	color: var(--text-dark);
	transition: color 0.15s;
}
.list-preview {
	font-size: 13px;
	color: var(--text-dark);
	line-height: 1.5;
	margin-bottom: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.list-time {
	font-size: 12px;
	color: var(--text-accent);
	margin-bottom: 6px;
}
.list-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 6px;
	transition: all 0.2s;
	&:hover {
		opacity: 0.85;
	}
}
.list-no-results {
	color: var(--text-accent);
	padding: 40px 0;
	font-style: italic;
	font-size: 15px;
}

/* Overlay for closing popout */
#popout-overlay {
	display: none;
	position: fixed; inset: 0;
	z-index: 999;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
	.top-bar { padding: 12px 16px; }
	.top-bar h1 { font-size: 17px; }
	.filters-bar, .cal-controls, .months-wrapper, .list-wrapper { padding-left: 12px; padding-right: 12px; }
	.list-event { grid-template-columns: 48px 70px 1fr; gap: 10px; }
	.list-img, .list-img-placeholder { width: 70px; height: 50px; }
	.list-date-day { font-size: 22px; }

	.cal-day { min-height: 42px; padding: 3px 1px 1px; }
	.cal-event-bar { display: none !important; }
	.cal-dot { display: block; }
	.day-num { font-size: 11px; }
}

.calendarback {
	display: block;
	margin-bottom: 20px;
	a {
		text-decoration: none;
		color: var(--text-dark);
		font-size: 14px;
		&::before {
			content: "\2039";
			margin-right: 6px;
		}
	}
}
.event {
	.title {
		background: var(--shaded-background);
		padding: 16px;
		border-bottom: var(--border);
		h1 {
			margin-bottom: 20px;
		}
		.date {
			display: block;
			margin-top: 10px;
			color: var(--text-dark);
		}
	}
	.image {
		display: block;
		margin: 30px 0 40px 0;
		img {
			max-width: 100%;
			height: auto;
		}
	}
	.content {
		display: block;
		margin: 40px 0;
		ul {
			padding-left: 20px;
			margin-bottom: 20px;
			li {
				margin-bottom: 10px;
				&:last-child {
					margin-bottom: 0;
				}
			}
		}
		table {
			max-width: 100%;
			td, th {
				padding: 4px 8px;
			}
		}
	}
	.tickets {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr;
		grid-gap: 30px;

		.ticket {
			display: grid;
			width: 100%;
			grid-template-columns: 1fr;
			grid-gap: 10px;
			font-size: 15px;
			border: var(--border);
			padding: 20px;
			box-shadow: var(--shadow-light);

			.name {
				font-size: 18px;
				font-weight: 600;
			}
			.description {
			}
			.price {
				span {
					font-weight: 600;
				}
			}
			.tickets_available {
				span {
					font-weight: 600;
				}
			}
			.buy {
				display: flex;
				grid-gap: 20px;
				align-items: center;
				justify-items: start;
				margin-top: 20px;

				input {
					width: 100px;
					background-color: var(--shaded-background);
					border: 0;
					border-bottom: var(--border);
					font-size: 16px;
					line-height: 1;
					padding: 10px 10px;
					font-weight: 600;
				}
				button {
					display: inline-block;
					padding: 10px 20px;
					border-radius: 6px;
					font-size: 16px;
					line-height: 1;
					border: 0;
					background-color: var(--accent-color);
					color: white;
					font-weight: 600;
					&:hover {
						cursor: pointer;
						opacity: .85;
					}
				}
			}
		}
	}
}
@media (max-width: 1280px) {
	.event {
		.tickets {
			grid-template-columns: 1fr 1fr;
		}
	}
}
@media (max-width: 768px) {
	.event {
		.tickets {
			grid-template-columns: 1fr;
		}
	}
}

.ui-dialog {
	background-color: var(--shaded-background);
	box-shadow: var(--shadow-light);
	.w3-input {
		background-color: var(--white-background);
	}
	.w3-button {
		background-color: var(--accent-color);
		color: white;
		padding: 10px 20px;
		border-radius: 6px;
		&:hover {
			cursor: pointer;
			opacity: .85;
		}
	}
	.split-zipcity, .split-naming {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-gap: 20px;
		align-items: start;
		justify-items: start;
		&.split-zipcity {
			grid-template-columns: 1fr 2fr;
		}
		.webform_field, > div {
			margin: 0 !important;
			width: 100%;
		}
	}
	.webform_labelbox label {
		margin-top: 10px !important;
	}
	.participant-options {
		background-color: var(--white-background);
		.header {
			display: block;
			font-weight: 600;
			padding: 10px 10px 5px 10px;
		}
		.participant-container {
			margin-bottom: 20px;
			&:last-child {
				padding-bottom: 10px;
			}
			.split-naming {
				padding: 0 10px 10px 10px;
			}
			&:hover {
				outline: var(--bg-default) 1px solid;
			}
		}
	}
	label a {
		text-decoration: underline;
	}
}
