/* Lesson outline (see static/js/outline.js): outline on the left, one item at a time on the right.
   Uses the colours from site.css. */
.ol-hide { display: none !important; }
body.has-outline .page { max-width: 1280px; }
.ol-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 36px; align-items: start; }
.ol-layout.ol-closed { grid-template-columns: minmax(0, 1fr); }
.ol-main { min-width: 0; }
.ol-main .reading { max-width: 860px; margin: 0; }
.ol-layout.ol-closed .ol-main .reading { margin: 0 auto; }

/* The outline panel */
.ol-side { position: sticky; top: 96px; max-height: calc(100vh - 116px); display: flex; flex-direction: column; }
.ol-side.is-closed { position: static; max-height: none; margin-bottom: 18px; }
.ol-toggle { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 18px; font: inherit; font-size: 1rem; font-weight: 600; color: var(--text-2); cursor: pointer; margin-bottom: 12px; }
.ol-toggle:hover { color: var(--primary-text); border-color: var(--primary-line); }
.ol-toggle-closed, .ol-side.is-closed .ol-toggle-open { display: none; }
.ol-side.is-closed .ol-toggle-closed { display: inline; }
.ol-side.is-closed .ol-panel { display: none; }
.ol-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 18px; overflow-y: auto; }
.ol-back { display: block; font-size: .95rem; color: var(--muted); margin: 0 6px 8px; }
.ol-title { font-size: 1.3rem; font-weight: 700; color: var(--text); line-height: 1.3; margin: 0 6px 16px; }

.ol-goal { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; font-size: 1.05rem; color: var(--text); }
.ol-goal-bar { height: 8px; border-radius: 999px; background: var(--surface); margin-top: 10px; overflow: hidden; }
.ol-goal-bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .3s ease; }

.ol-list { list-style: none; margin: 0; padding: 0; }
.ol-item { width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; background: none; border: 0; border-radius: 12px; padding: 12px 10px; font: inherit; color: var(--text-2); cursor: pointer; }
.ol-item:hover { background: var(--surface-2); }
.ol-list li.is-current .ol-item { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.ol-tick { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); position: relative; }
.ol-list li.is-done .ol-tick { background: var(--success-text); border-color: var(--success-text); }
.ol-list li.is-done .ol-tick::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.ol-text { min-width: 0; }
.ol-name { display: block; font-size: 1.08rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.ol-meta { display: block; font-size: .95rem; color: var(--muted); margin-top: 2px; }
.ol-lessons { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); margin-top: 14px; padding: 14px 6px 0; font-size: 1rem; font-weight: 600; }

/* Bottom bar under the item */
.ol-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; }
.ol-count { color: var(--muted); font-size: 1rem; }
.ol-bar .ol-next { font-size: 1.05rem; padding: 14px 28px; }

/* Practice: "What to expect" */
.ol-expect { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 16px; padding: 24px 26px; }
.ol-expect h3 { font-size: 1.3rem; margin: 0 0 12px; }
.ol-expect ul { margin: 0 0 20px; padding-left: 22px; font-size: 1.1rem; }
.ol-expect li { margin-bottom: 8px; }

