/* ============================================================
   Lekcje (/lekcje/...) - półki, seria przedmiotu, lekcja (app/includes/tresci/lessons.php).
   Korzysta z tokenów i klas poradnika z landing.css; tryb nocny przez theme.css.
   ============================================================ */

.ls-wrap { max-width: 920px; margin: 0 auto; padding: 48px 24px 90px; flex: 1 0 auto; width: 100%; box-sizing: border-box; }
.ls-lesson { max-width: 860px; }
.ls-h1 { font-family: var(--font-head); font-size: 34px; line-height: 1.15; margin: 0 0 12px; }
.ls-shelf { font-family: var(--font-head); font-size: 20px; margin: 40px 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--paper-line); }
.ls-shelf-sub { font-size: 14px; color: var(--ink-soft); margin: 10px 0 14px; }

/* półka przedmiotów */
.ls-series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.ls-series { display: flex; flex-direction: column; gap: 6px; background: var(--surface, #fff); border: 1px solid var(--paper-line); border-top: 3px solid var(--amber); padding: 16px 18px; text-decoration: none; color: var(--ink); min-height: 112px; }
.ls-series:hover { border-color: var(--amber); }
.ls-series.is-soon { border-top-color: var(--paper-line); }
.ls-no { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.ls-series-name { font-family: var(--font-head); font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.ls-series-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: auto; }
.ls-series:not(.is-soon) .ls-series-meta { color: var(--amber-text, #85500e); font-weight: 600; }
@media (max-width: 760px) { .ls-series-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .ls-series-grid { grid-template-columns: 1fr; } .ls-series { min-height: 0; } }

/* lista lekcji w serii */
.ls-list { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ls-row { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; background: var(--surface, #fff); border: 1px solid var(--paper-line); padding: 12px; text-decoration: none; color: var(--ink); }
.ls-row:hover { border-color: var(--amber); }
.ls-row-thumb { width: 160px; height: 90px; object-fit: cover; display: block; background: var(--navy-950, #0b1420); }
.ls-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ls-row-no { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.ls-row-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.3; }
.ls-row-lead { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 640px) {
  .ls-row { grid-template-columns: 112px 1fr; gap: 12px; }
  .ls-row-thumb { width: 112px; height: 63px; }
  .ls-row-lead { display: none; }
  }

/* karty */
.ls-card { background: var(--surface, #fff); border: 1px solid var(--paper-line); padding: 22px 24px; margin-top: 16px; }
.ls-card h2 { font-family: var(--font-head); font-size: 18px; margin: 0 0 10px; }
.ls-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 14px; }
.ls-card p b { color: var(--ink); }
.ls-link { display: block; font-weight: 600; font-size: 14px; color: var(--amber-text, #85500e); text-decoration: none; padding: 6px 0; min-height: 32px; }
.ls-link:hover { text-decoration: underline; }
.ls-aside { margin-top: 10px; }
.ls-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ls-grid2 .ls-card { margin-top: 16px; }
@media (max-width: 680px) { .ls-grid2 { grid-template-columns: 1fr; gap: 0; } }

/* odtwarzacz */
.ls-player { position: relative; aspect-ratio: 16 / 9; background: var(--navy-950, #0b1420); border: 1px solid var(--navy-700, #223a54); margin-top: 22px; }
.ls-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ls-facade { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: pointer; display: block; width: 100%; }
.ls-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ls-facade:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.ls-player-note { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(11, 20, 32, .92); color: var(--paper, #e8e6dd); font-size: 14px; padding: 14px 18px; }
.ls-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; border: 1px solid var(--paper-line); border-top: 0; background: var(--surface, #fff); }
.ls-chapters li { flex: 1 1 200px; border-top: 1px solid var(--paper-line); }
.ls-chapters button { width: 100%; text-align: left; background: none; border: 0; padding: 11px 14px; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: baseline; min-height: 44px; }
.ls-chapters button:hover { background: var(--paper); }
.ls-chapters button span { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--amber-text, #85500e); font-weight: 500; min-width: 36px; }


/* punkty i tekst */
.ls-keypoints { border-left: 4px solid var(--teal); }
.ls-keypoints ul { margin: 0; padding: 0; list-style: none; }
.ls-keypoints li { position: relative; padding: 0 0 10px 22px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.ls-keypoints li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; background: var(--teal); }
.ls-transcript summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 16px; min-height: 32px; display: flex; align-items: center; }
.ls-transcript[open] summary { margin-bottom: 12px; }
.ls-transcript .guide-body { max-width: none; }

/* poprzednia / następna */
.ls-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.ls-prevnext a { display: flex; flex-direction: column; gap: 4px; background: var(--surface, #fff); border: 1px solid var(--paper-line); padding: 14px 16px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.ls-prevnext a:hover { border-color: var(--amber); }
.ls-prevnext a span { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ls-prevnext .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .ls-prevnext { grid-template-columns: 1fr; } .ls-prevnext .next { grid-column: 1; } }

[data-theme="dark"] [data-theme="dark"] [data-theme="dark"] .ls-link, [data-theme="dark"] .ls-chapters button span, [data-theme="dark"] .ls-series:not(.is-soon) .ls-series-meta { color: var(--amber); }

/* lekcje w artykule przedmiotu (poradnik/index.php) */
.ls-in-guide { margin: 26px 0 30px; border: 1px solid var(--paper-line); border-top: 3px solid var(--amber); background: var(--surface, #fff); }
.ls-in-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 16px 18px 12px; }
.ls-in-head h2 { font-family: var(--font-head); font-size: 18px; margin: 0; }
.ls-in-head span { font-size: 13px; color: var(--ink-soft); }
.ls-mini { list-style: none; margin: 0; padding: 0; }
.ls-mini li { border-top: 1px solid var(--paper-line); }
.ls-mini a { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 10px 18px; text-decoration: none; color: var(--ink); min-height: 44px; }
.ls-mini a:hover { background: var(--paper); }
.ls-mini-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1.3; }
.ls-mini-min { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 560px) {
  .ls-mini a { grid-template-columns: 72px 1fr; padding: 10px 14px; }
  .ls-mini .ls-thumb-mini { width: 72px; grid-row: span 2; }
  .ls-mini-min { grid-column: 2; }
}
.guide-card-lessons { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--amber-text, #85500e); }
.guide-card-lessons svg { width: 9px; height: 9px; }
[data-theme="dark"] .guide-card-lessons { color: var(--amber); }

/* miniatura lekcji z HTML i CSS (lessonThumbHtml) - skaluje się z szerokością (jednostki cqw) */
.ls-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden;
  background-color: #0b1420; color: #e8e6dd; border-top: 3px solid var(--amber, #d98e2b);
  background-image: linear-gradient(#15243a 1px, transparent 1px), linear-gradient(90deg, #15243a 1px, transparent 1px); background-size: 5cqw 5cqw; text-align: left; }
.ls-thumb > span { position: absolute; left: 6.5cqw; right: 22cqw; }
.ls-thumb-brand { top: 5.5cqw; font-family: var(--font-head); font-weight: 700; font-size: 2.1cqw; padding-left: 2cqw; }
.ls-thumb-brand::before { content: ''; position: absolute; left: 0; top: 50%; width: 1.2cqw; height: 1.2cqw; margin-top: -.6cqw; border-radius: 50%; background: var(--amber, #d98e2b); }
.ls-thumb-eyebrow { top: 14cqw; font-weight: 600; font-size: 2cqw; letter-spacing: .03em; text-transform: uppercase; color: var(--amber, #d98e2b); }
.ls-thumb-title { top: 19cqw; font-family: var(--font-head); font-weight: 700; font-size: 4.8cqw; line-height: 1.15; }
.ls-thumb-meta { bottom: 5.5cqw; font-size: 2cqw; color: #9fb0c1; }
.ls-thumb > .ls-thumb-play { left: auto; right: 6.5cqw; bottom: 5.5cqw; width: 10cqw; height: 10cqw; background: var(--amber, #d98e2b); color: #0b1420; display: flex; align-items: center; justify-content: center; }
.ls-thumb-play svg { width: 45%; height: 45%; }
.ls-facade:hover .ls-thumb-play { filter: brightness(1.08); }
.ls-thumb-mini { width: 96px; border-top-width: 2px; }
.ls-thumb-mini > .ls-thumb-no { left: 10px; right: auto; top: 50%; transform: translateY(-50%); font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #e8e6dd; }
.ls-thumb-mini > .ls-thumb-play { right: 8px; bottom: 8px; width: 22px; height: 22px; }

/* artykuł przypięty do przedmiotu na liście „Lekcje i artykuły” */
.ls-mini-kind { display: block; font-family: var(--font-body); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 2px; }
.ls-thumb-doc { width: 96px; aspect-ratio: 16 / 9; background: var(--paper); border: 1px solid var(--paper-line); border-top: 2px solid var(--teal, #3fa796); display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 18px; box-sizing: border-box; }
.ls-thumb-doc span { display: block; height: 3px; background: var(--paper-line); }
.ls-thumb-doc span:nth-child(2) { width: 80%; }
.ls-thumb-doc span:nth-child(3) { width: 60%; }
@media (max-width: 560px) { .ls-mini .ls-thumb-doc { width: 72px; grid-row: span 2; padding: 0 12px; } }

/* karta tematu na liście przedmiotu (topics.php): miniatura „rysunek” - linia frontu nad ziemią */
.ls-thumb-fig { width: 96px; aspect-ratio: 16 / 9; background: var(--paper); border: 1px solid var(--paper-line); border-top: 2px solid var(--amber, #d98e2b); position: relative; box-sizing: border-box; overflow: hidden; }
.ls-thumb-fig::before { content: ''; position: absolute; left: 12%; right: 10%; bottom: 22%; height: 2px; background: var(--ink-soft); }
.ls-thumb-fig span { position: absolute; left: 12%; right: 10%; top: 18%; bottom: 22%; background: linear-gradient(to bottom right, transparent calc(50% - 1.5px), #c0392b calc(50% - 1px), #c0392b calc(50% + 1px), transparent calc(50% + 1.5px)); }
@media (max-width: 560px) { .ls-mini .ls-thumb-fig { width: 72px; grid-row: span 2; } }
