/* USAFA / DFEC course-slide theme.
   Overrides reveal.js's white theme. Applies to every deck via slides.html. */

:root {
  --usafa-blue: #0067b9;
  --usafa-blue-dark: #004a85;
  --usafa-red: #b01e24;
  --slide-ink: #1a1a1a;
  --slide-muted: #5a5a5a;
  --slide-bg: #fafaf7;
  --slide-rule: rgba(0, 48, 135, 0.85);
}

/* Backdrop + base type. */
.reveal, .reveal .slides { background: var(--slide-bg); }
.reveal {
  font-family: "Source Sans Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--slide-ink);
  font-size: 30px;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: "Source Sans Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--usafa-blue-dark);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  text-align: left;
  margin: 0 0 0.4em 0;
  line-height: 1.15;
}
.reveal h1 { font-size: 2.0em; }
.reveal h2 { font-size: 1.55em; }
.reveal h3 { font-size: 1.2em; }

.reveal p, .reveal li { line-height: 1.4; }
.reveal strong { color: var(--usafa-blue-dark); }
.reveal em { color: var(--slide-muted); font-style: italic; }
.reveal a { color: var(--usafa-blue); text-decoration: none; border-bottom: 1px dotted currentColor; }

.reveal blockquote {
  font-style: italic;
  border-left: 4px solid var(--usafa-blue);
  padding: 0.3em 0.9em;
  background: rgba(0, 48, 135, 0.04);
  box-shadow: none;
}

/* Left-align slide bodies globally. Vertical alignment stays reveal's default. */
.reveal .slides { text-align: left; }
.reveal .slides section { text-align: left; }

/* Code. */
.reveal pre { font-size: 0.55em; line-height: 1.3; box-shadow: none; }
.reveal pre code { padding: 12px 16px; max-height: 620px; border-radius: 4px; }
.reveal code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Lists — colored accent on first-level bullets. */
.reveal ul, .reveal ol { display: block; margin: 0.35em 0 0.5em 1.1em; }
.reveal ul li, .reveal ol li { margin: 0.28em 0; padding-left: 0.15em; }
.reveal ul li::marker { color: var(--usafa-blue); }
.reveal ol li::marker { color: var(--usafa-blue); font-weight: 700; }

/* Images: max height so tall shots don't dominate. */
.reveal img {
  max-height: 480px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Persistent per-slide chrome via ::before / ::after on the viewport.
   These float above slide content but below reveal's UI (arrows, progress). */
body.reveal-viewport::before,
body.reveal-viewport::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 30;
}
/* Top rule — thin USAFA-blue accent across every slide. */
body.reveal-viewport::before {
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--usafa-blue);
}
/* USAFA logo, top-right of every slide. */
body.reveal-viewport::after {
  top: 22px;
  right: 22px;
  width: 54px;
  height: 54px;
  background: url("/assets/ece444/img/USAFA-logo.png") no-repeat center / contain;
  opacity: 0.9;
}

/* Callout — big-idea statement. Tinted-blue transparent bg, crisp squircle border, centered. */
.reveal .callout {
  display: block;
  max-width: 80%;
  margin: 1.2em auto;
  padding: 0.9em 1.4em;
  background: rgba(0, 103, 185, 0.08);
  border: 2px solid var(--usafa-blue);
  border-radius: 18px;
  text-align: center;
  color: var(--usafa-blue-dark);
  font-weight: 600;
  font-size: 1.15em;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0, 103, 185, 0.12);
}
.reveal .callout p { margin: 0; }
.reveal .callout p + p { margin-top: 0.4em; }

/* Prose card — bordered, subtly opaque, justified. */
.reveal .slide-box {
  border: 1px solid rgba(0, 48, 135, 0.25);
  background: #ffffff;
  padding: 0.9em 1.1em;
  border-radius: 6px;
  text-align: justify;
  hyphens: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.reveal .slide-box p:last-child,
.reveal .slide-box ol:last-child,
.reveal .slide-box ul:last-child { margin-bottom: 0; }

/* Title slide — apply .title-slide to the first <section> in a deck. */
.reveal .title-slide {
  display: grid !important;
  grid-template-columns: 1.5fr 1fr;
  gap: 2em;
  align-items: center;
  padding: 1.5em 2em;
}
.reveal .title-slide .title-left {
  border-left: 8px solid var(--usafa-blue);
  padding: 0.6em 0 0.6em 1em;
}
.reveal .title-slide h1 {
  font-size: 2.2em;
  color: var(--usafa-blue-dark);
  margin: 0 0 0.25em 0;
}
.reveal .title-slide h1 + p {
  font-size: 1.05em;
  color: var(--slide-muted);
  margin: 0 0 1.1em 0;
}
.reveal .title-slide h2 {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--slide-ink);
  margin: 0 0 0.15em 0;
}
.reveal .title-slide .title-right {
  text-align: center;
}
.reveal .title-slide .title-right img {
  max-height: 380px;
  max-width: 90%;
  box-shadow: none;
  border-radius: 0;
}
/* On the title slide, don't repeat the small top-right logo — the big one carries. */
body.reveal-viewport:has(.title-slide.present)::after { display: none; }

