/* ============================================================================
   Career guide — stylesheet
   Mobile-first. BEM naming: block__element--modifier.

   Breakpoints, as specified: 375 / 768 / 1024 / 1440.
   Note that 375 is not written as a media query. Mobile-first means the base
   rules ARE the 375 layout; a `min-width: 375px` query would only exclude the
   360px Androids that make up a large share of this audience.

   Everything degrades: with CSS loaded but JS off you still get a working TOC,
   a working FAQ, readable skill bars and a scrollable college list.
   ========================================================================= */

/* --- tokens --------------------------------------------------------------
   Falls back to literals so the file works standalone, and defers to the
   site tokens when theme.css / site-theme.css are present.                  */
:root {
  --cg-accent:      var(--primary,   #7C3AED);
  --cg-accent-ink:  #ffffff;
  --cg-ink:         var(--text-main, #1f2937);
  --cg-ink-strong:  var(--white,     #0f172a);
  --cg-ink-dim:     var(--text-dim,  #5b6472);
  --cg-line:        var(--border,    #e5e7eb);
  --cg-surface:     var(--card-bg,   #ffffff);
  --cg-tint:        rgba(124, 58, 237, .08);
  --cg-tint-strong: rgba(124, 58, 237, .32);
  --cg-good:        #15803d;
  --cg-radius:      12px;
  --cg-gap:         1rem;
  --cg-measure:     68ch;      /* running text never exceeds this */
}

/* --- base ---------------------------------------------------------------- */
.cg {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 1rem 3rem;
  color: var(--cg-ink);
}
.cg *,
.cg *::before,
.cg *::after { box-sizing: border-box; }

.cg p,
.cg li { line-height: 1.7; font-size: .97rem; }
.cg p  { margin: 0 0 .9rem; max-width: var(--cg-measure); }
.cg ul,
.cg ol { padding-left: 1.2rem; margin: 0 0 1rem; max-width: var(--cg-measure); }
.cg li { margin-bottom: .45rem; }
.cg strong { color: var(--cg-ink-strong); font-weight: 700; }

.cg a { color: var(--cg-accent); font-weight: 600; text-decoration: none; }
.cg a:hover { text-decoration: underline; }

/* WCAG 2.4.7: focus must be visible, and never removed without replacement. */
.cg :focus-visible {
  outline: 3px solid var(--cg-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* WCAG 2.4.1: a skip link, visible only when focused. */
.cg-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--cg-accent); color: var(--cg-accent-ink);
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; font-weight: 700;
}
.cg-skip:focus { left: 0; }

/* Screen-reader-only text, for context that sighted users get from layout. */
.cg-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- typography ---------------------------------------------------------- */
.cg__title {
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.2; margin: 0 0 .6rem;
  color: var(--cg-ink-strong); text-wrap: balance;
}
.cg__h2 {
  font-size: clamp(1.2rem, 4.5vw, 1.4rem);
  margin: 2.2rem 0 .8rem; padding-top: 1.3rem;
  color: var(--cg-ink-strong);
  border-top: 1px solid var(--cg-line);
  scroll-margin-top: 4.5rem;        /* anchor links clear the sticky header */
}
.cg__h2:first-of-type { border-top: 0; padding-top: 0; }
.cg__h3 {
  font-size: 1.03rem; margin: 1.5rem 0 .5rem;
  color: var(--cg-ink-strong); scroll-margin-top: 4.5rem;
}
.cg__kicker {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--cg-accent); margin-bottom: .4rem;
}
.cg__meta { color: var(--cg-ink-dim); font-size: .82rem; margin-bottom: 1.2rem; }
.cg__source { color: var(--cg-ink-dim); font-size: .8rem; margin-top: .4rem; }

/* --- hero ---------------------------------------------------------------- */
.cg-hero__answer {
  background: var(--cg-tint);
  border-left: 4px solid var(--cg-accent);
  border-radius: 0 var(--cg-radius) var(--cg-radius) 0;
  padding: .9rem 1.1rem; margin: 0 0 1.4rem;
}
.cg-hero__answer p { margin: 0; }

.cg-hero__stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem; margin: 0 0 1.6rem; padding: 0;
}
.cg-hero__stat {
  background: var(--cg-surface); border: 1px solid var(--cg-line);
  border-radius: 10px; padding: .7rem .8rem;
}
.cg-hero__stat-label {
  font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cg-ink-dim); margin: 0 0 .2rem;
}
.cg-hero__stat-value {
  margin: 0; font-weight: 700; font-size: 1.02rem;
  color: var(--cg-ink-strong); font-variant-numeric: tabular-nums;
}

/* --- table of contents --------------------------------------------------- */
.cg-toc {
  background: var(--cg-surface); border: 1px solid var(--cg-line);
  border-radius: var(--cg-radius); padding: .4rem .9rem; margin: 0 0 1.6rem;
}
.cg-toc__summary {
  cursor: pointer; font-weight: 700; font-size: .95rem;
  color: var(--cg-ink-strong); padding: .6rem 0; list-style: none;
}
.cg-toc__summary::-webkit-details-marker { display: none; }
.cg-toc__summary::after { content: " \25BE"; color: var(--cg-ink-dim); }
.cg-toc[open] .cg-toc__summary::after { content: " \25B4"; }
.cg-toc__list { margin: .2rem 0 .7rem; padding-left: 1.1rem; }
.cg-toc__item { margin-bottom: .3rem; font-size: .9rem; }
.cg-toc__link { font-weight: 500; color: var(--cg-ink); }
.cg-toc__link[aria-current="true"] { color: var(--cg-accent); font-weight: 700; }

/* --- skill bars ----------------------------------------------------------
   The bar length encodes LEARNING PRIORITY (what to study first), not a
   proficiency percentage. A "Python 90%" bar would be an invented number;
   priority is a real editorial judgement and is stated as such on the page. */
.cg-skills__list { list-style: none; padding: 0; margin: 0; max-width: var(--cg-measure); }
.cg-skills__item { margin-bottom: 1rem; }
.cg-skills__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .75rem; margin-bottom: .3rem;
}
.cg-skills__name { font-weight: 700; color: var(--cg-ink-strong); }
.cg-skills__rank {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cg-ink-dim); white-space: nowrap;
}
.cg-skills__track {
  height: 8px; border-radius: 999px;
  background: var(--cg-line); overflow: hidden;
}
.cg-skills__fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--cg-accent);
  /* width is set inline from data; transition only if motion is welcome */
  transition: width .5s ease;
}
.cg-skills__note { font-size: .9rem; color: var(--cg-ink); margin: .3rem 0 0; }

