.site-main-heading {
  margin: 2rem 0;
  font-size: 2.5rem;
  font-weight: 300;
  color: #1b5e20;
}

.featurette-divider {
  margin: 3rem 0;
}

.lead {
  font-size: 1.2rem;
  color: #2e7d32;
  margin-bottom: 2rem;
}

/* Featured image styling */
.featured-image {
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Title row styling */
.title-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  background-color: #f1f8f4;
  border-bottom: 1px solid #c8e6c9;
}

/* Dark mode toggle positioned next to title */
.navbar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle-header {
  font-size: 20px;
  color: #333 !important;
  padding: 8px !important;
  background: transparent !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-header:hover {
  color: #4caf50 !important;
}

.theme-toggle-header i {
  font-size: 28px;
}

/* Navbar styling for menu below title */
.navbar {
  min-height: 60px !important;
  margin-bottom: 0;
}

.navbar-brand {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  display: flex;
  align-items: center;
  color: #1b5e20 !important;
}

.navbar-default .navbar-brand {
  color: #1b5e20 !important;
}

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
  color: #2e7d32 !important;
}

.navbar-brand img {
  margin-right: 10px;
}

/* Logo styling with dark green background */
.site-logo {
  background-color: #1a4d2e;
  padding: 5px;
  border-radius: 4px;
  height: 75px !important;
  transition: height 0.3s ease;
}

@media (max-width: 992px) {
  .site-logo {
    height: 70px !important;
  }
}

@media (max-width: 768px) {
  .site-logo {
    height: 60px !important;
  }
}

@media (max-width: 576px) {
  .site-logo {
    height: 45px !important;
  }
}

.navbar-nav > li > a {
  padding-top: 15px !important;
  padding-bottom: 15px !important;
  line-height: 20px;
  color: #2e7d32 !important;
}

.navbar-nav > li > a:hover {
  color: #1b5e20 !important;
}

/* Center the menu */
.navbar-nav {
  margin: 0;
  float: none !important;
  display: flex;
  justify-content: center;
}

.navbar-nav > li {
  float: none;
}

/* On mobile, keep the menu aligned right in collapsed view */
@media (max-width: 767px) {
  .title-row {
    padding: 10px 0;
  }

  .navbar-brand-wrapper {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar-brand {
    font-size: 16px !important;
  }

  .theme-toggle-header i {
    font-size: 20px;
  }

  .navbar {
    min-height: 50px !important;
  }

  .navbar-toggle {
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .navbar-nav {
    float: none !important;
    display: block;
    text-align: center;
  }

  .navbar-nav > li {
    float: none;
    display: inline-block;
  }

  .navbar-nav > li > a {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* Fix for Molekülstudio page on mobile */
  .studio-header {
    margin-top: 10px;
  }

  #molecule-studio-container {
    height: 35vh !important;
    min-height: 220px !important;
    max-height: 350px !important;
  }
}

/* Card grid styling - CSS Grid for equal height */
#card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 20px;
  margin-bottom: 40px;
  width: 100%;
}

#card-grid .card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

#card-grid .card .index-anchor {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

#card-grid .card .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 280px;
  margin: 0;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

#card-grid .card .panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

#card-grid .card .panel-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  font-size: 1rem;
  line-height: 1.5;
}

#card-grid .card .panel-body small {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
}

#card-grid .card .panel-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  padding: 15px;
}

#card-grid .card .panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

#card-grid .card .panel-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#card-grid .card .panel-body:last-child {
  flex: 1;
}

/* Mobile responsive */
@media (max-width: 991px) {
  #card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 15px;
  }
}

@media (max-width: 767px) {
  #card-grid {
    grid-template-columns: 1fr;
    gap: 20px 0;
  }

  #card-grid .card .panel {
    min-height: 220px;
  }

  #card-grid .card .panel-body {
    padding: 25px 20px;
    font-size: 1.1rem;
  }

  #card-grid .card .panel-body small {
    font-size: 1.1rem;
    line-height: 1.7;
  }

  #card-grid .card .panel-title {
    font-size: 1.4rem;
  }
}
