/* Veil - styles. */

/* Before the runtime starts, the filter marks hidden content, so that it
   does not show for a moment. */
html:not(.veil-ready) [data-veil-hidden] {
  display: none !important;
}

/* After the runtime starts, the `hidden` attribute controls the display,
   also on elements that have a `display` value of their own. */
html.veil-ready [data-veil-group][hidden],
html.veil-ready [data-veil-toc][hidden],
html.veil-ready [data-veil-menu][hidden] {
  display: none !important;
}

/* The interface. Set --veil-bg, --veil-fg, --veil-accent, --veil-radius,
   --veil-border, --veil-shadow, --veil-toast-bg, and --veil-active-bg on any
   parent to change it. The defaults come from the Bootstrap variables in HTML
   and from the theme variables in Reveal.js. */
.veil-ui {
  --veil-ui-bg: var(--veil-bg, var(--r-background-color, var(--bs-body-bg, #fff)));
  --veil-ui-fg: var(--veil-fg, var(--r-main-color, var(--bs-body-color, #212529)));
  --veil-ui-accent: var(--veil-accent, var(--r-link-color, var(--bs-primary, #0d6efd)));
  --veil-ui-radius: var(--veil-radius, var(--bs-border-radius, 0.375rem));
  --veil-ui-border: var(--veil-border, color-mix(in srgb, var(--veil-ui-fg) 35%, transparent));
  --veil-ui-toast-bg: var(--veil-toast-bg, color-mix(in srgb, var(--veil-ui-fg) 92%, transparent));
  --veil-ui-active-bg: var(--veil-active-bg, color-mix(in srgb, var(--veil-ui-accent) 20%, var(--veil-ui-bg)));
  font-family: var(--bs-body-font-family, var(--r-main-font, system-ui, sans-serif));
  font-size: 16px;
  line-height: 1.3;
}

.veil-ui button {
  font: inherit;
  color: var(--veil-ui-fg);
  cursor: pointer;
}

.veil-ui button:focus-visible {
  outline: 3px solid var(--veil-ui-accent);
  outline-offset: 2px;
}

.veil-button,
.veil-popover {
  position: fixed;
  z-index: 2000;
}

.veil-top-left { top: 1rem; left: 1rem; }
.veil-top-right { top: 1rem; right: 1rem; }
.veil-bottom-left { bottom: 1rem; left: 1rem; }
.veil-bottom-right { bottom: 1rem; right: 1rem; }

.veil-popover.veil-with-button.veil-bottom-left,
.veil-popover.veil-with-button.veil-bottom-right { bottom: 4.5rem; }
.veil-popover.veil-with-button.veil-top-left,
.veil-popover.veil-with-button.veil-top-right { top: 4.5rem; }

.veil-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: var(--veil-ui-bg);
  border: 1px solid var(--veil-ui-border);
  border-radius: 50%;
  box-shadow: 0 2px 8px var(--veil-shadow, rgba(0, 0, 0, 0.2));
  opacity: 0.85;
}

.veil-button:hover,
.veil-button:focus-visible,
.veil-button[aria-expanded="true"] {
  opacity: 1;
}

.veil-popover {
  box-sizing: border-box;
  max-width: calc(100vw - 2rem);
  min-width: 14rem;
  padding: 0.75rem;
  color: var(--veil-ui-fg);
  background: var(--veil-ui-bg);
  border: 1px solid var(--veil-ui-border);
  border-radius: var(--veil-ui-radius);
  box-shadow: 0 4px 16px var(--veil-shadow, rgba(0, 0, 0, 0.25));
  text-align: left;
}

.veil-popover[hidden] {
  display: none;
}

.veil-section + .veil-section {
  margin-top: 0.75rem;
}

.veil-heading {
  margin-bottom: 0.35rem;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.veil-ladder {
  display: flex;
  border: 1px solid var(--veil-ui-border);
  border-radius: var(--veil-ui-radius);
  overflow: hidden;
}

.veil-segment {
  flex: 1 1 auto;
  padding: 0.4rem 0.7rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 0 var(--veil-ui-accent);
}

.veil-segment + .veil-segment {
  border-left: 1px solid var(--veil-ui-border);
}

.veil-segment[aria-pressed="true"] {
  font-weight: 600;
  background: var(--veil-ui-active-bg);
  box-shadow: inset 0 -3px 0 0 var(--veil-ui-accent);
}

.veil-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.3rem 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.veil-track {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 1.25rem;
  border: 2px solid var(--veil-ui-fg);
  border-radius: 1rem;
}

.veil-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.75rem;
  height: 0.75rem;
  content: "";
  background: var(--veil-ui-fg);
  border-radius: 50%;
}

.veil-switch[aria-checked="true"] .veil-track {
  background: var(--veil-ui-fg);
}

.veil-switch[aria-checked="true"] .veil-track::after {
  left: auto;
  right: 2px;
  background: var(--veil-ui-bg);
}

.veil-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 2100;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem 1rem;
  color: var(--veil-ui-bg);
  background: var(--veil-ui-toast-bg);
  border-radius: 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.25s ease, visibility 0.25s;
}

.veil-toast.veil-toast-on {
  opacity: 1;
  visibility: visible;
}

/* Quarto websites. The back-to-top link sits at the bottom of the screen, under
   a popover at the bottom. The narrow sidebar opens over the page, under the
   button and the popover. The open popover hides the back-to-top link, and the
   open sidebar hides the button and the popover. */
body:has(.veil-popover:is(.veil-bottom-left, .veil-bottom-right):not([hidden])) #quarto-back-to-top,
body:has(#quarto-sidebar-glass:is(.show, .collapsing)) :is(.veil-button, .veil-popover) {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .veil-toast {
    transition: none;
  }
}

@media print {
  .veil-button,
  .veil-popover {
    display: none !important;
  }
}

html.print-pdf .veil-button,
html.print-pdf .veil-popover,
html.reveal-print .veil-button,
html.reveal-print .veil-popover {
  display: none !important;
}
