:root {
  --alink: #4242a0;
  --avisited: #6a31a0;

  --lightgray: rgba(240 240 240 / 1);
  --gray: rgba(150 150 150 / 1);
  --darkgray: rgba(50 50 50 / 1);
  --byuiblue: rgba(0 110 182 / 1);
  --navy: rgb(0 0 128 / 1);
  --red: rgb(182 0 19 / 1);
  --mustard: rgb(182 163 0 / 1);
  --callout: rgba(213 230 245 / 1);
  --error: rgb(255 215 225 / 1);
  --warning: rgba(255 247 178 / 1);
  --details: rgba(219 239 219 / 1);
  --ccl: rgb(125 90 160 / 0.45/ 1);
  --disciples: rgb(158 116 171 / 0.4);
  --info: rgba(213 230 245 / 1);
  --padd: 0.5rem;
  --bord: 1px solid rgb(0 0 0 / 0.1);

  /* this part is unique to cse111 */
  --formula-font-size: 120%;

  --coral: rgb(255, 127, 80);
  --lightest-byui-blue: rgb(235, 244, 249);
  --user-input-bk-color: var(--coral);
  --user-input-fg-color: white;
  --console-bk-color: var(--lightest-byui-blue);
  --border-color: rgb(112, 112, 112);
  --dfn-fg-color: var(--coral);
}

body {
  font: 400 17px / 1.7 Montserrat, Helvetica, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  color: rgb(85, 85, 85);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--padd);
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0 auto 0 0.5rem;
}

h1 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: normal;
  max-width: 960px;
}

#coursetitle {
  display: none;
}

h2 {
  color: var(--byuiblue);
  font-size: 1.6rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.4rem;
}

h3.duedate {
  color: var(--red);
}

h4 {
  font-size: 1.2rem;
}

h5 {
  font-size: 1rem;
  color: var(--navy);
}

a {
  color: var(--navy);
}

a:link {
  color: var(--alink);
}

a:active {
  color: var(--red);
}

a:visited,
a:focus {
  color: var(--avisited);
}

p {
  margin: 0.6rem;
}

/* Ensures long words or strings (like binary numbers) break and wrap to the next line if they exceed the container width */
.word-break {
  overflow-wrap: break-word;
  word-break: break-word;
}


/* h4+p {
  margin-left: 1.25rem;
} */

/* h5~p {
  margin-left: 1.5rem;
} */

ol ol,
ul ul {
  margin-top: 1rem;
}

li {
  margin-bottom: 0.6rem;
  margin-left: -0.6rem;
}

li ul li:nth-child(1) {
  margin-top: 0.5rem;
}

li ul li,
li ol li {
  margin-bottom: 0.5rem;
}

/* li p {
  margin: 0;
} */

img {
  max-width: 100%;
  height: auto;
}

header {
  background-color: var(--byuiblue);
  padding: 0.5rem;
}

.logo {
  width: 50px;
  height: auto;
  background-color: #000;
  padding: 12px 11px;
  position: absolute;
  top: 0;
  right: 0;
}

main {
  margin: 1.5rem 1rem;
}

nav {
  display: flex;
  width: -moz-fit-content;
  width: fit-content;
  flex-wrap: wrap;
  margin: 0 0.25rem 0.25rem 0.25rem;
}

nav span {
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--lightgray);
  margin: 0 0.25rem 0.25rem 0.25rem;
  text-align: center;
}

nav span a:link,
nav span a:visited,
nav span a:active,
nav span a:focus {
  color: #000;
  text-decoration: none;
  display: block;
  padding: 0.5rem 1rem;
  order: var(--bord);
}

nav span a:hover {
  background-color: var(--byuiblue);
  color: #fff;
}

footer {
  border-top: var(--bord);
  font-size: smaller;
  background-color: var(--lightgray);
  padding: 0.5rem;
  text-align: center;
}

footer p {
  margin: 0 0 0 0.5rem;
}

details {
  margin: 1rem 0 1rem 0.6rem;
  padding: 0.5rem;
  background-color: var(--details);
  border: 3px solid rgb(181, 223, 181);
  border-color: var(--details);
}

details p {
  margin: 0.5rem 0 0 0.5rem;
  transition: max-height 1000ms ease-out;
  overflow: hidden;
}

pre {
  line-height: 1.2;
  margin: 0.5rem 0.6rem;
}

pre code {
  /* line-height: 1.2; */
  margin: 0.0rem;
  border-left: 1px solid var(--byuiblue);
}

details pre code {
  border-left: 3px solid rgb(50, 100, 50);
}

code {
  font-weight: 600;
  color: rgb(1, 100, 1);
}

/* global css */

.html,
.css,
.javascript,
.cli .text {
  font-weight: 400;
  padding: 0.75rem;
  margin: 0rem;
}

.html,
.css,
.text {
  line-height: 1.2;
}

.cli {
  line-height: 1.2;
}

.html {
  margin-left: 0.6rem;
  background-color: var(--darkgray);
}

.css {
  margin-left: 0.6rem;
  background-color: var(--darkgray);
}

