.workouts-page {
  background:
    linear-gradient(180deg, rgba(8, 13, 21, .76), rgba(8, 13, 21, 1) 38%),
    radial-gradient(900px 520px at 86% 10%, rgba(107, 199, 255, .18), transparent 60%),
    var(--bg);
}

.workouts-hero {
  min-height: 72vh;
  display: grid;
  align-items: end;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(760px 420px at 72% 24%, rgba(246, 200, 78, .16), transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, .16), rgba(8, 13, 21, .95)),
    linear-gradient(90deg, rgba(8, 13, 21, .92), rgba(8, 13, 21, .42) 58%, rgba(8, 13, 21, .72)),
    url('../assets/images/workouts/workout-templates-hero-bg.png') center / cover no-repeat;
}

.workouts-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(180deg, transparent, var(--bg));
  z-index: 0;
  pointer-events: none;
}

.workouts-hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 96px;
  padding-bottom: 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workouts-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(40px, 7vw, 82px);
  line-height: .96;
  color: #fff;
}

.hero-copy {
  max-width: 680px;
  margin: 18px 0 0;
  color: #e6eeff;
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.workout-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 34px;
}

.workout-stats div {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(8, 13, 21, .62);
  padding: 14px;
  backdrop-filter: blur(8px);
}

.workout-stats strong {
  display: block;
  color: var(--gold);
  font-size: 30px;
  line-height: 1;
}

.workout-stats span {
  display: block;
  margin-top: 6px;
  color: #dbe7ff;
  font-size: 13px;
}

.intro-grid,
.path-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 36px;
  align-items: start;
}

.intro-grid h2,
.path-grid h2,
.cta-panel h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.05;
}

.intro-grid .title-gradient {
  color: #f6c84e;
  background: linear-gradient(135deg, #ffe58f 0%, #f6c84e 46%, #c88a24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0;
  letter-spacing: -.035em;
  text-shadow: 0 10px 28px rgba(0, 0, 0, .38);
}

.intro-grid p:last-child {
  margin: 0;
  color: #dbe7ff;
  font-size: 18px;
  line-height: 1.55;
}

.workout-projects {
  padding-top: 18px;
}

.compact-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.compact-heading h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(8, 13, 21, .18), rgba(8, 13, 21, .93)),
    radial-gradient(360px 240px at 86% 0%, rgba(246, 200, 78, .2), transparent 64%),
    rgba(13, 21, 38, .96);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .36);
  padding: 24px;
  isolation: isolate;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .34;
  background:
    linear-gradient(135deg, rgba(246, 200, 78, .16), transparent 42%),
    radial-gradient(240px 180px at 80% 20%, rgba(107, 199, 255, .18), transparent 68%);
}

.project-card-summer::before {
  background:
    linear-gradient(135deg, rgba(246, 200, 78, .22), transparent 46%),
    radial-gradient(260px 180px at 84% 18%, rgba(255, 135, 51, .22), transparent 64%);
}

.project-card-glutes::before {
  background:
    linear-gradient(135deg, rgba(246, 200, 78, .2), transparent 48%),
    radial-gradient(260px 180px at 82% 18%, rgba(255, 105, 180, .16), transparent 64%);
}

.project-card-dad::before {
  background:
    linear-gradient(135deg, rgba(107, 199, 255, .18), transparent 46%),
    radial-gradient(260px 180px at 84% 18%, rgba(246, 200, 78, .2), transparent 64%);
}

.project-duration {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(246, 200, 78, .58);
  border-radius: 999px;
  background: rgba(246, 200, 78, .12);
  color: #ffe8a3;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 16px 0 8px;
  color: #fff4c7;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.project-card p {
  margin: 0 0 18px;
  color: #dbe7ff;
  line-height: 1.55;
}

.project-card button {
  border: 1px solid rgba(246, 200, 78, .72);
  border-radius: 999px;
  background: rgba(246, 200, 78, .12);
  color: #ffe8a3;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.project-card button:hover,
.project-card button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(246, 200, 78, .95);
  background: rgba(246, 200, 78, .2);
}

.workout-filter-band {
  position: sticky;
  top: 92px;
  z-index: 30;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(8, 13, 21, .92);
  backdrop-filter: blur(14px);
}

.filter-shell {
  display: grid;
  grid-template-columns: minmax(230px, .78fr) minmax(0, 1.38fr) minmax(0, 1.1fr) minmax(180px, .66fr);
  gap: 18px;
  align-items: end;
  padding-top: 16px;
  padding-bottom: 16px;
}

.search-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.search-wrap label,
.filter-group span {
  color: #d7e2f8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: #fff;
  padding: 10px 12px;
  font-size: 15px;
}

