/* =====================================================================================
   LT Consultant Competencies — site styling.

   Everything this site adds on top of Material for MkDocs lives here. Classes generated
   by scripts/gen_site.py are all prefixed `cx-`; if you change a class name, change it
   there too.

   The brand block below is the only part you need to touch to re-colour the site.
   ===================================================================================== */

/* -------------------------------------------------------------------------------------
   1. Brand — change these five values and the whole site follows
   ------------------------------------------------------------------------------------- */
:root {
  --cx-brand:       #2b4570;   /* header, buttons, primary links */
  --cx-brand-light: #3d5b8c;
  --cx-brand-dark:  #1d2f4f;
  --cx-brand-lift:  #8fb6de;   /* the brand, lightened, for use on dark backgrounds */
  --cx-accent:      #b4603a;   /* hover / active — the one warm note */
}

/* Material reads its palette from these; `primary: custom` in mkdocs.yml opts in. */
[data-md-color-primary="custom"] {
  --md-primary-fg-color:        var(--cx-brand);
  --md-primary-fg-color--light: var(--cx-brand-light);
  --md-primary-fg-color--dark:  var(--cx-brand-dark);
  --md-primary-bg-color:        #fff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color:             var(--cx-accent);
  --md-accent-fg-color--transparent: rgba(180, 96, 58, 0.1);
  --md-accent-bg-color:             #fff;
  --md-accent-bg-color--light:      rgba(255, 255, 255, 0.7);
}

/* Shared tokens — surfaces are translucent so one value works in both schemes. */
:root {
  --cx-key:     var(--cx-brand);          /* the brand colour, safe as *text* */
  --cx-surface: rgba(0, 0, 0, 0.032);
  --cx-border:  rgba(0, 0, 0, 0.1);
  --cx-ok:      #2f7a4f;
  --cx-warn:    #9a5b2b;
  --cx-badge-fg: #fff;

  /* The 0-4 ladder ramp. Light scheme: deepening blues, with a gold capstone at 4.
     Every one of these carries white text at 4.5:1 or better. */
  --cx-l0: #5f6b7a;
  --cx-l1: #35648c;
  --cx-l2: #2a5580;
  --cx-l3: #1f3d61;
  --cx-l4: #8a5a12;
}

[data-md-color-scheme="slate"] {
  --cx-key:     var(--cx-brand-lift);
  --cx-surface: rgba(255, 255, 255, 0.045);
  --cx-border:  rgba(255, 255, 255, 0.13);
  --cx-ok:      #7fc79b;
  --cx-warn:    #e0a878;

  /* Same ramp, inverted: light badges carrying dark text, all well past 4.5:1. */
  --cx-badge-fg: #101828;
  --cx-l0: #9aa4b2;
  --cx-l1: #7fb0d4;
  --cx-l2: #5f98c4;
  --cx-l3: #4a80ad;
  --cx-l4: #d9a13c;
}

/* The brand is too dark to read as body-copy links on the slate background. */
[data-md-color-scheme="slate"][data-md-color-primary="custom"] {
  --md-typeset-a-color: var(--cx-brand-lift);
}

/* -------------------------------------------------------------------------------------
   2. Typography — a little more air, a little more hierarchy
   ------------------------------------------------------------------------------------- */
.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color);
}

.md-typeset h2 {
  margin-top: 2.6em;
  padding-top: 1.1rem;
  border-top: 1px solid var(--cx-border);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-typeset h3 {
  font-weight: 700;
}

/* Copy that introduces a page or a section. */
.cx-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 46rem;
  color: var(--md-default-fg-color--light);
}

/* A quiet aside — the "how to read this" line above a ladder. */
.md-typeset .cx-hint {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
  margin: -0.4rem 0 1.1rem;
}

/* Provenance footers. */
.md-typeset .cx-meta {
  margin-top: 2.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--cx-border);
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .cx-count {
  font-size: 0.76rem;
  color: var(--md-default-fg-color--light);
}

