@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Sen:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap");

/* Toolkit adaptation of the AlvaradoCSS editorial system. */
:root {
  --burgundy: #871548;
  --burgundy-dark: #5e0d32;
  --pink: #bd1763;
  --teal: #157c87;
  --teal-dark: #0d5962;
  --ink: #1f201d;
  --muted: #64645f;
  --paper: #f4f0e9;
  --white: #fff;
  --line: rgba(31, 32, 29, 0.18);
  --credential-accent: #8fe4e8;
  --font-editorial: "Source Serif 4", Georgia, serif;
  --font-identity: "Sen", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-link-color: var(--burgundy);
  --bs-link-hover-color: var(--burgundy-dark);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.68;
}

/* Quarto navigation, restyled to carry the AlvaradoCSS identity. */
.navbar {
  min-height: 76px;
  padding: 0 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: var(--white);
  background: rgba(94,13,50,.97) !important;
  box-shadow: none;
  font-family: var(--font-identity);
  backdrop-filter: blur(12px);
}
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .dropdown-toggle,
.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .show > .nav-link { color: var(--white) !important; }
.navbar-brand {
  max-width: min(56vw, 560px);
  overflow: hidden;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.navbar .nav-link {
  padding: .48rem .62rem !important;
  border-radius: 0;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus-visible { background: rgba(255,255,255,.08); }
.navbar .nav-link[href$="../index.html"] {
  letter-spacing: .04em;
  text-transform: none !important;
}

/* The parent-site destination remains distinct from Toolkit Home in both the
   expanded navbar and Quarto's collapsed mobile menu. */
.navbar .nav-link[href$="../index.html"] {
  border-left: 1px solid rgba(255,255,255,.28);
  margin-left: .4rem;
  padding-left: .9rem !important;
}

/* Give the parent-site link its own left column while centering the three
   Toolkit destinations as a group. The matching flexible edge columns keep
   the middle group centered on the viewport, independent of link widths. */
@media (min-width: 992px) {
  .navbar .navbar-container { position: relative; }
  .navbar .navbar-collapse > .navbar-nav:first-child {
    position: absolute;
    left: 50%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto) minmax(0, 1fr);
    align-items: center;
    width: 100vw;
    margin-right: 0 !important;
    padding: 0 2.5rem;
    transform: translateX(-50%);
  }
  .navbar .navbar-collapse > .navbar-nav:first-child > .nav-item:first-child {
    justify-self: start;
  }
  .navbar .nav-link[href$="../index.html"] {
    border-left: 0;
    margin-left: 0;
    padding-left: .62rem !important;
  }
}
.navbar-toggler { border-color: rgba(255,255,255,.38); }
.navbar-toggler-icon { filter: brightness(0) invert(1); }
.dropdown-menu {
  padding: .55rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 0;
  background: var(--burgundy-dark);
  box-shadow: 0 14px 34px rgba(31,32,29,.24);
}
.dropdown-item {
  padding: .65rem .75rem;
  color: var(--white);
  font-family: var(--font-identity);
  font-size: .76rem;
}
.dropdown-item:hover,
.dropdown-item:focus { color: var(--white); background: rgba(255,255,255,.10); }

/* Main editorial canvas. */
#quarto-content { max-width: 100%; }
main.content { padding-bottom: 5rem; }
.quarto-title-banner { background: transparent; }
.quarto-title-block { margin-bottom: 2.8rem; }
.quarto-title .title,
h1, h2, h3, h4 {
  color: var(--ink);
  font-family: var(--font-editorial);
  font-weight: 500;
  letter-spacing: -.03em;
  text-wrap: balance;
}

/* Match the homepage course-list heading to the navbar's base burgundy. */
#reading-lists-from-my-courses > h2 {
  color: var(--burgundy-dark);
}

.quarto-title .title {
  max-width: 980px;
  font-size: clamp(3rem, 5.6vw, 5.9rem);
  line-height: .94;
}
.quarto-title .subtitle {
  max-width: 900px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1.08rem;
}
h1 { line-height: .98; }
h2 {
  margin-top: 2.7rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.04;
}
h3 {
  margin-top: 1.85rem;
  color: var(--burgundy);
  font-size: clamp(1.35rem, 1.9vw, 1.78rem);
  line-height: 1.16;
}

/* Module titles use the toolkit teal accent. */
#modules h2 { color: var(--teal); }
p, li { max-width: 78ch; }
p { margin-bottom: .9rem; }
strong { font-weight: 700; }

