/* Klemy's public exercise pages and their hubs (klemy-exercise.leaf, klemy-exercise-index.leaf). Colours, type and
   widths are chrome.css's tokens. One reading column of steps and tips, with the muscles and equipment beside it
   on a wide screen and under it on a narrow one. No script. */

/* A still is the art's own 512 px wide, so two of them side by side set the page's width. */
.kx { max-width: calc(1040px + 2 * var(--gutter)); padding-top: 32px; padding-bottom: 96px; }

.kx-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font: 400 14px/1.4 var(--font-text);
  color: var(--ink-3);
}

.kx-crumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--ink-3); }
.kx-crumbs a { color: var(--ink-2); }

.kx h1 {
  font: 800 clamp(30px, 4.4vw, 46px)/1.1 var(--font-display);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}

.kx h2 {
  font: 700 22px/1.25 var(--font-display);
  margin: 0 0 12px;
}

.kx-stills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.kx-stills figure { margin: 0; }

.kx-stills img {
  width: 100%;
  height: auto;
  aspect-ratio: 512 / 288;
  border-radius: 16px;
  border: 1px solid var(--closeup-edge);
  background: var(--surface);
}

.kx-stills figcaption {
  margin-top: 8px;
  font: 500 14px/1.3 var(--font-text);
  color: var(--ink-2);
}

.kx-layout { display: grid; gap: 32px; }

.kx-main > section + section { margin-top: 32px; }

.kx-steps, .kx-tips { margin: 0; padding-left: 1.4em; font: 400 18px/1.6 var(--font-text); }
.kx-steps li, .kx-tips li { margin-bottom: 12px; padding-left: 4px; }
.kx-steps li::marker { font-weight: 700; color: var(--orange-text); }

.kx-aside section + section { margin-top: 24px; }

.kx-aside h2 { font-size: 18px; }

.kx-muscles { list-style: none; margin: 0; padding: 0; font: 400 17px/1.4 var(--font-text); }
.kx-muscles li { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.kx-muscles li:last-child { border-bottom: 0; }
.kx-muscles small { display: block; color: var(--ink-3); font-size: 14px; font-style: italic; }

.kx-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.kx-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: 500 15px/1.2 var(--font-text);
}

.kx-links a:hover { border-color: var(--orange-text); }

.kx-cta {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.kx-cta p { font: 600 19px/1.35 var(--font-display); flex: 1 1 260px; }

.kx-similar { margin-top: 48px; }

.kx-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 24px;
}

.kx-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
  font: 500 16px/1.3 var(--font-text);
}

.kx-grid a:hover span { text-decoration: underline; text-underline-offset: 3px; }

.kx-grid img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--closeup-edge);
}

.kx-group { margin-top: 40px; }
.kx-group > h2 a { color: inherit; }

.kx-langs {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.kx-langs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font: 400 14px/1.4 var(--font-text); }
.kx-langs [aria-current] { color: var(--ink); font-weight: 700; }

@media (min-width: 860px) {
  .kx-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; align-items: start; }
  .kx-aside { position: sticky; top: 24px; }
}

@media (max-width: 559px) {
  .kx { padding-top: 24px; padding-bottom: 64px; }
  .kx-stills { grid-template-columns: 1fr; }
  .kx-steps, .kx-tips { font-size: 17px; }
  .kx-cta { padding: 20px; }
}

/* A muscle's picture before its name: the app's own muscle art cropped round, as the exercise thumbnails are.
   It is drawn on the same near-white the exercise art uses, so it reads the same in light and dark. */
.kx-muscle {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--closeup-edge);
  background: #fafafa;
}

/* A name no muscle group claims keeps the column's width without a picture. */
.kx-muscle--none { border: 0; background: none; }

.kx-title { display: flex; align-items: center; gap: 14px; }
.kx-muscle--title { width: 56px; height: 56px; }
.kx-muscle--heading { width: 36px; height: 36px; }

.kx-muscles li { display: flex; align-items: center; gap: 12px; }

.kx-links a .kx-muscle { width: 26px; height: 26px; margin: -4px 8px -4px -8px; vertical-align: middle; }
.kx-links a { display: inline-flex; align-items: center; }

@media (max-width: 559px) {
  .kx-muscle--title { width: 44px; height: 44px; }
}
