html{
   font-family:sans-serif;
   -webkit-text-size-adjust:100%;
   -ms-text-size-adjust:100%
}
body {
   margin:0;
   font-family: Palatino, Palatino Linotype, Palatino LT STD, Book Antiqua, Georgia, serif;
   font-size:16px;
   line-height:1.35;
   color:#000;
   background-color:#fff;
   text-align: justify;
   hyphens: auto;
}
p {
   margin-top: 1em;
   /*text-indent: 2em;*/
}
a {
   color: #1b1f8aaa;
   text-decoration: none;
}
a:hover {
   color: #1b1f8add;
   text-decoration: underline;
}
ul,ol{
   margin-bottom: 0;
   margin-top: 0;
   margin-left: 40px;
}
ul,ol li {
   margin-bottom: 0;
   margin-top: 0;
}

table {
   margin-left: auto;
   margin-right: auto;
   border-collapse: collapse;
}

th,td {
   padding: 6px 12px;
   text-align: left;
}

thead tr {
   border-bottom: 1px solid #333;
}

.page-title {
   font-variant: small-caps;
   padding-top: 20px;
   padding-bottom: 8px;
   font-size: 52px;
   hyphens: none;
}
.course-info {
   font-size: 24px;
}
.course-info::after {
   content: "Crane, Gkioulekas, Miller, Sawhney";
}

:root {
   --highlight-color: #1b1f8a33;
   --highlight-text-color: #1b1f8a88;
   --highlight-text-size: 12px;
   --highlight-above-offset: -.75em;
   --highlight-below-offset: 4.25em;

   /* style for definition/theorem boxes */
   --boxed-background-color: #ddd;
   --boxed-radius: 6px;
   --boxed-border-style: solid;
   --boxed-border-color: #ccc;
   --boxed-border-width: 1.5px;
   --proof-background-color: #eee;

   --pseudocode-text-color: #101255;
   --pseudocode-box-color: #1b1f8a11;
}

.texHighlight {
   background-color: var(--highlight-color);
   border-radius: 6px;
   padding: 5px;
   text-align: center;
   margin: 1px;
   position: relative;
   margin-top: 15px; /* add extra space above highlight */
}
.texHighlight::before {
   content: attr(id);
   display: block;
   position: absolute;
   font-size: var(--highlight-text-size);
   color: var(--highlight-text-color);
   top: 0%;
   left: 50%;
   transform: translateX(-50%) translateY(-5px);
}
.texLowlight {
   background-color: var(--highlight-color);
   border-radius: 6px;
   padding: 5px;
   text-align: center;
   margin: 1px;
   position: relative;
   margin-bottom: 15px;
}
.texLowlight::after {
   content: attr(id);
   display: block;
   position: absolute;
   text-align: center;
   font-size: var(--highlight-text-size);
   color: var(--highlight-text-color);
   top: 100%;
   margin-top: 15px;
   left: 50%;
   transform: translateX(-50%);
}


todo {
   display: block;
   width: fit-content;
   clear: both;
   background-color: #ffcc00;
   border-radius: 3px;
   padding: 10px;
   margin: 5px;
   font-style: italic;
}
todo::before {
   content: "TODO: ";
   font-weight: bold;
   color: #ff6600;
   font-style: normal;
}

