/* LoudMemories — charts. Page-only rules; the design system and chrome live in
   core/css/lm-base.css. Token ladder from the design export
   (LoudMemoriesClaudeDesign/charts.css). */

:root {
	--lm-max: 1200px;

	--h1: 2.375rem;
	--two-col: 1fr;
	--chart-h: 12rem;
	--rank-w: 1.75rem;
	--bar-min: 3rem;
}
@media (min-width: 480px) {
	:root { --h1: 3rem; --chart-h: 14rem; }
}
@media (min-width: 768px) {
	:root { --h1: 4rem; --chart-h: 18rem; --rank-w: 2.25rem; --bar-min: 6rem; }
}
@media (min-width: 1024px) { :root { --h1: 5rem; --two-col: 1fr 1fr; --chart-h: 21rem; } }
@media (min-width: 1280px) { :root { --h1: 5.75rem; --chart-h: 23rem; } }

/* ------------------------------------------------------------ the hero */

.ch-title {
	margin: 0;
	font-family: var(--lm-sans);
	font-size: var(--h1);
	font-weight: 700;
	line-height: .92;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

.ch-lead {
	margin: 16px 0 0;
	max-width: 34rem;
	font-size: clamp(0.9375rem, 3.2vw, 1.0625rem);
	line-height: 1.6;
	color: var(--lm-muted);
	text-wrap: pretty;
}

.ch-periods { display: flex; flex-wrap: wrap; gap: 8px; margin: clamp(1.5rem, 4vw, 2.25rem) 0 0; }
.ch-period {
	display: inline-flex;
	align-items: center;
	font-family: var(--lm-sans);
	font-size: 0.75rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 11px 18px;
	min-height: 2.75rem;
	border-radius: 2px;
	border: 1px solid var(--lm-line-strong);
	color: var(--lm-muted);
	transition: border-color .16s, color .16s;
}
.ch-period:hover { border-color: var(--lm-green-lt); color: var(--lm-green-lt); }
.ch-period.is-on {
	background: rgba(var(--lm-green-dk-rgb), .5);
	border-color: var(--lm-green-lt);
	color: var(--lm-on-green);
}

/* ------------------------------------------------- 01 / 02 / 04 the rows */

.ch-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }

.ch-row {
	color: inherit;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(0.625rem, 2.5vw, 1.125rem);
	padding: 14px 12px;
	margin: 0 -12px;
	border-radius: 3px;
	border-bottom: 1px solid var(--lm-line);
	transition: background .16s;
}
.ch-row:hover { background: rgba(var(--lm-panel-rgb), .9); color: inherit; }
.ch-row.is-me { background: rgba(var(--lm-green-dk-rgb), .28); }

.ch-rank {
	flex: 0 0 var(--rank-w);
	font-family: var(--lm-mono);
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--lm-muted);
}
.ch-rank.is-top { color: var(--lm-gold); }

.ch-avatar {
	flex: 0 0 2.25rem;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--lm-panel-2);
	border: 1px solid var(--lm-line-strong);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--lm-sans);
	font-size: 0.75rem;
	color: var(--lm-green-lt);
}

.ch-row-main { flex: 1 1 9rem; min-width: 0; }
.ch-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ch-row-name { font-family: var(--lm-sans); font-size: 1rem; color: var(--lm-ink); }
.ch-row-meta { display: block; font-family: var(--lm-mono); font-size: 0.6875rem; color: var(--lm-muted); margin-top: 4px; }
.ch-you {
	font-family: var(--lm-mono);
	font-size: 0.5625rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--lm-green-lt);
	border: 1px solid rgba(var(--lm-green-lt-rgb), .5);
	border-radius: 2px;
	padding: 2px 6px;
}

.ch-bar {
	flex: 1 1 var(--bar-min);
	min-width: 2.5rem;
	height: 0.5rem;
	background: rgba(var(--lm-ink-rgb), .07);
	border-radius: 2px;
	overflow: hidden;
	display: block;
}
.ch-bar.is-tall { height: 1.5rem; }
.ch-bar-fill { display: block; height: 100%; background: var(--lm-green); }
.ch-bar-fill.is-gold { background: var(--lm-gold); }

.ch-value {
	flex: 0 0 auto;
	min-width: 3.75rem;
	text-align: right;
	font-family: var(--lm-mono);
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--lm-ink);
}

/* -------------------------------------------- 03 highest-rated nights */

