/* ---------- The training origin (training.truewebcare.com) ----------
   A FILE OF ITS OWN, and it costs nothing to add: stylesheet_link_tag :app
   globs app/assets/*.css and Propshaft serves them in alphabetical order, so
   this lands after chrome.css with no manifest to edit. Everything here is
   either new to this host or a small correction to something chrome.css
   already dresses.

   WHAT THIS HOST INHERITS RATHER THAN RESTATES. The lesson page is the same
   page a trainee opens from their email, so .training-topbar, .training-week,
   .training-body-copy, .quiz-* and .pill all come from chrome.css untouched.
   A second vocabulary for the same components is how two pages that are meant
   to be one page stop looking alike. */

/* The bar. layouts/lms renders the app's own .app-topbar, so the background,
   the height, the sticky behaviour, the wordmark and every rule that dresses
   the account control come from chrome.css untouched - which is the whole
   point, and what the hand-rolled bar this replaced kept getting wrong.

   The ONE adjustment: .app-topbar-inner is a three-column grid (1fr auto 1fr)
   whose middle track holds the website's centred nav links. This host does not
   carry those links - see the note in the layout - and with only two children
   the actions would be placed into that middle track and float in the middle of
   the bar. Two tracks puts them back on the right-hand edge where every other
   bar in the product keeps them. */
.lms-topbar-inner { grid-template-columns: 1fr auto; }
/* Which of the three origins you are standing on. The wordmark is identical on
   all of them, so without this the address bar is the only thing that says. */
.lms-context {
  font-family: var(--font-head); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--blue); background: var(--blue-soft);
  padding: 3px 10px; border-radius: 999px;
}
/* Nothing pushes the account control to the right any more: it sits in
   .app-topbar-actions, which chrome.css already end-aligns. */

/* The signed-out landing. A reading column rather than a hero: this is one
   headline, one paragraph and two buttons, and stretching it to a marketing
   page would be pretending it is one. */
.lms-hero-title { margin-bottom: 10px; }
.lms-hero-sub { max-width: 46ch; }
.lms-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lms-hero-note { color: var(--muted); font-size: .88rem; }

/* The week list, on the dashboard's course cards and on a course page. A list
   rather than a table: it is two facts per row on a page people will open on a
   phone, and .data-table's horizontal scroll is the wrong shape for that. */
.lms-course + .lms-course { margin-top: 18px; }
.lms-lesson-list { margin: 0; padding: 0; list-style: none; }
.lms-lesson-row {
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--line); padding: 12px 0;
}
.lms-lesson-row:first-child { border-top: 0; padding-top: 0; }
/* The link takes the row's free space so the pill is always hard right and the
   pills line up down the list - a ragged right edge is what makes a status
   column unreadable at a glance. */
