@import "colors.css";

html {
  box-sizing: border-box;
  font-size: 16px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

ol,
ul {
  list-style: none;
}

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

address,
table {
  margin-bottom: 1em;
  margin-left: 1em;
}

td {
  padding: 0.2em 0.5em 0.2em 0;
}

/* Shared Styles */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Roboto, Helvetica, sans-serif;
  font-weight: 500;
  background-color: var(--body-bg);
}

.header-wrapper,
.container-wrapper,
.footer-wrapper {
  width: 100%;
}

.header-wrapper,
.footer-wrapper {
  background-color: var(--wrapper-bg);
}

.container-wrapper {
  background-color: var(--wrapper-bg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.container,
header,
footer {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 1em;
}

/* Content */

.container {
  color: var(--container-text);
  background-color: var(--container-bg);
  flex-grow: 1;
  position: relative;
}

.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.content-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.content h1 {
  text-align: center;
}

.content h1,
.content h2,
.content h3,
.content p {
  margin-bottom: 0.75em;
}

.content ul {
  margin-left: 1em;
  margin-bottom: 1.5em;
}

.content li {
  margin-bottom: 0.5em;
}

.content a {
  text-decoration: none;
  color: var(--container-text);
}

.content a:hover {
  text-decoration: underline;
  cursor: pointer;
}

.content > :last-child {
  margin-bottom: 3em;
}

/* Header & Footer */

header,
footer {
  background-color: var(--header-footer-bg);
  color: var(--header-footer-text);
}

header {
  display: flex;
  justify-content: space-between;
}

.header-link a {
  color: var(--header-footer-text);
  text-decoration: none;
  cursor: pointer;
}

header button {
  background-color: transparent;
  border: none;
  padding: 0.3em;
  cursor: pointer;
  transition: opacity 0.5s;
}

header button:hover {
  background-color: var(--button-hover-bg);
}

header button svg {
  stroke: var(--header-footer-text);
  stroke-width: 1;
  stroke-linecap: round;
}

/* Footer */

footer {
  text-align: center;
}

footer ul {
  margin-bottom: 1em;
}

footer .nav li {
  display: inline;
}

footer .nav li + li {
  margin-left: 1em;
}

footer .nav a {
  color: var(--header-footer-text);
  text-decoration: none;
  cursor: pointer;
}

footer .nav a:hover {
  text-decoration: underline;
}

.content-panel {
  padding: 1em 2em;
  border-radius: 5px;
  margin-bottom: 1.5em;
}

.code {
  background-color: black;
  color: white;
  letter-spacing: 1px;
}

.comment {
  color: limegreen;
}

.output {
  background-color: white;
  color: blue;
}

.output h1 {
  margin-bottom: 0;
}

/* Side Bar */
.side-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 100;
  background-color: var(--sidebar-bg);
  padding: 1em 1.5em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.side-bar.is-open {
  opacity: 1;
  visibility: visible;
}

.side-nav {
  background-color: var(--sidebar-bg);
}

.side-bar button {
  background-color: var(--container-bg);
  border: none;
  border-radius: 0.25em;
  padding: 0.25em 0.5em;
  margin-bottom: 0.75em;
}

.side-bar button:hover {
  background-color: var(--header-footer-bg);
  color: var(--header-footer-text);
}

.side-bar li {
  margin-bottom: 0.125em;
}

.side-bar a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 1.2rem;
}

.side-bar a:hover {
  text-decoration: underline;
  cursor: pointer;
}

.copyright-notice {
  margin-top: 1em;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .container,
  header,
  footer {
    padding: 1em 0.5em;
  }

  .content {
    padding: 0.5em;
  }

  .content h1 {
    font-size: 1.5rem;
  }
}
