/* MLO shared styles: unit-page
   The course book unit page, drawn by /unit-page.js (rebuilt 2026-11-09
   from Santo's chosen Grok mock-up). Needs design-system/styles.css and
   design-system/layout.css first. One edit here changes every unit. */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { padding: 0 var(--gutter, 24px) var(--s-7); position: relative; min-height: 100vh; }
.container { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; }

/* ── Bar: logo · breadcrumb · Back ─────────────────────────── */
.u-bar { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-4) 0; }
.u-logo img { height: clamp(48px, 4vw, 60px); width: auto; display: block; }
.u-crumbs { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-small); font-weight: 700; color: var(--text-dim); }
.u-crumbs a { color: var(--cream); text-decoration: none; }
.u-crumbs a:hover { color: var(--gold); }
.u-crumbs .sep { opacity: 0.5; }
.u-bar > .mlo-btn { margin-left: auto; }

/* ── Title ─────────────────────────────────────────────────── */
.u-head { margin: var(--s-4) 0 var(--s-5); }
.u-title { font-size: var(--t-h1); font-weight: 800; line-height: 1.05; color: var(--cream); }
.u-desc { font-size: var(--t-body); line-height: 1.45; color: var(--cream); opacity: 0.85; margin-top: var(--s-3); max-width: 980px; }
.u-desc em { font-style: normal; }
.u-head.has-med { display: flex; align-items: center; gap: var(--s-5); }
.u-head-text { min-width: 0; }
.medallion { min-width: 112px; min-height: 112px; padding: 10px 18px; border-radius: 28px; text-align: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent, var(--gold)) 0%, var(--accent-dark, #c89c1c) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: clamp(34px, 4.5vw, 50px); color: #fff; line-height: 1;
  box-shadow: 0 14px 30px rgba(var(--accent-rgb, 244,200,66), 0.35), inset 0 -6px 0 rgba(0,0,0,0.15); }
.medallion small { font-size: 15px; font-weight: 700; opacity: 0.9; margin-top: 6px; }
.medallion.talks { cursor: pointer; transition: transform 0.15s ease; }
.medallion.talks:hover { transform: scale(1.04) rotate(-2deg); }
@media (max-width: 640px) { .u-head.has-med { flex-direction: column; align-items: flex-start; gap: var(--s-3); } .medallion { min-width: 88px; min-height: 88px; } }

/* ── Lesson tabs ───────────────────────────────────────────── */
.u-tabs { display: flex; border-bottom: 1.5px solid rgba(254,246,228,0.12); margin-bottom: var(--s-5); overflow-x: auto; scrollbar-width: none; }
.u-tabs::-webkit-scrollbar { display: none; }
.u-tab { flex: 1 0 0; min-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 2px;
         padding: var(--s-3) var(--s-3) var(--s-3); margin-bottom: -1.5px; border-bottom: 4px solid transparent;
         color: var(--cream); text-decoration: none; text-align: center; opacity: 0.8; }
.u-tab:hover { opacity: 1; }
.u-tab-n { font-size: var(--t-h3); font-weight: 800; line-height: 1.2; }
.u-tab-t { font-size: var(--t-small); font-weight: 700; color: var(--text-dim); }
.u-tab[aria-current="page"] { opacity: 1; border-bottom-color: var(--gold); }
.u-tab[aria-current="page"] .u-tab-n { color: var(--gold); }
.u-tab[aria-current="page"] .u-tab-t { color: var(--cream); }

/* ── Goal box ──────────────────────────────────────────────── */
.u-goal { display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap;
          border: 1.5px solid var(--gold); border-radius: var(--corner-card);
          padding: var(--s-4) var(--s-5); margin-bottom: var(--s-6); }
.u-goal-k { font-size: var(--t-small); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.u-goal-t { flex: 1; min-width: 240px; font-size: var(--t-body); font-weight: 700; color: var(--cream); }
.u-goal-m { font-size: var(--t-small); font-weight: 700; color: var(--text-dim); white-space: nowrap; }

/* ── Sections: side by side on one 4-column grid ─────────── */
.u-secs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--s-4); row-gap: var(--s-5); }
.u-sec { grid-column: span var(--k, 4); min-width: 0; display: flex; flex-direction: column; }
.u-sec-h { font-size: var(--t-h3); font-weight: 800; color: var(--cream); margin-bottom: var(--s-3); }
.u-sec-note { font-size: var(--t-small); font-weight: 700; color: var(--text-dim); margin-left: var(--s-2); }
.u-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--k, 4), minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--s-4); }