/* Presentation lead-ins use a restrained editorial small-caps marker. */
.presentation-lead {
  color: var(--teal);
  font-family: var(--font-editorial);
  font-size: .88em;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: .045em;
  white-space: nowrap;
}
.presentation-lead::after {
  display: inline-block;
  width: 1.05em;
  height: 1px;
  margin: 0 .58em .18em .62em;
  background: currentColor;
  content: "";
  vertical-align: middle;
}
a { color: var(--burgundy); }
a:hover { color: var(--burgundy-dark); }

/* Course landing page. Homepage layouts are scoped through the
   presence of the curriculum deck; shared typography remains above. */
body:has(.curriculum-deck) .quarto-title-block {
  margin-bottom: 1.15rem;
}
body:has(.curriculum-deck) .quarto-title .title {
  font-weight: 500;
  line-height: .97;
  letter-spacing: -.032em;
}

.toolkit-intro {
  max-width: 880px;
  margin: .15rem 0 1.75rem;
  color: var(--ink);
  font-family: var(--font-editorial);
  font-size: clamp(1.22rem, 1.85vw, 1.55rem);
  line-height: 1.48;
}
body:has(.curriculum-deck) main.content > section.level2:first-of-type > h2,
body:has(.curriculum-deck) main.content > h2:first-of-type {
  margin-top: 1.65rem;
  margin-bottom: 1.05rem;
  padding-bottom: .38rem;
  border-bottom: 1px solid rgba(31,32,29,.14);
  font-size: clamp(1.8rem, 2.5vw, 2.45rem);
  font-weight: 500;
  line-height: 1.08;
}

.curriculum-deck {
  --deck-ink: #20211e;
  display: grid;
  gap: .9rem;
  width: min(100%, 1320px);
  margin: 1.25rem 0 3rem;
}

.curriculum-card {
  --card-accent: var(--teal);
  --card-wash: rgba(21,124,135,.055);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 19vw, 245px);
  min-height: 265px;
  overflow: hidden;
  border: .75px solid color-mix(in srgb, var(--card-accent) 38%, var(--line));
  background:
    linear-gradient(90deg, rgba(255,255,255,.62) 0 67%, var(--card-wash) 67% 100%);
  box-shadow: none;
}

.curriculum-card--data {
  --card-accent: #157c87;
  --card-wash: rgba(21,124,135,.075);
}
.curriculum-card--code {
  --card-accent: #a48a10;
  --card-wash: rgba(164,138,16,.075);
}
.curriculum-card--css {
  --card-accent: #287c45;
  --card-wash: rgba(40,124,69,.07);
}
.curriculum-card--ai {
  --card-accent: #6858a5;
  --card-wash: rgba(104,88,165,.075);
}

.curriculum-card__copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 760px;
  padding: 2.05rem 3.15rem 1.9rem 2.7rem;
}
.curriculum-card__copy h3 {
  max-width: 18ch;
  margin: 0 0 .65rem;
  color: var(--deck-ink);
  font-size: clamp(1.65rem, 2.5vw, 2.45rem);
  line-height: 1.04;
}
.curriculum-card__copy p {
  max-width: 66ch;
  margin-bottom: .68rem;
  color: var(--muted);
  line-height: 1.72;
}
.curriculum-card__copy p:first-of-type {
  margin-bottom: .5rem;
  color: var(--card-accent);
  font-family: var(--font-identity);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .045em;
  text-transform: uppercase;
  line-height: 1.45;
}

.curriculum-card__mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 0;
  color: var(--card-accent);
}
.curriculum-card__mark img {
  display: block;
  width: min(132%, 340px);
  height: auto;
  max-height: 350px;
  object-fit: contain;
  transform: translateX(-7%);
}

/* Preserve the existing visible illustration scale and optical corrections. */
.curriculum-card--data .curriculum-card__mark img { width: min(136%, 350px); }
.curriculum-card--code .curriculum-card__mark img { width: min(132%, 340px); }
.curriculum-card--css .curriculum-card__mark img { width: min(134%, 345px); }
.curriculum-card--ai .curriculum-card__mark img { width: min(132%, 340px); }