.lms-lesson-link {
  display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0;
  font-weight: 600; text-decoration: none;
}
.lms-lesson-link:hover .lms-lesson-title { text-decoration: underline; }
.lms-lesson-week {
  flex: 0 0 auto; font-family: var(--font-head); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
/* Long titles give way rather than push the pill off the row. */
.lms-lesson-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lms-lesson-row .pill { flex: 0 0 auto; margin-left: auto; }


/* The sign-up form. Stacked labels and full-width controls, the same shape
   .claim-form has, because it is the same kind of thing: a stranger with no
   account telling us how to reach them. */
.lms-signup-form label {
  display: block; margin: 14px 0 4px; font-size: .88rem; font-weight: 600;
}
.lms-signup-form label:first-of-type { margin-top: 0; }
.lms-signup-form input[type="text"], .lms-signup-form input[type="email"],
.lms-signup-form input[type="tel"], .lms-signup-form select,
.lms-signup-form textarea { width: 100%; }
.lms-signup-form textarea { resize: vertical; }
.lms-signup-form input[type="submit"] { margin-top: 18px; }

@media (max-width: 600px) {
  /* The context pill is the first thing to go: on a narrow screen the wordmark
     and the account control are what the reader needs, and the host is already
     in the address bar they can see. */
  .lms-context { display: none; }
}

/* ---------- The course shell: a contents rail beside the reading column ----------
   The shape the owner asked for, and the reason it is worth the width: a
   course you can see all of is a course you can tell you are making progress
   through. A lesson page with only a Next link tells you nothing about where
   you are, which is most of what a training platform is for.

   Two columns on a desktop, one on a phone with the rail collapsed to the top
   - see the breakpoint at the bottom. The rail is NOT sticky on purpose: a
   39-lesson course makes a rail taller than the viewport, and a sticky element
   taller than the screen is one whose bottom you can never reach. */
.lms-shell {
  display: grid; grid-template-columns: 290px minmax(0, 1fr);
  gap: 28px; align-items: start;
}
/* The prose keeps its reading measure even though the page is now wide. 720px
   rather than layouts/lms's 780px because the rail took some of the room, and
   a measure is about the line length rather than the page. */
.lms-reading { min-width: 0; max-width: 720px; }

.lms-contents {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.lms-contents-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.lms-contents-eyebrow {
  font-family: var(--font-head); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 6px;
}
.lms-contents-title { font-size: 1.02rem; line-height: 1.3; margin: 0 0 10px; }
.lms-contents-title a { color: var(--navy); text-decoration: none; }
.lms-contents-title a:hover { color: var(--blue); text-decoration: underline; }
.lms-contents-meta { font-size: .84rem; color: var(--muted); margin: 7px 0 0; display: flex; align-items: center; gap: 8px; }
.lms-contents-empty { padding: 16px 18px; color: var(--muted); font-size: .88rem; margin: 0; }

/* The bar. A track and a fill, and the width is the only thing that changes -
   no transition, because this only ever moves on a page load and an animation
   that plays on arrival reads as the page still loading. */
.lms-progress {
  height: 6px; border-radius: 999px; background: var(--line);
  overflow: hidden; width: 100%;
}
.lms-progress-fill { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.lms-progress-lg { height: 9px; }

.lms-contents-list { list-style: none; margin: 0; padding: 6px 0; }
.lms-contents-row + .lms-contents-row { border-top: 1px solid var(--line); }
.lms-contents-link {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 18px; text-decoration: none; color: var(--navy);
  transition: background var(--ease);
}
.lms-contents-link:hover { background: var(--blue-soft); }
.lms-contents-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lms-contents-week {
  font-family: var(--font-head); font-size: .71rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.lms-contents-name { font-size: .92rem; font-weight: 600; line-height: 1.35; }
.lms-contents-time { font-size: .79rem; color: var(--muted); }
/* WHERE YOU ARE, said with a bar down the left edge rather than a background
   fill: the hover state is already a fill, and two fills competing is how the
   current row stops being findable the moment the pointer is anywhere near the
   list. */
.lms-contents-row.is-here .lms-contents-link {
  background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue);
}
.lms-contents-row.is-here .lms-contents-name { color: var(--blue-dark); }
/* THE PAGES OF THE LESSON YOU ARE IN, hung under its row. Indented past the
   state mark so they read as belonging to the row above rather than as more
   rows, and numbered rather than marked - the marks belong to the lesson's own
   contents page, and a second vocabulary of ticks in a 200px rail is noise.
   `is-here` is drawn by the server from the URL: a section is its own page
   now, so there is nothing for script to keep in step. */
.lms-contents-pages {
  list-style: none; margin: 0 0 8px; padding: 0 0 0 48px;
}
.lms-contents-page-link {
  display: flex; gap: 9px; align-items: baseline;
  padding: 5px 18px 5px 0; text-decoration: none;
  font-size: .84rem; color: var(--muted); line-height: 1.35;
}
.lms-contents-page-link:hover { color: var(--blue); }
/* A section named by its first sentence can be sixty characters; in a 200px
   rail that is four lines, and four lines a row turns a seven-row list into a
   page of its own. Two, then it gives up gracefully. */
.lms-contents-page-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lms-contents-page-n {
  flex: 0 0 auto; font-family: var(--font-head); font-size: .72rem; font-weight: 700;
  color: var(--muted-2); min-width: 1.1em; text-align: right;
}
.lms-contents-page.is-here .lms-contents-page-link { color: var(--blue-dark); font-weight: 600; }
.lms-contents-page.is-here .lms-contents-page-n { color: var(--blue); }
/* READ. The tick says it in colour and shape, the name steps back, and the
   visually-hidden word says it to a screen reader - because a list whose
   whole job is "what have I got left" must not answer that question in colour
   alone. No line through the name: a strikethrough reads as "deleted". */
.lms-contents-page-tick { display: inline-flex; line-height: 0; }
.lms-contents-page-tick .lms-state svg { width: 13px; height: 13px; }
.lms-contents-page-done .lms-contents-page-name { opacity: .62; }
/* Except where you are standing: the row you are reading is not behind you. */
.lms-contents-page-done.is-here .lms-contents-page-name { opacity: 1; }

/* A finished week steps back. It is still legible and still a link - going
   back over one is normal - but the eye should land on what is left. */
.lms-contents-done .lms-contents-name { color: var(--muted); font-weight: 500; }

/* The three marks. Sized once here so the tick in the rail, the tick on the
   course page and the tick in the lesson footer cannot drift apart. */
.lms-state { flex: 0 0 auto; display: inline-flex; line-height: 0; }
.lms-state svg { width: 19px; height: 19px; }
.lms-state-done { color: var(--green); }
.lms-state-started { color: var(--blue); }
.lms-state-not_started { color: var(--faint); }

/* ---------- The course page ---------- */
.lms-course-head {
  display: flex; gap: 28px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 26px;
}
.lms-course-head-text { flex: 1 1 380px; min-width: 0; }
.lms-course-head-text h1 { margin-bottom: 6px; }
.lms-course-facts { font-size: .88rem; color: var(--muted); margin: 0; }
.lms-course-head-progress {
  flex: 0 1 260px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.lms-course-percent { font-size: .86rem; color: var(--muted); margin: 0; }

.lms-week-list { list-style: none; margin: 0; padding: 0; }
.lms-week {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px; transition: border-color var(--ease), box-shadow var(--ease);
}
.lms-week:hover { border-color: var(--blue-line); box-shadow: var(--shadow-md); }
.lms-week-link {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; text-decoration: none; color: var(--navy);
}
.lms-week-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lms-week-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.lms-week-n {
  font-family: var(--font-head); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); flex: 0 0 auto;
}
.lms-week-title { font-weight: 600; font-size: 1rem; }
.lms-week-link:hover .lms-week-title { text-decoration: underline; }
.lms-week-summary { font-size: .89rem; color: var(--muted); line-height: 1.5; }
.lms-week-meta { font-size: .8rem; color: var(--muted-2); }
.lms-week .pill { flex: 0 0 auto; align-self: center; }
.lms-week-done { background: var(--bg); }
.lms-week-done .lms-week-title { color: var(--muted); }

/* ---------- The dashboard's shelf of courses ---------- */
.lms-course-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin-bottom: 26px;
}
.lms-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.lms-card-title { font-size: 1.06rem; margin: 0; }
.lms-card-title a { color: var(--navy); text-decoration: none; }
.lms-card-title a:hover { color: var(--blue); text-decoration: underline; }
.lms-card-blurb { font-size: .89rem; color: var(--muted); line-height: 1.55; margin: 0; }
.lms-card-meta { font-size: .83rem; color: var(--muted); margin: 0; }
/* The actions row is the last thing in the card and is pushed to the bottom, so
   a row of cards with blurbs of different lengths still has its buttons in a
   line. */
.lms-card-actions {
  margin: auto 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.lms-card-next { font-size: .82rem; color: var(--muted); min-width: 0; }

/* The foot of a lesson's contents: previous, next, and the "mark as done" a
   skimmer needs. One row, not a stacked block with a paragraph of explanation
   in it - the ticks in the list above already say what has been read. */
.lms-lesson-nav {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.lms-lesson-nav form { margin: 0; margin-left: auto; }
.lms-lesson-nav form + .btn { margin-left: 0; }

/* The label a screen reader gets and nobody sees: the state of a row is a
   colour and a shape, and neither is announced. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  /* The rail goes above the lesson rather than beside it. It keeps its full
     list: somebody on a phone still wants to know there are six weeks left,
     and a <details> that hides it would put the course one tap further away on
     the device most likely to be used for five minutes at a time. */
  .lms-shell { grid-template-columns: 1fr; gap: 22px; }
  .lms-reading { max-width: none; }
  .lms-course-head-progress { flex: 1 1 100%; }
}
