/* NV9P "Front Range at Dusk" theme. See specs/2026-10-18-dusk-theme-design.md */

:root {
  --nv-sky-1: #1b1f3a;
  --nv-sky-2: #6a3a5c;
  --nv-sky-3: #ff7043;
  --nv-sky-4: #ffb74d;
  --nv-ridge-1: #4a2f4a;
  --nv-ridge-2: #2a1f33;
  --nv-ridge-3: #17131f;
  --nv-accent: #ff7043;
  --nv-peach: #ffd9c2;
  --nv-panel: #23252e;
}

/* Map the theme's accent colors onto the dusk palette */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--nv-accent);
  --md-primary-fg-color--light: #ff8a65;
  --md-primary-fg-color--dark: #f4511e;
  --md-accent-fg-color: var(--nv-accent);
  --md-typeset-a-color: #ff8a65;
}

/* Header and tabs sit on the top of the dusk sky */
.md-header {
  background-color: var(--nv-sky-1);
  color: #fff;
}

.md-header__topic:first-child {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* The theme reserves a slot right of search for a repository link; this site
   has none, so drop the empty slot and let search sit at the right edge */
.md-header__source:not(:has(*)) {
  display: none;
}

.md-tabs {
  background-color: var(--nv-sky-1);
  color: var(--nv-peach);
  box-shadow: none;
}

.md-tabs__item--active .md-tabs__link {
  color: #fff;
  opacity: 1;
  box-shadow: 0 2px 0 var(--nv-accent);
}

/* Banner: sky, orbit, satellite, radiosonde and Front Range ridges */
.nv-banner {
  position: relative;
  overflow: hidden;
  background-color: var(--nv-sky-1);
  color: #fff;
}

.nv-banner--home {
  /* Grow with the width (300/1100 of it) so wide screens keep the whole sky */
  height: clamp(320px, 27.3vw, 720px);
}

.nv-banner--slim {
  height: 150px;
}

.nv-banner__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nv-banner__inner {
  position: relative;
  height: 100%;
  padding: 0 0.8rem;
}

.nv-banner__copy {
  padding-top: 56px;
  max-width: 32rem;
}

.nv-banner--slim .nv-banner__copy {
  padding-top: 40px;
  max-width: 40rem;
}

.nv-banner p {
  margin: 0;
}

.nv-banner__call {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.nv-banner__tagline {
  margin-top: 10px !important;
  font-size: 16px;
  opacity: 0.92;
}

.nv-banner__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(23, 19, 31, 0.6);
  overflow-wrap: anywhere;
}

.nv-banner__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.nv-banner__tags li {
  font: 600 12px/1 ui-monospace, Menlo, monospace;
  padding: 6px 9px;
  border-radius: 4px;
  background: rgba(255, 112, 67, 0.18);
  color: #ffab91;
  border: 1px solid rgba(255, 112, 67, 0.5);
}

/* The banner shows the page's first H1, so hide it visually but keep it for screen readers */
.md-container:has(.nv-banner) .md-content__inner > h1:first-of-type {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Phones and small tablets: copy on top, artwork below it, cropped around
   the balloon and satellite so nothing sits behind the text */
@media screen and (max-width: 47.9375em) {
  .nv-banner--home {
    height: 440px;
  }

  .nv-banner--home .nv-banner__art {
    inset: auto;
    top: 170px;
    /* Centered on the balloon and satellite, but never leaving a gap at either edge */
    left: clamp(calc(100% - 990px), calc(50% - 702px), 0px);
    width: 990px;
    height: 270px;
  }

  .nv-banner__copy {
    padding-top: 28px;
  }

  .nv-banner__call {
    font-size: 42px;
  }

  .nv-banner__title {
    font-size: 22px;
  }

  .nv-banner--slim .nv-banner__copy {
    padding-top: 28px;
  }
}

/* "What I'm working on right now" panel */
.md-typeset .nv-now {
  margin: 0 0 1.6em;
  padding: 16px 18px;
  border: 1px solid #3a2e3a;
  border-radius: 8px;
  background: linear-gradient(180deg, #24202b, #1e1f27);
}

.md-typeset .nv-now__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.md-typeset .nv-now__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--nv-peach);
}

.nv-now__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nv-accent);
  box-shadow: 0 0 0 4px rgba(255, 112, 67, 0.2);
}

.nv-now__updated {
  margin-left: auto;
  font-size: 12px;
  color: var(--md-default-fg-color--light);
}

.md-typeset ul.nv-now__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.md-typeset ul.nv-now__items > li.nv-now__item {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.nv-now__item strong {
  display: block;
  font-size: 14px;
  color: #fff;
}

.nv-now__icon {
  flex: none;
  width: 20px;
  color: var(--nv-accent);
}

.nv-now__icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media screen and (max-width: 43.75em) {
  .md-typeset ul.nv-now__items {
    grid-template-columns: 1fr;
  }
}

/* Homepage: latest posts as cards; project headings get the card's orange edge */
.md-container:has(.nv-banner--home) .md-typeset h4:has(> a) {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-top: 3px solid var(--nv-accent);
  border-radius: 6px;
  background: var(--nv-panel);
  font-size: 15px;
}

.md-container:has(.nv-banner--home) .md-typeset h4 > a {
  color: #fff;
  text-decoration: none;
}

.md-container:has(.nv-banner--home) .md-typeset h4 > a:hover {
  color: #ff8a65;
}

.md-container:has(.nv-banner--home) .md-typeset h3 {
  padding-left: 12px;
  border-left: 3px solid var(--nv-accent);
}

/* The homepage, and pages with full_width: true, have no section navigation
   worth a sidebar on desktop; on smaller screens the same sidebar is the menu
   drawer, so keep it there */
@media screen and (min-width: 76.25em) {
  .md-container:has(.nv-banner--home, .nv-banner--full) .md-sidebar--primary {
    display: none;
  }
}
