/* Written by tools/build_docs.py. One palette, two lightnesses, three hues:
   slate, paper and Python's blue, which are the colours the mark is drawn in.
   Editing this file by hand will be undone on the next build.

   These extend Material's own `default` and `slate` schemes rather than
   replacing them, so the theme keeps every value it relies on and only the
   identity changes. */

:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color:           #2F3E4A;
  --md-primary-fg-color--light:    #3E5160;
  --md-primary-fg-color--dark:     #22303C;
  --md-primary-bg-color:           #FAFBFC;
  --md-primary-bg-color--light:    #D7DDE3;

  --md-accent-fg-color:            #2F81F7;
  --md-accent-fg-color--transparent: #2F81F714;
  --md-accent-bg-color:            #FAFBFC;

  --md-default-bg-color:           #FAFBFC;
  --md-default-fg-color:           #22303C;
  --md-default-fg-color--light:    #5B6B78;
  --md-default-fg-color--lighter:  #8794A0;
  --md-default-fg-color--lightest: #D7DDE3;

  /* The typeset reads its own variables, which is why setting only the
     default colours above left the body text untouched. */
  --md-typeset-color:              #22303C;
  --md-typeset-a-color:            #1F6FD8;

  --md-code-bg-color:              #F1F4F7;
  --md-code-fg-color:              #22303C;

  --md-footer-bg-color:            #22303C;
  --md-footer-bg-color--dark:      #1A2630;
  --md-footer-fg-color:            #FAFBFC;
  --md-footer-fg-color--light:     #AEBAC4;
  --md-footer-fg-color--lighter:   #7D8B98;
}

[data-md-color-scheme="slate"] {
  /* Slate builds its greys from one hue. Moving it to 210 degrees tilts the
     whole dark theme towards the blue-slate the mark is drawn in, rather
     than the violet it ships with. */
  --md-hue: 210;

  --md-primary-fg-color:           #1E2832;
  --md-primary-fg-color--light:    #2A3744;
  --md-primary-fg-color--dark:     #141C23;
  --md-primary-bg-color:           #E6ECF2;
  --md-primary-bg-color--light:    #9AA8B4;

  --md-accent-fg-color:            #6CB0FF;
  --md-accent-fg-color--transparent: #6CB0FF1F;
  --md-accent-bg-color:            #11181E;

  --md-default-bg-color:           #161E26;
  --md-default-fg-color:           #E6ECF2;
  --md-default-fg-color--light:    #9AA8B4;
  --md-default-fg-color--lighter:  #74828F;
  --md-default-fg-color--lightest: #2C3845;

  --md-typeset-color:              #E6ECF2;
  --md-typeset-a-color:            #6CB0FF;

  --md-code-bg-color:              #1B242E;
  --md-code-fg-color:              #E6ECF2;

  --md-footer-bg-color:            #11181E;
  --md-footer-bg-color--dark:      #0D1317;
  --md-footer-fg-color:            #E6ECF2;
  --md-footer-fg-color--light:     #9AA8B4;
  --md-footer-fg-color--lighter:   #6B7885;
}

/* The mark in the title bar sits beside the name, so give it room and keep it
   from being scaled into mush. */
.md-header__button.md-logo :is(img, svg) {
  height: 1.4rem;
  width: auto;
}

/* The course reads better with a measured line length than with the full
   width of a monitor. */
.md-typeset {
  font-size: .78rem;
  line-height: 1.7;
}

/* Tables carry most of the measured results, so they are built to be read
   rather than to decorate. */
.md-typeset table:not([class]) {
  font-size: .70rem;
  border: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset table:not([class]) th {
  background: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
  font-weight: 600;
}

/* Every lesson opens on a quotation, which is the hook, so let it look like
   one rather than like an aside. */
.md-typeset blockquote {
  border-left: 2px solid var(--md-accent-fg-color);
  color: var(--md-default-fg-color);
}

/* The palette control, drawn as a switch rather than left as a bare icon.
   Material shows exactly one of the two labels at a time, so the label is the
   track and its icon is the knob: parked left while the light scheme is on,
   slid right while the dark one is. */
form[data-md-component="palette"] {
  display: flex;
  align-items: center;
}

form[data-md-component="palette"] > label.md-header__button {
  position: relative;
  box-sizing: border-box;
  width: 2.4rem;
  height: 1.2rem;
  margin: 0 .35rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .16);
  opacity: 1;
  transition: background .25s, border-color .25s;
}

form[data-md-component="palette"] > label.md-header__button:hover {
  background: rgba(255, 255, 255, .26);
  border-color: rgba(255, 255, 255, .5);
}

form[data-md-component="palette"] > label.md-header__button svg {
  position: absolute;
  top: 50%;
  width: .96rem;
  height: .96rem;
  padding: .16rem;
  border-radius: 50%;
  background: var(--md-primary-bg-color);
  color: var(--md-primary-fg-color);
  transform: translateY(-50%);
  transition: left .25s ease;
}

[data-md-color-scheme="default"] form[data-md-component="palette"] > label svg {
  left: .08rem;
}

[data-md-color-scheme="slate"] form[data-md-component="palette"] > label svg {
  left: calc(100% - 1.04rem);
}

/* The repository name, in full. Material allows it 11.7rem and
   "Amey-Thakur/AI-ENGINEERING" is wider than that, so it arrived ellipsised. */
