/* jeremylasne.com/workout: the week, the wave of reps, the three sessions, the total and the maxes.
   Built on site.css: the same column, hairlines and Figtree; Geist Mono stays in the section heads.
   Pink marks this week and the numbers to look at; every number is tabular. */

.workout .hero h1 { max-width: 22ch; }
.workout main { font-variant-numeric: tabular-nums; }

/* a small label over a number */
.now-week { font: 500 14px/1.4 var(--sans); color: var(--fg-60); }

/* ---- the wave: one bar per week, its height the reps ---- */
.wave-wrap { padding: 28px var(--pad) 26px; border-bottom: 1px solid var(--fg-12); }
.wave { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; height: 180px; list-style: none; }
.wave li { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; gap: 6px; min-width: 0; cursor: default; }
.bar { align-self: end; width: min(100%, 34px); height: var(--h); min-height: 6px; border-radius: 4px 4px 0 0; background: var(--fg-25); transition: background .2s; }
.wave li.past .bar { background: var(--fg-60); }
.wave li.cur .bar { background: var(--pink); }
.wave li.light .bar {
  background: repeating-linear-gradient(45deg, var(--fg-25) 0 3px, transparent 3px 7px);
  box-shadow: inset 0 0 0 1px var(--fg-25);
}
.wave li.light.past .bar { background: repeating-linear-gradient(45deg, var(--fg-60) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--fg-60); }
.wave li.light.cur .bar { background: repeating-linear-gradient(45deg, var(--pink) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--pink); }
.bar-v { font: 600 14px/1 var(--sans); color: var(--fg-60); }
.wave li.cur .bar-v { color: var(--fg); }
.bar-w { font: 500 12px/1 var(--sans); color: var(--fg-60); }
.wave li.cur .bar-w { color: var(--fg); font-weight: 600; }
@media (hover: hover) { .wave li:hover .bar { filter: brightness(1.12); } }
.wave-note { margin-top: 16px; max-width: 60ch; font-size: 14px; color: var(--fg-60); }

/* ---- the sessions: three cells, the goal lifts in bold ---- */
.day { cursor: default; }
.day:hover { background: none; }
.day-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.day-h b { font: 700 17px/1.3 var(--sans); }
.ex { display: grid; gap: 7px; list-style: none; counter-reset: ex; }
.ex li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--fg-80); counter-increment: ex; }
.ex li::before { content: counter(ex); flex: none; width: 1.4em; font: 500 12px/1 var(--sans); color: var(--fg-60); }
.ex-max { font-weight: 700; color: var(--fg) !important; }
.ex-c { color: var(--fg-60) !important; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--fg-25);
  font: 600 12px/1.4 var(--sans); color: var(--fg-60);
}
.tag-max { box-shadow: inset 0 0 0 1px var(--fg-12); background: var(--fg-06); color: var(--fg-80); }
.tags-note { padding: 14px var(--pad) 18px; border-bottom: 1px solid var(--fg-12); font-size: 12px; line-height: 1.8; color: var(--fg-60); }
.tags-note .tag + .tag, .tags-note .tag { margin-right: 4px; }

/* ---- the maxes: one card per lift, then the table ---- */
.lifts { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; border-bottom: 1px solid var(--fg-12); }
.lift { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 24px clamp(14px, 2vw, 22px) 22px; }
.lift-n { font: 500 14px/1.4 var(--sans); color: var(--fg-60); }
.lift-v { font-size: 34px; line-height: 1.1; font-weight: 800; }
.lift-none { color: var(--fg-60); }
.lift-s { font-size: 12px; line-height: 1.45; color: var(--fg-60); }
@media (max-width: 799px) { .lifts { grid-template-columns: repeat(2, 1fr); } .lifts .lift { padding-inline: var(--pad); } }

.table-wrap { overflow-x: auto; border-bottom: 1px solid var(--fg-12); }
.maxtab { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.maxtab th, .maxtab td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--fg-06); }
.maxtab thead th { font: 500 12px/1.4 var(--sans); color: var(--fg-60); border-bottom-color: var(--fg-12); }
.maxtab th:first-child, .maxtab td:first-child { padding-left: var(--pad); }
.maxtab tbody th { font: 600 14px/1.3 var(--sans); color: var(--fg-80); }
.maxtab td { color: var(--fg); font-weight: 600; }
.maxtab small { font-size: 12px; font-weight: 500; color: var(--fg-60); }
.maxtab .dim { color: var(--fg-60); }
.maxtab tr.empty td, .maxtab tr.empty th { opacity: .7; }
.maxtab tbody tr:last-child th, .maxtab tbody tr:last-child td { border-bottom: 0; }

