/* News-header */

.back-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-5px);
}

/* ================= News-header ================= */
.news-header {
  text-align: center;
  padding: 45px 10px;
  border-bottom: 1px solid #eaeaea;
  position: relative;

  .backbtn {
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: var(--primary);
    color: white;
    font-size: 0.765rem;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;

    i {
      display: flex;
    }
  }
}

.news-header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 15px;
  line-height: 1.2;
}

.article-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.95rem;
  color: #666;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tag {
  display: inline-block;
  margin-top: 15px;
  background: #4361ee;
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.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;
}

/* ================= ARTICLE BODY ================= */
main {
  animation: fadeIn 0.8s ease;
}

.content-wrapper::after {
  content: "";
  display: table;
  clear: both;
}

/* Image floated top-left */
.image-column {
  float: left;
  width: 40%;
  max-height: 350px;
  margin: 0 50px 20px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.image-column img {
  width: 100%;
  object-fit: cover;
  height: 350px;
}

.image-caption {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px;
  font-size: 0.9rem;
  text-align: center;
}

/* Text */
.intro-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: #444;
  margin-bottom: 25px;
}
.news-body {
  font-size: 1.05rem !important;

  div {
    font-size: 1.05rem !important;
  }
  span {
    font-size: 1.05rem !important;
  }
  p {
    font-size: 1.05rem !important;
  }
}

.highlight {
  background: #f0f4ff;
  padding: 25px;
  border-left: 5px solid #4361ee;
  border-radius: 8px;
  margin: 30px 0;
  font-style: italic;
}

/* Clear float */
main::after {
  content: "";
  display: table;
  clear: both;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .news-header h1 {
    font-size: 2.2rem;
  }

  .image-column {
    width: 100%;
    float: none;
    margin: 0 0 25px 0;
  }
}

@media (max-width: 480px) {
  .news-header h1 {
    font-size: 1.8rem;
  }
}

/* ================= ANIMATION ================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Share Section */
.share-section {
  border-top: 1px solid #eaeaea;
  background: var(--white);
  margin-bottom: 40px;
  margin-top: 20px;
  padding-top: 10px;
}

.share-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--dark);
}

.share-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.765rem;
  transition: 0.3s ease-in-out;

  i {
    display: flex;
    font-size: 1rem;
  }
}

.facebook {
  background: #1877f2;
  color: white;
}
.twitter {
  background: #1da1f2;
  color: white;
}
.whatsapp {
  background: #25d366;
  color: white;
}
.email {
  background: var(--gray);
  color: white;
}

.share-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.share-button:hover {
  transform: scale(0.9);
}

/* Related News */
.related-news {
  margin-bottom: 50px;
}

.section-title {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 30px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.related-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.related-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.related-content {
  padding: 20px;
}

.related-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark);
}

.related-date {
  font-size: 0.9rem;
  color: var(--gray);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid var(--light-gray);
  color: var(--gray);
  font-size: 0.9rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px;
}

.loading-spinner {
  border: 5px solid var(--light-gray);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error State */
.error-state {
  text-align: center;
  padding: 60px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.error-icon {
  font-size: 4rem;
  color: #e53e3e;
  margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .news-header-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .detail-image {
    height: 300px;
  }

  .detail-content {
    padding: 25px;
  }

  .detail-title {
    font-size: 2rem;
  }

  .detail-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .share-buttons {
    justify-content: center;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .detail-image {
    height: 200px;
  }

  .detail-title {
    font-size: 1.7rem;
  }

  .share-button {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }

  .school-logo h1 {
    font-size: 1.4rem;
  }
}