#popwrap {
   position:relative;
   margin:75px auto;
   width:252px; height:252px;
}
.popup img { 
   border:2px solid #999;
   margin:3px;
   float:left;
   filter: drop-shadow(0px 10px 10px #00000066);
}
.popup span { 
   position:absolute;
   visibility:hidden;
}
.popup:hover, .popup:hover span { 
   visibility:visible;
   top:30px;
   left:0px; 
   z-index:1;
}

.topic {
   position: relative;
   display: inline-block;
}
.topic .description {
   visibility: hidden;
   width: max-content;
   max-width: 500px;
   background-color: var(--boxed-background-color);
   color: #666;
   text-align: left;
   padding: 8px;
   border-radius: 6px;
   border-style: solid;
   border-color: #ccc;
   border-width: 2px;
   position: absolute;
   z-index: 1;
   top: 50%;
   left: 105%;
   transform: translateY(-50%);
   filter: drop-shadow(-4px 4px 4px rgba(0, 0, 0, 0.3));
}
.topic:hover {
   color: #428bca77;
}
.topic:hover .description {
   visibility: visible;
}
.topic .description::before {
   content: "topics: ";
   font-style: italic;
}


footnote {
   position: relative;
   display: inline-block;
}
footnote content {
   visibility: hidden;
   width: max-content;
   max-width: 500px;
   background-color: var(--boxed-background-color);
   color: #666;
   text-align: left;
   padding: 8px;
   border-radius: var(--boxed-radius);
   border-style: solid;
   border-color: #ccc;
   border-width: 2px;
   position: absolute;
   z-index: 1;
   top: 50%;
   left: 105%;
   transform: translateY(-50%);
   filter: drop-shadow(-4px 4px 4px rgba(0, 0, 0, 0.3));
}
footnote:hover {
   color: #428bca77;
}
footnote:hover content {
   visibility: visible;
}
footnote::before {
   content: "👣";
   vertical-align: super;
   line-height: 0;
   padding-right: .35em;
}

.definition {
   background-color: var(--boxed-background-color);
   padding: 8px;
   border-radius: var(--boxed-radius);
   border-style: var(--boxed-border-style);
   border-color: var(--boxed-border-color);
   border-width: var(--boxed-border-width);
}
.definition::before {
   content: "Definition.";
   font-weight: bold;
}

theorem {
   display: block;
   background-color: var(--boxed-background-color);
   padding: 8px;
   margin-top: 14px;
   margin-bottom: 14px;
   border-radius: var(--boxed-radius);
   border-style: var(--boxed-border-style);
   border-color: var(--boxed-border-color);
   border-width: var(--boxed-border-width);
}
theorem::before {
   content: "Theorem. ";
   font-weight: bold;
}
theorem[name]::before {
   content: "Theorem (" attr(name) ").";
   font-weight: bold;
}

proof {
   display: block;
   background-color: var(--proof-background-color);
   padding: 8px;
   margin-top: 8px;
   margin-bottom: 12px;
}
proof::before {
   content: "Proof. ";
   font-style: italic;
}

.aside {
   background-color: #eee;
   border:2px solid #ccc;
   border-radius: 10px;
   padding: 15px;
}
.solution {
   background-color: #eee;
   border:2px solid #ccc;
   border-radius: 10px;
   padding: 15px;
}
.solution::before {
   content: "Solution: ";
   font-weight: bold;
   color: black;
   font-style: normal;
}

/*-----------*/
/* Numbering */
/*-----------*/

/* chapter, section, subsection, subsubsection, appendix */

.chapterPage ul,ol {
   margin-top:10px;
}
.chapterPage li {
   margin-bottom: 10px;
}
chapter, appendix {
   display: block;
   width: 100%;
   font-size: 28px;
   background: linear-gradient(to right, #1b1f8a33, #ffffff33);  /* Gradient from left to right */
   padding: 10px;
   margin-top: 10px;
   margin-bottom: 10px;
   font-size: 38px;
   font-variant: small-caps;
}
chapter {
   counter-reset: sectionCounter 0;
   counter-reset: figureCounter 0;
   counter-reset: algorithmCounter 0;
   counter-increment: chapterCounter;
   counter-reset: sectionCounter;
}
chapter::before {
   content: "Chapter " counter(chapterCounter) ": ";
}
appendix {
   counter-reset: sectionCounter 0;
   counter-reset: figureCounter 0;
   counter-reset: algorithmCounter 0;
   counter-increment: appendixCounter;
   counter-reset: sectionCounter;
}
appendix::before {
   content: "Appendix " counter(appendixCounter,upper-alpha) ": ";
}
section {
   display: block;
   width: 100%;
   font-size: 28px;
   background-color: #1b1f8a33;
   padding: 8px;
   margin-top: 10px;
   margin-bottom: 10px;
   counter-increment: sectionCounter;
   counter-reset: subsectionCounter;
}
section::before {
   content: counter(chapterCounter) "." counter(sectionCounter) " ";
}
subsection {
   display: block;
   width: 100%;
   font-size: 18px;
   background-color: #eee;
   padding: 6px;
   margin-top: 6px;
   margin-bottom: 6px;
   counter-increment: subsectionCounter;
   counter-reset: subsubsectionCounter;
}
subsection::before {
   content: counter(chapterCounter) "." counter(sectionCounter) "." counter(subsectionCounter) " ";
}
subsubsection {
   display: block;
   width: 100%;
   font-size: 16px;
   font-weight: bold;
   margin-top: 16px;
   margin-bottom: 0px;
   counter-increment: subsubsectionCounter;
   text-decoration: underline;
}
subsubsection::after {
   content: ".";
}
/*subsubsection::before {
   content: counter(chapterCounter) "." counter(sectionCounter) "." counter(subsectionCounter) "." counter(subsubsectionCounter) " ";
}*/

figure {
   text-align: center;
   margin-top: 20px;
   margin-bottom: 20px;
   counter-increment: figureCounter;
}
figure img {
   width: 600px;
}
figcaption {
   display: inline-block;
   text-align: justify;
   font-style: italic;
   font-size: small;
   color: #888;
}
figcaption::before {
   content: "Figure " counter(figureCounter) ". ";
}

.assignmentPage ul,ol {
   margin-top:10px;
}
.assignmentPage li {
   margin-bottom: 10px;
}

assignment
{
   font-size: 36px;
   font-variant: small-caps;
   display: block;
}
assignment::before
{
   content: "Assignment " counter(chapterCounter) ": ";
}

/*------------*/
/* Pseudocode */
/*------------*/

Pseudocode {
   color: var(--pseudocode-text-color);
   display: block;
   padding-left: 10px;
   padding-right: 10px;
   padding-top: 5px;
   padding-bottom: 5px;
   margin-top: 20px;
   margin-bottom: 20px;
   background-color: var(--pseudocode-box-color);
   counter-reset: lineCounter 0;
}
Pseudocode::after {
   content: "";
   display: block;
   margin-top: 10px;
   border-bottom: 1px solid var(--pseudocode-text-color); /* Style for the horizontal line */
}
Pseudocode Name {
   display: block;
   border-top: 2px solid var(--pseudocode-text-color); /* Style for the horizontal line */
   padding-top: 10px; /* Space above the line */
   margin-bottom: 10px; /* Space below the line */
   counter-increment: algorithmCounter;
}
Pseudocode Name::before {
   font-weight: bold;
   content: "Algorithm " counter(chapterCounter) "." counter(figureCounter) " ";
   margin-right: .5em;
}
Pseudocode Name::after {
   content: "";
   display: block;
   border-bottom: 1px solid var(--pseudocode-text-color); /* Style for the horizontal line */
   margin-top: 10px; /* Space above the line */
   margin-bottom: 10px; /* Space below the line */
}
Pseudocode Proc {
}
Pseudocode Inputs {
   margin-bottom: 8px;
   display: block;
}
Pseudocode Outputs {
   margin-bottom: 8px;
   display: block;
}
Pseudocode Inputs::before {
   content: "Input: ";
   font-weight: bold;
}
Pseudocode Outputs::before {
   content: "Output: ";
   font-weight: bold;
}
Pseudocode Return::before {
   content: "return ";
   font-weight: bold;
}
Pseudocode ParallelFor::before {
   content: "parallel for ";
   font-weight: bold;
}
Pseudocode ParallelEndFor::before {
   content: "end parallel for ";
   font-weight: bold;
}
Pseudocode For::before {
   content: "for ";
   font-weight: bold;
}
Pseudocode EndFor::before {
   content: "end for ";
   font-weight: bold;
}
Pseudocode If::before {
   content: "if ";
   font-weight: bold;
}
Pseudocode If::after {
   content: " then";
   font-weight: bold;
}
Pseudocode Else::before {
   content: "else ";
   font-weight: bold;
}
Pseudocode EndIf::before {
   content: "end if ";
   font-weight: bold;
}
Pseudocode Comment {
   color: #1b1f8a99;
   margin-left: 1em;
   float: right;
   clear: left;
}
Pseudocode Comment::before {
   content: "▸ ";
}

/* A Line can have an optional `indent` attribute that sets */
/* the indentation level (1, 2, 3, etc.).  Zero by default. */
Pseudocode Line {
   display: block;
   counter-increment: lineCounter;
   text-align: left;
   position: relative;
   padding-left: calc(3em + var(--indent-level, 0) * 1.5em);
   line-height: 1.5em;
}
Pseudocode Line::before {
   content: counter(lineCounter) ": ";
   width: 2em;
   text-align: right;
   display: inline-block;
   margin-right: 1em;
   position: absolute;
   left: -.5em; /* Keep line numbers aligned left */
   top: 50%;
   transform: translateY(-50%); /* Vertically center the line numbers */
   line-height: 1.5em; /* Match the line height */
}
Pseudocode Line[indent="1"] { --indent-level: 1; }
Pseudocode Line[indent="2"] { --indent-level: 2; }
Pseudocode Line[indent="3"] { --indent-level: 3; }
Pseudocode Line[indent="4"] { --indent-level: 4; }
Pseudocode Line[indent="5"] { --indent-level: 5; }
Pseudocode Line[indent="6"] { --indent-level: 6; }
Pseudocode Line[indent="7"] { --indent-level: 7; }
Pseudocode Line[indent="8"] { --indent-level: 8; }

details:not([open]) {
   display: block;
   width: fit-content;
   clear: both;
}
details[open] {
   display: inline;
   background-color:#ddd;
   padding: 10px;
   border-radius: 6px;
}
details summary {
   display: inline;
   background-color: #1b1f8a55;
   color: #fff;
   font-weight: bold;
   padding: 5px;
   border-radius: 6px;
   margin: 10px;
}
details summary:hover {
   background-color: #1b1f8a77;
}
details[open] summary {
   margin: 0;
}
details summary::before {
   content: "Details";
}

.external-link::after {
  content: " 🔗";
  vertical-align: super;
  font-size: 0.7em;
  color: #888;
}

.static-code {
   width: 95%;
   margin-top: 10px;
   margin-bottom: 10px;
   margin-left: auto;
   margin-right: auto;
}

.static-code .CodeMirror {
  padding: 10px;
  border-radius: 5px;
}

.static-code .CodeMirror {
  background-color: #eee;
}

/* ------------------- */
/* Table of Contents   */
/* ------------------- */

.toc {
   background: #f8f8f8;
   border: 1px solid #ddd;
   border-radius: 6px;
   padding: 12px 16px;
   margin: 16px 0 20px 0;
}
.toc-title {
   font-variant: small-caps;
   font-size: 24px;
   margin: 4px 0 10px 0;
}
.toc ul {
   list-style: none;
   padding-left: 0;
   margin: 0;
}
.toc li {
   margin: 4px 0;
}
.toc a {
   color: inherit;
   text-decoration: none;
}
.toc a:hover {
   text-decoration: underline;
}
.toc .toc-number {
   font-variant: small-caps;
   color: #666;
   margin-right: .6em;
}
.toc .toc-level-1 { margin-left: 0; }
.toc .toc-level-2 { margin-left: 1.25em; font-size: .97em; }
.toc .toc-level-3 { margin-left: 2.0em; font-size: .94em; }
.toc .toc-level-4 { margin-left: 2.75em; font-size: .92em; }

/* ------------------- */
/* Image Toggle Switch */
/* ------------------- */

.image-toggle-wrapper::before {
   content: "Diagram Style";
   font-weight: bold;
   font-size: 12px;
}

.image-toggle-wrapper {
   width: 240px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0 20px 0;
  margin-left: auto;
  margin-right: 0;
  text-align: center;
}

.image-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  cursor: pointer;
  font-size: 12px;
  color: #333;
}

.toggle-text {
  font-weight: 500;
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-top: 4px;
}

.toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-slider {
  background-color: #1b1f8a;
}

.toggle-checkbox:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-checkbox:focus + .toggle-slider {
  box-shadow: 0 0 1px #1b1f8a;
}

/* ------------------- */
/* Shortcuts Table    */
/* ------------------- */

.shortcuts-table {
  margin: 16px 0;
  border-collapse: collapse;
  width: 100%;
  max-width: 600px;
}

.shortcuts-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.shortcuts-table .shortcut-key {
  text-align: right;
  white-space: nowrap;
  width: 200px;
}

.shortcuts-table tr:last-child td {
  border-bottom: none;
}