.course-link {
  display: inline-flex;
  align-items: baseline;
  margin-top: .3rem;
  padding-bottom: 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--card-accent) 72%, transparent);
  color: var(--card-accent);
  font-family: var(--font-identity);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .105em;
  text-decoration: none;
  text-transform: uppercase;
}
.course-link::after {
  content: "→";
  width: 0;
  overflow: visible;
  transform: translateX(0);
  transition: transform 150ms ease;
}
.course-link:hover,
.course-link:focus-visible {
  color: var(--ink);
}
.course-link:hover::after,
.course-link:focus-visible::after {
  transform: translateX(.22rem);
}
.course-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--card-accent) 70%, white);
  outline-offset: 4px;
}
.course-link {
  font-size: 0;
}
.course-link::before {
  content: "Explore Syllabus";
  font-size: .68rem;
}
.course-link::after {
  width: auto;
  margin-left: .25rem;
  font-size: .68rem;
}
@media (prefers-reduced-motion: reduce) {
  .course-link::after { transition: none; }
  .course-link:hover::after,
  .course-link:focus-visible::after { transform: none; }
}

.curriculum-pathway {
  max-width: 980px;
  margin: 2rem 0 3rem;
  padding: 1.15rem 1.3rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.curriculum-pathway > p:first-child {
  margin-bottom: .45rem;
  font-family: var(--font-identity);
}
.curriculum-pathway > p:nth-child(2) {
  margin: 0 0 .65rem;
  color: var(--teal-dark);
  font-family: var(--font-identity);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .015em;
}
.curriculum-pathway > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

/* Typography-led editorial closing section for optional lessons. */
.toolkit-note {
  display: block;
  width: min(100%, 1320px);
  margin: 3.1rem 0 2.8rem;
  padding: 0;
  border: 0;
  border-top: 2px solid var(--teal);
  background: transparent;
}
.toolkit-note__heading {
  padding: 1rem 0 1.05rem;
  border-bottom: 1px solid var(--line);
}
.toolkit-note__heading h3 {
  max-width: none;
  margin: 0;
  color: var(--teal-dark);
  font-size: clamp(2.15rem, 3.35vw, 2.55rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.toolkit-nowrap {
  white-space: nowrap;
}
.toolkit-note__body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.35rem, 2.5vw, 2.4rem);
  padding: 1.05rem 0 1.15rem;
  border-bottom: 1px solid var(--line);
}
.toolkit-note__column {
  min-width: 0;
}
.toolkit-note__column > p {
  max-width: none;
  margin: 0;
  line-height: 1.66;
}
.toolkit-contact {
  margin-top: .72rem;
  color: var(--ink);
  line-height: 1.5;
}
.toolkit-copy-email {
  display: inline-flex;
  align-items: center;
  gap: .34rem;
  margin: 0;
  padding: .02rem .06rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 54%, transparent);
  border-radius: 0;
  color: var(--teal-dark);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.toolkit-copy-email:hover {
  color: var(--burgundy);
  border-bottom-color: color-mix(in srgb, var(--burgundy) 58%, transparent);
}
.toolkit-copy-email:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.toolkit-copy-email .bi {
  font-size: .82em;
  line-height: 1;
}
.toolkit-copy-status {
  display: inline-block;
  min-width: 3.8em;
  margin-left: .45rem;
  color: var(--teal-dark);
  font-family: var(--font-identity);
  font-size: .72rem;
  font-weight: 600;
}

@media (max-width: 980px) and (min-width: 761px) {
  .toolkit-note__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolkit-note__column:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.35rem, 2.5vw, 2.4rem);
    align-items: start;
  }
  .toolkit-note__column:last-child .toolkit-contact {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  body:has(.curriculum-deck) .quarto-title-block {
    margin-bottom: .9rem;
  }
  .toolkit-intro {
    margin-bottom: 1.45rem;
    font-size: 1.18rem;
  }
  body:has(.curriculum-deck) main.content > section.level2:first-of-type > h2,
  body:has(.curriculum-deck) main.content > h2:first-of-type {
    margin-top: 1.35rem;
  }
  .curriculum-card {
    grid-template-columns: 1fr;
    min-height: 0;
    background: rgba(255,255,255,.55);
  }
  .curriculum-card__copy {
    padding: 1.8rem 1.75rem 1.35rem;
  }
  .curriculum-card__copy h3 {
    max-width: 20ch;
  }
  .curriculum-card__mark {
    min-height: 150px;
    padding-bottom: 1.25rem;
    background: var(--card-wash);
  }
  .curriculum-card__mark img {
    width: min(82vw, 255px);
    max-height: 275px;
    transform: translateX(-3%);
  }
  .curriculum-card--data .curriculum-card__mark img { width: min(84vw, 265px); }
  .curriculum-card--code .curriculum-card__mark img { width: min(82vw, 255px); }
  .curriculum-card--css .curriculum-card__mark img { width: min(83vw, 260px); }
  .curriculum-card--ai .curriculum-card__mark img { width: min(82vw, 255px); }

  .toolkit-note {
    margin-top: 2.7rem;
  }
  .toolkit-note__heading {
    padding: .85rem 0 .9rem;
  }
  .toolkit-note__heading h3 {
    font-size: clamp(1.72rem, 8vw, 2.1rem);
    line-height: 1.1;
  }
  .toolkit-note__body {
    grid-template-columns: 1fr;
    gap: .8rem;
    padding: .9rem 0 1rem;
  }
  .toolkit-contact {
    margin-top: .58rem;
  }
}

