:root {
  --gray: #757575;
  --blue: #0a3f77;
  --green: #27aa27;
  --white: #f6f6ee;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

/* Remove any conflicting navbar styles since we're using tr-navbar now */
.navbar,
.navbar-brand,
.navbar-toggler,
.navbar-collapse,
.navbar-nav,
.nav-item,
.nav-link {
  /* These are now handled by tr-navbar classes */
  all: unset;
}

.tag-header {
  background: var(--blue);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  margin: 2rem auto;
  width: fit-content;
  text-align: center;
}

.tag-header h1,
.tag-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.articles-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.article-card {
  background: var(--white);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.article-link {
  display: flex;
  color: inherit;
  text-decoration: none;
}

.article-image {
  flex-shrink: 0;
  width: 40%;
  max-width: 320px;
  position: relative;
  overflow: hidden;
  background: #e0e0e0;
}

.article-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.article-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.article-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.3;
}

.article-content time {
  color: var(--gray);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.article-excerpt {
  flex: 1;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  color: var(--green);
  font-weight: 600;
  font-size: 0.875rem;
  align-self: flex-start;
}

.article-card:hover .read-more {
  text-decoration: underline;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
}

.pagination-div {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-item .page-link {
  display: block;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #dee2e6;
  color: var(--blue);
  text-decoration: none;
  transition: background 0.2s;
}

.page-item .page-link:hover {
  background: #f8f9fa;
}

.page-item.active .page-link {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.page-item.disabled .page-link {
  color: #6c757d;
  cursor: not-allowed;
  background: #f8f9fa;
}

@media (max-width: 767px) {
  .article-link {
    flex-direction: column;
  }
  
  .article-image {
    width: 100%;
    max-width: none;
    height: 200px;
  }
  
  .article-image img {
    aspect-ratio: auto;
    height: 100%;
  }
  
  .article-content {
    padding: 1rem;
  }
  
  .article-content h3 {
    font-size: 1.1rem;
  }
  
  .article-content p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .banners {
    display: none;
  }
}

@media (min-width: 768px) {
  .tag-header h1,
  .tag-header h2 {
    font-size: 1.5rem;
  }
  
  .article-excerpt {
    -webkit-line-clamp: 4;
  }
}

@media (min-width: 1200px) {
  .articles-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 2rem;
      max-width: 100%;
  }
    
  .article-image {
    width: 40%;
    max-width: 300px;
    max-height: 210px;
    border-bottom-right-radius: 0.5rem
  }
  
  .article-link {
    min-height: 220px;
  }
  
  .article-excerpt {
    -webkit-line-clamp: 3;
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    font-size: 0.9rem;
  }

  .article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .article-link {
    min-height: 220px;
    flex: 1;
    display: flex;
  }
  
  .article-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .article-content h3 {
    font-size: 1.2rem;
    min-height: 3.5em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .articles-grid {
    align-items: stretch;
  }
}

@media (min-width: 1600px) {
  .article-content h3 {
    font-size: 1.3rem;
  }
}