.padded-image {
    padding: 1em;
    border: none;
    outline: none;
}

/* Default image styles for block images */
img {
    max-width: 100%;
    height: auto;
    display: block; /* Ensures images are treated as block elements */
    margin: 4px auto; /* Centers the image horizontally with spacing */
    border: 1px solid #e0e0e0; /* Tiny border for visual separation */
}

/* Operator label (+ = etc.) centered under a 250px image */
.img-operator {
  width: 250px;
  margin: 0 auto;
  text-align: center;
  font-size: 2em;
  font-weight: bold;
}

/* Inline images for small icons */
.inline-img {
    display: inline;
    max-width: none; /* Allow images to retain their natural size unless otherwise specified */
    vertical-align: middle; /* Align with text vertically */
}

/* Style for user input in sample runs. */
.input {
  color: #d60000;
  font-weight: 700;
  text-decoration: underline;
  background-color: transparent;
}

/* Quarto-native sample output blocks used in lab pages. */
.sample-output {
  margin: 0.75rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.45;
}

.sample-output .line-block {
  margin: 0;
}

/* Ensure figure captions meet AA contrast on white backgrounds. */
figure figcaption,
.figure-caption {
  color: #71777c !important;
}

/*
More standout for sections
*/

/* --- Main H2 Headings --- */
h2 {
  font-size: 2em !important;
  font-weight: 600 !important;      /* A strong, but not-too-heavy, bold */
  margin-top: 3rem !important;       /* BIG space above to separate sections */
  padding-left: 0.75rem !important;  /* Space for the bar */
  
  /* This is the accent bar! */
  border-left: 32px solid #0366d6 !important; /* A nice, noticeable blue */
  
  /* Remove the old bottom border */
  border-bottom: none !important;
}

/* --- Sub-H3 Headings --- */
h3 {
  font-size: 1.5em !important;
  font-weight: 600 !important;
  margin-top: 2rem !important;        /* Generous space above */
  padding-left: 0.5rem !important;    /* Space for the bar */
  
  /* This is the lighter, thinner accent bar */
  border-left: 24px solid #959da5 !important; /* A more subtle grey */

  /* Remove the old bottom border */
  border-bottom: none !important;
}

/* Style only the AI terminology table in lab 09_regression. */
table.gnome-ai-terminology-table,
table.gnome-ai-terminology-table thead,
table.gnome-ai-terminology-table tbody,
table.gnome-ai-terminology-table tr,
table.gnome-ai-terminology-table th,
table.gnome-ai-terminology-table td {
  background-color: transparent !important;
  vertical-align: top !important;
}

/* Don't show authors and date in title block */
#title-block-header .quarto-title-meta {
  display: none !important;
}

/* Unified fenced code block styling across all languages. */
:root {
  --code-block-bg: #f8fafc;
  --code-block-border: #d0d7de;
  --code-block-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.55);
  --code-inline-bg: #eef2ff;
}

/* Shared visual treatment for all block code containers. */
div.sourceCode,
pre:is(
  .shell,
  .terminal,
  .text,
  .bash,
  .console,
  [class^="language-"],
  [class*=" language-"]
),
pre:not(.sourceCode):not(.shell):not(.terminal):not(.text):not(.bash):not(.console):not([class^="language-"]):not([class*=" language-"]) {
  margin: 1.15rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--code-block-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--code-block-bg) 100%);
  box-shadow: var(--code-block-shadow);
  line-height: 1.5;
}

/* Pandoc/Quarto highlighted code blocks render a wrapper + inner pre. */
div.sourceCode {
  padding: 0;
  overflow: hidden;
}