.u-card { position: relative; display: flex; align-items: center; gap: var(--s-4); min-height: 120px;
          padding: var(--s-5) 44px var(--s-5) var(--s-5);
          background: linear-gradient(180deg, rgba(74,45,140,0.62), rgba(58,34,116,0.55));
          border: 1px solid rgba(254,246,228,0.08); border-radius: var(--corner-card);
          box-shadow: var(--elev-rest); color: var(--cream); text-decoration: none;
          transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.u-card:hover { transform: translateY(-3px); box-shadow: var(--elev-hover); border-color: rgba(244,200,66,0.45); }
.u-badge { width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center;
           border: 2px solid var(--gold); border-radius: 16px; color: var(--gold); }
.u-ico { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.u-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.u-name { font-size: var(--t-h3); font-weight: 800; line-height: 1.2; }
.u-meta { font-size: var(--t-small); line-height: 1.35; color: var(--cream); opacity: 0.8; }

/* Done ring: progress.js adds .is-done when the student has finished it. */
.act-check { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%;
             border: 2px solid rgba(254,246,228,0.55); }
.u-card.is-done .act-check { background: var(--gold); border-color: var(--gold); }
.u-card.is-done .act-check::after { content: ''; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px;
             border: solid var(--night-deep); border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* ── Bottom: previous lesson · Next lesson ─────────────────── */
.u-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-top: var(--s-6); }

.footer { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid rgba(254,246,228,0.1);
          text-align: center; font-size: var(--t-small); color: var(--text-dim); }

/* ── Smaller screens ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .u-secs { grid-template-columns: 1fr; }
  .u-sec { grid-column: 1 / -1; }
  .u-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .u-bar { flex-wrap: wrap; gap: var(--s-3); }
  .u-crumbs { order: 3; flex-basis: 100%; }
  .u-grid { grid-template-columns: 1fr; }
  .u-card { min-height: 0; }
  .u-tab { min-width: 130px; }
  .u-nav .mlo-btn { padding: 0 20px; }
}

/* ── Real-World English: the class plan ─────────────────────── */
.u-h2 { font-size: var(--t-h2); font-weight: 800; color: var(--cream); margin: var(--s-6) 0 var(--s-4); }
.u-h3 { font-size: var(--t-h3); font-weight: 800; color: var(--cream); margin-bottom: var(--s-3); }
.u-goal-ex { display: block; margin-top: 4px; font-weight: 700; color: var(--gold); }

.u-prep { border: 1px solid rgba(254,246,228,0.14); border-radius: var(--corner-card); padding: var(--s-5); background: rgba(15,10,46,0.35); }
.u-prep ul { margin-left: var(--s-5); display: grid; gap: var(--s-2); font-size: var(--t-body); line-height: 1.45; }
.u-prep a { color: var(--cream); text-decoration: underline; text-decoration-color: rgba(244,200,66,0.6); text-underline-offset: 3px; }
.u-prep a:hover { color: var(--gold); }

.u-steps { list-style: none; display: flex; flex-direction: column; gap: var(--s-4); }
.u-step { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-5); padding: var(--s-5);
          background: linear-gradient(180deg, rgba(74,45,140,0.62), rgba(58,34,116,0.55));
          border: 1px solid rgba(254,246,228,0.08); border-radius: var(--corner-card); box-shadow: var(--elev-rest); }
.u-step-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.u-step-n { width: 56px; height: 56px; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 16px;
            color: var(--gold); font-size: 26px; font-weight: 800; }
.u-step-min { font-size: var(--t-small); font-weight: 800; color: var(--cream); margin-top: 4px; }
.u-step-clock { font-size: var(--t-small); color: var(--text-dim); }
.u-step-body { min-width: 0; }
.u-step-top { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-3); }
.u-step-name { font-size: var(--t-h3); font-weight: 800; line-height: 1.2; color: var(--cream); }
.u-open { gap: 8px; }
.u-open .u-ico { width: 20px; height: 20px; }
.u-away { font-size: var(--t-small); font-weight: 700; color: var(--text-dim); border: 1.5px dashed rgba(254,246,228,0.3);
          border-radius: var(--corner-pill); padding: 6px 16px; }
.u-step-do { margin-left: var(--s-5); display: grid; gap: 6px; font-size: var(--t-body); line-height: 1.5; color: var(--cream); }
.u-step-do q { color: var(--gold); font-style: normal; font-weight: 700; quotes: '"' '"'; }
.u-step-do b { color: var(--cream); }
.u-step-two { margin-top: var(--s-3); font-size: var(--t-small); line-height: 1.45; color: var(--text-dim); }
.u-step-note { margin-top: var(--s-3); font-size: var(--t-small); color: var(--text-dim); }
@media (max-width: 640px) {
  .u-step { grid-template-columns: 1fr; gap: var(--s-3); }
  .u-step-side { flex-direction: row; gap: var(--s-3); }
  .u-step-min { margin-top: 0; }
}