/* -------------------------------------------------------------------------------------
   3. Home page hero
   ------------------------------------------------------------------------------------- */
.md-typeset h1.cx-hero__title {
  margin: 1.2rem 0 0.7rem;
  font-size: 2.1rem;
  line-height: 1.15;
}

.cx-hero {
  padding-bottom: 1.7rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--cx-border);
}

.md-typeset .cx-hero__lede {
  font-size: 1.12rem;
  line-height: 1.55;
  max-width: 44rem;
  color: var(--md-default-fg-color--light);
  margin: 0 0 1.3rem;
}

.md-typeset .cx-hero .md-button {
  margin-right: 0.4rem;
}

/* Section headings on the landing page don't need the hairline twice over. */
.md-typeset .cx-hero + h2 {
  border-top: 0;
  margin-top: 1.8em;
  padding-top: 0;
}

/* -------------------------------------------------------------------------------------
   4. Chips — category / coverage / provenance labels under a page title
   ------------------------------------------------------------------------------------- */
.cx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -0.4rem 0 1.4rem;
}

.md-typeset .cx-chip {
  display: inline-block;
  padding: 0.24rem 0.62rem;
  border: 1px solid var(--cx-border);
  border-radius: 1rem;
  background: var(--cx-surface);
  color: var(--md-default-fg-color--light);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-decoration: none;
}

.md-typeset a.cx-chip:hover {
  border-color: var(--cx-key);
  color: var(--cx-key);
}

.md-typeset .cx-chip--cat {
  background: rgba(43, 69, 112, 0.09);
  border-color: rgba(43, 69, 112, 0.22);
  color: var(--cx-key);
}

[data-md-color-scheme="slate"] .md-typeset .cx-chip--cat {
  background: rgba(143, 182, 222, 0.12);
  border-color: rgba(143, 182, 222, 0.28);
}

.md-typeset .cx-chip--cov {
  background: rgba(47, 122, 79, 0.1);
  border-color: rgba(47, 122, 79, 0.25);
  color: var(--cx-ok);
}

.md-typeset .cx-chip--gap {
  background: rgba(154, 91, 43, 0.1);
  border-color: rgba(154, 91, 43, 0.25);
  color: var(--cx-warn);
}

.md-typeset .cx-chip + .cx-chip {
  margin-left: 0.35rem;
}

/* -------------------------------------------------------------------------------------
   5. Target competency callout
   ------------------------------------------------------------------------------------- */
.md-typeset .cx-target {
  margin: 0 0 1.6rem;
  padding: 0.95rem 1.15rem;
  background: var(--cx-surface);
  border-left: 3px solid var(--cx-key);
  border-radius: 0 0.35rem 0.35rem 0;
  font-size: 1rem;
  line-height: 1.6;
}

.cx-target__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cx-key);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------------------------
   6. The ladder — the level tables, rebuilt as steps
   ------------------------------------------------------------------------------------- */
.md-typeset [data-level="0"] { --cx-rung-color: var(--cx-l0); }
.md-typeset [data-level="1"] { --cx-rung-color: var(--cx-l1); }
.md-typeset [data-level="2"] { --cx-rung-color: var(--cx-l2); }
.md-typeset [data-level="3"] { --cx-rung-color: var(--cx-l3); }
.md-typeset [data-level="4"] { --cx-rung-color: var(--cx-l4); }

.md-typeset ol.cx-ladder {
  list-style: none;
  margin: 1.1rem 0 2rem;
  padding: 0;
}

.md-typeset .cx-rung {
  position: relative;
  margin: 0 0 0.45rem;
  padding: 0.9rem 1.1rem 0.85rem 0.95rem;
  background: var(--cx-surface);
  border-left: 3px solid var(--cx-rung-color, var(--cx-l0));
  border-radius: 0 0.35rem 0.35rem 0;
}

