/* Styles for news page */
.news-page-container {
  padding: 2rem 0;
}

/* Center the main page title on the news listing */
.news-page-container .page-title {
  text-align: center;
  width: 100%;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  /* use global h1 size from base stylesheet */
  /* Use global heading color from base styles */
  /* color intentionally inherits from h1 styling in base stylesheet */
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* center each news card horizontally inside the page container */
  align-items: center;
}

/* Clean, centered pagination for news pages */
.news-page-container .pagination {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center; /* center the pagination block */
  width: 100%;
}
.news-page-container .pagination ul {
  list-style: none; /* remove dotted bullets */
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
  align-items: center;
}
.news-page-container .pagination li {
  margin: 0;
}
.news-page-container .pagination a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  /* Use global link color from base stylesheet */
  background: transparent;
  border: 1px solid transparent;
}
.news-page-container .pagination a:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.news-page-container .pagination .current {
  font-weight: 700;
  color: #ffffff;
  /* Align current page highlight with brand green */
  background: #1DB954;
  border-color: #1DB954;
}
.news-item {
  border-radius: 6px;
  padding: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  /* make each card constrained and centered by the parent .news-list */
  width: 100%;
  max-width: 980px;
}
.news-image {
  margin: 0 0 0.75rem 0;
  text-align: center;
  /* Enforce 4:3 aspect ratio for all news images */
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden; /* clip any overflow to keep boxes equal */
}
/* Constrain container widths per context */
.news-item .image-link { display: block; max-width: 480px; flex: 0 0 440px; }
.news-item.detail .news-image { max-width: 820px; }

/* Images fill the aspect-ratio box and crop as needed */
.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px solid #e5e7eb; /* subtle light gray border */
  border-radius: 4px;
}

/* Detail page: stack content vertically and center */

.news-item.detail {
  flex-direction: column;
  align-items: center; /* center content within the page */
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem 1rem;
}

/* constrain the visual width of title, image and text to align them */
.news-item.detail .news-title,
.news-item.detail .news-image,
.news-item.detail .news-text,
.news-item.detail .news-date,
.news-item.detail .news-date-below {
  max-width: 820px; /* narrower block */
  width: 100%;
  box-sizing: border-box;
  /* align left inside container */
}

/* Detail image keeps same 4:3 crop; slightly larger radius */
.news-item.detail .news-image img {
  border-radius: 6px;
}

/* Date overlay on top of image */
.news-image { position: relative; display:block; }

.news-date-below {
  text-align: left; /* align date to the left under the image */
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem 0;
}

.news-summary {
  font-size: 0.9rem; /* smaller than base paragraph size */
  color: #4b5563; /* slightly muted */
  margin: 0 0 0.75rem 0;
}

.news-date.small {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.5rem;
}
.news-body {
  flex: 1 1 auto;
}

.news-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem; /* Decrease list title size */
  /* Inherit global heading color from base stylesheet */
  font-weight: 700;
  line-height: 1.18;
}
.news-item.detail .news-title {
  font-size: 2rem; /* Decrease detail title size */
  text-align: center; /* center align title on detail page */
  width: 100%;
  margin-bottom: 0.75rem;
}
.news-date {
  color: #6b7280;
  margin: 0.25rem 0 0.75rem 0;
  font-size: 0.9rem;
}
.news-excerpt {
  color: #374151;
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.read-more a {
  /* Use global link color */
  font-weight: 600;
  text-decoration: none;
}

/* Rich text / CKEditor or markdown content styling */
.news-text { 
  font-size: 1.02rem;
  line-height: 1.6; 
  color: #1f2937; /* gray-800 */
  width: 100%;
}
.news-text p { margin: 0 0 1rem 0; }
.news-text h1, .news-text h2, .news-text h3, .news-text h4 { margin: 2rem 0 0.75rem 0; line-height:1.25; font-weight:600; }
/* h1 inside rich text should be smaller than the page title (2rem) */
.news-text h1 { font-size:1.75rem; }
.news-text h2 { font-size:1.65rem; }
.news-text h3 { font-size:1.35rem; }
.news-text h4 { font-size:1.15rem; }
.news-text ul, .news-text ol { margin: 0 0 1.25rem 1.25rem; padding:0; }
.news-text li { margin: 0.4rem 0; }
.news-text img { max-width:100%; height:auto; border-radius:6px; margin: 1rem auto; display:block; }
.news-text a { color: #1DB954; text-decoration: underline; }
.news-text blockquote { margin:1.25rem 0; padding:0.75rem 1rem; background:#f1f5f9; border-left:4px solid #1DB954; border-radius:4px; font-style:italic; }
.news-text table { width:100%; border-collapse:collapse; margin:1.5rem 0; font-size:0.95rem; }
.news-text th, .news-text td { border:1px solid #e5e7eb; padding:0.5rem 0.75rem; text-align:left; }
.news-text th { background:#f8fafc; }
.news-text pre { background:#0f172a; color:#f1f5f9; padding:1rem; overflow:auto; border-radius:6px; font-size:0.85rem; line-height:1.4; }
.news-text code { background:#f1f5f9; padding:2px 4px; border-radius:4px; font-size:0.85rem; }

@media (max-width: 720px) {
  .news-text h1 { font-size:1.5rem; }
  .news-text h2 { font-size:1.4rem; }
  .news-text h3 { font-size:1.2rem; }
  .news-text h4 { font-size:1.05rem; }
}

/* Responsive: stack image above text on small screens */
@media (max-width: 720px) {
  .news-item { flex-direction: column; }
  .news-list .news-image img { max-width: 100%; }
}
