.section-header::after {
  content: "";
  flex: 1;
  height: 3px;
  background: linear-gradient(to right, var(--primary), transparent);
  max-width: 150px;
}

.i-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 1024px) {
  .i-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* News Section */
.news-section {
  display: grid;
  gap: 25px;
}

@media (min-width: 768px) {
  .news-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .news-section {
    grid-template-columns: 1fr;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Card Styles */
.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.04);
}

.card-content {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: start;
}

.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;
}

.card-excerpt {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.865rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  /* number of lines */
  -webkit-box-orient: vertical;
  overflow: hidden;

  text-overflow: ellipsis;
  line-height: 1.5em;
  /* adjust if needed */
  max-height: 6em;
}

.card-meta {
  margin: auto;
  width: 100%;
  margin-bottom: 0;
  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;
  }
}

/* Events Section */
.events-section {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

.event-item {
  padding: 10px 0;
  border-left: 4px solid var(--primary);
  padding-left: 15px;
  margin-bottom: 20px;
  transition: background-color 0.2s ease;
}

.event-item:hover {
  background-color: #f9f9f9;
  border-left-color: var(--primary);
}

.event-item:last-child {
  margin-bottom: 0;
}

.event-date {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 5px;
}

.event-title {
  font-size: 0.9rem;
  color: #666;
}

.event-footer {
  margin: auto;
  width: fit-content;

  a {
    display: flex;
    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;
  }
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .section-header h2 {
    font-size: 1.5rem;
  }

  .news-image {
    height: 200px;
  }

  .news-title {
    font-size: 1.1rem;
  }

  .events-section {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .section-header h2 {
    font-size: 1.3rem;
  }

  .section-header::after {
    max-width: 80px;
  }

  .news-content {
    padding: 15px;
  }

  .event-item {
    padding-left: 12px;
  }
}
