/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  line-height: 1.5;
  color: var(--primary-text-color);
  background-color: var(--bg-color);
}

/* Results Container */
.results-container {
  padding: 1rem 1rem;
  padding-top: 96px !important;
  /* in mobile the content layout is made by padding instead of max-width like desktop */
  max-width: 1200px;
  min-height: 64vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-heading {
  width: 100%;
  margin-bottom: 2rem;
  text-align: left;
}

.heading-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: var(--sm-margin);
}

.page-total {
  font-size: 1rem;
  color: #555;
}

/* Results List */
.results-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

/* Result Item */
.result-item {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}

.image-link {
  width: 50%;
}

/* Image Wrapper */
.result-image-wrapper {
  max-height: 320px;
  overflow: hidden;
  display: flex;
  /* Enable Flexbox */
  align-items: center;
  /* Center vertically */
  justify-content: center;
  /* Center horizontally */
}

.result-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.3s ease;
  object-position: center;
  /* Center the image */
}

.result-item:hover .result-image {
  transform: scale(1.05);
}

/* Result Content */
.result-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-link {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}

.category-link:hover {
  text-decoration: underline;
}

.result-title {
  font-size: 1.25rem;
  font-weight: bold;
  transition: color 0.2s ease;
}

.result-title:hover {
  color: var(--primary);
}

.result-description {
  font-size: 1rem;
  color: var(--light-gray-text);
  display: -webkit-box;
  /* Webkit browsers */
  -webkit-line-clamp: 4;
  /* Webkit-specific */
  -webkit-box-orient: vertical;
  /* Webkit-specific */

  line-clamp: 4;
  /* Future compatibility */
  overflow: hidden;
  /* Fallback for unsupported browsers */
  text-overflow: ellipsis;

}

@media (min-width: 480px) {

  .results-container {
    padding: 2rem 4rem;
  }

}

/* Responsive Design */
@media (min-width: 768px) {

  .result-item {
    flex-direction: row;
  }

  .results-heading {
    text-align: center;
  }

  .result-image-wrapper {
    width: 100%;
  }

  .result-content {
    width: 60%;
  }
}

@media (min-width: 1024px) {
  .results-list {
    max-width: 70%;
    margin: 0 auto;
    margin-bottom: 4rem;

  }

  .results-container {
    padding: 1rem 0;
  }

}