/* =============================================================================
   BLACK SIGNAL — css/screens/index.css (layout only)
   Index screens — Course Select, a course's module list, a module's lab list,
   quiz home — all lay out on one 1200px column: the hero band, then ruled
   cells. Children stop carrying their own measure; the column is the measure.
   (Analytics uses the same column: css/screens/analytics.css.)
   ============================================================================= */
@layer screens {

.bs-course-screen .course-main,
.linux-category-screen .linux-cat-body {
  width: 100%;
  max-width: calc(var(--sig-col) + var(--sig-gutter) * 2);
  margin: 0 auto;
  padding: 28px var(--sig-gutter) 104px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}
.course-title-wrap, .linux-cat-heading, .qh-head,
.qh-section-label, .qh-actions, .obj-entry,
.linux-category-grid, .linux-lab-list {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 599px) {
  .bs-course-screen .course-main,
  .linux-category-screen .linux-cat-body { padding: 16px var(--sig-gutter) 96px; }
}

/* Whole-pixel hero type → crisp grid rules.
   The ruled grid draws its horizontal rules as 1px cell borders. At 1x screens a
   1px border on a fractional Y anti-aliases into near-nothing ("grid lines
   disappear"). The grid's Y is fractional whenever the hero above it is a
   fractional height, which it was: the title's viewport-scaled font (clamp with
   vw) times a unitless line-height, and the 11.5px eyebrow, give fractional line
   boxes that shift with width. Pinning the hero's line boxes to whole pixels
   keeps the grid on a whole pixel at every width, so the rules stay crisp.
   (The column is a fixed 1200px, so the title needs no viewport scaling here.) */
.linux-category-screen .sig-hero :is(h1, .course-title, .qh-head-title, .linux-cat-title),
.bs-course-screen .sig-hero :is(h1, .course-title, .qh-head-title, .linux-cat-title) { line-height: 44px; }
.linux-category-screen .sig-hero :is(.sig-eyebrow, .bs-eyebrow),
.bs-course-screen .sig-hero :is(.sig-eyebrow, .bs-eyebrow) { line-height: 16px; }
.linux-category-screen .sig-hero :is(.bs-meta-num, .sig-meta-num),
.bs-course-screen .sig-hero :is(.bs-meta-num, .sig-meta-num) { line-height: 28px; }
.linux-category-screen .sig-hero :is(.bs-meta-lbl, .sig-meta-lbl),
.bs-course-screen .sig-hero :is(.bs-meta-lbl, .sig-meta-lbl) { line-height: 16px; }
/* FLUSH INDEX PATTERN: the hero ends exactly where the first numbered
   tile (or lab row) begins. No section-label strip, top hairline or gutter.
   Retain the left and vertical cell rules and every original tile style. */
:is(.bs-course-screen, .linux-category-screen) .sig-hero + .linux-category-grid {
  margin-top: 0;
  border-top: 0;
  box-shadow: inset 1px 0 0 0 var(--sig-rule);
}
.linux-category-screen .sig-hero + .linux-lab-list {
  margin-top: 0;
  border-top: 0;
}


/* Course select sections (Terminal / Exam prep / Code). Each is one ruled
   row you open; its course cards appear under it. One open at a time, so the
   screen shows three calm rows until the operator picks a track. */
.bs-course-screen .course-groups {
  display: flex;
  flex-direction: column;
  /* The first row sits right under the hero: no gap, no extra rule. */
  margin-top: 0;
  border-top: 0;
}
.bs-course-screen .course-group { border-bottom: 1px solid var(--sig-rule); }
.bs-course-screen .course-group-toggle {
  display: flex;
  width: 100%;
  padding: 0;
  border: 0;
  background-color: var(--sig-cell);
  color: inherit;
  text-align: left;
  cursor: pointer;
  /* The sweep's 1px edge ring would poke out past the column; keep the fill
     exactly on the row so it lines up with the hero and the course cards. */
  overflow: hidden;
}
/* The row is the app's sweep button: the accent fill grows in from the left
   on hover and every label flips to the ink on the accent. The sweep sits on
   an inner span so the open row (aria-expanded) is not held filled. */
.bs-course-screen .course-group-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 4px 20px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 92px;
  /* left inset = the hero's, so TERMINAL lines up under SELECT YOUR COURSE */
  padding: 18px 22px 18px 28px;
  background-color: var(--sig-cell);
}
@media (max-width: 1023px) { .bs-course-screen .course-group-inner { padding-left: 22px; } }
.bs-course-screen .course-group-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .bs-course-screen .course-group-inner:hover .course-group-chev::before,
  .bs-course-screen .course-group-inner:hover .course-group-chev::after { color: var(--accent-on-accent); }
}
.bs-course-screen .course-group-inner:active .course-group-chev::before,
.bs-course-screen .course-group-inner:active .course-group-chev::after { color: var(--accent-on-accent); }
.bs-course-screen .course-group.is-open .course-group-inner { box-shadow: inset 3px 0 0 var(--orange); }
.bs-course-screen .course-group-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bs-course-screen .course-group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 32px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
}
.bs-course-screen .course-group.is-open .course-group-title { color: var(--orange); }
.bs-course-screen .course-group-sub {
  font-family: var(--sig-mono);
  font-size: 12px;
  line-height: 17px;
  color: var(--sig-ink-mute);
}
.bs-course-screen .course-group-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--sig-ink-mute);
}
.bs-course-screen .course-group-chev {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid var(--sig-rule);
}
.bs-course-screen .course-group-chev::before,
.bs-course-screen .course-group-chev::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  background: currentColor;
  color: var(--orange);
  transition: transform 200ms ease;
}
.bs-course-screen .course-group-chev::after { transform: rotate(90deg); }
.bs-course-screen .course-group.is-open .course-group-chev::after { transform: rotate(0deg); }
.bs-course-screen .course-group-panel { padding: 0 0 22px; }
.bs-course-screen .course-group-panel[hidden] { display: none; }
.bs-course-screen .course-group.is-open .course-group-panel { animation: cgOpen 220ms ease both; }
@keyframes cgOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .bs-course-screen .course-group.is-open .course-group-panel { animation: none; }
  .bs-course-screen .course-group-chev::after { transition: none; }
}
.bs-course-screen .course-group .linux-category-grid {
  flex: 0 0 auto;
  max-height: none;
  grid-auto-rows: minmax(176px, auto);
  /* Each card draws its own top and left rule, so a short last row ends
     cleanly instead of trailing the grid's full-width border. */
  border-top: 0;
  border-left: 0;
  box-shadow: none;
  padding: 1px 0 0 1px;
}
.bs-course-screen .course-group .linux-category-grid .linux-category-card {
  box-shadow: -1px -1px 0 0 var(--sig-rule);
}
@media (min-width: 1024px) {
  .bs-course-screen .course-group .linux-category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .bs-course-screen .course-group-inner { min-height: 80px; padding: 16px 16px 16px 18px; gap: 4px 14px; }
  .bs-course-screen .course-group-title { font-size: 24px; line-height: 26px; }
  .bs-course-screen .course-group-count { font-size: 22px; }
}
}