.ch-nights {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	gap: 14px;
}
.ch-nights a {
	color: inherit;
	display: flex;
	gap: 14px;
	height: 100%;
	background: var(--lm-panel);
	border: 1px solid var(--lm-line);
	border-radius: 3px;
	padding: 16px 18px;
	transition: border-color .16s;
}
.ch-nights a:hover { border-color: rgba(var(--lm-green-lt-rgb), .6); color: inherit; }
.ch-nights .ch-rank { font-size: 1.125rem; }
.ch-night-main { flex: 1 1 auto; min-width: 0; display: block; }
.ch-night-artist { display: block; font-family: var(--lm-sans); font-size: 1rem; color: var(--lm-ink); line-height: 1.25; }
.ch-night-place { display: block; font-family: var(--lm-mono); font-size: 0.6875rem; color: var(--lm-muted); margin-top: 5px; }
.ch-night-date { display: block; font-family: var(--lm-mono); font-size: 0.6875rem; color: var(--lm-muted); margin-top: 3px; }
.ch-night-score { flex: 0 0 auto; text-align: right; }
.ch-night-pct { display: block; font-family: var(--lm-mono); font-size: 1.375rem; font-weight: 700; color: var(--lm-green-lt); line-height: 1; }
.ch-night-votes { display: block; font-family: var(--lm-mono); font-size: 0.625rem; color: var(--lm-muted); margin-top: 5px; }

/* ------------------------------------------------ 05 years of logging */

.ch-year-wrap { background: var(--lm-panel); border: 1px solid var(--lm-line); border-radius: 3px; overflow: hidden; }
/* The shape is stretched to fill the box, so nothing with a readable shape of
   its own — text, dots — may live inside the SVG. The marks are HTML, placed
   over it in percentages, which land in the right spot at any width. */
.ch-year-chart { position: relative; height: var(--chart-h); }
.ch-year-svg { display: block; width: 100%; height: 100%; }
.ch-year-area { fill: rgba(var(--lm-green-rgb), .22); stroke: none; }
.ch-year-line { fill: none; stroke: var(--lm-green); stroke-width: 2; vector-effect: non-scaling-stroke; }

.ch-year-mark {
	position: absolute;
	transform: translate(-50%, -100%);
	padding-bottom: 9px;
	text-align: center;
	white-space: nowrap;
	pointer-events: none;
}
.ch-year-mark.is-start { transform: translate(0, -100%); text-align: left; }
.ch-year-mark.is-end { transform: translate(-100%, -100%); text-align: right; }
.ch-year-mark::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 7px;
	height: 7px;
	margin: 0 0 -3px -3.5px;
	border-radius: 50%;
	background: var(--lm-green-lt);
}
.ch-year-mark.is-start::after { left: 0; margin-left: -3.5px; }
.ch-year-mark.is-end::after { left: 100%; margin-left: -3.5px; }
.ch-year-mark b { display: block; font-family: var(--lm-mono); font-size: 0.8125rem; font-weight: 700; color: var(--lm-ink); }
.ch-year-mark i { display: block; font-family: var(--lm-mono); font-size: 0.625rem; font-style: normal; color: var(--lm-muted); }

.ch-year-notes {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	padding: 14px clamp(0.875rem, 3vw, 1.375rem);
	border-top: 1px solid var(--lm-line);
}
.ch-year-notes p {
	margin: 0;
	flex: 1 1 13rem;
	min-width: 0;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: var(--lm-muted);
	text-wrap: pretty;
}
.ch-year-notes span {
	display: block;
	margin-bottom: 4px;
	font-family: var(--lm-mono);
	font-size: 0.6875rem;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.ch-year-notes p.is-green span { color: var(--lm-green-lt); }
.ch-year-notes p.is-gold span { color: var(--lm-gold); }
.ch-year-notes p.is-red span { color: var(--lm-red); }

/* ------------------------------------------------- 06 / 07 side by side */

.ch-pair { display: grid; grid-template-columns: var(--two-col); gap: 0 var(--lm-sec-gap); }

.ch-buckets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ch-buckets li { display: flex; align-items: center; gap: 12px; }
.ch-bucket-label { flex: 0 0 3rem; font-family: var(--lm-mono); font-size: 0.75rem; color: var(--lm-muted); }
.ch-bucket-share {
	flex: 0 0 3rem;
	text-align: right;
	font-family: var(--lm-mono);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--lm-ink);
}

.ch-months {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	align-items: flex-end;
	gap: clamp(0.25rem, 1.2vw, 0.5rem);
	height: 11rem;
}
.ch-months li {
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	gap: 6px;
}
.ch-month-pct { flex: 0 0 auto; font-family: var(--lm-mono); font-size: 0.625rem; color: var(--lm-muted); }
.ch-month-pct.is-top { color: var(--lm-gold); }
.ch-month-track { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: flex-end; }
.ch-month-bar {
	flex: 0 0 auto;
	display: block;
	width: 100%;
	border-radius: 2px 2px 0 0;
	background: rgba(var(--lm-green-rgb), .6);
}
.ch-month-bar.is-top { background: var(--lm-gold); }
.ch-month-label {
	flex: 0 0 auto;
	font-family: var(--lm-mono);
	font-size: 0.5938rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--lm-muted);
}

.ch-note {
	margin: 18px 0 0;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--lm-muted);
	font-style: italic;
	text-wrap: pretty;
}
