/* Tutorials "shell" background on body */
body.tutorials-book {
  background-color: #ffffff !important;
  background-image:
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.65),
      rgba(0, 0, 0, 0.35),
      rgba(0, 0, 0, 0)
    ),
    url("../assets/why4.png");
  background-position:
    left top,
    left top;
  background-repeat:
    repeat-y,
    repeat-y;
  background-size:
    340px auto,
    340px auto;
}

body.tutorials-book .page-columns {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  background: transparent !important;
}

body.tutorials-book #quarto-content,
body.tutorials-book .quarto-margin-sidebar {
  background: transparent !important;
}

/* Main content area */
body.tutorials-book main#quarto-document-content {
  background: #ffffff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 2rem 3rem 3rem;
  font-size: 0.98rem;
}

/* Margin/sidebar rhs */
body.tutorials-book .sidebar {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1.25rem 1.2rem;
  position: sticky;
  top: 6rem;
  align-self: flex-start;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

body.tutorials-book .sidebar h2,
body.tutorials-book .sidebar .sidebar-title,
body.tutorials-book .sidebar .toc-title {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 0.75rem 0;
}

body.tutorials-book .sidebar nav,
body.tutorials-book .sidebar #toc {
  font-size: 0.9rem;
}

body.tutorials-book .sidebar ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

body.tutorials-book .sidebar li {
  margin: 0.15rem 0;
}

body.tutorials-book .sidebar a {
  text-decoration: none;
  color: #111827;
}

body.tutorials-book .sidebar a:hover {
  color: #0f766e;
}

body.tutorials-book .sidebar .active > a,
body.tutorials-book .sidebar a.active {
  font-weight: 600;
  color: #0f766e;
}

/* Tutorials nav sidebar lhs */
body.nav-sidebar.tutorials-book {
  --sidebar-width: 340px;
}

body.tutorials-book #quarto-sidebar {
  background: #002b36;
  color: #f9fafb;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

body.tutorials-book #quarto-sidebar .sidebar-menu-container {
  padding: 1.5rem 1.2rem;
}

body.tutorials-book #quarto-sidebar .sidebar-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

body.tutorials-book #quarto-sidebar .sidebar-menu-container::before {
  content: "Spatial Data for GGW Restoration";
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

body.tutorials-book #quarto-sidebar .sidebar-menu-container::after {
  content: "Tutorial modules";
  display: block;
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7f9f5;
}

body.tutorials-book #quarto-sidebar .sidebar-item-section > .sidebar-item-container {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0f2f1;
}

body.tutorials-book #quarto-sidebar .sidebar-item-section + .sidebar-item-section {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

body.tutorials-book #quarto-sidebar .sidebar-item-section > ul,
body.tutorials-book #quarto-sidebar .sidebar-item-section > .sidebar-section {
  padding-left: 1.1rem;
}

body.tutorials-book #quarto-sidebar .sidebar-item {
  margin: 0.08rem 0;
}

body.tutorials-book #quarto-sidebar .sidebar-link {
  display: block;
  padding: 0.08rem 0.2rem;
  border-radius: 3px;
  color: #f9fafb;
  text-decoration: none;
  font-size: 0.9rem;
}

body.tutorials-book #quarto-sidebar .sidebar-link:hover {
  background: rgba(15, 118, 110, 0.35);
  color: #ffffff;
}

body.tutorials-book #quarto-sidebar .sidebar-item .active,
body.tutorials-book #quarto-sidebar .sidebar-item a.active {
  background: rgba(15, 118, 110, 0.6);
  font-weight: 600;
  color: #ffffff;
}

/* Typography inside tutorials main content */
body.tutorials-book main#quarto-document-content h1 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

body.tutorials-book main#quarto-document-content h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

body.tutorials-book main#quarto-document-content h3 {
  font-size: 1.1rem;
  margin-top: 1.8rem;
  margin-bottom: 0.3rem;
  color: #111827;
}

body.tutorials-book main#quarto-document-content h4 {
  font-size: 1rem;
  margin-top: 1.1rem;
  margin-bottom: 0.25rem;
  color: #111827;
}

body.tutorials-book main#quarto-document-content ul {
  padding-left: 1.2rem;
}

body.tutorials-book main#quarto-document-content li + li {
  margin-top: 0.15rem;
}

body.tutorials-book main#quarto-document-content hr {
  margin: 2rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.5);
}

body.tutorials-book main#quarto-document-content em {
  color: #6b7280;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  body.tutorials-book .page-columns {
    padding: 1.5rem 1rem 2rem;
  }

  body.tutorials-book .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
  }

  body.tutorials-book main#quarto-document-content {
    padding: 1.5rem 1.2rem 2rem;
  }
}
