/* Learn page (learn.html) and the small bits it adds to MerkerProofer. Uses the tokens in styles.css. */
body.learn { overflow: auto; display: block; height: auto; min-height: 100%; }
body.learn .topbar { position: sticky; top: 0; z-index: 10; }
.ln-wrap { max-width: 1440px; margin: 0 auto; padding: 22px 24px 72px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---- the side list ---- */
.ln-side { position: sticky; top: 66px; max-height: calc(100vh - 84px); overflow: auto; padding: 4px 6px 16px 0; font-size: 14px; }
.ln-side a { display: block; color: var(--text); text-decoration: none; padding: 5px 10px; border-radius: 8px; line-height: 1.3; }
.ln-side a:hover { background: var(--panel2); }
.ln-side a[aria-current="page"] { background: var(--text); color: #fff; }
.ln-side .top { font-weight: 800; }
.ln-side h3 { font: 800 11.5px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 6px; }
.ln-side details { margin: 0; }
.ln-side summary { cursor: pointer; list-style: none; font-weight: 700; padding: 5px 10px 5px 8px; border-radius: 8px; display: flex; align-items: baseline; gap: 6px; }
.ln-side summary::-webkit-details-marker { display: none; }
.ln-side summary::before { content: "▸"; color: var(--muted); font-size: 11px; width: 10px; flex: none; }
.ln-side details[open] > summary::before { content: "▾"; }
.ln-side summary .n { margin-left: auto; }
.ln-side summary:hover { background: var(--panel2); }
.ln-side details a { padding-left: 22px; font-size: 13.5px; color: var(--muted); }
.ln-side details a[aria-current="page"] { color: #fff; }
.ln-side .lock { font-size: 11px; color: var(--accent2); font-weight: 800; margin-left: 4px; }
.ln-side .n { font-size: 12px; color: var(--muted); font-weight: 700; }
.ln-side a[aria-current="page"] .n, .ln-side a[aria-current="page"] .lock { color: #ffffffc0; }

/* ---- the main column ---- */
.ln-main { min-width: 0; }
.ln-main:focus { outline: none; }
.ln-crumb { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.ln-crumb a { color: var(--muted); }
.ln-main h1 { font: 800 32px/1.15 'Outfit', var(--ui); margin: 0 0 10px; letter-spacing: -.01em; }
.ln-main h2 { font: 800 19px/1.25 'Outfit', var(--ui); margin: 30px 0 10px; }
.ln-main p, .ln-main li { max-width: 78ch; }
.ln-lead { font-size: 17.5px; line-height: 1.55; margin: 0 0 6px; }
.ln-muted { color: var(--muted); }
.ln-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.ln-tag { font: 800 11.5px/1 var(--ui); padding: 5px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.ln-tag.free { background: #e7f2e9; color: #1d5a33; }
.ln-tag.addon { background: #fbefd3; color: var(--accent2); }
.ln-tag.you { background: #fde5df; color: #a32d16; }

/* cards */
.ln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ln-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); text-decoration: none; }
a.ln-card:hover { border-color: #b9ab8f; box-shadow: 0 2px 10px #1f235012; }
.ln-card h3 { font: 800 16.5px/1.25 'Outfit', var(--ui); margin: 0; }
.ln-card p { margin: 0; color: var(--muted); font-size: 14px; }
.ln-card .meta { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: auto; padding-top: 6px; }

/* figures */
.ln-fig { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0 18px; }
.ln-fig > p.cap { margin: 0 0 12px; font-size: 14.5px; color: var(--muted); }
.ln-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.ln-side-ex { border-radius: 10px; padding: 10px 12px 12px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.ln-side-ex.bad { border-top: 3px solid #c8391f; }
.ln-side-ex.good { border-top: 3px solid #1d6b3a; }
.ln-side-ex .hd { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; margin-bottom: 6px; flex-wrap: wrap; }
.ln-side-ex .hd b { font: 800 12px/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; }
.ln-side-ex.bad .hd b { color: #a32d16; }
.ln-side-ex.good .hd b { color: #1d6b3a; }
.ln-side-ex .lr { overflow-x: auto; }
.ln-side-ex svg { display: block; max-width: 100%; height: auto; }
.ln-side-ex .lines { font: 15px/1.6 'EB Garamond', Georgia, var(--music), serif; margin: 4px 0 0; padding: 0; list-style: none; }
.ln-origin { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* lists */
.ln-list { padding-left: 20px; }
.ln-list li { margin: 4px 0; }
.ln-sources { font-size: 14px; color: var(--muted); padding-left: 20px; }
.ln-check { list-style: none; padding: 0; margin: 0; }
.ln-check li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.ln-check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--blue); }

/* quiz */
.ln-quiz { display: flex; flex-direction: column; gap: 14px; }
.ln-q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ln-q > p { margin: 0 0 10px; font-weight: 700; }
.ln-q .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-q .opts button { font-weight: 600; }
.ln-q .opts button.right { background: #e7f2e9; border-color: #1d6b3a; color: #1d5a33; }
.ln-q .opts button.wrong { background: #fde5df; border-color: #c8391f; color: #a32d16; }
.ln-q .why { margin: 10px 0 0; font-size: 14.5px; }
.ln-q .ln-pair { margin-bottom: 10px; }

/* "see it in your music" and examples from his scores */
.ln-hits { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ln-main .ln-hits li { max-width: none; }
.ln-hit { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ln-hit .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ln-hit .top a { font-weight: 800; color: var(--text); }
.ln-hit .msg { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.ln-hit .lr { margin-top: 8px; overflow-x: auto; }
.ln-hit svg { display: block; max-width: 100%; height: auto; }
.ln-note { font-size: 14px; color: var(--muted); }

/* tendencies */
.ln-pattern { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; margin: 0 0 14px; }
.ln-pattern h3 { font: 800 17px/1.25 'Outfit', var(--ui); margin: 0; }
.ln-pattern .sum { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.ln-pattern .acts { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.ln-pattern .full { grid-column: 1 / -1; }
.ln-trend { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.ln-trend span { width: 14px; background: #c9d3f5; border-radius: 3px 3px 0 0; min-height: 2px; }
.ln-trend span.last { background: var(--blue); }
.ln-trendrow { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.ln-dir { font-weight: 800; }
.ln-dir.rising { color: #a32d16; }
.ln-dir.falling { color: #1d6b3a; }
.ln-exs { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-exs a { font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--panel2); color: var(--text); text-decoration: none; }
.ln-exs a:hover { background: #e6dcc6; }
.ln-settings { margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.ln-settings summary { cursor: pointer; font-weight: 800; }
.ln-settings .row { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 12px 0; }
.ln-settings label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ln-settings input[type=number] { width: 110px; font: 600 14px var(--ui); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.ln-empty { background: var(--panel); border: 1px dashed #c9b994; border-radius: 14px; padding: 22px; color: var(--muted); }
.ln-empty b { color: var(--text); }

/* locked add-ons: a clear preview, not a nag */
.ln-locked { background: linear-gradient(180deg, #fffdf8, #fbf5e8); border: 1px solid #e3d3ad; border-radius: 14px; padding: 18px; margin: 14px 0; }
.ln-locked h3 { font: 800 16px/1.3 'Outfit', var(--ui); margin: 0 0 6px; }
.ln-locked ol { margin: 8px 0 12px; padding-left: 20px; color: var(--text); }
.ln-locked .buy { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ln-locked .price { font-weight: 800; color: var(--accent2); font-size: 14px; }
.ln-ai { background: #f5f7fe; border: 1px solid #cdd7f5; border-radius: 14px; padding: 16px; margin: 12px 0; }
.ln-ai p { margin: 0 0 10px; }
.ln-ai .by { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.ln-err { color: var(--accent); font-weight: 700; }
.ln-unlock { font-size: 13.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ln-unlock .ok { color: #1d6b3a; }

dialog.ln-dlg { border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; max-width: 480px; width: calc(100% - 32px); background: var(--panel); color: var(--text); }
dialog.ln-dlg::backdrop { background: #1f235055; }
dialog.ln-dlg h2 { margin: 0 0 8px; font: 800 19px 'Outfit', var(--ui); }
dialog.ln-dlg input { width: 100%; font: 14px ui-monospace, Consolas, monospace; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
dialog.ln-dlg .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
dialog.ln-dlg .msg { min-height: 20px; font-size: 14px; color: var(--accent); margin: 0; }

/* MerkerProofer: "Why is this a rule?" */
.mk-why { font: 700 12.5px/1.2 var(--ui); color: var(--blue); text-decoration: none; white-space: nowrap; margin-left: auto; padding: 2px 4px; border-radius: 6px; }
.mk-why:hover { text-decoration: underline; }
.mk-chead .mk-why { margin-left: 8px; }

/* the lessons menu button (phones and narrow windows only) */
.ln-sidebtn { display: none; }
@media (max-width: 900px) {
  .ln-wrap { grid-template-columns: 1fr; padding: 10px 16px 60px; gap: 10px; }
  /* the menu folds behind a button so the lesson comes first; it opens as a panel over the page */
  .ln-sidebtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 800 15px var(--ui); justify-self: start; }
  .ln-side { display: none; position: fixed; inset: 0 0 0 auto; width: min(340px, 88vw); max-height: none; z-index: 60; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -10px 0 30px #1f235030; padding: 16px 12px 40px; overflow: auto; }
  body.ln-side-open .ln-side { display: block; }
  body.ln-side-open::after { content: ""; position: fixed; inset: 0; background: #1f235040; z-index: 55; }
  body.cr-focus .ln-sidebtn { display: none; }
  .ln-side a, .ln-side summary { min-height: 40px; display: flex; align-items: center; }
  .ln-main h1 { font-size: 26px; }
  .ln-pattern { grid-template-columns: 1fr; }
  .ln-pattern .acts { justify-content: flex-start; }
}
