/* Wave 5 shared readability and control-size fixes.
   Loaded after the template CSS. rem for type, px-free targets via rem. */

main p,
main li,
main td,
main dd,
.prose-custom p,
.prose-custom li {
  font-size: 1.125rem;
  line-height: 1.7;
  text-wrap: pretty;
}

main h1,
main h2,
main h3 {
  text-wrap: balance;
  line-height: 1.25;
}

main p,
.prose-custom p {
  max-width: 68ch;
}

pre,
main pre,
.prose-custom pre {
  overflow-x: auto;
  max-inline-size: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

main code,
.prose-custom code,
pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  max-inline-size: 100%;
}

.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

img,
.prose-img-slot {
  max-width: 100%;
  height: auto;
}

/* Sky-500 (#0ea5e9) on the fitness navy fails WCAG AA. Use a light sky that clears 4.5:1. */
body[data-theme="fitness"] :where(
  a.text-brand-600,
  a.text-brand-800,
  .prose-custom a,
  main a
) {
  color: #e0f2fe;
}

body[data-theme="fitness"] :where(
  a.text-brand-600,
  a.text-brand-800,
  .prose-custom a,
  main a
):hover {
  color: #ffffff;
}

/* Filled controls keep their own foreground. */
body[data-theme="fitness"] :where(
  a.cookie-consent__btn,
  button,
  .v2-group-btn,
  .v2-hamburger
) {
  color: inherit;
}

@media (pointer: coarse), (max-width: 800px) {
  :where(button, .v2-hamburger, .v2-mobile-close, .cookie-consent__btn, .v2-group-btn, .wave5-planner button, .wave5-planner select, .wave5-planner input) {
    min-block-size: 2.75rem;
    min-inline-size: 2.75rem;
  }

  footer a {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    padding-block: 0.35rem;
  }
}

.cookie-consent {
  z-index: 80;
}

.wave5-planner {
  margin: 2rem 0 2.5rem;
  padding: 1.15rem 1.2rem 1.3rem;
  max-width: 68ch;
  border: 1px solid color-mix(in srgb, var(--t-accent, #7dd3fc) 40%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--t-bg-card, #1e293b) 90%, black);
}

.wave5-planner h2 {
  margin-top: 0;
}

.wave5-planner label {
  display: block;
  margin: 0.85rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
}

.wave5-planner select,
.wave5-planner input {
  font: inherit;
  font-size: 1rem;
  min-block-size: 2.75rem;
  width: min(100%, 24rem);
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--t-text-primary, #f0f9ff) 35%, transparent);
  background: #0f172a;
  color: #f0f9ff;
}

.wave5-planner pre {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  line-height: 1.55;
  background: #020617;
  color: #e0f2fe;
  border-radius: 0.6rem;
}

.wave5-planner button {
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  min-block-size: 2.75rem;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 0.55rem;
  background: #e0f2fe;
  color: #0f172a;
  cursor: pointer;
}

.wave5-planner .wave5-note {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  color: #bae6fd;
}


/* Table legibility for the dark fitness theme (T-0179 preview only until approved). */
[data-theme=fitness] .prose-custom table,
[data-theme=fitness] .prose-custom .table-wrap table,
[data-theme=fitness] .table-board table {
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 500;
  color: #f3f4f6;
}
[data-theme=fitness] .prose-custom th,
[data-theme=fitness] .prose-custom .table-wrap th,
[data-theme=fitness] .table-board th {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff7ed;
  background: #1c1917;
  border-color: #44403c;
}
[data-theme=fitness] .prose-custom td,
[data-theme=fitness] .prose-custom .table-wrap td,
[data-theme=fitness] .table-board td {
  font-size: 1.0625rem;
  font-weight: 500;
  color: #f3f4f6;
  border-color: #44403c;
}
[data-theme=fitness] .prose-custom tbody tr:nth-child(odd) td,
[data-theme=fitness] .table-board tbody tr:nth-child(odd) td {
  background: #171717;
  color: #f3f4f6;
}
[data-theme=fitness] .prose-custom tbody tr:nth-child(even) td,
[data-theme=fitness] .table-board tbody tr:nth-child(even) td {
  background: #2a2a2a;
  color: #f3f4f6;
}
[data-theme=fitness] .prose-custom tbody tr:hover td,
[data-theme=fitness] .table-board tbody tr:hover td {
  background: #3f3f46;
  color: #fff7ed;
}
[data-theme=fitness] .prose-custom .table-wrap,
[data-theme=fitness] .table-board,
[data-theme=fitness] .table-wrap.table-wide {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
[data-theme=fitness] .prose-custom .table-wrap.table-stack td:before {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fb923c;
}
[data-theme=fitness] .prose-custom .table-wrap.table-stack td:first-child {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff7ed;
}
[data-theme=fitness] .prose-custom .table-wrap.table-stack tbody tr {
  background: #171717;
  color: #f3f4f6;
  border: 1px solid #44403c;
}
[data-theme=fitness] .prose-custom .table-wrap.table-stack tbody tr:nth-child(even) {
  background: #2a2a2a;
}
