/* ==========================================================
   My Workout AI  -  CSS FOR THE WORKOUT AND EXERCISE PAGES

   Loaded only on:
       /workouts  ,  /workouts/{slug}  ,  /exercise/{slug}

   The rest of the site CSS is in public/css/style.css, and the
   colours (--brand and friends) come from :root there.
   ========================================================== */


/* ----------------------------------------------------------
   1. The body part picker strip at the top of the page
   ---------------------------------------------------------- */
.part-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-bottom: 40px;
}

.part-chip {
    --c: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.2s;
}

.part-chip:hover {
    color: var(--text);
    border-color: var(--c);
}

.part-chip.on {
    background: var(--c);
    border-color: var(--c);
    color: #fff;
}

.part-chip span {
    font-size: 11.5px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}


/* ----------------------------------------------------------
   2. Exercise cards
   ---------------------------------------------------------- */
.ex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.ex-card {
    --c: var(--brand);
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

/* a soft wash of its own colour from the corner */
.ex-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(115% 90% at 10% 0%, var(--c), transparent 60%);
    opacity: 0.09;
    transition: opacity 0.3s;
    pointer-events: none;
}

.ex-card:hover::before {
    opacity: 0.20;
}

.ex-card:hover {
    border-color: var(--c);
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}

.ex-card > * {
    position: relative;
}

.ex-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ex-card .ex-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.ex-card:hover .ex-icon {
    transform: scale(1.1) rotate(-7deg);
    border-color: var(--c);
    box-shadow: 0 10px 24px -9px var(--c);
}

.ex-card h3 {
    font-size: 21px;
    margin-bottom: 4px;
}

.ex-card .ex-muscle {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.ex-card p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
    margin: 10px 0 16px;
}

/* the bottom row - level and sets */
.ex-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.ex-foot .how {
    font-size: 12.5px;
    color: var(--muted);
}

/* the level badge, coloured by level */
.lvl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.lvl-beginner {
    background: rgba(74, 222, 128, 0.14);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.lvl-intermediate {
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.lvl-advanced {
    background: rgba(255, 92, 92, 0.14);
    color: #ff5c5c;
    border: 1px solid rgba(255, 92, 92, 0.35);
}


/* ----------------------------------------------------------
   3. Single exercise page - the top block
   ---------------------------------------------------------- */
.ex-hero {
    position: relative;
    padding: 50px 0 44px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.ex-hero::before {
    content: "";
    position: absolute;
    top: -230px;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    height: 420px;
    background: var(--c, var(--brand));
    opacity: 0.16;
    filter: blur(130px);
    border-radius: 50%;
    pointer-events: none;
}

.ex-hero .inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.ex-hero h1 {
    font-size: 52px;
    margin: 16px 0 14px;
}

.ex-hero .lead {
    color: var(--muted);
    font-size: 17px;
}

/* four quick facts - level, equipment, sets, muscles */
.ex-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 860px;
    margin: 34px auto 0;
}

.ex-facts div {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 15px;
    text-align: center;
}

.ex-facts small {
    display: block;
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}

.ex-facts b {
    font-size: 14.5px;
}


/* ----------------------------------------------------------
   4. How to do it - the numbered steps
   ---------------------------------------------------------- */
.how-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

.how-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px;
}

.how-box h3 {
    font-size: 23px;
    margin-bottom: 18px;
}

/* the step list, numbered */
.step-list {
    list-style: none;
    counter-reset: step;
}

.step-list li {
    counter-increment: step;
    position: relative;
    padding: 0 0 18px 46px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
}

/* the vertical line on the left joining the steps */
.step-list li::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 2px;
    width: 2px;
    background: var(--line);
}

.step-list li:last-child {
    padding-bottom: 0;
}

.step-list li:last-child::after {
    display: none;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: 10px;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
}

/* the mistakes list, marked with a red cross */
.miss-list {
    list-style: none;
}

.miss-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: rgba(255, 92, 92, 0.07);
    border: 1px solid rgba(255, 92, 92, 0.22);
    border-radius: 11px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.miss-list li:last-child {
    margin-bottom: 0;
}

.miss-list .x {
    color: #ff5c5c;
    font-weight: 700;
    flex: 0 0 auto;
}

/* one useful tip */
.tip-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 0 14px 14px 0;
    padding: 20px 22px;
    margin-top: 22px;
}

.tip-box .bulb {
    font-size: 22px;
}

.tip-box b {
    display: block;
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 5px;
}

.tip-box p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
}


/* ----------------------------------------------------------
   5. Mobile
   ---------------------------------------------------------- */
@media (max-width: 900px) {

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

    .ex-facts {
        grid-template-columns: 1fr 1fr;
    }

    .ex-hero h1 {
        font-size: 38px;
    }

    .how-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

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

    .ex-hero h1 {
        font-size: 31px;
    }
}


/* ==========================================================
   THE SECOND HALF OF AN EXERCISE PAGE

   Reps by level, breathing, the progression ladder and the
   questions. These pages used to be 250 words - a name, four
   steps and three mistakes - which is the thinnest content on
   the site across 64 of its URLs.
   ========================================================== */

/* these sections read better narrow, like an article */
.narrow-ex {
    max-width: 780px;
}


/* ---------- sets and reps ---------- */
.rep-table {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
}

.rep-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
}

.rep-row:last-child {
    border-bottom: 0;
}

.rep-row.head {
    background: var(--bg);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.rep-row b {
    color: var(--text);
    font-weight: 600;
}

/* the row matching what the page already recommends */
.rep-row.now {
    background: var(--brand-soft);
}

.rep-row.now span:last-child {
    color: var(--text);
    font-weight: 600;
}


/* ---------- breathing ---------- */
.breath-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

.br-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg);
    font-size: 15px;
    line-height: 1;
}

.breath-box b {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.breath-box p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--muted);
}


/* ---------- the ladder ---------- */
.ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 13px;
}

.rung {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    text-decoration: none;
    transition: border-color 0.18s, transform 0.18s;
}

a.rung:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.rung-tag {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 9px;
}

.rung b {
    display: block;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 3px;
}

.rung small {
    display: block;
    font-size: 12.5px;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: 9px;
}

.rung p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--muted);
}

/* the middle card is where you already are, so it does not link */
.rung.here {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.rung.here .rung-tag {
    color: var(--brand);
}


/* ---------- questions ---------- */
.ex-faqs {
    border-top: 1px solid var(--line);
}

.ex-faq {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.ex-faq h3 {
    font-size: 16.5px;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.4;
}

.ex-faq p {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
}


@media (max-width: 560px) {

    .rep-row {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 12px 15px;
    }

    .rep-row.head {
        display: none;
    }
}
