/* Knowledge Bank – shared styles (homepage green theme) */

body.kb-list-page {
  font-family: 'Urbanist', sans-serif;
  background: #F6FAF2;
  color: #484848;
}

.kb-container {
  max-width: 1400px;
  margin: 12px auto 48px;
  padding: 0 clamp(16px, 5%, 120px) 32px;
  box-sizing: border-box;
}

.articles-container {
  max-width: 1400px;
  margin: 0 auto 48px;
  padding: calc(var(--nav-height, 88px) + 12px) clamp(16px, 5%, 120px) 32px;
  box-sizing: border-box;
}

.kb-header {
  text-align: center;
  margin-bottom: 40px;
}

.kb-header h1 {
  font-size: 2rem;
  color: #173404;
  margin-bottom: 10px;
  font-weight: 700;
}

.kb-header p {
  font-size: 1.1rem;
  color: #3D5229;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.topic-card {
  background: #ffffff;
  border: 1px solid rgba(59, 109, 17, 0.12);
  border-radius: 16px;
  padding: 24px 24px 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 8px 32px rgba(38, 75, 1, 0.08);
}

.topic-card:hover {
  transform: translateY(-4px);
  border-color: #639922;
  box-shadow: 0 12px 32px rgba(38, 75, 1, 0.12);
}

.topic-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #C5FF8C;
  box-shadow: 0 6px 20px rgba(38, 75, 1, 0.15);
}

.topic-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-icon-large {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #C5FF8C;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.topic-icon-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-card h2 {
  color: #3B6D11;
  font-size: 1.6rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.topic-card p {
  color: #484848;
  font-size: 1rem;
  line-height: 1.5;
}

.article-count {
  background: #F0FFE0;
  border: 1px solid rgba(59, 109, 17, 0.15);
  border-radius: 999px;
  padding: 6px 16px;
  display: inline-block;
  margin-top: 12px;
  color: #264B01;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Topic navigation tabs */
.topic-nav-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 24px;
  flex-wrap: wrap;
  max-width: 1400px;
  padding: 0;
  box-sizing: border-box;
  scroll-margin-top: calc(var(--nav-height, 88px) + 12px);
}

.topic-nav-tab {
  background: #ffffff;
  border: 2px solid rgba(59, 109, 17, 0.15);
  padding: 8px 18px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #484848;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topic-nav-tab .tab-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.topic-nav-tab:hover {
  border-color: #639922;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(38, 75, 1, 0.15);
}

.topic-nav-tab.active {
  background: linear-gradient(135deg, #3B6D11, #264B01);
  color: #ffffff;
  border-color: #264B01;
}

/* Topic header banner */
.topic-header {
  text-align: center;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #3B6D11, #264B01);
  padding: 40px 20px;
  border-radius: 16px;
  color: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.topic-header-center {
  flex: 1;
  text-align: center;
  padding: 0 20px;
}

.topic-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  line-height: 1.2;
  color: #C5FF8C;
}

.topic-header p {
  margin: 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

/* Video containers */
.video-container {
  flex: 0 0 300px;
  background: #ffffff;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.video-label {
  font-size: 1rem;
  font-weight: 600;
  color: #264B01;
  margin-bottom: 10px;
  text-align: center;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Language tabs */
.language-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.language-tab {
  background: #ffffff;
  border: 2px solid rgba(59, 109, 17, 0.15);
  padding: 15px 40px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #484848;
}

.language-tab:hover {
  border-color: #639922;
  transform: translateY(-3px);
}

.language-tab.active {
  background: linear-gradient(135deg, #3B6D11, #264B01);
  color: #ffffff;
  border-color: #264B01;
}

/* Article list */
.articles-section {
  display: none;
}

.articles-section.active {
  display: block;
}

.section-header {
  text-align: center;
  margin-bottom: 30px;
}

.section-header h2 {
  color: #173404;
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-header p {
  color: #3D5229;
  font-size: 1.1rem;
}

.articles-list {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

.article-item {
  background: #ffffff;
  border: 2px solid rgba(59, 109, 17, 0.12);
  border-radius: 12px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 20px;
}

.article-item:hover {
  border-color: #639922;
  box-shadow: 0 5px 20px rgba(38, 75, 1, 0.12);
  transform: translateX(6px);
}

.article-number {
  background: linear-gradient(135deg, #3B6D11, #264B01);
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0;
}

.article-content {
  flex: 1;
}

.article-content h3 {
  color: #173404;
  font-size: 1.3rem;
  margin: 0;
}

.article-arrow {
  font-size: 1.5rem;
  color: #639922;
  flex-shrink: 0;
}

.breadcrumb a {
  color: #264B01;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .topic-header {
    flex-direction: column;
    padding: 30px 20px;
  }

  .video-container {
    flex: 0 0 100%;
    max-width: 500px;
    width: 100%;
  }

  .topic-header-center {
    order: -1;
  }

  .topic-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .topic-header h1 {
    font-size: 1.75rem;
  }

  .language-tabs {
    flex-direction: column;
    align-items: center;
  }

  .language-tab {
    width: 200px;
    text-align: center;
  }

  .article-item {
    flex-direction: column;
    text-align: center;
  }

  .article-arrow {
    display: none;
  }

  .topic-nav-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}
