/* ================================== */
/* GLOBAL & CONTAINER */
/* ================================== */
.newsroom-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
}

a {
  text-decoration: none;
  color: #0071e3; /* Apple-inspired link color */
  transition: opacity 0.2s ease;
}
a:hover {
  opacity: 0.7;
}

/* ================================== */
/* 1. MODERN HEADER */
/* ================================== */
.newsroom-header {
  display: flex;
  flex-wrap: wrap; /* Allows stacking on small screens */
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 40px;
  gap: 20px;
}

.newsroom-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  flex-shrink: 0; /* Prevents title from shrinking */
}

.newsroom-categories {
  display: flex;
  gap: 15px;
  flex-grow: 1; /* Allows categories to fill space */
  justify-content: center;
}

.newsroom-categories a {
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: 600;
  color: #555;
  background-color: #f5f5f7;
  white-space: nowrap; /* Prevents category text from wrapping */
}

.newsroom-categories a.active,
.newsroom-categories a:hover {
  background-color: #0071e3;
  color: #fff;
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.newsroom-search {
  display: flex;
}

.newsroom-search input {
  border: 1px solid #ccc;
  border-right: none;
  padding: 8px 12px;
  border-radius: 20px 0 0 20px;
  outline: none;
  min-width: 100px; /* Ensures it doesn't get too small */
}
.newsroom-search input:focus {
  border-color: #0071e3;
}

.newsroom-search button {
  border: 1px solid #ccc;
  background-color: #f5f5f7;
  padding: 8px 10px;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
}

.create-btn {
  background-color: #333;
  color: #fff;
  padding: 9px 15px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.create-btn:hover {
  background-color: #000;
  opacity: 1;
}

/* ================================== */
/* 2. HERO SECTION */
/* ================================== */
.newsroom-hero {
  position: relative;
  min-height: 450px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end; /* Aligns content to the bottom */
  background-color: #1d1d1f; /* Fallback bg */
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: transform 0.4s ease-out;
}
.newsroom-hero:hover .hero-image {
  transform: scale(1.05);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  color: #fff;
  width: 100%;
  /* This gradient makes text readable over any image */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6) 30%, rgba(0, 0, 0, 0) 100%);
}

.hero-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 10px 0;
}
.hero-content h2 a {
  color: #fff;
}
.hero-content p {
  font-size: 1.1rem;
  max-width: 700px;
  line-height: 1.5;
}
.hero-content small {
  font-size: 0.9rem;
  opacity: 0.8;
}
.hero-category {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.9;
}

/* ================================== */
/* 3. LATEST ARTICLES GRID */
/* ================================== */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
  margin-bottom: 30px;
}

.newsroom-grid {
  display: grid;
  /* Responsive grid: auto-fill columns, each at least 300px wide */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.newsroom-card {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.newsroom-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 20px;
}

.card-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
}

.card-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 8px 0;
  line-height: 1.3;
}
.card-body h3 a {
  color: #1d1d1f;
}
.card-body h3 a:hover {
  color: #0071e3;
  opacity: 1;
}

.card-body p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}
.card-body small {
  color: #888;
}

/* ================================== */
/* 4. PAGINATION */
/* ================================== */
.pagination {
  text-align: center;
  padding: 40px 0;
  font-weight: 600;
}
.pagination a,
.pagination span {
  padding: 10px 15px;
  margin: 0 5px;
}
.pagination a {
  background-color: #f5f5f7;
  border-radius: 10px;
  color: #333;
}
.pagination a:hover {
  background-color: #e0e0e0;
  opacity: 1;
}

/* ================================== */
/* 5. RESPONSIVE (MOBILE) */
/* ================================== */
@media (max-width: 768px) {
  .newsroom-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  /* !! --- FIX FOR MOBILE CATEGORY SCROLLING --- !!
    These rules make the category bar scrollable horizontally
    if the items don't fit on the screen.
  */
  .newsroom-categories {
    order: 3; /* Move categories to the bottom */
    justify-content: flex-start;
    overflow-x: auto; /* <-- ADDS HORIZONTAL SCROLL */
    white-space: nowrap; /* <-- KEEPS CATEGORIES IN A SINGLE LINE */
    padding-bottom: 10px;
    
    /* Hides the scrollbar for a cleaner look on supported browsers */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  /* Hides scrollbar for Chrome, Safari and Opera */
  .newsroom-categories::-webkit-scrollbar {
    display: none;
  }
  /* --- END OF FIX --- */

  .header-actions {
    order: 2; /* Move search/create below title */
    justify-content: space-between;
  }
  .newsroom-search {
    flex-grow: 1; /* Allows search bar to fill space */
  }
  .newsroom-search input {
    width: 100%; /* Makes input field fill the available space */
  }

  .newsroom-title {
    order: 1;
    text-align: center;
    width: 100%;
  }

  .hero-content h2 {
    font-size: 1.8rem;
  }
  .hero-content {
    padding: 25px;
  }
  .newsroom-hero {
    min-height: 350px;
  }

  .newsroom-grid {
    grid-template-columns: 1fr; /* Stack cards on mobile */
  }
}


/* ================================== */
/* 6. ARTICLE DETAIL PAGE STYLES */
/* (Add this to the end of newsroom.css) */
/* ================================== */

/* --- 1. Article Header --- */
.article-detail-header {
  text-align: center;
  padding: 40px 0;
  max-width: 900px;
  margin: 0 auto;
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  font-weight: 600;
}
.meta-category {
  color: #0071e3; /* Blue category color */
  text-transform: uppercase;
}
.meta-date {
  color: #888;
}

.article-detail-header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1d1d1f;
  margin: 0;
}

/* --- 2. Hero Image --- */
.article-hero-image {
  width: 100%;
  max-height: 600px;
  margin: 0 0 40px 0;
  overflow: hidden;
  border-radius: 20px;
  background-color: #f5f5f7;
}
.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image covers the area nicely */
}
.article-hero-image figcaption {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  padding: 10px 15px;
  background-color: #f5f5f7;
}

/* --- 3. Article Body --- */
.article-content-body {
  /* This is key for readability: centered column */
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.article-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
}

/* Style paragraphs inside the article */
.article-text p {
  margin-bottom: 1.5em;
}

/* Style links inside the article */
.article-text a {
  color: #0071e3;
  text-decoration: underline;
}
.article-text a:hover {
  opacity: 0.8;
}

/* Style blockquotes */
.article-text blockquote {
  border-left: 4px solid #0071e3;
  padding-left: 20px;
  margin: 2em 0;
  font-style: italic;
  color: #555;
}

/* --- 4. Image Gallery (Rest of images) --- */
.article-gallery {
  margin-top: 40px;
  display: grid;
  gap: 20px;
}
.gallery-image {
  margin: 0;
  border-radius: 15px;
  overflow: hidden;
  background: #f5f5f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.gallery-image img {
  width: 100%;
  display: block; /* Removes bottom space under image */
}
.gallery-image figcaption {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  padding: 12px 15px;
}

/* --- 5. Responsive for Detail Page --- */
@media (max-width: 768px) {
  .article-detail-header h1 {
    font-size: 2.1rem; /* Smaller title on mobile */
  }
  
  .article-hero-image {
    border-radius: 15px;
    margin-bottom: 30px;
  }
  
  .article-text {
    font-size: 1.05rem;
    line-height: 1.65;
  }
}