/* ---- the tooltip ---- */
.tip {
  position: fixed; z-index: 40; max-width: 240px; padding: 7px 10px; border-radius: 4px; pointer-events: none;
  background: var(--fg); color: var(--bg); font: 500 12px/1.4 var(--sans); box-shadow: 0 8px 24px -10px rgba(0,0,0,.5);
}

/* site.css draws a hairline between the cells of .grid: keep it off the exercise rows */
.days-grid .ex li { border: 0 !important; }

/* ---- the goals of the week: one line per lift ---- */
.goals { display: grid; gap: 2px; margin-top: 6px; list-style: none; }
.goals li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--fg-06); font-size: 14px; color: var(--fg-80); }
.goals li:last-child { border-bottom: 0; }
.goals b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- the total ---- */
.total { display: grid; grid-template-columns: 1.4fr 1fr; border-bottom: 1px solid var(--fg-12); }
.total > div { display: grid; align-content: start; gap: 6px; padding: 28px var(--pad) 30px; }
.total-side { border-left: 1px solid var(--fg-12); }
.total-v { font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -.02em; color: var(--pink); font-variant-numeric: tabular-nums; }
.total-s { font-size: 34px; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .total { grid-template-columns: 1fr; } .total-side { border-left: 0; border-top: 1px solid var(--fg-12); } }

/* ---- the lift cards pick the chart ---- */
.lifts > li { display: flex; min-width: 0; }
.lifts > li + li { border-left: 1px solid var(--fg-12); }
.lifts .lift { width: 100%; border: 0 !important; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background .15s; }
.lifts .lift:hover { background: var(--fg-06); }
.lifts .lift.is-on { background: color-mix(in srgb, var(--pink) 9%, transparent); box-shadow: inset 0 -2px 0 var(--pink); }
.lift-g { margin-top: 6px; font: 500 12px/1.4 var(--sans); color: var(--fg-80); }
@media (max-width: 799px) {
  .lifts > li + li { border-left: 0; }
  .lifts > li { border-top: 1px solid var(--fg-12); }
  .lifts > li:nth-child(-n+2) { border-top: 0; }
  .lifts > li:nth-child(even) { border-left: 1px solid var(--fg-12); }
  .lifts > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .lifts .lift { border-top: 0 !important; }
}

/* ---- the chart: theory (dashed), actual (solid), goals (rings) ---- */
.chart-wrap { padding: 22px var(--pad) 20px; border-bottom: 1px solid var(--fg-12); }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 8px; }
.chart-head b { font-size: 17px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; font-size: 12px; color: var(--fg-80); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 22px; height: 0; }
.lg-th { border-top: 2px dashed var(--fg-60); }
.lg-ac { border-top: 2px solid var(--pink); }
.lg-gl { width: 12px !important; height: 12px !important; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--cm); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--fg-12); stroke-width: 1; }
.chart .ax { font: 500 12px var(--sans); fill: var(--fg-60); }
.chart .ax-t { fill: var(--fg-60); font-size: 12px; }
.chart .th { fill: none; stroke: var(--fg-60); stroke-width: 2; stroke-dasharray: 6 6; stroke-linecap: round; }
.chart .ac { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ac-d { fill: var(--pink); stroke: var(--bg); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .gl { fill: var(--bg); stroke: var(--cm); stroke-width: 2.5; }
.chart .gl-next { stroke-dasharray: 3 3; }
.chart .gl-t { font: 600 12px var(--sans); fill: var(--fg); }
.chart-empty { padding: 40px 0; font-size: 14px; color: var(--fg-60); }
.chart-note { margin-top: 10px; max-width: 64ch; font-size: 12px; line-height: 1.6; color: var(--fg-60); }

/* the table: the goals still to come, lighter; this week marked */
.maxtab td.goal { color: var(--fg-60); font-weight: 500; }
.maxtab tr.cur th, .maxtab tr.cur td { background: color-mix(in srgb, var(--pink) 7%, transparent); }
.maxtab tr.cur th { color: var(--fg); }

/* six lifts: two rows of three, two of two on a phone */
.lifts > li:nth-child(3n+1) { border-left: 0; }
.lifts > li:nth-child(n+4) { border-top: 1px solid var(--fg-12); }
@media (max-width: 799px) {
  .lifts > li { border-left: 0; border-top: 1px solid var(--fg-12); }
  .lifts > li:nth-child(-n+2) { border-top: 0; }
  .lifts > li:nth-child(even) { border-left: 1px solid var(--fg-12); }
}

/* the sets under each goal lift */
.ex > li { flex-wrap: wrap; }
.ex-n { display: inline-flex; align-items: center; gap: 8px; }
.ex-sets { flex-basis: 100%; margin: 2px 0 2px 1.4em; padding-left: 14px; font-size: 12px; font-weight: 500; color: var(--fg-60); }
.ex-sets li { list-style: disc; }
.ex .ex-sets li { display: list-item; counter-increment: none; font-size: 12px; color: var(--fg-60); }
.ex .ex-sets li::before { content: none; }

.chart .gl-sm { stroke-width: 2; }
.chart .ax-cur { fill: var(--fg); font-weight: 600; }
.total + .chart-wrap { border-top: 0; }

/* the table: the week stays in view while the lifts scroll */
.maxtab tbody th small { display: block; font: 500 12px var(--sans); color: var(--fg-60); }
.maxtab th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); }
.maxtab tr.cur th:first-child { background: color-mix(in srgb, var(--pink) 7%, var(--bg)); }

