/* =========================================================
   IDIOTOON — GYM EXERCISES (FULL CLEAN CSS)
   Includes:
   - Page header
   - Exercises listing page (groups, grid, cards)
   - Single exercise page (layout + level badge)
   - Markdown rendering (h1/h2/h3, blockquotes, lists, hr)
   ========================================================= */


/* ---------- Page header (kept) ---------- */
.page-header {
  max-width: 1100px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

.close-btn:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}


/* =========================================================
   LISTING PAGE: /gym-exercises
   ========================================================= */

/* Intro text above level cards */
.gym-level-filter > .who {
  margin: 0 0 24px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.65;
  font-weight: 500;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

/* Weekly plan link inside intro */
.gym-level-filter > .who .plan-link {
  color: var(--color-secondary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  opacity: 0.95;
}

.gym-level-filter > .who .plan-link:hover {
  opacity: 1;
  color: cyan;
}


.page-content.gym-exercises {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2cm 5rem;
}

/* CATEGORY GROUP WRAPPER */
.exercise-group {
  margin-bottom: 3rem;
  padding: 1.5rem 1.75rem 2rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
}

/* CATEGORY TITLE LABEL */
.exercise-group h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0.3rem 1rem;
  display: inline-block;
  border-radius: 12px;

  background-image: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* tiny accent dot */
.exercise-group h2::after {
  content:"";
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--color-accent);
  opacity: .6;
}

/* GRID */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

/* CARDS */
.exercise-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
  
}



/* CARD TEXT */
.exercise-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.exercise-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.4rem;
}


/* =========================================================
   SINGLE EXERCISE PAGE + LEVEL UI + MARKDOWN (FULL FINAL)
   ========================================================= */

/* =========================================================
   SINGLE EXERCISE PAGE: /gym-exercises/{slug}
   ========================================================= */

.page-content.exercise-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2cm 5rem;
}

.exercise-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.exercise-text {
  flex: 1.2;
  min-width: 0;
}

.exercise-media img {
  width: 360px;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: contain;
}

.exercise-media:empty {
  display: none;
}

/* =========================================================
   LEVEL INDICATOR STRIP (used on listing cards)
   ========================================================= */

.level-indicator {
  display: block;
  width: 48px;
  margin-top: 6px;
  border-radius: 3px;
  opacity: 0.95;
}

.level-green {
  height: 3px;
  background: repeating-linear-gradient(
    45deg,
    #3ddc97,
    #3ddc97 6px,
    rgba(61,220,151,0.25) 6px,
    rgba(61,220,151,0.25) 12px
  );
}

.level-yellow {
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    #ffd166,
    #ffd166 6px,
    rgba(255,209,102,0.45) 6px,
    rgba(255,209,102,0.45) 12px
  );
}

.level-red {
  height: 9px;
  background: repeating-linear-gradient(
    45deg,
    #ef476f,
    #ef476f 6px,
    rgba(239,71,111,0.6) 6px,
    rgba(239,71,111,0.6) 12px
  );
}

/* =========================================================
   LEVEL BADGE (shown inside exercise page by PHP)
   ========================================================= */

.exercise-level {
  display: inline-block;
  margin-bottom: 34px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 600;
  border-radius: 999px;
  opacity: 0.95;
  
}

.exercise-level.level-green {
  background: rgba(61, 220, 151, 0.15);
  color: #3ddc97;
}
.exercise-level.level-yellow {
  background: rgba(255, 209, 102, 0.15);
  color: #ffd166;
}
.exercise-level.level-red {
  background: rgba(239, 71, 111, 0.15);
  color: #ef476f;
}


/* =========================================================
   SINGLE EXERCISE: Compact Instructions
   ========================================================= */

.exercise-cat {
  margin: 0 0 0.75rem;
  opacity: 0.9;
}


.exercise-focus {
  margin: 0 0 1.25rem;
  opacity: 0.9;
}

/* Collapsible “How to train” */
.exercise-how {
  margin: 0 0 2rem;
  opacity: 0.75;
}

