/* ============================================================
   WHY KNOT YARN — lessons.css
   ------------------------------------------------------------
   LESSONS TAB ONLY (lessons.html). Load after base.css.
   Covers: achievement progress bar + stepper, hook sizes table
   (purple section) + hook type cards, yarn type cards, stitch
   name/abbreviation key grid, how-to-join-yarn steps + video,
   and the choosing-yarn question cards.
   ============================================================ */

  /* ---------- Achievement progress bar ---------- */
  .progress-summary{ margin-bottom: 36px; }
  .progress-bar-track{
    height: 8px;
    background: var(--paper-deep);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line);
  }
  .progress-bar-fill{
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--pink), var(--berry));
    border-radius: 999px;
    transition: width 0.3s ease;
  }
  .progress-summary-text{
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
  }
  .progress-label{ font-size: 14px; color: var(--ink-soft); }
  .progress-badge{
    font-size: 12px;
    color: var(--sage);
    border: 1px solid var(--sage);
    border-radius: 3px;
    padding: 3px 9px;
  }

  .ach-category{
    font-family: "Fraunces", serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--berry);
    margin: 0 0 14px;
  }
  .ach-divider{ margin: 32px 0; }
  .ach-hint{
    font-size: 13px;
    color: var(--ink-soft);
    margin: -8px 0 22px;
  }
  .ach-hint a{ color: var(--berry); }
  #patternAchievementStepper .ach-dot{ cursor: default; }


  /* ---------- Achievement stepper ---------- */
  .achievement-stepper{
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .ach-step{
    display: flex;
    gap: 18px;
    align-items: flex-start;
    position: relative;
    padding-bottom: 26px;
  }
  .ach-step::before{
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 1px;
    background: var(--line);
  }
  .ach-step:last-child::before{ display: none; }
  .ach-step.done::before{ background: var(--gold); }

  .ach-dot{
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
  }
  .ach-dot .ach-num{
    font-family: "Fraunces", serif;
    font-size: 13px;
    color: var(--ink-soft);
  }
  .ach-dot .ach-check{ display: none; }
  .ach-step.done .ach-dot{ background: linear-gradient(135deg, var(--gold), var(--pink)); border-color: var(--gold); }
  .ach-step.done .ach-dot .ach-num{ display: none; }
  .ach-step.done .ach-dot .ach-check{ display: block; }

  .ach-body h3{ font-size: 15.5px; font-weight: 500; }
  .ach-body p{ font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 0; }
  .ach-step.done .ach-body h3{ color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line-strong); }


  /* ---------- Hook sizes (purple) ---------- */
  .section-purple .section-head h2{ color: var(--purple-deep); }

  .hook-table-wrap{
    margin-top: 36px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(165deg, var(--purple-soft), #F2EDE1 85%);
    position: relative;
  }
  .hook-table-wrap::before{
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--purple), var(--berry) 60%, var(--gold));
  }
  .hook-size-table{
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 760px;
  }
  .hook-size-table th,
  .hook-size-table td{
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }
  .hook-size-table thead th{
    font-family: "Fraunces", serif;
    font-weight: 500;
    color: var(--purple-deep);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
  }
  .hook-size-table tbody tr:last-child td{ border-bottom: none; }
  .hook-size-table tbody tr:hover{ background: rgba(255,255,255,0.5); }
  .hook-size-table td.hook-glyph-cell,
  .hook-size-table th.hook-glyph-cell{
    width: 70px;
    padding-left: 20px;
    padding-right: 4px;
  }
  .hook-glyph{ display: block; color: var(--purple); }
  .hook-icon-img{
    display: block;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(43,38,32,0.25));
  }
  .hook-size-table td.hook-mm{
    font-family: "Fraunces", serif;
    color: var(--purple);
    font-size: 16px;
    white-space: nowrap;
  }
  .hook-size-table td:nth-child(3){ color: var(--ink); }
  .hook-size-table td:nth-child(4),
  .hook-size-table td:nth-child(5){ color: var(--ink-soft); }

  .hook-types{ margin-top: 52px; max-width: 900px; }
  .hook-types h3{
    font-family: "Fraunces", serif;
    font-weight: 500;
    font-size: 20px;
    color: var(--purple-deep);
  }
  .hook-types > p{ color: var(--ink-soft); margin: 8px 0 18px; }
  .hook-types-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .hook-type-card{
    background: var(--paper-deep);
    border-radius: 12px;
    border-top: 3px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 22px 20px 18px;
  }
  .hook-type-card:nth-child(1){ border-top-color: #7A3563; }
  .hook-type-card:nth-child(2){ border-top-color: #C6922F; }
  .hook-type-card:nth-child(3){ border-top-color: #8F8C7E; }
  .hook-type-card:nth-child(4){ border-top-color: #6E4E9E; }
  .hook-type-card:nth-child(5){ border-top-color: #C97A9B; }
  .hook-type-card:nth-child(6){ border-top-color: #4E3675; }
  .hook-type-art{ margin-bottom: 16px; }
  .hook-type-art svg{ display: block; width: 100%; height: 44px; }
  .hook-type-card strong{
    color: var(--ink);
    font-weight: 500;
    font-size: 14.5px;
  }
  .hook-type-card p{
    font-size: 13px;
    color: var(--ink-soft);
    margin: 6px 0 0;
  }
  @media (max-width: 860px){ .hook-types-grid{ grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 480px){ .hook-types-grid{ grid-template-columns: 1fr; } }


  /* ---------- Yarn types — cards ---------- */
  .yarn-card-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  @media (max-width: 980px){ .yarn-card-grid{ grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 520px){ .yarn-card-grid{ grid-template-columns: 1fr; } }
  .yarn-card{
    background: var(--paper);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
  }
  .yarn-num{
    font-family: "Fraunces", serif;
    font-style: italic;
    font-size: 26px;
    color: var(--berry);
  }
  .yarn-card h3{ font-size: 16px; font-weight: 500; margin-top: 4px; }
  .yarn-hook{ display:block; font-size: 12px; color: var(--purple); margin-top: 6px; font-weight: 500; }
  .yarn-card p{ font-size: 13.5px; color: var(--ink-soft); margin: 10px 0 0; flex-grow: 1; }
  .yarn-makes{ display:block; font-size: 12.5px; color: var(--ink-soft); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .yarn-makes strong{ color: var(--ink); font-weight: 500; }


  /* ---------- Stitch key grid ---------- */
  .stitch-key-grid{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  @media (max-width: 860px){ .stitch-key-grid{ grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 480px){ .stitch-key-grid{ grid-template-columns: 1fr; } }
  .stitch-key-card{
    background: var(--paper);
    padding: 22px 20px 24px;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .stitch-key-card:hover,
  .stitch-key-card:focus-visible{
    background: var(--paper-deep);
    transform: translateY(-2px);
  }
  .key-symbol{
    width: 34px; height: 34px;
    display: block;
    margin-bottom: 10px;
  }
  .stitch-key-card .abbr{
    font-family: "Fraunces", serif;
    font-style: italic;
    font-size: 22px;
    color: var(--berry);
    display: block;
  }
  .stitch-key-card h3{ font-size: 15px; font-weight: 500; margin-top: 4px; }
  .stitch-key-card p{ font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; }
  .learn-tip{
    display: block;
    font-size: 12px;
    color: var(--sage);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .watch-tip{
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--berry);
    margin-top: 10px;
  }


  /* ---------- Joining yarn: steps + video ---------- */
  .join-layout{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }
  @media (max-width: 900px){ .join-layout{ grid-template-columns: 1fr; gap: 32px; } }
  .join-steps{
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: joinstep;
  }
  .join-steps li{
    counter-increment: joinstep;
    position: relative;
    padding: 0 0 22px 44px;
    margin-bottom: 4px;
  }
  .join-steps li::before{
    content: counter(joinstep);
    position: absolute;
    left: 0; top: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--berry));
    color: var(--paper);
    font-family: "Fraunces", serif;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .join-steps li:not(:last-child)::after{
    content: "";
    position: absolute;
    left: 15px; top: 30px;
    width: 1px; height: calc(100% - 24px);
    background: var(--line);
  }
  .join-steps h3{ font-size: 15.5px; font-weight: 500; }
  .join-steps p{ font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 0; }
  .video-embed{ position: sticky; top: 92px; }
  @media (max-width: 900px){ .video-embed{ position: static; } }
  .video-frame{
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--ink);
  }
  .video-frame img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .video-play{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    transition: background 0.15s ease;
  }
  .video-play svg{ width: 68px; height: 48px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); transition: transform 0.15s ease; }
  .video-frame:hover .video-play{ background: rgba(0,0,0,0.05); }
  .video-frame:hover .video-play svg{ transform: scale(1.08); }
  .video-caption{ font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }


  /* ---------- Choosing yarn ---------- */
  .choose-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  @media (max-width: 860px){ .choose-grid{ grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 560px){ .choose-grid{ grid-template-columns: 1fr; } }
  .choose-card{
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 20px;
    position: relative;
  }
  .choose-card::before{
    content: "";
    position: absolute;
    left: 0; top: 20px; bottom: 20px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--purple), var(--pink));
  }
  .choose-card h3{ font-size: 15.5px; font-weight: 500; }
  .choose-card p{ font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 0; }
