.hero-section {
  background-image: url("/assets/design-images/news_hero.png");
}
/* Cards Grid Container */
.news-grid {
  display: grid;
  gap: 25px;
  margin-bottom: 40px;
}

/* Large screens: 4 cards per row */
@media (min-width: 1200px) {
  .news-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Medium screens: 2 cards per row (tablets) */
@media (min-width: 768px) and (max-width: 1199px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small screens: 1 card per row (mobile) */
@media (max-width: 767px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================== */
/*       NEWS CARDS       */
/* =============================== */
.news-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-image {
  height: 200px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.category {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
  position: absolute;
  top: 10px;
  right: 10px;
}

.academic {
  background-color: #57cc99;
  color: white;
}

.sports,
.vacances {
  background-color: #ff9f1c;
  color: white;
}

.events {
  background-color: #e63946;
  color: white;
}

.achievements {
  background-color: #7209b7;
  color: white;
}

.announcements {
  background-color: #3a86ff;
  color: white;
}

.arts {
  background-color: #ff6b6b;
  color: white;
}

.technology {
  background-color: #4cc9f0;
  color: white;
}

.card-content h3 {
  font-size: 1.1rem;
  color: #1a5f7a;
  margin-bottom: 5px;
  line-height: 1.3;
  flex-grow: 1;
}

.card-excerpt {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.865rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* number of lines */
  -webkit-box-orient: vertical;
  overflow: hidden;

  text-overflow: ellipsis;
  line-height: 1.5em; /* adjust if needed */
  max-height: 3em;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 5px;
}

.card-date {
  color: #888;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.card-date i {
  color: #888;
  font-size: 1rem;
  margin-right: 5px;
}

.read-more {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  color: var(--primary);
  padding: 5px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  gap: 5px;
  i {
    display: flex;
    margin-top: 1px;
  }
}

/* View Toggle Buttons (Optional) */
.view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 15px;
}

.toggle-btn {
  padding: 10px 25px;
  background-color: #e0e0e0;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-btn.active {
  background-color: #1a5f7a;
  color: white;
}

.toggle-btn:hover {
  background-color: #d0d0d0;
}

.toggle-btn.active:hover {
  background-color: #155a75;
}

/* School Header */
.school-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  color: #1a5f7a;
}

.school-logo {
  font-size: 2.865rem;
  margin-right: 20px;
}

.school-title h2 {
  font-size: 2.2rem;
  margin-bottom: 5px;
}

.school-title p {
  color: #666;
  font-size: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  color: #777;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .header h1 {
    font-size: 1.865rem;
  }

  .header p {
    font-size: 1rem;
  }

  .school-header {
    flex-direction: column;
    text-align: center;
  }

  .school-logo {
    margin-right: 0;
    margin-bottom: 15px;
  }

  .card-content {
    padding: 20px;
  }

  .card-content h3 {
    font-size: 1.3rem;
  }

  .view-toggle {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.6rem;
  }

  .card-content h3 {
    font-size: 1.2rem;
  }

  .card-meta {
    /* 
    flex-direction: column; */
    flex-wrap: wrap;
    gap: 15px;
  }

  .read-more {
    align-self: stretch;
    text-align: center;
    width: 100%;
    background-color: var(--primary);
    justify-content: center;
    color: white;
  }
}
