/* Live music calendar. See templates/calendar.html and calendar.js. */

/* Always dark: the venue colors are easier to tell apart on it. */
:root {
	color-scheme: dark;
	--bg: #141416;
	--surface: #1e1e21;
	--text: #ececef;
	--muted: #9b9ba3;
	--border: #34343a;
	--accent: #ff8a7e;
	--gold: #d9ad3c;		/* selection: the view toggle, a clicked day */
	--radius: 8px;

}

/* Venue colors, named in site.kColors; a venue's is set in its scraper, or assigned. */
[data-color="blue"]    { --vc: #7fa6ff; }
[data-color="orange"]  { --vc: #ff9b63; }
[data-color="green"]   { --vc: #5fd18d; }
[data-color="purple"]  { --vc: #c79bff; }
[data-color="pink"]    { --vc: #ff7d9a; }
[data-color="cyan"]    { --vc: #52d0e6; }
[data-color="yellow"]  { --vc: #f0c454; }
[data-color="lime"]    { --vc: #a9d65a; }
[data-color="magenta"] { --vc: #ee6bd8; }
[data-color="tan"]     { --vc: #d2a679; }
[data-color="red"]     { --vc: #ff5f57; }
[data-color="teal"]    { --vc: #3fbfa0; }

[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
	margin: 0 auto;
	max-width: 64rem;
	--grid-width: 1132px;
	padding: 0 16px 4rem;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

.visually-hidden {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip-path: inset(50%); white-space: nowrap;
}

/* --- Header and controls ---------------------------------------------------------------- */

.masthead {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 0.25rem 1rem; padding: 1rem 0;
}
.masthead h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo { width: auto; height: 64px; }
@media (max-width: 640px) {
	.logo { height: 44px; }
	.masthead h1 { font-size: 1.35rem; }
}
.updated { color: var(--muted); font-size: 0.875rem; }

.no-js .controls { display: none; }

/* The view shown is html[data-view] (grid, list or new), set by the page and calendar.js;
   without it, the list. */
#grid-view, #new-view, html[data-view="grid"] #list-view, html[data-view="new"] #list-view { display: none; }
html[data-view="grid"] #grid-view, html[data-view="new"] #new-view { display: block; }

/* "All" and the view toggle on top; the venue chips beneath. */
.controls { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.controls-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

.venues { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; margin: 0; padding: 0; }

.chip {
	display: inline-flex; align-items: center; gap: 0.4rem;
	padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 999px;
	background: var(--surface); color: var(--muted); font: inherit; font-size: 0.875rem;
	cursor: pointer; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .swatch { width: 0.65rem; height: 0.65rem; border-radius: 50%; border: 2px solid var(--vc); }
.chip:has(input:checked) { color: var(--text); border-color: var(--vc); }
.chip:has(input:checked) .swatch { background: var(--vc); }
.chip:has(input:focus-visible), .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-toggle button {
	padding: 0.35rem 0.9rem; border: 0; background: var(--surface); color: var(--muted);
	font: inherit; font-size: 0.875rem; cursor: pointer;
}
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--bg); font-weight: 600; }

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

.day h2 {
	position: sticky; top: 0; z-index: 1;
	padding: 1.25rem 0 0.5rem; background: var(--bg);
	font-size: 1rem; font-weight: 650;
}

/* A day's events (show groups): in the list, and in the row the grid inserts below a day's week.
   Each is a venue pill, the name and details, and the show times on the right. */
.entries { font-size: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.entry {
	display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: start;
	padding: 0.7rem 0.75rem;
}
.entry:not([hidden]) ~ .entry { border-top: 1px solid var(--border); }
.entry .pill {
	margin-top: 0.15rem; padding: 0.15rem 0.5rem; border-radius: 999px;
	background: var(--vc); color: var(--bg); font-size: 0.75rem; font-weight: 600; text-align: center;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entry .times { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.entry .time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry .date { font-weight: 600; white-space: nowrap; }		/* in the New view */
.entry .show-status { font-size: 0.75rem; color: var(--accent); }
.entry .name { font-size: 1.05em; font-weight: 600; overflow-wrap: anywhere; }
.entry .name a { text-decoration: none; }
.entry .name a:hover { text-decoration: underline; }
.entry .meta { color: var(--muted); font-size: 0.9em; }
.entry .price { font-variant-numeric: tabular-nums; }
.entry .excerpt { margin-top: 0.3rem; font-size: 0.9em; }

.badge {
	display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem; vertical-align: 0.1em;
	border: 1px solid currentColor; border-radius: 999px;
	color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.status-cancelled .badge, .status-postponed .badge { color: var(--accent); }
.entry.status-cancelled .name a, .cell .status-cancelled a { text-decoration: line-through; }

.empty { padding: 3rem 0; color: var(--muted); text-align: center; }
.new-intro { padding-top: 1.25rem; color: var(--muted); font-size: 0.9rem; }

/* On phones: the pill and times on top, the details below. */
@media (max-width: 640px) {
	.entry { grid-template-columns: 7.5rem minmax(0, 1fr); grid-template-areas: "pill times" "details details"; gap: 0.35rem 0.75rem; }
	.entry .pill { grid-area: pill; margin-top: 0; }
	.entry .times { grid-area: times; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 0 1rem; }
	.entry .details { grid-area: details; }
}

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

/* The page widens while the grid is shown (calendar.js sets data-view), for a grid this wide. */
html[data-view="grid"] body { max-width: calc(var(--grid-width) + 2 * 16px); }

.month-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.25rem 0 0.75rem; }
.month-nav h2 { min-width: 11rem; text-align: center; font-size: 1.25rem; }
.month-nav button {
	width: 2.25rem; height: 2.25rem; border: 1px solid var(--border); border-radius: 50%;
	background: var(--surface); color: var(--text); font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.month-nav button:disabled { opacity: 0.35; cursor: default; }

/* Days are separate rounded rectangles; days outside the month are left empty. */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { padding: 0.35rem; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-align: center; }
.cell { min-height: 7rem; padding: 0.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.cell.blank { background: none; border: 0; }
.cell.past > * { opacity: 0.5; }
.daynum { display: block; margin-bottom: 0.15rem; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.cell .event {
	margin-bottom: 0.2rem; padding-left: 0.3rem; border-left: 4px solid var(--vc);
	font-size: 0.75rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cell .event a { text-decoration: none; }
.cell .event a:hover { text-decoration: underline; }

/* Clicking a day (other than on an event's link) shows its events, copied from the list, in a
   row calendar.js inserts below the day's week. */
.day-detail { grid-column: 1 / -1; padding: 0.4rem 0 0.6rem; }
.day-detail h2 { margin-bottom: 0.5rem; font-size: 0.95rem; font-weight: 650; }
.cell:has(.event:not([hidden])) { cursor: pointer; }
.cell.selected { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

/* On phones, grid days show a dot per event; tapping a day shows it in the list. */
@media (max-width: 640px) {
	.weekday { padding: 0.35rem 0; }
	.cell { min-height: 3.5rem; cursor: pointer; }
	.cell ul { display: flex; flex-wrap: wrap; gap: 3px; }
	.cell .event { width: 0.5rem; height: 0.5rem; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--vc); }
	.cell .event > * { display: none; }
}
