/* Section Pinned */
.news-pinned-section {
  position: relative;
  padding: 20px 20px 40px 20px; /* Reduced top padding */
  text-align: center;
  font-family: 'Roboto Slab', serif;
}

.news-pinned-title {
  font-size: 2.5em;
  margin-bottom: 30px;
  color: #f7f6f3;
  position: relative;
  z-index: 1;
}

.news-pinned-card {
  max-width: 1200px; /* Original max width */
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Three cards per row */
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.boxnews {
  background-color: #ffffff; /* White background for pinned cards */
  border-radius: 10px; /* Rounded corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s;
  position: relative;
  padding: 10px;
  max-width: 350px; /* Reduced width for smaller cards */
  margin: 0 auto; /* Center the cards within the grid cell */
}

.boxnews:hover {
  transform: scale(1.05);
}

.news-pinned-section .boxnews img {
  width: 100%;
  height: 350px; /* Adapted for 1024x1024 image */
  object-fit: cover;
  display: block;
  border-bottom: 2px solid var(--sidebar-color); /* Maintain your original color */
}

.news-pinned-section .boxnews h3 {
  font-size: 1.2em;
  margin: 10px 0;
  color: #333; /* Original text color */
}

.news-pinned-section .boxnews p {
  font-size: 0.9em;
  color: #666;
  padding: 0 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section Non-Pinned */
.news-section {
  padding: 40px 20px;
  text-align: center;
  font-family: 'Roboto Slab', serif;
}

.news-title {
  font-size: 2.5em;
  margin-bottom: 30px;
  color: var(--sidebar-color);
}

.news-card {
  max-width: 1200px; /* Original max width */
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Three cards per row */
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.news-section .boxnews {
  background-color: transparent; /* No background color */
  border: none; /* No border */
  box-shadow: none; /* No shadow */
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s;
  position: relative;
  padding: 10px;
  max-width: 350px; /* Consistent size with pinned cards */
  margin: 0 auto; /* Center the cards within the grid cell */
}

.news-section .boxnews:hover {
  transform: scale(1.05);
}

.news-section .boxnews img {
  width: 100%;
  height: 350px; /* Adapted for 1024x1024 image */
  object-fit: cover;
  display: block;
}

.news-section .boxnews h3 {
  font-size: 1.2em;
  margin: 10px 0;
  color: #333; /* Original text color */
}

.news-section .boxnews p {
  font-size: 0.9em;
  color: #666;
  padding: 0 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive Design */
@media (max-width: 992px) {
  .news-pinned-card,
  .news-card {
    grid-template-columns: repeat(2, 1fr); /* Two cards per row */
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  .news-pinned-card,
  .news-card {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .boxnews {
    max-width: 100%; /* Full width on smaller screens */
  }

  .news-pinned-section .boxnews img,
  .news-section .boxnews img {
    height: 250px;
  }

  .news-pinned-section .boxnews h3,
  .news-section .boxnews h3 {
    font-size: 1.4em;
  }

  .news-pinned-section .boxnews p,
  .news-section .boxnews p {
    height: 60px;
  }
}

@media (max-width: 1200px) {
  .news-pinned-section .boxnews img,
  .news-section .boxnews img {
    max-width: 100%;
    height: auto;
  }
}