/* The rail: a short connector in the gap between two rungs, so they read as one climb. */
.md-typeset .cx-rung + .cx-rung::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: -0.45rem;
  width: 2px;
  height: 0.45rem;
  background: var(--cx-border);
}

.cx-rung__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.md-typeset .cx-rung__head {
  margin: 0;
}

.cx-rung__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--cx-rung-color, var(--cx-l0));
  color: var(--cx-badge-fg);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cx-rung__level {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.md-typeset .cx-rung__act {
  margin: 0.45rem 0 0;
  padding-left: 2.35rem;
  font-size: 0.8rem;
  line-height: 1.65;
}

.md-typeset .cx-rung__reach {
  margin: 0.5rem 0 0;
  padding-left: 2.35rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.md-typeset .cx-rung__reach::before {
  content: "\21B3\00a0";  /* ↳ */
  color: var(--cx-rung-color, var(--cx-l0));
  font-weight: 700;
}

.md-typeset .cx-rung__reach strong {
  color: var(--md-default-fg-color);
  font-weight: 700;
}

.md-typeset .cx-rung__reach--top {
  font-style: italic;
}

.md-typeset .cx-rung__reach--top::before {
  content: "\2605\00a0";  /* ★ */
}

/* Component headings — "2.0 — Creating Simple Books" becomes a numbered chip + a title. */
.md-typeset h3.cx-component {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.4em;
  font-size: 1.05rem;
}

.md-typeset h3.cx-component[data-num]::before {
  content: attr(data-num);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--cx-border);
  border-radius: 0.3rem;
  background: var(--cx-surface);
  color: var(--md-default-fg-color--light);
  font-size: 0.72rem;
  font-weight: 700;
}

/* -------------------------------------------------------------------------------------
   7. Sub-competency pages — observable criteria / why it matters
   ------------------------------------------------------------------------------------- */
.md-typeset .cx-label {
  margin: 1.2rem 0 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.md-typeset .cx-label--crit {
  color: var(--cx-key);
}

.md-typeset .cx-label--crit + ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.md-typeset .cx-label--crit + ul > li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.3rem;
}

.md-typeset .cx-label--crit + ul > li::before {
  content: "\2713";  /* ✓ */
  position: absolute;
  left: 0;
  color: var(--cx-ok);
  font-weight: 700;
}

.md-typeset .cx-label--why + ul {
  margin-left: 0;
  padding-left: 1.1rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.82rem;
}

/* -------------------------------------------------------------------------------------
   8. Cards — home page categories, category page competencies
   ------------------------------------------------------------------------------------- */
.md-typeset .cx-cards > ul > li {
  border: 1px solid var(--cx-border);
  border-radius: 0.4rem;
  box-shadow: none;
  transition: border-color 125ms, transform 125ms, box-shadow 125ms;
}

.md-typeset .cx-cards > ul > li:hover {
  border-color: var(--cx-key);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.md-typeset .cx-cards > ul > li > hr {
  margin: 0.6rem 0;
  border-color: var(--cx-border);
}

.md-typeset .cx-cards > ul > li > p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
}

.md-typeset .cx-cards > ul > li > p:first-child {
  font-size: 0.9rem;
  color: var(--md-default-fg-color);
}

.md-typeset .cx-cards a {
  text-decoration: none;
}

.md-typeset .cx-cat-icon svg {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  fill: var(--cx-key);
}

/* -------------------------------------------------------------------------------------
   9. The five-level scale strip
   ------------------------------------------------------------------------------------- */
.cx-scale {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.55rem;
  margin: 1.3rem 0 1.6rem;
}

.cx-scale__step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-top: 3px solid var(--cx-rung-color, var(--cx-l0));
  border-radius: 0.35rem;
}

