/* --- section 5 latest-news-section section --- */
/* --- section 5 blog --- */
.blog-section {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  height: 120vh;
  background-color: #fdffe6;
}

/* The big background rectangle */
.agenda-section {
  width: 35%;
  flex-shrink: 0;

  background-image: url('../images/student/Image_20260819134404_3044_3.jpg');
  background-repeat: no-repeat;
  background-position: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;

  height: 100%;
  box-sizing: border-box;
  margin: 0% 2%;
}
.right-side {
  width: 60%;
}

/* The 4 smaller rectangles stacked on top of each other */
.agenda-item {
  background-color: rgba(253, 255, 230, 0.5);
  backdrop-filter: blur(6px);
  color: #1f2937;
  border-radius: 6px;
  padding: 16px;
  font-weight: 600;
  height: 20%;
}
.agenda-item:first-child {
  margin-top: 5%;
}
.agenda-name {
  font-weight: bold;
  font-size: 1ypx;
  margin-bottom: 4px;
}
.agenda-category {
  font-size: 10px;
  margin-bottom: 4px;
}
.agenda-description{
  font-size:12px;
}
.agenda-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 20px;
  background-color: #7cbdff;
  color: #000000;
  border: 1px solid #7cbdff;
  border-radius: 20px;
  cursor: pointer;
  align-self: flex-start;
  text-decoration: none;
  font-size:15px;
}
.agenda-btn:hover {
  background-color: #ffffff;
  border: 1px solid #ffffff;
  color: #1f2937;
}
/* --- Right Side: News Section --- */
.blog-section .right-side {
   display: flex; 
  flex-direction: column; 
  height: 100%;
}

.latest-news-section {
    width: 100%;
    height: 85%;
    overflow: hidden;
    display: grid;
    grid-template-rows: repeat(2, 1fr);      /* height is divided into 2 fixed rows */
    grid-template-columns: repeat(2, auto);   /* columns size themselves to content */
    justify-content: center;                  /* centers cards if they don't fill the width */
    gap: 20px;
    overflow: hidden;
    overflow-y: auto;
    padding: 5% 0%;
}
/* news item */
.news-item {
    background: #fdffe6;
    padding: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.news-item img {
    width: 100%;         /* fixed to container width */
    height: 200px;        /* fixed height */
    display: block;
    object-fit: cover;     /* fills the box, cropping overflow — this is the "zoom" effect */
    object-position: center; /* controls which part of the image stays visible when cropped */
}
.news-item h2 {
  font-size: 17px;
  margin-top: 10px;
  font-weight: bold;
}
.news-item p {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 10px;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;              /* standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-item-link:visited {
    color: inherit;
}
.news-item-link p {
    text-decoration: none;
    color: inherit;
}
.news-item-link img {
    transition: opacity 0.2s ease;
}

.news-item-link h2 {
    transition: text-decoration 0.2s ease;
}

.news-item-link:hover img {
    opacity: 0.8;
}

.news-item-link:hover h2 {
    text-decoration: underline;
}
.button-section {
  flex: 0 0 auto;
  margin-top: 12px;
  align-self: flex-start;
}

.news-more-button {
  display: inline-block; /* Allows padding to work like a button */
  padding: 12px 20px;
  color: #000000;
  background-color: #7cbdff;
  border: 1px solid #7cbdff;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none; /* Removes underline from <a> */
  font-size: 15px;
}

.news-more-button:hover {
  background-color: #ffffff;
  border: 1px solid #ffffff;
}

@media (max-width: 768px) {
  .blog-section {
    flex-direction: column;
    height: auto; /* 120vh made sense for side-by-side; stacked content needs auto height */
  }

  .agenda-section,
  .right-side {
    width: 100%;
  }

  .agenda-section {
    order: 1; /* forces it to render first/top */
  }

  .right-side {
    order: 2;
    margin-bottom: 20px;
  }
}