.exercise-how summary {
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.exercise-how ol {
  margin: 0.25rem 0 0 1.25rem;
}


/* =========================================================
   GYM LEVEL FILTER CARDS (top of gym-exercises page)
   ========================================================= */

.gym-level-filter {
  margin-bottom: 48px;
}

.level-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.level-card {
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 20px 22px;
  color: #eafcff;
  text-decoration: none;
}

.level-card h3 {
  margin: 0;
  font-size: 19px;
}

.level-card .who {
  font-size: 13px;
  opacity: 0.65;
  margin: 4px 0 12px;
}

.level-card .how {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.75;
  margin: 6px 0 12px;
}

.level-card ul {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
}

.level-card li {
  margin-bottom: 6px;
  opacity: 0.85;
}

.level-card .meta {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

/* Color accents */
.level-card.green  { border-left: 4px solid #4ade80; }
.level-card.yellow { border-left: 4px solid #facc15; }
.level-card.red    { border-left: 4px solid #f87171; }

/* All exercises (secondary) */
.level-all {
  text-align: center;
  margin-top: 26px;
}

.level-all .all-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #eafcff;
  text-decoration: none;
  font-size: 14px;
}

.level-all p {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.6;
}

/* =========================================================
   MARKDOWN — THE ONLY MARKDOWN STYLING (NO DUPLICATES)
   Requires wrapper: <div class="md md-yellow">...</div>
   ========================================================= */

.md {
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Headings */
.md h1 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 0.6rem 0 0.9rem;
}

.md h2:first-of-type {
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 0.6rem 0 1.2rem;
  font-weight: 700;

  /* 🔑 MATCH OLD H1 */
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


.md h2:first-of-type::after {
  width: 48px;
  height: 3px;
  opacity: 1;
}



.md h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.8;
}

.md h3 {
  display: inline-block;
  margin: 1.6rem 0 0.6rem;
  padding: 8px 14px;
  font-size: 1.05rem;
  font-weight: 600;
  background: rgba(255,255,255,.06);
  border-left: 4px solid var(--color-accent);
  border-radius: 12px;
}

/* Paragraphs */
.md p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.9;
}

/* Connectors / focus words */
.md strong {
  font-weight: 800;
  color: #a78bfa;
}

/* RULE / NOTE */
.md blockquote {
  margin: 1.5rem 0;
  padding: 0.95rem 1.15rem;
  border-left: 4px solid #38bdf8; /* cyan */
  background: rgba(56,189,248,.12);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  opacity: 0.95;
}


/* Reps list */
.md-reps {
  list-style: none;
  counter-reset: reps;
  margin: 1rem 0 2rem;
  padding: 0;
}

.md-reps li {
  counter-increment: reps;
  position: relative;
  padding: 0.65rem 0.9rem 0.65rem 42px;
  margin-bottom: 0.45rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 0.92rem;
  line-height: 1.45;
}

.md-reps li::before {
  content: counter(reps);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #000;
  font-weight: 700;
  display: grid;
  place-items: center;
}
/* Bullet list (vocab/support) */
.md-list {
  margin: 0.8rem 0 1.6rem 1.2rem;
  padding: 0;
  list-style: disc;
  opacity: 0.9;
}

.md-list li {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Divider */
.md hr {
  border: none;
  height: 1px;
  margin: 2.5rem 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.25),
    transparent
  );
}

/* Level accents */
.md-green  { --color-accent: #22c55e; }
.md-yellow { --color-accent: #facc15; }
.md-red    { --color-accent: #ef4444; }

/* Links — scoped (no global a override) */
.md a,
.level-card a,
.level-all a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: box-shadow 0.15s ease;
}

.md a:hover,
.md a:focus,
.level-card:hover,
.level-all .all-btn:hover {
  box-shadow: 0 0 0 1.5px rgba(127, 90, 240, 0.45);
}


.exercise-layout { width: 100%; min-width: 0; }



/*------------------------*/

.gym-intro{
  max-width:720px;
  margin:0 auto 28px auto;
  text-align:center;
  font-size:0.95rem;
  color:rgba(255,255,255,0.75);
  line-height:1.6;
}


/* ------------------------
   Popular exercises block
------------------------ */

.popular-exercises{
  max-width: 760px;
  margin: 34px auto 46px;
  text-align: center;
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(255,255,255,0.020);
  border: 1px solid rgba(255,255,255,0.04);
}

.popular-exercises h2{
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popular-exercises ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.popular-exercises li{
  margin: 8px 0;
}

.popular-exercises a{
  position: relative;
  display: inline-block;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 500;
  padding: 3px 2px;
  transition: color 0.22s ease, transform 0.22s ease, opacity 0.22s ease;
}

.popular-exercises a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
  transition: width 0.22s ease;
  opacity: 0.95;
}

.popular-exercises a:hover,
.popular-exercises a:focus{
  color: #fff;
  opacity: 1;
  transform: translateY(-1px);
}

.popular-exercises a:hover::after,
.popular-exercises a:focus::after{
  width: 100%;
}



.gym-watch-link{
  max-width: 720px;
  margin: 34px auto 0;
  text-align: center;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.74);
  line-height: 1.6;
}

.gym-watch-link a{
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 90, 240, 0.35);
  transition: color .22s ease, border-color .22s ease;
}

.gym-watch-link a:hover{
  color: #fff;
  border-color: var(--color-secondary);
}

.gym-proof {
  max-width: 760px;
  margin: 0.9rem auto 1.6rem;
  padding: 0.9rem 1.1rem;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