.filter-group {
  display: flex;
  align-items: end;
  align-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.filter-group[aria-label="Project filter"],
.filter-group[aria-label="Goal filter"] {
  grid-column: 2;
}

.filter-group[aria-label="Project filter"] {
  grid-row: 1;
}

.filter-group[aria-label="Goal filter"] {
  grid-row: 2;
}

.filter-group[aria-label="Level filter"] {
  grid-column: 3;
  grid-row: 1;
}

.filter-group[aria-label="Training place filter"] {
  grid-column: 3;
  grid-row: 2;
}

.filter-group button {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #edf4ff;
  min-height: 38px;
  padding: 8px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.filter-group button:hover,
.filter-group button.active {
  border-color: rgba(246, 200, 78, .8);
  background: rgba(246, 200, 78, .15);
  color: #ffe8a3;
}

.result-count {
  margin: 0;
  color: #dbe7ff;
  font-size: 14px;
  white-space: nowrap;
}

.filter-results {
  display: grid;
  justify-items: end;
  gap: 5px;
  grid-column: 4;
  grid-row: 1 / span 2;
  align-self: center;
}

.clear-filters {
  border: 0;
  background: transparent;
  color: #f6c84e;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.clear-filters:hover,
.clear-filters:focus-visible {
  color: #ffe8a3;
}

.workout-grid-section {
  padding-top: 44px;
}

.workout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.workout-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 28, 47, .96), rgba(13, 21, 38, .98)),
    linear-gradient(120deg, rgba(246, 200, 78, .08), rgba(107, 199, 255, .05));
  box-shadow: 0 22px 54px rgba(0, 0, 0, .34);
  padding: 18px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: opacity .35s ease, transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.workout-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .12), transparent 34%),
    radial-gradient(340px 180px at 85% 0%, rgba(246, 200, 78, .13), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.workout-card:hover,
.workout-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(246, 200, 78, .45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .46);
}

.workout-card:hover::before,
.workout-card:focus-within::before {
  opacity: 1;
}

.workout-js .workout-card {
  opacity: 0;
  transform: translateY(18px);
}

.workout-js .workout-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.workout-js .workout-card.is-visible:hover,
.workout-js .workout-card.is-visible:focus-within {
  transform: translateY(-6px);
}

.workout-card[hidden] {
  display: none;
}

.workout-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #d6e0f5;
  font-size: 13px;
}

.project-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  margin-top: 14px;
  border: 1px solid rgba(246, 200, 78, .42);
  border-radius: 999px;
  background: rgba(246, 200, 78, .1);
  color: #ffe8a3;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
}

.level {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.level-beginner { background: rgba(56, 242, 165, .16); color: #98ffd2; }
.level-intermediate { background: rgba(107, 199, 255, .16); color: #b7e8ff; }
.level-advanced { background: rgba(255, 159, 45, .18); color: #ffd39b; }

.workout-card h3 {
  margin: 16px 0 8px;
  font-size: 25px;
  line-height: 1.12;
}

.workout-card p {
  margin: 0;
  color: #e0e8fb;
}

.quick-facts {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
  color: #cfdaf1;
  font-size: 14px;
}

.quick-facts li {
  border-left: 3px solid rgba(246, 200, 78, .65);
  padding-left: 10px;
}

.workout-card details {
  margin-top: auto;
}

.workout-card summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(246, 200, 78, .45);
  background: linear-gradient(135deg, rgba(246, 200, 78, .18), rgba(255, 159, 45, .12));
  color: #ffe8a3;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.workout-card summary::-webkit-details-marker {
  display: none;
}

.workout-card summary:hover {
  transform: translateY(-1px);
  border-color: rgba(246, 200, 78, .85);
  background: rgba(246, 200, 78, .22);
}

.workout-detail {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding-top: 14px;
}

.workout-detail h4 {
  margin: 10px 0 0;
  color: #fff;
  font-size: 15px;
}

.workout-detail h4:first-child {
  margin-top: 0;
}

.workout-detail p {
  color: #dbe7ff;
  font-size: 14px;
}

.workout-plan {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.workout-plan-note {
  border-left: 3px solid rgba(246, 200, 78, .75);
  background: rgba(246, 200, 78, .08);
  padding: 10px 12px;
}

.session-block {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  padding: 12px;
}

.session-block h5 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
}

.session-meta {
  margin: 4px 0 10px;
  color: #b9c6df;
  font-size: 13px;
}

.exercise-table-wrap {
  overflow-x: auto;
}

.exercise-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}

.exercise-table th,
.exercise-table td {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.exercise-table th {
  color: #ffe8a3;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.exercise-table td {
  color: #e5edff;
}

.exercise-table tr:last-child td {
  border-bottom: 0;
}

.workout-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
}

.workout-modal[hidden] {
  display: none;
}

.workout-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 14, .82);
  backdrop-filter: blur(14px);
}

