/* ------------------------------------------------------------ */
/* ROOT VARIABLES                                               */
/* ------------------------------------------------------------ */

:root {
  /* Light mode */
  --bg-color: #f8f5f0;
  --text-color: #1b1b1b;
  --link-color: #2f5d50;
  --accent-color: #4f7c68;

  --sidebar-width: 260px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1f1f1f;
    --text-color: #f5f3ef;
    --link-color: #9cc3b1;
    --accent-color: #b9d2c3;
  }
}

/* ------------------------------------------------------------ */
/* BASE SITE STYLES                                             */
/* ------------------------------------------------------------ */

body {
  margin: 0;
  padding: 2rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
  max-width: 850px;
  margin: 0 auto;
}

h1 {
  color: var(--link-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

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

a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-color);
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
  text-decoration-color: var(--accent-color);
}

ul {
  list-style: none;
  padding-left: 0;
}

footer {
  margin-top: 3rem;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.8;
}

/* ------------------------------------------------------------ */
/* SIDEBAR                                                      */
/* ------------------------------------------------------------ */

#sidebar-toggle {
  display: none;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-color);
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  z-index: 1000;
}

.sidebar a {
  color: var(--link-color);
}

.sidebar a:hover {
  color: var(--accent-color);
}

/* ------------------------------------------------------------ */
/* TOGGLE BUTTON                                                */
/* ------------------------------------------------------------ */

.sidebar-toggle-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  background: transparent;
  border: 1px solid var(--link-color);
  color: var(--link-color);
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1100;
  font-size: 1.1rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--link-color);
  color: var(--bg-color);
}

/* ------------------------------------------------------------ */
/* PAGE CONTENT                                                 */
/* ------------------------------------------------------------ */

.page-content {
  position: relative;
  transition: margin-left 0.35s ease;
}

/* ------------------------------------------------------------ */
/* DESKTOP BEHAVIOR                                             */
/* ------------------------------------------------------------ */

@media (min-width: 900px) {

  .sidebar {
    transform: translateX(0);
  }

  .page-content {
    margin-left: var(--sidebar-width);
  }

  .sidebar-toggle-btn {
    display: none;
  }
}

/* ------------------------------------------------------------ */
/* MOBILE BEHAVIOR                                              */
/* ------------------------------------------------------------ */

@media (max-width: 899px) {

  .page-content {
    margin-left: 0;
  }

  #sidebar-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle-btn {
    display: block;
  }
}

/* ------------------------------------------------------------ */
/* CALLOUT                                                      */
/* ------------------------------------------------------------ */

.callout {
  position: relative;
  background-color: #4f7c68;
  color: #ffffff;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin: 1rem 0;
}

.callout a {
  color: #ffffff;
}

/* ------------------------------------------------------------ */
/* RESPONSIVE VIDEO                                             */
/* ------------------------------------------------------------ */

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1rem 0;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Page wrapper */
.page-content {
  transition: margin-left 0.35s ease;
}

/* Desktop layout */
@media (min-width: 900px) {

  /* Sidebar open */
  #sidebar-toggle:not(:checked) ~ .page-content {
    margin-left: 260px;
  }

  /* Sidebar closed */
  #sidebar-toggle:checked ~ .page-content {
    margin-left: 0;
  }

  /* Visually re-center the content */
  .page-content .container {
    margin-left: clamp(1.5rem, 5vw, 4rem);
    margin-right: auto;
  }
}
