/**
 * Topic Grid Block styles
 */

/* Add smooth scrolling to all elements */
html {
  scroll-behavior: smooth;
}

/* Add scroll margin to the topic grid view block */
#topic-grid-view {
  scroll-margin-top: 100px; /* Adjust this value based on your header size */
}

.topic-grid-block {
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.topic-grid-block__container {
  width: 100%;
}

.topic-grid-block__header {
  text-align: center;
  margin-bottom: 2rem;
}

.topic-grid-block__heading {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.topic-grid-block__subheading {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.topic-grid-block__filter {
  display: flex;
  justify-content: center;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.filter__button {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  background-color: #f0f0f0;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

body .body-page .filter__button:hover {
  background-color: #e0e0e0;
  color: #333 !important;
}

.filter__button--active {
  background-color: #333;
  color: white;
}

.filter__button--disabled {
  background-color: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

.topic-grid-block__grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 3.5rem;
}

@media (min-width: 576px) {
  .topic-grid-block__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .columns-2 .topic-grid-block__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .columns-3 .topic-grid-block__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .columns-4 .topic-grid-block__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.topic-grid-block__item {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.topic-grid-block__no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin: 2rem 0;
}

.topic-grid-block__image-wrapper {
}

.topic-grid-block__image-wrapper img {
  width: 100%;
  max-height: 305px;
  height: 100%;
  object-fit: cover;
}

.topic-grid-block__content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topic-grid-block__category {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.topic-grid-block__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0;
  margin-bottom: 0.5rem;
}

.topic-grid-block__title a {
  color: #030706;
  text-decoration: none;
  transition: color 0.2s ease;
}

body .body-page .topic-grid-block__title a:hover {
  color: #0056b3 !important;
}

/* Author and date styling */
.topic-grid-block__author {
  font-size: 1rem;
  color: #333;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-style: italic;
}

.topic-grid-block__date {
  font-size: 1rem;
  color: #333;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.topic-grid-block__pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.pagination__link:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.pagination__link--active {
  background-color: #0056b3;
  color: white;
  border-color: #0056b3;
  cursor: default;
  font-weight: 600;
}

.pagination__link--disabled {
  background-color: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
  border-color: #ddd;
}

.pagination__prev,
.pagination__next {
  padding: 0 1rem;
  font-weight: 500;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2.5rem;
  color: #333;
}

.pagination__link:hover {
  background-color: #f8f9fa;
  color: #0056b3;
  border-color: #0056b3;
}

.pagination__link--active {
  background-color: #0056b3;
  color: #fff;
  border-color: #0056b3;
}