/* --- colleges: a scroll-snap track, not an auto-rotating carousel ---------
   Auto-rotating carousels shift layout (hurting CLS), hide content behind
   interaction, and are awkward for keyboard and screen-reader users. This is
   a horizontally scrollable list: same affordance, no CLS, fully keyboard
   accessible, and it degrades to a plain list when it fits. */
.cg-colleges { margin: 1rem 0; }
.cg-colleges__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
  gap: .75rem; overflow-x: auto; padding-bottom: .6rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cg-colleges__card {
  scroll-snap-align: start;
  background: var(--cg-surface); border: 1px solid var(--cg-line);
  border-radius: var(--cg-radius); padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.cg-colleges__logo {
  width: 40px; height: 40px; border-radius: 8px; object-fit: contain;
  background: var(--cg-tint); /* reserves the box before the image loads */
  flex: 0 0 auto;
}
/* Default logo: a text monogram. Institution marks are files we may not have
   and trademarks we may not have the right to publish, and a missing <img>
   would show a broken-image icon on every card. The monogram sits in the same
   40px box, so swapping a real <img> back in shifts nothing. */
.cg-colleges__logo--text {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  color: var(--cg-accent); font-variant-numeric: tabular-nums;
}
.cg-colleges__name { margin: 0; font-size: 1rem; color: var(--cg-ink-strong); }
.cg-colleges__note { margin: 0; font-size: .88rem; color: var(--cg-ink); }
.cg-colleges__metrics {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .5rem;
}
.cg-colleges__metric {
  font-size: .74rem; background: var(--cg-tint); color: var(--cg-ink-strong);
  border-radius: 999px; padding: .18rem .55rem; font-variant-numeric: tabular-nums;
}
.cg-colleges__hint { font-size: .8rem; color: var(--cg-ink-dim); margin: .2rem 0 0; }

/* --- tables --------------------------------------------------------------- */
.cg-table__scroll { overflow-x: auto; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
.cg-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  font-variant-numeric: tabular-nums; min-width: 460px;
}
.cg-table__caption {
  caption-side: top; text-align: left;
  color: var(--cg-ink-dim); font-size: .8rem; padding-bottom: .5rem;
}
.cg-table th,
.cg-table td {
  border: 1px solid var(--cg-line); padding: .55rem .7rem;
  text-align: left; vertical-align: top;
}
.cg-table th {
  background: var(--cg-tint); color: var(--cg-ink-strong);
  font-size: .8rem; white-space: nowrap;
}
.cg-table td:first-child { font-weight: 600; color: var(--cg-ink-strong); }
.cg-table__win { color: var(--cg-good); font-weight: 700; }

/* --- FAQ ------------------------------------------------------------------ */
.cg-faq__item {
  background: var(--cg-surface); border: 1px solid var(--cg-line);
  border-radius: 10px; padding: .5rem .9rem; margin-bottom: .5rem;
}
.cg-faq__q {
  cursor: pointer; font-weight: 600; font-size: .94rem;
  color: var(--cg-ink-strong); padding: .45rem 0;
}
.cg-faq__a { margin: .5rem 0 .3rem; font-size: .92rem; }

/* --- CTA + newsletter ----------------------------------------------------- */
.cg-cta {
  background: var(--cg-tint); border: 1px solid var(--cg-tint-strong);
  border-left: 4px solid var(--cg-accent);
  border-radius: var(--cg-radius); padding: 1rem 1.1rem; margin: 1.4rem 0;
}
.cg-cta__button {
  display: inline-block; margin-top: .6rem;
  background: var(--cg-accent); color: var(--cg-accent-ink);
  padding: .6rem 1.1rem; border-radius: 8px; font-weight: 700; font-size: .88rem;
}
.cg-cta__button:hover { text-decoration: none; filter: brightness(1.08); }

.cg-signup__form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.cg-signup__input {
  flex: 1 1 12rem; min-width: 0; font: inherit; font-size: .92rem;
  padding: .6rem .8rem; border: 1px solid var(--cg-line);
  border-radius: 8px; background: var(--cg-surface); color: var(--cg-ink);
}
.cg-signup__submit {
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
  padding: .6rem 1.1rem; border: 0; border-radius: 8px;
  background: var(--cg-accent); color: var(--cg-accent-ink);
}
.cg-signup__status { font-size: .85rem; margin: .5rem 0 0; min-height: 1.2em; }
.cg-signup__status--error { color: #b91c1c; }
.cg-signup__status--ok    { color: var(--cg-good); }

/* --- related sidebar ------------------------------------------------------ */
.cg-related__list { list-style: none; padding: 0; margin: 0; }
.cg-related__item { margin-bottom: .5rem; }
.cg-related__link {
  display: block; background: var(--cg-surface);
  border: 1px solid var(--cg-line); border-radius: 10px;
  padding: .6rem .8rem; font-weight: 600;
}
.cg-related__link:hover { border-color: var(--cg-accent); text-decoration: none; }
.cg-related__note {
  display: block; font-weight: 400; font-size: .8rem;
  color: var(--cg-ink-dim); margin-top: .15rem;
}

/* ==========================================================================
   BREAKPOINTS. min-width only: every query adds, none takes away.
   ======================================================================== */

/* 768 — tablets. Stats go to four across, colleges show two cards. */
@media (min-width: 768px) {
  .cg { padding: 5rem 1.25rem 3.5rem; }
  .cg-hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cg-colleges__track { grid-auto-columns: 46%; }
}

/* 1024 — the sidebar becomes a sidebar. Below this it is simply the last
   thing in the document, which is the correct reading order anyway. */
@media (min-width: 1024px) {
  .cg__layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 264px;
    gap: 2.5rem; align-items: start;
  }
  .cg-toc,
  .cg__side { position: sticky; top: 4.5rem; }
  .cg-colleges__track { grid-auto-columns: 31%; }
}

/* 1440 — wider measure, roomier gutters. Nothing structural changes. */
@media (min-width: 1440px) {
  .cg { padding: 5.5rem 2rem 4rem; --cg-measure: 74ch; }
  .cg__layout { gap: 3rem; grid-template-columns: minmax(0, 1fr) 300px; }
  .cg-colleges__track { grid-auto-columns: 23.5%; }
}

/* --- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cg *,
  .cg *::before,
  .cg *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- forced colours (Windows high contrast) ------------------------------- */
@media (forced-colors: active) {
  .cg-skills__fill { background: Highlight; }
  .cg-colleges__card,
  .cg-faq__item { border: 1px solid CanvasText; }
}

/* ==========================================================================
   PRINT. Career guides get printed and handed to parents; that is a real
   use case for this audience. Drop the furniture, keep the substance, and
   expose link targets since a printed href is otherwise dead.
   ======================================================================== */
@media print {
  .navbar, .footer, .cg-skip, .cg-cta, .cg-signup,
  .cg__side, .breadcrumbs, .cg-colleges__hint { display: none !important; }

  .cg { max-width: none; padding: 0; color: #000; }
  .cg__layout { display: block; }

  .cg__h2, .cg__h3 { break-after: avoid; page-break-after: avoid; }
  .cg-table, .cg-faq__item, .cg-colleges__card { break-inside: avoid; page-break-inside: avoid; }

  .cg-toc { border: 1px solid #999; }
  .cg-toc[open] .cg-toc__summary::after,
  .cg-toc .cg-toc__summary::after { content: ""; }

  /* Open every answer: a printed accordion is a list of questions with no
     answers, which is worse than useless. */
  .cg-faq__item, .cg-toc { display: block !important; }
  .cg-faq__a { display: block !important; }

  /* Skill bars do not survive greyscale printing; show the rank instead. */
  .cg-skills__track { display: none; }

  .cg-colleges__track {
    display: block; overflow: visible;
  }
  .cg-colleges__card { border: 1px solid #999; margin-bottom: .5rem; }

  .cg a[href^="/"]::after  { content: " (jobstoedu.com" attr(href) ")"; font-size: .8em; }
  .cg a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; word-break: break-all; }
  .cg a { color: #000; text-decoration: underline; }
}

/* Roadmap. The number comes from the <ol>, not from text typed into each
   heading: a step inserted later renumbers itself, and a screen reader
   announces the list position rather than reading a digit twice. */
.cg-steps { list-style: none; counter-reset: cg-step; padding-left: 0; margin: 0 0 1.4rem; }
.cg-steps__item {
  counter-increment: cg-step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}
.cg-steps__item::before {
  content: counter(cg-step);
  position: absolute; left: 0; top: .1rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cg-tint); color: var(--cg-accent);
  font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.cg-steps__item .cg__h3 { margin-top: 0; }
@media print { .cg-steps__item { break-inside: avoid; } }