pre .cli {
  margin: auto 0rem;
  background-color: var(--darkgray);
}

.vertical pre .css {
  margin: auto 0rem;
}







kbd {
  color: red;
}

mark {
  padding: 0.5rem;
  font-style: italic;
}

mark::before {
  content: '⚒️';
}

figure {
  margin: 3rem 0;
  text-align: center;
}

figcaption {
  font-size: smaller;
  margin: 0 0 1rem 0;
}

.video-container {
  position: relative;
  overflow: hidden;
  height: 0;
  padding-bottom: calc(var(--aspect-ratio, 0.5625) * 100%);
  margin: 0.5em auto;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.vertical {
  border-left: 2px solid var(--darkgray);
  padding-left: 10px;
  height: 100%;
  margin-left: 0.7rem;
}

.vertical .html {
  margin-left: 0.1rem;
}

table {
  border-collapse: collapse;
  margin: 1rem auto;
  width: 80%;
  border: var(--bord);
  background-color: var(--lightgray);
}

table caption {
  color: var(--navy);
  font-weight: 600;
}

th {
  background-color: var(--darkgray);
  color: #fff;
}

th,
td {
  border: var(--bord);
  padding: 0.5rem;
  text-align: center;
}

.active {
  background-color: #404040;
  color: #fff;
  text-decoration: none;
}

.active a:link,
.active a:visited,
.active a:active,
.active a:focus {
  color: #fff;
}

/* cse111 */
td.detailed-text-cell {
  text-align: left;
  font-size:90%;
}

td.detailed-text-cell ul,
td.detailed-text-cell ol{
  padding-left: 1rem;
  margin-top:0.25rem;
  margin-bottom:0.25rem;
}

td.detailed-text-cell li{
  margin-bottom: 0.1rem;
}

.team::after {
  content: " \1F465"
}

.callout {
  margin: 1rem 0 1rem 0.6rem;
  padding: 0.5rem;
}

.callout p {
  margin: 0.5rem;
}

.callout-title{
  font-weight: bold;
  font-size: 1.1rem; 
  margin-top: 1rem;
  margin-left: 1rem;
}

.reference {
  background-color: var(--lightgray);
}

.callout.reference pre .html {
  margin: 0 0.7rem;
}

.info {
  background-color: var(--info);
  padding: 15px;
}

.error {
  background-color: var(--error);
}

.warning {
  border-color: rgba(233, 211, 14, 0.479);
  background-color: var(--warning);
  margin: 20px 1 20px 0;
}

.question {
  color: var(--navy);
  border-top: var(--bord);
}

.discussion {
  background-color: var(--details);
}

.discussion h5 {
  color: var(--black);
}

blockquote {
  border-left: 3px solid var(--darkgray);
}

.smaller {
  font-size: smaller;
}

.detailsinfo {
  background-color: var(--details);
  padding: 15px;
}

.floatright {
  float: right;
  margin: 0 0 0.5rem 1rem;
}

.step-reset {
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal) "º Passo: ";
  font-size: large;
  color: var(--byuiblue);
}

.part-reset {
  counter-reset: part;
}

.part {
  counter-increment: part;
  margin-left: 1rem;
}

.part::before {
  content: 'Parte ' counter(part) ':  ';
  font-size: x-large;
  color: var(--navy);
}

.check {
  list-style: '☑️ ';
}

#weeks {
  list-style: none;
  padding-left: 1rem;
}

#weeks li {
  margin-left: 0;
  margin-right: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: .25rem .5rem;
}

#weeks li a {
  display: block;
  text-decoration: none;
  color: #000;
}

#weeks li:hover {
  background-color: var(--byuiblue);
  color: #fff;
}

#weeks li a:hover {
  font-weight: 600;
  text-decoration: underline;
  color: #fff;
}

hr {
  margin: 1.5rem 0 1.5rem 0.5rem;
}

li .callout {
  margin-left: 0rem;
}

li .vertical {
  margin-left: 0.1rem;
}

li .html {
  margin-left: 0rem;
  background-color: var(--darkgray);
}

li details {
  margin-left: 0rem;
}

@media screen and (min-width: 600px) {

  .page {
    position: relative;
  }

  .logo {
    width: 75px;
    padding: 18px 15px;
    top: -.5rem;
    right: 1rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  #coursetitle {
    display: inline;
  }
}

@media screen and (min-width: 800px) {
  .logo {
    width: 100px;
    padding: 22px 20px;
  }

  h1 {
    font-size: 1.75rem;
    margin-left: 0;
  }
}

/* Container for console (terminal) input and output. */
pre.console {
  border: 1px solid var(--border-color);
  background-color: var(--console-bk-color);
  padding: 12px;
}

li pre.console {
  margin-left: 0;
  
  /* In a list, don't indent pre.console elements. */
}


pre.console>span.input {
  border: 1px solid var(--border-color);
  padding: 0 0.25em;
  background-color: var(--user-input-bk-color);
  color: var(--user-input-fg-color);
}

pre.console>span.pass {
  color: green;
}

