/* Listening Taste page. Scoped to .lh so it cannot affect other pages.
   Blue carries amounts, amber marks the two-week obsessions: a pair that stays apart with deuteranomaly. */
.lh { --muted: #5f6772; --line: #e4e4e4; --soft: #f6f6f4; --blue: #2a78d6; --blue-l: #dbe8f8; --amber: #b8720a; --amber-l: #f6e7cf; }
.lh-wrap { width: min(1000px, 100% - 32px); margin: 0 auto; padding: 56px 0 72px; }
.lh-head { text-align: center; max-width: 660px; margin: 0 auto; }
.lh-head p { color: var(--muted); margin-top: 16px; }

.lh-stats { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lh-stats li { background: var(--soft); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.lh-stats b { display: block; font-size: 28px; font-weight: 400; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lh-stats span { font-size: 14px; color: var(--muted); }

.lh-sec { margin-top: 64px; }
.lh-h { font-size: 28px; }
.lh-sub { color: var(--muted); margin: 8px 0 0; max-width: 70ch; }

/* Playlists and albums (moved from /music/) */
.lh-pl { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lh-pl iframe { display: block; width: 100%; height: 352px; border: 0; border-radius: 12px; }
.lh-albums { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.lh-albums a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; transition: transform .15s; }
.lh-albums a:hover, .lh-albums a:focus-visible { transform: translateY(-2px); }
.lh-albums img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Bars over time */
.lh-chart { position: relative; margin-top: 24px; }
.lh-cols { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px solid var(--line); }
.lh-cols button { flex: 1 1 0; min-width: 0; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; display: flex; align-items: flex-end; }
.lh-cols button i { display: block; width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 1px; transition: opacity .15s; }
.lh-cols.dim button i { opacity: .28; }
.lh-cols.dim button.on i, .lh-cols button:hover i, .lh-cols button:focus-visible i { opacity: 1; }
.lh-cols button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.lh-xaxis { position: relative; height: 20px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lh-xaxis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.lh-ymax { position: absolute; top: -2px; left: 0; font-size: 12px; color: var(--muted); background: #fff; padding-right: 6px; }
.lh-gl { position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed var(--line); pointer-events: none; }

.lh-tip { position: absolute; z-index: 5; pointer-events: none; background: #1a1a1a; color: #fff; font-size: 13px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.lh-tip b { font-weight: 700; }
.lh-tip[hidden] { display: none; }

/* Year picker */
.lh-years { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.lh-years button { border: 1px solid var(--line); background: #fff; border-radius: 1000px; padding: 6px 14px; font: 400 14px/1.4 var(--font); cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; }
.lh-years button:hover { background: var(--soft); }
.lh-years button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }

.lh-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; margin-top: 24px; }
.lh-ylabel { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.lh-yearline { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

.lh-rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.lh-rank li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; font-size: 15px; }
.lh-rank .n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lh-rank .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-rank .v { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lh-rank .bar { grid-column: 2 / 4; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.lh-rank .bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; transition: width .35s ease; }
.lh-rank.tracks .nm small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

/* Clock heatmap */
.lh-peak { margin: 16px 0 0; font-size: 18px; }
.lh-heat { position: relative; margin-top: 20px; display: grid; grid-template-columns: 40px repeat(24, minmax(0, 1fr)); gap: 2px; }
.lh-heat .d { font-size: 12px; color: var(--muted); align-self: center; }
.lh-heat .c { aspect-ratio: 1.25; border-radius: 3px; background: var(--blue); }
.lh-heat .c:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.lh-heat .hx { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.lh-ramp { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.lh-ramp i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #eef4fc, var(--blue)); }
.lh-hours { margin-top: 28px; }
.lh-hours .lh-cols { height: 110px; }

/* Obsessions */
.lh-obs { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.lh-obs li { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.lh-obs li > div { min-width: 0; }
.lh-obs h3 { font-size: 17px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-obs .ar { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lh-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; align-items: end; height: 44px; }
.lh-strip i { background: var(--amber); border-radius: 2px 2px 0 0; min-height: 2px; }
.lh-strip i.z { background: var(--line); }
.lh-obs .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.lh-obs .meta b { color: var(--text); font-weight: 700; }
.lh-obs .also { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.lh-more { margin-top: 20px; border: 1px solid var(--text); background: #fff; color: var(--text); border-radius: 1000px; padding: 10px 22px; font: 700 13px/1.6 var(--font); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.lh-more:hover { background: var(--soft); }
.lh-more[hidden] { display: none; }

.lh-table { margin-top: 16px; }
.lh-table summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.lh-table table { border-collapse: collapse; margin-top: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.lh-table th, .lh-table td { text-align: left; padding: 4px 16px 4px 0; border-bottom: 1px solid var(--line); }
.lh-table th { font-weight: 700; }

.lh-how { margin-top: 64px; color: var(--muted); font-size: 14px; max-width: 72ch; }
.lh-how p { margin: 0 0 8px; }

@media (max-width: 920px) {
  .lh-wrap { padding: 40px 0 56px; }
  .lh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lh-stats b { font-size: 24px; }
  .lh-two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lh-sec { margin-top: 48px; }
  .lh-h { font-size: 24px; }
  .lh-heat { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .lh-heat .c { aspect-ratio: .8; border-radius: 2px; }
  .lh-heat .hx:nth-child(odd) { visibility: hidden; }
  .lh-cols { height: 140px; gap: 1px; }
  .lh-pl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lh-albums { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 560px) { .lh-pl { grid-template-columns: minmax(0, 1fr); } .lh-albums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .lh-albums a { transition: none; } .lh-rank .bar i, .lh-cols button i { transition: none; } }