@media (max-width: 599px) {
  /* the total: both numbers side by side */
  .total { grid-template-columns: 1fr 1fr; }
  .total > div { padding: 22px 16px 22px var(--pad); }
  .total-side { border-left: 1px solid var(--fg-12); border-top: 0; padding-left: 16px !important; padding-right: var(--pad) !important; }
  .total-v { font-size: 34px; letter-spacing: 0; white-space: nowrap; }
  .total-s { font-size: 22px; padding-top: 8px; white-space: nowrap; }
  .total .now-week { font-size: 12px; }
  /* tighter cells */
  .lifts .lift { padding: 18px 16px 18px var(--pad); }
  .lifts > li:nth-child(even) .lift { padding-left: 16px; padding-right: var(--pad); }
  .lift-v { font-size: 22px; }
  .chart-wrap { padding-top: 18px; }
  .legend { gap: 12px; }
  .maxtab { min-width: 520px; }
  .maxtab th, .maxtab td { padding: 9px 10px; }
  .wave { height: 150px; }
  .wave-wrap { padding-top: 20px; padding-bottom: 18px; }
  .cell.day { padding-top: 22px; padding-bottom: 22px; }
}
.chart .th-d { fill: var(--bg); stroke: var(--fg-60); stroke-width: 2; }
.chart .test-l { stroke: var(--fg-25); stroke-width: 1; stroke-dasharray: 2 4; }

/* the theory points that rose: bigger, filled, a tap opens what raised them */
.chart .th-up { fill: var(--blue); stroke: var(--bg); stroke-width: 2; cursor: pointer; }
.chart .th-up.is-on { stroke: var(--fg); stroke-width: 2.5; }
.chart .th-d { cursor: pointer; }
.up-panel { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--fg-06); box-shadow: inset 0 0 0 1px var(--fg-12); }
.up-h { display: flex; align-items: center; gap: 10px; }
.up-h b { font-size: 17px; font-weight: 700; }
.up-h span { flex: 1; font-size: 14px; color: var(--fg-60); font-variant-numeric: tabular-nums; }
.up-x { width: 44px; height: 44px; margin: -12px -14px -12px 0; border: 0; border-radius: 50%; background: none; color: var(--fg-60); font-size: 20px; line-height: 1; cursor: pointer; }
.up-x:hover { background: var(--fg-06); color: var(--fg); }
.up-l { display: grid; gap: 0; margin-top: 8px; list-style: none; }
.up-l li { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 14px; padding: 8px 0; border-top: 1px solid var(--fg-12); font-size: 14px; }
.up-l b { color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.up-l small { min-width: 7.5em; text-align: right; font-size: 12px; color: var(--fg-60); font-variant-numeric: tabular-nums; }
.up-none { margin-top: 8px; font-size: 14px; color: var(--fg-60); }

/* the final goals: a dotted accent line and a filled ring */
.chart .tg { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 1 5; stroke-linecap: round; opacity: .8; }
.chart .tg-d { fill: var(--blue); stroke: var(--bg); stroke-width: 2.5; }
.lg-tg { border-top: 2px dotted var(--blue); }
.maxtab td.goal-final { color: var(--blue); font-style: normal; font-weight: 700; }