pre.console>span.fail {
  color: red;
}
 dfn {
   color: var(--dfn-fg-color)
 }

/* Code line numbering styles */

table.hljs-ln {
  width: 100%;
  background-color: inherit;
}
 td.hljs-ln-numbers {
  text-align: right;
  color: #ccc;
  border-right: 1px solid #999;
  vertical-align: top;
  padding-right: 10px;
  margin-right: 5px;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

td.hljs-ln-code {
  padding-left: 10px;
  text-align: left;
  margin-left: 5px;
}

code {
  white-space: pre-wrap;
  overflow: auto;
}
pre code.nohljsln{
  text-align: left;
}

.todo::before {
  content: "\2620";
  display: inline;
  color: white;
  background-color: black;
  font-size: 200%;

}
/* support for list numbering lik 1 1.1 1.1.1  */
ol.nested {
  list-style-type: none;
  counter-reset: item;
}

ol.nested li {
  display: block;
}

ol.nested li:before {
  content: counters(item, ".") " ";
  counter-increment: item;

}

ol.nested ol {
  list-style-type: none;
  counter-reset: subitem;
  margin-left: 1em;
}

ol.nested ol li:before {
  content: counters(item, ".") "." counters(subitem, ".") " ";
  counter-increment: subitem;

}

ol.nested li::marker {
  font-weight: bold; /* Bold the bullets */
}

/* END support for list numbering lik 1 1.1 1.1.1  */

.no-bullets {
  list-style-type: none;
  padding: 0; 
  margin: 0;  
}

.center-inline-img {
  vertical-align: middle;
}

/* Container for the function call graph and code */
.code,
.callgraph {
  max-width: 100%;     /* Prevents the figure from overflowing on small screens */
  width: 31em;         /* Default width for medium and large screens */
  margin: 0 auto;      /* Centers the figure horizontally */
}

/* Ensures the image scales correctly within its container */
.code img,
.callgraph img {
  max-width: 100%;     /* Makes the image responsive */
  height: auto;        /* Preserves the aspect ratio */
  display: block;      /* Removes extra space below the image */
}


/* Requirements table formatting  */
#function_specs th, #function_specs td {
  text-align: left;
  vertical-align: top;
}

/* Password testing table formatting */
.column-left{
  text-align: left;
}


/* copy button */

/* define the copy buttom position and color */
.highlight-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 8px;
  color: #000000;
}

.highlight-copy-button:hover {
  color: #006EB6; /* BYUI blue on hover */
}

/*hide the code copy button */
code.no-hljs-copy + div.hljs-copy-container{
  display: none;
}

/* ===================================================== */
/* RESPONSIVENESS — Adjustments for screens smaller than 600px */
/* ===================================================== */
@media screen and (max-width: 599px) {
  /* General typography and spacing adjustments */
  body {
    font-size: 15px;
    line-height: 1.5;
    padding: 0 0.5rem;
  }

  .page {
    padding: 0.5rem;
  }

  /* Keep header layout original (logo aligned to the right) */
  header {
    text-align: left; /* prevent centering on small screens */
    position: relative;
  }

  .logo {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    width: 50px;      /* reduced logo size for mobile */
    padding: 6px;     /* smaller padding for better proportion */
  }

  /* Maintain proportional heading sizes */
  h1 {
    font-size: 1.1rem;
    text-align: left; /* maintain alignment consistent with desktop */
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  /* Navigation: stacked vertically for better readability */
  nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  nav span {
    width: 100%;
    margin: 0.2rem 0;
  }

  main {
    margin: 1rem 0.25rem;
  }

  /* Tables scroll horizontally on small screens */
  table {
    width: 100%;
    display: block;
    overflow-x: auto;
    font-size: 0.9rem;
  }

  /* Adjust code and preformatted text font size */
  pre,
  code {
    font-size: 0.85rem;
  }

  figure {
    margin: 1rem 0;
  }

  figcaption {
    font-size: 0.8rem;
  }
}

/* ===================================================== */
/* EXTRA — Fine-tuning for very small screens (<400px) */
/* ===================================================== */
@media screen and (max-width: 400px) {
  h1, h2, h3 {
    margin-left: 0;
  }

  li {
    margin-left: 0;
  }

  pre {
    padding: 0.25rem;
  }
}

/* ===================================================== */
/* GLOBAL IMPROVEMENT — Better handling for long code lines */
/* ===================================================== */
pre, code {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

@media screen and (max-width: 599px) {
  /* Adjust console box for small screens */
  pre.console {
    font-size: 0.85rem;          /* Slightly smaller font for readability on mobile */
    padding: 0.5rem;             /* Reduced padding to save space */
    overflow-x: auto;            /* Enables horizontal scrolling if content overflows */
    word-wrap: break-word;       /* Allows long words to break and wrap to the next line */
    white-space: pre-wrap;       /* Preserves formatting but allows line wrapping */
  }

  /* Adjust font size inside code blocks */
  pre.console code {
    font-size: 0.85rem;          /* Matches font size for nested code */
  }
}

