section {
  scroll-margin-top: 100px;
}

.container {
  display: flex;
  max-width: 1500px;
}

.content {
  padding: 0 15px 0 40px;
}

.content-h {
  padding: 1rem 0;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(77, 71, 71, 0.1);
}

.content-h h1 {
  font-size: 2rem;
  color: #09b44b;
}

/* Sidebar navigation panel */
.sidebar {
  top: 90px;
  height: 100vh;
  width: 300px;
  padding: 24px 20px;
  scroll-behavior: smooth;
  position: sticky; /* sticks to viewport on scroll */
  flex-shrink: 0; /* prevents sidebar from shrinking */
  border-radius: 15px;
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease;
}

.sidebar .logo-text {
  margin-bottom: 8px;
  color: #14cb5a;
}

.nav li {
  padding: 5px 15px;
  list-style: none;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.nav li:hover {
  background: #f0f4ff;
  color: #1a73e8;
}

.nav li i {
  margin-right: 15px;
  color: #2d6a4f;
  font-size: 16px;
}

.header-for-content {
  margin-top: 1.5rem;
  color: #14cb5a;
}

iframe {
  margin: 0 auto;
  width: 100%;
  height: 28rem;
  border-radius: 16px;
  border: none;
}

/* Video frame wrapper for centering */
.video-frame {
  width: 65%;
  margin: auto;
}

/* Responsive video wrapper with 16:9 aspect ratio */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Position the iframe to fill the video wrapper */
.video-wrapper iframe {
  position: absolute;
  height: 100%;
}

.content img {
  margin: 1rem auto;
}

.climate-img {
  margin-top: 2rem;
  border-radius: 2rem;
  width: 60%;
}

#climate-systems img {
  width: 60%;
}

#greenhouse-gases img {
  max-height: 32rem;
}

#resources ul {
  padding: 0 50px;
}

/* Responsive design */
@media (max-width: 768px) {
  .sidebar {
    width: fit-content;
    text-align: center;
    padding: 10px 5px;
  }

  /* Hide text in nav items, only show icons */
  .nav li span {
    display: none;
  }

  .nav li i {
    margin: auto;
  }

  iframe {
    height: auto;
  }
}

@media (max-width: 600px) {
  section {
    scroll-margin-top: 85px;
  }

  .content {
    padding: 0 10px 0 20px;
  }

  .content-h h1 {
    font-size: 20px;
  }

  .header-for-content {
    font-size: 18px;
    margin: 0.3rem 0;
  }

  .content p,
  #resources ul {
    font-size: 14px;
    margin-bottom: 0.3rem;
  }

  .sidebar .logo-text {
    margin-top: 0.5rem;
    font-size: 16px;
  }

  .climate-img {
    width: 100%;
    margin-top: 1.5rem;
  }

  #climate-systems img {
    width: 80%;
  }

  .video-frame {
    width: 100%;
    margin: 1rem auto;
  }
}
