/* The Learnings page (16/11/2026). Desktop: one table, the column titles once, the answer to "Has it come back?" in a
   green or red box (mock-up A2). Phone: one card per learning, its status line visible while folded, the rest on a tap
   (mock-up tel-etat_2). Mock-ups: docs/apprentissages-20261116/maquettes/. */

.lr-main { max-width: 1360px; }
.lr-body .topbar__inner { max-width: 1360px; }
/* opaque, as on the versions page (16/11): the cards must not show through while scrolling */
.lr-body .topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.lr-topbar { justify-content: flex-start; }
.lr-backlink {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 14.5px; font-weight: 600; text-decoration: none; color: var(--action);
  padding: 8px 4px; min-height: 44px;
}
.lr-backlink:hover { color: var(--action-hover); }
.lr-backlink--head { display: none; }

.lr-head { padding: 10px 0 18px; }
.lr-title { font-size: 30px; line-height: 1.15; font-weight: 750; letter-spacing: -0.02em; }
.lr-lead { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; max-width: 900px; }
.lr-meta { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.lr-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lr-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14.5px; font-weight: 550; color: var(--ink-2);
}
.lr-chip__n { font-size: 12.5px; font-weight: 650; color: var(--muted); background: var(--line-2); border-radius: 999px; padding: 1px 7px; }
.lr-chip[aria-pressed="true"] { background: var(--action-soft); border-color: var(--action); color: var(--action); }
.lr-chip[aria-pressed="true"] .lr-chip__n { background: var(--surface); color: var(--action); }

/* the table */
.lr-cols {
  display: grid; grid-template-columns: 34% 23% 22% 21%;
  padding: 0 14px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.lr-cols span { padding: 0 12px; }
.lr-cols span:first-child { padding-left: 46px; }
#lr-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.lr-row {
  display: grid; grid-template-columns: 34% 23% 22% 21%; align-items: start;
  padding: 16px 14px; border-top: 1px solid var(--line-2); scroll-margin-top: 70px;
}
.lr-row:first-child { border-top: 0; }
.lr-cell { padding: 0 12px; min-width: 0; }
.lr-label { display: none; }

.lr-learning { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.lr-num {
  grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--action-soft); color: var(--action);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 650;
}
.lr-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lr-tag { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font-weight: 550; }
.lr-text { margin-top: 8px; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.lr-toggle { display: none; }

.lr-applied p { font-size: 14.5px; color: var(--ink-2); }
.lr-applied p + p { margin-top: 8px; }
.lr-applied b { color: var(--ink); font-weight: 650; }

.lr-quote { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }
.lr-quote + .lr-quote { margin-top: 8px; }
.lr-quote__who { font-weight: 650; color: var(--ink); }
.lr-quote__text { margin-top: 3px; font-style: italic; color: var(--ink-2); overflow-wrap: anywhere; }
.lr-quote__context { margin-top: 4px; font-size: 13px; color: var(--muted); }
.lr-quote__page { display: inline-block; margin-top: 4px; font-size: 13px; }
.lr-more {
  margin-top: 8px; padding: 6px 0; border: 0; background: none; color: var(--action);
  font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; min-height: 32px;
}
.lr-earlier { margin-top: 8px; }
.lr-none { font-size: 14px; color: var(--muted); }

.lr-back { border-radius: var(--radius-sm); padding: 12px 12px 12px 40px; position: relative; font-size: 14px; color: var(--ink-2); margin: 0 12px; }
.lr-back__icon { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.lr-back--good { background: var(--ok-soft); }
.lr-back--good .lr-back__icon { background: var(--ok); }
.lr-back--bad { background: var(--danger-soft); }
.lr-back--bad .lr-back__icon { background: var(--danger); }
.lr-back--new { background: var(--surface-2); border: 1px solid var(--line); }
.lr-back--new .lr-back__icon { background: var(--faint); }
.lr-back__head { color: var(--ink); }
.lr-back__head b { font-weight: 700; }
.lr-back__q { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lr-back--bad .lr-back__head b { color: var(--danger); }
.lr-back--good .lr-back__head b { color: var(--ok); }
.lr-back__more > * { margin-top: 6px; }
.lr-back__last { color: var(--ink-2); }
.lr-back__last q { font-style: italic; }
.lr-back__small { font-size: 13px; color: var(--muted); }
.lr-back .lr-quote { background: rgba(255, 255, 255, 0.6); }

.lr-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- phone and narrow windows: one card per learning */
@media (max-width: 899px) {
  .lr-title { font-size: 28px; }
  .lr-cols { display: none; }
  #lr-rows { background: none; border: 0; box-shadow: none; }
  .lr-row {
    display: flex; flex-direction: column; gap: 0; padding: 0; margin-top: 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .lr-row:first-child { margin-top: 0; border-top: 1px solid var(--line); }
  .lr-cell { padding: 0 14px; }
  .lr-learning { order: 1; display: block; padding: 14px 14px 10px; position: relative; }
  .lr-num { display: none; }
  .lr-tags { padding-right: 40px; }
  .lr-toggle {
    display: flex; position: absolute; top: 6px; right: 4px; width: 44px; height: 44px; align-items: center; justify-content: center;
    border: 0; background: none; color: var(--muted); border-radius: 10px;
  }
  .lr-toggle svg { transition: transform 0.15s ease; }
  .lr-row.is-open .lr-toggle svg { transform: rotate(180deg); }
  .lr-back { order: 2; margin: 0 10px 12px; padding: 9px 12px; font-size: 14.5px; }
  .lr-back__icon { display: none; }
  .lr-back__q { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-weight: 700; color: var(--ink); }
  .lr-back__head b { font-weight: 500; }
  .lr-back--bad .lr-back__head { color: var(--danger); }
  .lr-back--good .lr-back__head { color: var(--ok); }
  .lr-topbar .lr-backlink { display: none; }
  .lr-backlink--head { display: inline-flex; margin: 0 0 2px -4px; min-height: 40px; }
  .lr-chip { min-height: 36px; padding: 0 12px; font-size: 14px; }
  .lr-applied { order: 3; padding-top: 4px; padding-bottom: 12px; }
  .lr-notes { order: 4; padding-bottom: 14px; }
  .lr-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
  .lr-row:not(.is-open) .lr-applied,
  .lr-row:not(.is-open) .lr-notes,
  .lr-row:not(.is-open) .lr-back__more { display: none; }
}
