:root {
  color-scheme: light;
  --background: #f3f5ef;
  --paper: #fff;
  --ink: #141c16;
  --muted: #4a574e;
  --line: #d4dbd2;
  --green: #234837;
  --dark: #182b22;
  --lime: #dcf6a6;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--background); }
body { margin: 0; color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
a:focus-visible, summary:focus-visible {
  outline: 3px solid #557944;
  outline-offset: 4px;
}
[hidden] { display: none !important; }

.shell {
  width: min(76rem, calc(100% - 4rem));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 2;
  inset: 1rem auto auto 1rem;
  padding: .65rem 1rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.hero {
  color: var(--paper);
  background: var(--dark);
  border-bottom: 5px solid #86a454;
}

.hero-content {
  min-height: 15rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2.5rem 2.75rem;
}

.equipment, .weekday, .group {
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.equipment { color: var(--lime); }

h1 {
  margin-block: .4rem .75rem;
  font-size: clamp(2.25rem, 6.2vw, 5.5rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.06em;
}

.edition { color: #e0e9db; max-width: 48rem; }

.download {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  flex-shrink: 0;
  padding: .625rem 1rem;
  border-radius: .375rem;
  background: var(--lime);
  color: var(--dark);
  font-weight: 750;
}

.download:hover { background: #ecffc5; }
.download:focus-visible { outline-color: var(--lime); }

.training-layout {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.75rem);
  padding-block: 2.75rem 3rem;
  align-items: start;
}

.week-nav { position: sticky; top: 1.5rem; }
.week-nav h2 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: .75rem;
  padding-inline: .65rem;
}

.week-nav ol, .exercise-grid { padding: 0; margin: 0; list-style: none; }
.week-nav a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  margin-block: .25rem;
  padding: .55rem .7rem;
  border-radius: .3rem;
  text-decoration: none;
  font-weight: 650;
  color: var(--ink);
}

.week-nav a:hover { background: #e5ecdf; }
.week-nav a[aria-current="true"] { background: var(--green); color: var(--paper); }
.workout-day + .workout-day { margin-top: 3.5rem; }
.workout-day[hidden] + .workout-day { margin-top: 0; }

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.weekday { color: var(--green); margin-bottom: .25rem; }
.day-header h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.12;
}

.duration {
  flex-shrink: 0;
  padding: .25rem .65rem;
  border-radius: .25rem;
  background-color: #e1eadc;
  color: var(--green);
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.day-note { max-width: 66ch; margin-block: .85rem 1.1rem; color: var(--muted); }
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin-bottom: 1.15rem;
}

.exercise {
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  align-items: center;
  min-height: 10.5rem;
  padding: .7rem .85rem .7rem .55rem;
  gap: .9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .4rem;
  break-inside: avoid;
}

.exercise-photo {
  display: grid;
  place-items: center;
  block-size: 9rem;
  overflow: hidden;
}

.exercise-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.dose {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .55rem;
  margin-bottom: .42rem;
  font-size: .875rem;
  font-weight: 650;
  color: var(--muted);
}

.time { color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
.group { color: var(--green); font-size: .78rem; margin-bottom: .2rem; }
.exercise h3 { font-size: 1.06rem; font-weight: 800; line-height: 1.22; overflow-wrap: anywhere; }
.cue { color: var(--muted); font-size: .9rem; margin-top: .42rem; }
.site-footer { padding-block: 0 2.5rem; }
.credits { border-top: 1px solid var(--line); color: var(--muted); padding-top: 1rem; }
.credits summary { cursor: pointer; width: fit-content; font-weight: 650; }
.credits p, .credits ul { margin-block: .5rem 0; }

.photo-link {
  border-radius: .25rem;
  cursor: zoom-in;
}

.photo-link:focus-visible {
  outline-offset: 0;
}

.day-short { display: none; }

.photo-dialog {
  box-sizing: border-box;
  width: min(64rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  color: var(--ink);
  background: var(--paper);
}

.photo-dialog::backdrop { background: #101a15d9; }
body:has(.photo-dialog[open]) { overflow: hidden; }
.photo-viewer { padding: clamp(.75rem, 3.5vw, 1.5rem); }

.photo-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.photo-viewer-header h2 { font-size: 1.25rem; line-height: 1.2; }

.photo-viewer-header button {
  min-height: 2.75rem;
  padding-inline: .75rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: #e1eadc;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.photo-viewer-header button:focus-visible {
  outline: 3px solid #557944;
  outline-offset: 2px;
}

.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 77dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
}

@media (max-width: 68rem) {
  .shell { width: min(65rem, calc(100% - 3rem)); }
  .training-layout { grid-template-columns: 9rem minmax(0, 1fr); }
  .exercise { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: .65rem; }
}

@media (max-width: 57rem) {
  .training-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .week-nav { position: static; }
  .week-nav h2 { padding-inline: 0; }
  .week-nav ol { display: flex; gap: .35rem; flex-wrap: wrap; }
  .week-nav a { border: 1px solid var(--line); margin: 0; }
  .week-nav a[aria-current="true"] { border-color: var(--green); }
}

@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .hero-content { display: grid; align-items: start; gap: 1.25rem; min-height: 0; padding-block: 1.7rem; }
  .download { justify-self: start; }
  .training-layout { display: block; padding-block: .8rem 2rem; }
  .week-nav {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 -1rem 1.3rem;
    padding: .5rem 1rem .6rem;
    background: var(--background);
    border-bottom: 1px solid var(--line);
  }
  .week-nav h2 { margin-bottom: .35rem; font-size: .875rem; }
  .week-nav ol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; }
  .week-nav a { justify-content: center; min-height: 2.75rem; padding: .35rem 0; font-size: .875rem; }
  .day-name { display: none; }
  .day-short { display: inline; }
  .workout-day { scroll-margin-top: 6rem; }
  main { scroll-margin-top: 6rem; }
  .exercise-grid { grid-template-columns: 1fr; }
  .exercise { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); min-height: 9rem; gap: .65rem; }
  .exercise-photo { block-size: 8rem; }
  .group { font-size: .875rem; }
  .cue { font-size: .95rem; }
}

@media (max-width: 24rem) {
  .week-nav ol { gap: .1rem; }
  .week-nav a { font-size: .825rem; }
  .day-header { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .exercise { grid-template-columns: 1fr; grid-template-areas: "details" "photo"; padding: .8rem; }
  .exercise-details { grid-area: details; }
  .exercise-photo { grid-area: photo; block-size: clamp(8.5rem, 44vw, 11.5rem); }
}

@media print {
  :root { --background: #fff; --paper: #fff; --ink: #000; --muted: #222; --green: #111; }
  .shell { width: 100%; }
  .hero { background: none; color: #000; border-color: #777; }
  .hero-content { display: block; min-height: 0; padding: 0 0 1rem; }
  .hero-content h1 { font-size: 2rem; }
  .equipment, .edition { color: #222; }
  .skip-link, .download, .week-nav, .photo-dialog { display: none; }
  .training-layout { display: block; padding: 1rem 0 0; }
  .workout-day[hidden] { display: block !important; }
  .workout-day + .workout-day { break-before: page; margin-top: 0; }
  .day-header { break-after: avoid; }
  .exercise-grid { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .exercise { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); min-height: 6rem; padding: .4rem; }
  .exercise-photo { block-size: 5rem; }
  .photo-link { text-decoration: none; }
  .duration { background: none; border: 1px solid #aaa; }
  .site-footer { padding-bottom: 0; }
  .credits > * { display: block; }
}