.cx-scale__name {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.cx-scale__desc {
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

/* -------------------------------------------------------------------------------------
   10. Coverage progress bars
   ------------------------------------------------------------------------------------- */
.cx-bars {
  display: grid;
  gap: 0.55rem;
  margin: 1.3rem 0 1.8rem;
}

.cx-bar {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr auto;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.76rem;
}

.cx-bar__label {
  font-weight: 600;
}

.cx-bar__track {
  height: 0.5rem;
  background: var(--cx-border);
  border-radius: 1rem;
  overflow: hidden;
}

.cx-bar__fill {
  display: block;
  height: 100%;
  border-radius: 1rem;
  background: linear-gradient(90deg, var(--cx-l1), var(--cx-l3));
}

[data-md-color-scheme="slate"] .cx-bar__fill {
  background: linear-gradient(90deg, var(--cx-l3), var(--cx-l1));
}

.cx-bar__value {
  color: var(--md-default-fg-color--light);
  font-variant-numeric: tabular-nums;
}

.cx-bars--lg .cx-bar {
  font-size: 0.82rem;
}

.cx-bars--lg .cx-bar__track {
  height: 0.7rem;
}

/* -------------------------------------------------------------------------------------
   11. All-competencies table + its filter
   ------------------------------------------------------------------------------------- */
.cx-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.3rem 0 0.9rem;
}

.cx-filter__q,
.cx-filter__cat,
.cx-filter__cov {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--cx-border);
  border-radius: 0.3rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
}

.cx-filter__q {
  flex: 1 1 16rem;
  min-width: 0;
}

.cx-filter__q:focus,
.cx-filter__cat:focus,
.cx-filter__cov:focus {
  outline: 2px solid var(--cx-key);
  outline-offset: 1px;
}

.cx-filter__count {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
  font-variant-numeric: tabular-nums;
}

.cx-table-wrap {
  overflow-x: auto;
}

.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.cx-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--cx-border);
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
}

.cx-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--cx-border);
  vertical-align: top;
  line-height: 1.55;
}

.cx-table tbody tr:hover {
  background: var(--cx-surface);
}

.cx-table td a {
  font-weight: 600;
  text-decoration: none;
}

.cx-td-cat {
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
}

.cx-td-target {
  color: var(--md-default-fg-color--light);
  max-width: 34rem;
}

.cx-td-cov {
  text-align: right;
}

.cx-pill {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.8rem;
  background: rgba(47, 122, 79, 0.12);
  color: var(--cx-ok);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.cx-pill--gap {
  background: rgba(154, 91, 43, 0.12);
  color: var(--cx-warn);
  font-weight: 600;
}

.md-typeset .cx-filter__empty {
  padding: 1.6rem 0;
  color: var(--md-default-fg-color--light);
  text-align: center;
}

/* -------------------------------------------------------------------------------------
   12. Further Information links, and the gaps list
   ------------------------------------------------------------------------------------- */
.md-typeset .cx-links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.45rem;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.md-typeset .cx-links li {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--cx-border);
  border-radius: 0.3rem;
  background: var(--cx-surface);
  transition: border-color 125ms;
}

.md-typeset .cx-links li:hover {
  border-color: var(--cx-key);
}

.md-typeset .cx-links li a {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.cx-link__desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
}

.cx-link__host {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.66rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .cx-gaps ul {
  columns: 2;
  column-gap: 2rem;
}

.md-typeset .cx-gaps li {
  break-inside: avoid;
}

/* -------------------------------------------------------------------------------------
   13. Narrow screens
   ------------------------------------------------------------------------------------- */
@media screen and (max-width: 44.9375em) {
  .md-typeset h1.cx-hero__title {
    font-size: 1.65rem;
  }

  .md-typeset .cx-hero__lede {
    font-size: 1rem;
  }

  .md-typeset .cx-rung__act,
  .md-typeset .cx-rung__reach {
    padding-left: 0;
  }

  .cx-bar {
    grid-template-columns: 1fr auto;
    gap: 0.3rem 0.7rem;
  }

  .cx-bar__label {
    grid-column: 1 / -1;
  }

  .md-typeset .cx-gaps ul {
    columns: 1;
  }

  .cx-td-target {
    display: none;  /* the target statement is the first thing to go on a phone */
  }
}