.btn-primary {
  border-color: var(--burgundy);
  border-radius: 0;
  background: var(--burgundy);
  font-family: var(--font-identity);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.btn-primary:hover,
.btn-primary:focus { border-color: var(--burgundy-dark); background: var(--burgundy-dark); }

/* Table of contents follows the teal/burgundy editorial accents. */
.sidebar nav[role=doc-toc] { font-family: var(--font-identity); }
.sidebar nav[role=doc-toc] ul > li > a {
  color: var(--muted);
  font-size: .78rem;
}
.sidebar nav[role=doc-toc] ul > li > a.active,
.sidebar nav[role=doc-toc] ul > li > ul > li > a.active,
#TOC .nav-link.active,
#TOC a.active {
  border-left-color: var(--teal) !important;
  color: var(--teal) !important;
  font-weight: 700;
}

/* Full bibliography entries surfaced inside module reading lists. */
.bibentry-item {
  max-width: 78ch;
  margin: .35rem 0 .8rem;
}
.bibentry-item > p {
  margin: 0;
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}
.bibentry-item a,
#refs a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Central References page continues to use citeproc's CSL bibliography. */
#refs { max-width: 78ch; font-size: .94rem; }
#refs .csl-entry {
  position: relative;
  margin-bottom: .75rem;
  padding-left: 4.2rem;
  text-indent: -1.5rem;
}

/* Course markers on the References page are inserted after rendering from a
   syllabus-derived map. This keeps marker placement independent of citeproc markup. */
.course-marker-legend {
  max-width: 78ch;
  margin: .7rem 0 1.35rem;
  padding: .7rem .9rem;
  border-left: 0;
  background: rgba(255,255,255,.38);
  font-size: .82rem;
  line-height: 1.55;
}
.course-marker-legend p { margin: 0; }

#refs .course-ref-markers {
  position: absolute;
  top: .05rem;
  left: 0;
  display: inline-flex;
  gap: .12rem;
  width: 2.45rem;
  text-indent: 0;
  white-space: nowrap;
  font-size: .82rem;
  line-height: 1.45;
}

/* Keep anchored headings comfortably below the pinned navbar. */
section[id],
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: 92px;
}

/* Let Quarto's own wrappers handle wide scholarly content without allowing it
   to force the page wider than a phone viewport. */
.table-responsive,
.cell-output-display,
pre {
  max-width: 100%;
  overflow-x: auto;
}

.nav-footer {
  border-top: 0;
  color: var(--white);
  background: #282822;
  font-family: var(--font-identity);
}
.nav-footer a {
  color: var(--white);
  text-underline-offset: .18em;
}
.nav-footer-left,
.nav-footer-right {
  color: rgba(255,255,255,.72);
}

@media (max-width: 991.98px) {
  .navbar .nav-link[href$="../index.html"] {
    border-top: 1px solid rgba(255,255,255,.2);
    border-left: 0;
    margin: .45rem 0 0;
    padding: .85rem .62rem !important;
  }
}

@media (max-width: 575.98px) {
  .navbar {
    padding-right: 1rem;
    padding-left: 1rem;
  }
  .navbar-brand {
    max-width: calc(100vw - 6.5rem);
  }
  .quarto-title .title {
    overflow-wrap: anywhere;
    font-size: clamp(2.35rem, 12vw, 3.3rem);
  }
  .nav-footer,
  .nav-footer-left,
  .nav-footer-right {
    min-width: 0;
    white-space: normal;
  }
}