@media (max-width: 980px) {
  .ol-layout, .ol-layout.ol-closed { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ol-side, .ol-side.is-closed { position: static; max-height: none; margin-bottom: 18px; }
  .ol-panel { max-height: 60vh; }
  .ol-bar .ol-next { padding: 12px 18px; }
}

/* ---- 15 Nov: whole lesson on one scrolling page; the outline is a list of jump links ---- */
.ol-side { top: 84px; max-height: calc(100vh - 104px); }
.ol-panel { max-height: calc(100vh - 104px); }
a.ol-item { text-decoration: none; }
.ol-title { margin-bottom: 14px; }
.ol-main .toolbar.reading { align-items: flex-start; flex-wrap: nowrap; }
.ol-main .stack > .card { scroll-margin-top: 86px; }
@media (max-width: 980px) { .ol-side { display: none; } }

/* Printer icon (lesson and grammar pages) */
.print-btn { flex: none; width: 46px; height: 46px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.print-btn:hover { color: var(--primary-text); border-color: var(--primary-line); background: var(--primary-soft); }
.toolbar .print-btn, .g-article .print-btn { margin-top: 0; }
.g-article .print-btn { float: right; margin: 0 0 10px 14px; }

/* Restart lesson (bottom of the outline) */
.ol-restart { display: block; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.ol-restart:hover { color: var(--primary-text); border-color: var(--primary-line); background: var(--primary-soft); }

/* Mark as complete (under each part) and Mark lesson as complete (outline) */
.ol-markrow { display: flex; justify-content: flex-end; padding: 0 20px 16px; }
.ol-mark { font: inherit; font-size: .92rem; font-weight: 600; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.ol-mark:hover { border-color: var(--primary-line); color: var(--primary-text); background: var(--primary-soft); }
.ol-mark.is-done { background: var(--success-soft); border-color: var(--success-line); color: var(--success-text); }
.ol-complete-lesson { display: block; width: 100%; margin-top: 14px; }
.ol-lesson-done { margin-top: 14px; text-align: center; font-weight: 600; color: var(--success-text); background: var(--success-soft); border: 1px solid var(--success-line); border-radius: 8px; padding: 9px; }

/* ---- 15 Nov: Canva style for the single lesson ---- */
.ol-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.ol-panel { background: transparent; border: 0; box-shadow: none; padding: 4px 0; }
.ol-item { border-radius: 12px; padding: 10px 12px; }
.ol-list li.is-current .ol-item { background: var(--primary-soft); box-shadow: none; }
.ol-list li.is-current .ol-name { color: var(--primary-text); }
.ol-side { border-right: 1px solid var(--border); padding-right: 14px; }
.ol-main > .toolbar.reading { border-radius: 20px; padding: 34px 32px 30px; margin-bottom: 26px; align-items: center;
  background: linear-gradient(120deg, #fbd3d9 0%, #fde8e4 45%, #f6d6ea 100%); }
html[data-course="tagalog"] .ol-main > .toolbar.reading { background: linear-gradient(120deg, #b9d6e3 0%, #ddebf1 50%, #c3dbe6 100%); }
.ol-main > .toolbar.reading h1 { font-size: 2rem; font-weight: 700; }
.ol-main > .toolbar.reading .subtitle { color: var(--text-2); font-size: 1.05rem; }
.ol-main > .toolbar.reading .print-btn { background: rgba(255, 255, 255, .8); border-color: rgba(0, 0, 0, .08); }
.ol-side-head { padding: 0 12px 12px; }
.ol-side-head a { font-size: .92rem; font-weight: 600; }
.ol-side-head .ol-side-title { display: block; font-size: 1.05rem; font-weight: 700; color: var(--text); margin-top: 6px; }

/* Polish (15 Nov): smaller lesson outline */
.ol-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 26px; }
.ol-item { padding: 7px 10px; gap: 10px; }
.ol-name { font-size: .9rem; font-weight: 500; line-height: 1.3; }
.ol-meta { font-size: .78rem; margin-top: 1px; }
.ol-tick { width: 20px; height: 20px; margin-top: 0; }
.ol-list li.is-done .ol-tick::after { left: 6px; top: 2px; width: 5px; height: 10px; border-width: 0 2px 2px 0; }
.ol-side-head { padding: 0 10px 8px; }
.ol-side-head a { font-size: .85rem; }
.ol-complete-lesson { font-size: .88rem; padding: 8px 12px; }
.ol-restart { font-size: .85rem; padding: 7px 10px; margin-top: 8px; }
.ol-mark { font-size: .85rem; padding: 5px 12px; }

/* "You haven't passed the exam yet" dialog */
.ol-dialog { position: fixed; inset: 0; z-index: 100; background: rgba(40, 35, 50, .45); display: grid; place-items: center; padding: 20px; }
.ol-dialog-box { position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); text-align: center; }
.ol-dialog-box h3 { font-size: 1.25rem; margin: 0 0 8px; }
.ol-dialog-box p { color: var(--text-2); margin: 0 0 20px; }
.ol-dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ol-dialog-actions .btn { padding: 11px 22px; }
.ol-dialog-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* ---- 15 Nov (evening): a calmer outline. One white card, three groups (Start, Lesson, Finish),
   short names, a number in the circle for the lesson parts, and "x of y done" at the top. ---- */
.ol-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 28px; }
.ol-side { border-right: 0; padding-right: 0; }
.ol-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 12px 12px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.ol-panel:hover { scrollbar-color: var(--border-strong) transparent; }
.ol-panel::-webkit-scrollbar { width: 6px; }
.ol-panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.ol-panel::-webkit-scrollbar-button { display: none; }
.ol-side-head { padding: 0 8px 10px; border-bottom: 1px solid var(--border); }
.ol-side-head a { font-size: .85rem; font-weight: 600; color: var(--muted); }
.ol-side-head a:hover { color: var(--primary-text); }
.ol-progress { margin-top: 8px; }
.ol-progress-text { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ol-progress-bar { height: 6px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.ol-progress-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width .3s ease; }
.ol-list li.ol-group { padding: 11px 8px 3px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ol-item { align-items: center; gap: 10px; padding: 4px 8px; border-radius: 8px; }
.ol-name { font-size: .9rem; font-weight: 500; line-height: 1.3; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ol-item:hover .ol-name { color: var(--text); }
.ol-tick { width: 20px; height: 20px; display: grid; place-items: center; border-width: 1.5px; border-color: var(--border-strong); font-size: .72rem; font-weight: 600; line-height: 1; color: var(--muted); }
.ol-list li.is-current .ol-item { background: var(--primary-soft); }
.ol-list li.is-current .ol-name { color: var(--primary-text); font-weight: 600; }
.ol-list li.is-current .ol-tick { border-color: var(--primary); color: var(--primary-text); }
.ol-list li.is-done .ol-tick { background: var(--primary); border-color: var(--primary); font-size: 0; }
.ol-list li.is-done .ol-tick::after { left: 6px; top: 2px; width: 5px; height: 10px; border-width: 0 2px 2px 0; }
.ol-list li.is-done .ol-name { color: var(--muted); }
.ol-complete-lesson { margin-top: 12px; width: 100%; justify-content: center; font-size: .88rem; padding: 9px 12px; }
.ol-lesson-done { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-text); font-size: .88rem; }
.ol-restart { border: 0; background: none; margin-top: 4px; padding: 4px; font-size: .82rem; font-weight: 500; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.ol-restart:hover { background: none; color: var(--text); }

/* Phones and small tablets: the outline is hidden, so the lesson must use the whole width.
   (The column rules above come after the first phone rule and were winning: the lesson sat in a 264px column.) */
@media (max-width: 980px) {
  .ol-layout, .ol-layout.ol-closed { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ol-main > .toolbar.reading { padding: 22px 20px; border-radius: 16px; }
  .ol-main > .toolbar.reading h1 { font-size: 1.6rem; }
}

/* "Take the quick check" in the step list is a link now (17 Nov): centred like the button it replaced. */
a.ol-complete-lesson { text-align: center; text-decoration: none; }