/* Course schedule / module timeline.
   One overarching grid: 5 columns (modules) × 3 rows (top / middle / bottom).
   Zones line up horizontally across every module. Each column is visually
   framed by a card wrapper (.module-frame) sitting behind its three cells. */
.reveal .schedule-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 0;
  column-gap: 0.6em;
  margin: 0.4em 0;
  align-items: stretch;
}
/* Each cell is styled independently — they don't share a parent .module. */
.reveal .schedule-grid .mod-top,
.reveal .schedule-grid .mod-lessons,
.reveal .schedule-grid .mod-bottom {
  background: #ffffff;
  border-left: 1px solid rgba(0, 103, 185, 0.3);
  border-right: 1px solid rgba(0, 103, 185, 0.3);
  padding: 0.55em 0.75em;
  text-align: left;
}
.reveal .schedule-grid .mod-top {
  border-top: 4px solid var(--usafa-blue);
  border-bottom: 1px solid rgba(0, 103, 185, 0.2);
  border-radius: 8px 8px 0 0;
  padding-top: 0.7em;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
}
.reveal .schedule-grid .mod-lessons {
  border-bottom: 1px solid rgba(0, 103, 185, 0.2);
  font-size: 0.68em;
  color: var(--slide-muted);
  font-variant-numeric: tabular-nums;
}
.reveal .schedule-grid .mod-bottom {
  border-bottom: 1px solid rgba(0, 103, 185, 0.3);
  border-radius: 0 0 8px 8px;
  padding-bottom: 0.7em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3em;
  font-size: 0.6em;
  color: var(--slide-ink);
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.reveal .schedule-grid .mod-num {
  font-size: 1.6em;
  font-weight: 800;
  color: var(--usafa-blue);
  line-height: 1;
  display: block;
}
.reveal .schedule-grid .mod-title {
  font-size: 0.75em;
  font-weight: 700;
  color: var(--usafa-blue-dark);
  line-height: 1.2;
  display: block;
  margin-top: 0.15em;
}
.reveal .schedule-grid .milestone {
  display: inline-block;
  background: rgba(176, 30, 36, 0.10);
  color: var(--usafa-red);
  border: 1px solid rgba(176, 30, 36, 0.35);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1em;
}

/* QR code image + optional caption. Usage on any slide:
     <figure class="qr">
       <img src="/assets/.../foo-qr.png" alt="…">
       <figcaption>Scan for …</figcaption>
     </figure>
   Add class "qr-corner" to float it into the top-right corner of the slide. */
.reveal .qr {
  display: inline-block;
  margin: 0.5em auto;
  text-align: center;
  padding: 0.4em;
  background: #fff;
  border: 1px solid rgba(0, 103, 185, 0.25);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.reveal .qr img {
  display: block;
  width: 180px;
  height: 180px;
  max-height: 180px;
  box-shadow: none;
  border-radius: 0;
  margin: 0 auto;
}
.reveal .qr figcaption {
  font-size: 0.55em;
  color: var(--slide-muted);
  margin-top: 0.3em;
  font-style: italic;
}
.reveal .qr.qr-corner {
  position: absolute;
  top: 70px;
  right: 24px;
  margin: 0;
}
.reveal .qr.qr-corner img { width: 130px; height: 130px; max-height: 130px; }

/* Handwriting-style annotation — for margin notes in USAFA red. */
.reveal .ink {
  font-family: "Caveat", "Comic Sans MS", "Bradley Hand", cursive;
  color: var(--usafa-red);
  font-weight: 700;
  transform: rotate(-4deg);
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
}

/* Slide-number pill styling override (reveal.js). */
.reveal .slide-number {
  background: transparent;
  color: var(--slide-muted);
  font-family: inherit;
  font-size: 0.6em;
}

/* Print/PDF export — hide top-right logo watermark to avoid every-page repeat. */
@media print {
  body.reveal-viewport::before,
  body.reveal-viewport::after { display: none; }
}
