/* SpecPoint — course page (lessons in teaching order) */

.course { padding: 28px 0 72px; }
.course .wrap { max-width: 980px; }
.course-head { display: grid; gap: 14px; margin-bottom: 30px; }
.course-head h1 { font-size: clamp(2.1rem, 7vw, 3.2rem); }
.course-count { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--leaf-strong); }

.course-unit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.cu-head { display: grid; gap: 4px; margin-bottom: 12px; }
.cu-head h2 { font-size: 1.4rem; }

.topic { border-top: 1px solid var(--line-soft); padding: 14px 0 4px; }
.topic:first-of-type { border-top: 0; }
.topic-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.topic-top h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; letter-spacing: 0; }
.topic-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--leaf-strong); background: var(--leaf-tint); border-radius: 5px; padding: 2px 6px; margin-right: 4px; white-space: nowrap; }
.topic-note { font-size: 0.9rem; color: var(--ink-3); margin-top: 6px; }

.lessons { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.lr { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px 10px; align-items: center; background: #f3faf6; border: 1px solid #cfe5da; border-radius: 10px; padding: 10px 12px; }
.lr-check { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--leaf); color: #fff; font-size: 0.75rem; font-weight: 700; }
.lr-num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-2); }
.lr-title a { color: var(--ink); font-weight: 600; text-decoration: none; }
.lr-title a:hover { text-decoration: underline; }
.lr-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.lr-link { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--leaf); color: #fff; text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.lr-link:hover { background: var(--leaf-strong); color: #fff; }
.lr-link--self { background: #fff; color: var(--leaf-strong); border: 1.5px solid var(--leaf); }
.lr-link--self:hover { background: var(--leaf-tint); color: var(--leaf-strong); }
.lr-soon { display: inline-flex; align-items: center; min-height: 36px; font-size: 0.86rem; color: var(--ink-3); }

@media (min-width: 720px) {
  .course { padding: 40px 0 96px; }
  .course-unit { padding: 24px 28px; }
  .lr { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .lr-links { grid-column: auto; }
}
.topic-extras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lr--soon { background: var(--paper-2, #f4f1ea); border-color: var(--line); }
.lr-check--soon { background: transparent; border: 1.5px dashed var(--ink-3); }
.lr--soon .lr-title { color: var(--ink-2); font-weight: 500; }
.lr-spec { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); font-weight: 400; }

/* Units and topics fold: the whole header row is the toggle, with a chevron on the right */
.course-unit > summary, .topic > summary { list-style: none; cursor: pointer; }
.course-unit > summary::-webkit-details-marker, .topic > summary::-webkit-details-marker { display: none; }
.cu-head { display: flex; align-items: center; gap: 12px; }
.cu-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.course-unit:not([open]) > .cu-head { margin-bottom: 0; }
.topic { padding: 12px 0; }
.topic-top { align-items: center; }
.topic-top h3 { flex: 1; }
.fold { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--leaf-tint); }
.fold::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--leaf-strong); border-bottom: 2px solid var(--leaf-strong); transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
details[open] > summary > .fold::before { transform: translateY(2px) rotate(-135deg); }
.course-unit > summary:hover .fold, .topic > summary:hover .fold { background: #d9ede3; }
.course-unit > summary:focus-visible, .topic > summary:focus-visible { outline: 3px solid var(--hl); outline-offset: 4px; border-radius: 8px; }

/* What a free account opens (Robbe, 4 Nov 2026): a badge on every topic, a lock on every locked row, one line at
   the top of the page (tools/free_access.py). js/site.js swaps the badges for "Open to you" and takes the locks
   away for a visitor whose plan opens everything. */
.sp-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lock-ico { display: inline-block; flex: none; width: 14px; height: 14px; }
.tag--free { background: var(--hl-soft); color: var(--ink); box-shadow: inset 0 0 0 1px #e5cc5c; }
.tag--part { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px #e5cc5c; }
.tag--plan { background: var(--paper-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tag--plan .lock-ico { width: 12px; height: 12px; }
.tag--open { background: var(--leaf); color: #fff; }

/* Topic headers: on a phone the title has its own line and the badges sit under it, with the chevron on the right */
.topic-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; }
.topic-top h3 { grid-column: 1; }
.topic-top .fold { grid-column: 2; grid-row: 1 / span 2; }
.topic-tags { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; }

.lr--locked { background: var(--card); border-color: var(--line); }
.lr--locked .lr-check { background: var(--ink-3); }
.lr-lock { display: inline-flex; vertical-align: -1px; margin-left: 7px; color: var(--ink-3); }
.lr-link .lr-lock { margin-left: 6px; color: currentColor; vertical-align: 0; }

.course-access { display: flex; gap: 10px; align-items: flex-start; max-width: 70ch; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }
.course-access > .lock-ico { margin-top: 4px; color: var(--ink-3); }
.course-access-links { display: inline-flex; flex-wrap: wrap; gap: 2px 16px; }
.course-access-links a { font-weight: 600; }
.course-access--open { border-color: #cfe5da; background: #f3faf6; }

/* "This course includes:" at the top of a course page (tools/free_access.py includes_box; Robbe, 4 Nov 2026, 22:50
   CET: tick lists, not paragraphs). js/site.js adds course-access--open and hides the sign-up and plans buttons. */
.course-includes { display: grid; gap: 10px; max-width: 760px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.course-includes [hidden] { display: none !important; }
.course-includes-h { font-weight: 600; }
.course-includes-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.lp-end-ticks { display: grid; gap: 8px; }
.lp-end-ticks[hidden] { display: none; }

@media (min-width: 720px) {
  .topic-top { display: flex; }
  .topic-tags { flex: none; justify-content: flex-end; }
  .course-includes { padding: 18px 22px; }
  .course-includes .ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