.workout-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(246, 200, 78, .32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 26, 45, .98), rgba(8, 13, 21, .99)),
    radial-gradient(680px 320px at 90% 0%, rgba(246, 200, 78, .16), transparent 64%);
  box-shadow: 0 30px 110px rgba(0, 0, 0, .62);
  animation: workoutModalIn .24s ease both;
}

.workout-modal-header,
.workout-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  padding: 18px clamp(18px, 3vw, 28px);
}

.workout-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 0;
  flex-wrap: wrap;
}

.workout-modal-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workout-modal-title {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1.02;
}

.workout-modal-summary {
  margin: 8px 0 0;
  color: #dbe7ff;
}

.workout-modal-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.workout-modal-body {
  overflow-y: auto;
  padding: clamp(18px, 3vw, 28px);
}

.workout-modal-body .workout-detail {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.workout-modal-body .workout-plan {
  gap: 18px;
}

.workout-modal-body .session-block {
  background: rgba(255, 255, 255, .045);
}

.workout-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.workout-modal-meta span {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #eaf1ff;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

@keyframes workoutModalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media print {
  body.workouts-page > *:not(.workout-modal),
  .workout-modal-backdrop,
  .workout-modal-header .workout-modal-close,
  .workout-modal-footer {
    display: none !important;
  }

  .workout-modal,
  .workout-modal-panel,
  .workout-modal-body {
    position: static;
    display: block;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    background: #fff;
    color: #111;
    box-shadow: none;
  }

  .workout-modal-header {
    border: 0;
    padding: 0 0 18px;
  }

  .workout-modal-title,
  .workout-modal-summary,
  .workout-modal-body,
  .workout-modal-body h3,
  .workout-modal-body h4,
  .workout-modal-body p,
  .workout-modal-body li,
  .workout-modal-meta span {
    color: #111 !important;
  }

  .workout-modal-meta span,
  .workout-plan,
  .session-block {
    border-color: #bbb !important;
    background: transparent !important;
  }
}

.no-results {
  border: 1px solid rgba(246, 200, 78, .35);
  border-radius: 8px;
  background: rgba(246, 200, 78, .08);
  color: #ffe8a3;
  padding: 18px;
}

.workout-paths {
  background:
    linear-gradient(90deg, rgba(107, 199, 255, .09), transparent 58%),
    rgba(255, 255, 255, .025);
}

.path-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.path-list a {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #f2f6ff;
  padding: 16px;
  font-weight: 900;
}

.path-list a:hover {
  border-color: rgba(246, 200, 78, .75);
  color: #ffe8a3;
}

.workout-cta {
  padding-top: 44px;
}

.cta-panel {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 200, 78, .18), rgba(107, 199, 255, .08)),
    rgba(12, 19, 33, .92);
  padding: clamp(24px, 5vw, 54px);
}

.cta-panel p {
  max-width: 760px;
  color: #e2ebff;
  font-size: 18px;
}

@media (max-width: 1180px) {
  .filter-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .filter-group[aria-label="Project filter"],
  .filter-group[aria-label="Goal filter"],
  .filter-group[aria-label="Level filter"],
  .filter-group[aria-label="Training place filter"],
  .filter-results {
    grid-column: auto;
    grid-row: auto;
  }

  .filter-group {
    overflow-x: visible;
    padding-bottom: 2px;
  }

  .filter-results {
    justify-items: start;
  }

  .result-count {
    white-space: normal;
  }
}

@media (min-width: 1024px) {
  .workout-filter-band {
    top: 102px;
  }
}

@media (max-width: 980px) {
  .workout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .intro-grid,
  .path-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workouts-hero {
    min-height: 78vh;
  }

  .workout-filter-band {
    position: static;
    top: auto;
    background: rgba(8, 13, 21, .98);
    overflow: hidden;
  }

  .intro-grid .title-gradient {
    font-size: clamp(32px, 13vw, 48px);
    letter-spacing: -.045em;
  }

  .workout-stats,
  .workout-grid,
  .project-grid,
  .path-list {
    grid-template-columns: 1fr;
  }

  .filter-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .filter-shell > * {
    max-width: 100%;
    min-width: 0;
  }

  .search-wrap input {
    font-size: 16px;
    min-height: 42px;
    border-radius: 12px;
  }

  .search-wrap label,
  .filter-group span {
    font-size: 11px;
    letter-spacing: .04em;
  }

  .filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    align-items: stretch;
  }

  .filter-group span {
    grid-column: 1 / -1;
    flex-basis: 100%;
    min-width: 0;
  }

  .filter-group button {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    border-radius: 10px;
    padding-inline: 10px;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filter-results {
    justify-items: stretch;
    gap: 3px;
  }

  .result-count,
  .clear-filters {
    font-size: 12px;
  }

  .workouts-page .whatsapp-float {
    right: 10px;
    bottom: 10px;
    width: 48px;
    height: 48px;
    max-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .workouts-page .whatsapp-float::after {
    content: "WA";
    font-size: 13px;
    line-height: 1;
  }
}