div.sourceCode pre,
pre.sourceCode {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

pre:is(
  .shell,
  .terminal,
  .text,
  .bash,
  .console,
  [class^="language-"],
  [class*=" language-"]
):not(.sourceCode),
pre:not(.sourceCode):not(.shell):not(.terminal):not(.text):not(.bash):not(.console):not([class^="language-"]):not([class*=" language-"]) {
  overflow-x: auto;
}

pre:is(
  .shell,
  .terminal,
  .text,
  .bash,
  .console,
  [class^="language-"],
  [class*=" language-"]
) code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Keep inline code distinct without affecting fenced blocks. */
p code,
li code,
td code,
th code {
  background: var(--code-inline-bg);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

/* Improve contrast in callouts, where Quarto can apply local backgrounds. */
.callout div.sourceCode {
  background: #ffffff;
}

/* Keep Quarto section numbers fully black in headings and TOC. */
.header-section-number {
  color: #000 !important;
  opacity: 1 !important;
}

/* Accessibility: avoid low-contrast muted text in blockquote content. */
blockquote,
blockquote p,
blockquote li {
  color: var(--bs-body-color, #212529) !important;
}

/* Visible external-link marker paired with hidden assistive text. */
.external-link-icon {
  display: inline;
  margin-left: 0.18em;
  padding: 0.01em 0.16em;
  border: 1px solid currentColor;
  border-radius: 0.16em;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.2em;
  text-decoration: none;
}

/* ── Style guide: good/bad code indicators ────────────────────────────── */

/* Small colored square preceding "Good Style" / "Bad Style" labels */
.color-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}
.bg-bad  { background-color: #dc3545; } /* Bootstrap danger red   */
.bg-good { background-color: #198754; } /* Bootstrap success green */

/* Colored left border around "bad" code examples */
.code-border-bad {
  border-left: 4px solid #dc3545;
  padding-left: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}
/* Colored left border around "good" code examples */
.code-border-good {
  border-left: 4px solid #198754;
  padding-left: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}

/* ── Hide text visually while keeping it available to screen readers. ─── */
/* Hide text visually while keeping it available to screen readers. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Website navbar (UM branding) ─────────────────────────────────────── */

.navbar {
  background-color: #00274C !important;
  border-bottom: 3px solid #FFCB05;
}

#quarto-header {
  position: relative !important;
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

body {
  padding-top: 0 !important;
}

.navbar .navbar-brand {
  color: #FFFFFF !important;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.90) !important;
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #FFCB05 !important;
}

.navbar .nav-link.active,
.navbar .nav-item.active .nav-link {
  color: #FFCB05 !important;
  font-weight: 700;
}

/* Dropdown menus from the navbar */
.navbar .dropdown-menu {
  border-top: 3px solid #FFCB05;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: #f0f4f8;
  color: #00274C;
}

/* ── Left sidebar (docs section) ──────────────────────────────────────── */

#quarto-sidebar {
  border-right: 1px solid #dee2e6;
}

.sidebar-title {
  font-weight: 700;
  color: #00274C;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #FFCB05;
  margin-bottom: 0.75rem;
}

.sidebar-item .sidebar-item-text {
  font-size: 0.9rem;
}

.sidebar-item-container .sidebar-item-text:hover {
  color: #00274C;
}

.sidebar-item.active > .sidebar-item-container .sidebar-item-text {
  color: #00274C;
  font-weight: 600;
}

/* Section headers in sidebar */
.sidebar-section > .sidebar-item-container .sidebar-item-text {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a6475;
}

/* ── Scope heading accent bars to page content only ───────────────────── */
/* Keep the large accent bars out of sidebar and navbar elements */

nav h2, nav h3,
.quarto-sidebar h2, .quarto-sidebar h3,
#quarto-sidebar h2, #quarto-sidebar h3,
#quarto-margin-sidebar h2, #quarto-margin-sidebar h3 {
  font-size: revert !important;
  font-weight: revert !important;
  margin-top: revert !important;
  padding-left: revert !important;
  border-left: none !important;
  border-bottom: revert !important;
}

/* ── Index/landing page cards (for labs, tutorials, projects) ─────────── */

/* Table enhancements for the index listing pages */
.quarto-listing table {
  width: 100%;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.nav-footer {
  border-top: 1px solid #dee2e6;
  background-color: #f8f9fa;
  font-size: 0.85rem;
  color: #6c757d;
}

/* ── Tutorial breadcrumb strip (top of each tutorial page) ───────────── */

.tnav-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  background: #f0f4f9;
  border: 1px solid #c8d6e8;
  border-left: 4px solid #00274C;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  margin-bottom: 1.75rem;
}

.tnav-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00274C;
  white-space: nowrap;
}

.tnav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tnav-item a,
.tnav-item.tnav-current {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
  border: 1px solid #96aec8;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tnav-item a {
  background: #ffffff;
  color: #00274C;
}

.tnav-item a:hover {
  background: #00274C;
  color: #FFCB05;
  border-color: #00274C;
  text-decoration: none;
}

.tnav-item.tnav-current {
  background: #00274C;
  color: #FFCB05;
  border-color: #00274C;
  font-weight: 700;
  cursor: default;
}

/* ── Tutorial prev / next pager (bottom of each tutorial page) ────────── */

.tnav-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 2px solid #e0e8f0;
}

.tnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tnav-btn:hover {
  text-decoration: none;
}

.tnav-prev {
  background: #ffffff;
  border: 2px solid #00274C;
  color: #00274C;
}

.tnav-prev:hover {
  background: #00274C;
  color: #FFCB05;
}

.tnav-next {
  background: #00274C;
  border: 2px solid #00274C;
  color: #FFCB05;
  margin-left: auto;
}

.tnav-next:hover {
  background: #FFCB05;
  color: #00274C;
  border-color: #FFCB05;
}

.tnav-ghost {
  opacity: 0;
  pointer-events: none;
}

/* ── Highlighted lines in display code blocks ────────────────────────── */

/* box-shadow extends the yellow left into pre padding and right past the
   longest line; div.sourceCode { overflow: hidden } clips the right edge. */
code span.hll {
  display: block;
  background-color: #fff3cd;
  box-shadow: -1.1rem 0 0 0 #fff3cd, 1000px 0 0 0 #fff3cd;
}

/* ── Left-align content on floating-sidebar pages ───────────────────── */
/* Quarto's floating sidebar layout has a 5fr left gutter that centers the
   content block on wide screens. Removing it anchors the page to the left
   edge (matching the behaviour of docked-sidebar pages). Desktop only. */
@media (min-width: 992px) {
  body.floating .page-columns {
    grid-template-columns:
      [screen-start] 1.5em [screen-start-inset page-start]
      minmax(25px, 50px) [page-start-inset] minmax(50px, 150px)
      [body-start-outset] minmax(25px, 50px) [body-start] 1.5em
      [body-content-start] minmax(500px, calc(800px - 3em))
      [body-content-end] 1.5em [body-end] minmax(25px, 50px)
      [body-end-outset] minmax(50px, 150px) [page-end-inset]
      minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em
      [screen-end] !important;
  }
}

/* ── TOC list visibility ─────────────────────────────────────────────── */
/* Quarto's JS removes the Bootstrap "collapse" class to show the TOC list,
   but that JS is an ES module and browsers block modules on file:// URLs.
   Force the list visible so the TOC works regardless. */
#TOC > ul {
  display: block !important;
}

/* ── Active TOC link (left-side TOC on lab/project pages) ────────────── */

.toc-actions a.active,
#TOC a.active {
  color: #00274C !important;
  font-weight: 600;
  border-left: 3px solid #FFCB05;
  padding-left: 0.4rem;
}