/* Material lets this shrink, which is what was clipping the name: raising
   max-width changed nothing because the flex layout, not the maximum, was
   the constraint. Sizing it to its content and refusing to shrink fixes it,
   and the maximum stays as a guard so a longer name cannot crowd the search
   box out. */
.md-header__source {
  flex: 0 0 auto;
  width: auto;
  max-width: 19rem;
  margin-left: .6rem;
}

/* Wide enough for the whole name, and still clipping rather than overlapping
   if a longer one ever arrives. */
.md-source__repository {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .68rem;
}

/* Below the width where both fit, the name goes and the icon stays, which is
   better than half a name. */
@media screen and (max-width: 76.1875em) {
  .md-header__source {
    max-width: none;
  }
}

/* Authorship, on its own line at the foot of every page. */
.md-footer-meta__inner {
  flex-wrap: wrap;
}

/* The curriculum page's progress strip. The boxes are ordinary task list
   items everywhere else; here they are clickable and they keep their place
   in this browser, which is the only place that state exists. */

.progress-note {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem 0.8rem;
  margin: 1.2rem 0 1.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.3rem;
  background: var(--md-code-bg-color);
}

.progress-said {
  grid-column: 1;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--md-default-fg-color);
}

.progress-track {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 0.3rem;
  overflow: hidden;
  border-radius: 0.3rem;
  background: var(--md-default-fg-color--lightest);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 0.3rem;
  background: var(--md-accent-fg-color);
  transition: width 0.25s ease;
}

.progress-reset {
  grid-column: 2;
  grid-row: 1;
  padding: 0.25rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--md-typeset-a-color);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
}

.progress-reset:hover {
  border-color: var(--md-accent-fg-color);
}

.md-content .task-list-item {
  transition: opacity 0.2s ease;
}

.md-content .task-list-item.is-done {
  opacity: 0.55;
}

.md-content .task-list-item.is-done > .task-list-control ~ * {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.md-content .task-list-control input[type="checkbox"] {
  cursor: pointer;
}

.md-content .task-list-item label,
.md-content .task-list-control {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .md-content .task-list-item {
    transition: none;
  }
}

/* The verify page's checker. Paper, slate and Python blue like everything
   else, with one green for a pass and one red for a failure, which are the
   launch kit's own status colours. */

.verify {
  margin: 1.4rem 0 1.8rem;
}

.verify-drop {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  padding: 1.7rem 1rem;
  text-align: center;
  cursor: pointer;
  border: 2px dashed var(--md-default-fg-color--lighter);
  border-radius: 0.3rem;
  background: var(--md-code-bg-color);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.verify-drop:hover,
.verify-drop:focus-visible,
.verify-drop.is-over {
  border-color: var(--md-accent-fg-color);
  outline: none;
}

.verify-drop strong {
  font-size: 0.86rem;
}

.verify-drop span {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
}

.verify-pick {
  padding: 0;
  font: inherit;
  color: var(--md-typeset-a-color);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
}

.verify-manual {
  margin-top: 0.9rem;
  font-size: 0.74rem;
}

.verify-manual > summary {
  cursor: pointer;
  color: var(--md-default-fg-color--light);
}

.verify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.verify-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--md-default-fg-color--light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.verify-grid input {
  padding: 0.4rem 0.5rem;
  font-family: var(--md-code-font-family);
  font-size: 0.74rem;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.2rem;
}

.verify-grid input:focus {
  border-color: var(--md-accent-fg-color);
  outline: none;
}

.verify-go {
  padding: 0.4rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-default-bg-color);
  cursor: pointer;
  background: var(--md-accent-fg-color);
  border: 0;
  border-radius: 0.2rem;
}

.verify-result {
  display: block;
  margin-top: 1.1rem;
}

.verify-result:empty {
  display: none;
}

.verify-result .verify-verdict {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.verify-result.is-pass {
  padding: 0.9rem 1rem;
  border-left: 3px solid #2EA043;
  border-radius: 0 0.2rem 0.2rem 0;
  background: var(--md-code-bg-color);
}

.verify-result.is-fail {
  padding: 0.9rem 1rem;
  border-left: 3px solid #CF222E;
  border-radius: 0 0.2rem 0.2rem 0;
  background: var(--md-code-bg-color);
}

.verify-result.is-pass .verify-verdict {
  color: #2EA043;
}

.verify-result.is-fail .verify-verdict {
  color: #CF222E;
}

.verify-result ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify-result li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.2rem 0.6rem;
  padding: 0.16rem 0;
  font-size: 0.74rem;
}

.verify-result li:not(:has(span)) {
  display: block;
  margin-top: 0.5rem;
  color: var(--md-default-fg-color--light);
}

.verify-result li span {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--md-default-fg-color--light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.verify-result li code {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  background: none;
  padding: 0;
}

/* A table that is a header row and a separator with nothing under it. GitHub
   draws the header alone; Python-Markdown adds one empty cell below it, which
   shows as a stray band. The markdown is right, so the cell is hidden. */

.md-typeset table:not([class]) tbody tr:only-child > td:only-child:empty {
  display: none;
}

.md-copyright {
  width: 100%;
}

.md-copyright__highlight {
  color: var(--md-footer-fg-color);
}
