/* ===============================
   BASE / RESET
================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: #111;
  background: #f8f8f8;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===============================
   HEADER / NAV
================================ */
.news-header {
  background: #fff;
  border-bottom: 2px solid #ddd;
  padding: 1.5rem 0;
}

.header-center {
  text-align: center;
}

.logo {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

nav a {
  margin: 0 0.75rem;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

/* ===============================
   MARKET TICKER
================================ */
.market-ticker {
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

/* ===============================
   CAROUSEL
================================ */
.carousel {
  position: relative;
  margin: 2rem auto;
  overflow: hidden;
}

.slide {
  display: none;
  position: relative;
}

.slide.active {
  display: block;
}

.slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 6px;
}

.slide-text {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 1rem;
  max-width: 60%;
}

#prev,
#next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

#prev {
  left: 10px;
}

#next {
  right: 10px;
}

.slide-category {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

.slide-text h2 a {
  color: inherit;
  text-decoration: none;
}

.slide-text h2 a:hover {
  text-decoration: underline;
}
/* ===============================
   WORLD NEWS SECTION
================================ */
.world-news-section {
  border: 1px solid #ddd;
  padding: 1.5rem;
  padding-bottom: 0; /* Remove bottom padding for button */
  margin: 1.5rem auto;
  background: #fff;
  position: relative;
}

.world-news-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #000;
  padding-bottom: 0.25rem;
}

.world-news-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* Featured Article with Image Overlay */
.featured-article {
  position: relative;
  height: 350px;
  border-radius: 6px;
  overflow: hidden;
}

.featured-article img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: #ddd;
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3));
  padding: 1.5rem;
}

.featured-overlay h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.featured-overlay a {
  color: #fff;
  text-decoration: none;
}

.featured-overlay a:hover {
  text-decoration: underline;
}

/* Headlines Sidebar */
.headlines-sidebar {
  display: flex;
  flex-direction: column;
}

.headlines-sidebar ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}

.headlines-sidebar li {
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.headlines-sidebar a {
  text-decoration: none;
  color: #000;
  font-size: 0.95rem;
}

.headlines-sidebar a:hover {
  text-decoration: underline;
}

/* More Headlines Container (full width below main content) */
#more-headlines-container,
#local-more-headlines-container,
#national-more-headlines-container,
#business-more-headlines-container,
#sports-more-headlines-container,
#health-more-headlines-container,
#entertainment-more-headlines-container,
#technology-more-headlines-container {
  border-top: 1px solid #ddd;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}

#more-headlines-list,
#local-more-headlines-list,
#national-more-headlines-list,
#business-more-headlines-list,
#sports-more-headlines-list,
#health-more-headlines-list,
#entertainment-more-headlines-list,
#technology-more-headlines-list   {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
  column-count: 3;
  column-gap: 2rem;
}

#more-headlines-list li,
#local-more-headlines-list li,
#national-more-headlines-list li,
#business-more-headlines-list li,
#sports-more-headlines-list li,
#health-more-headlines-list li,
#entertainment-more-headlines-list li,
#technology-more-headlines-list li {
  margin-bottom: 0.75rem;
  line-height: 1.4;
  break-inside: avoid;
}

#more-headlines-list a,
#local-more-headlines-list a,
#national-more-headlines-list a,
#business-more-headlines-list a,
#sports-more-headlines-list a,
#health-more-headlines-list a,
#entertainment-more-headlines-list a,
#technology-more-headlines-list a  {
  text-decoration: none;
  color: #000;
  font-size: 0.95rem;
}

#more-headlines-list a:hover,
#local-more-headlines-list a:hover,
#national-more-headlines-list a:hover,
#business-more-headlines-list a:hover,
#sports-more-headlines-list a:hover,
#health-more-headlines-list a:hover,
#entertainment-more-headlines-list a:hover,
#technology-more-headlines-list a:hover {
  text-decoration: underline;
}

/* More Button (full width, invisible until hover) */
.more-button {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid #ddd;
  padding: 1rem;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.more-button:hover {
  background-color: #f0f0f0;
}

.more-button .arrow-down {
  font-size: 1.2rem;
  color: #999;
  transition: color 0.2s ease;
  transform: scaleX(2.5); /* Make arrow 2.5x wider */
  display: inline-block;
}

.more-button:hover .arrow-down {
  color: #000;
}

.more-button[aria-expanded="true"] .arrow-down {
  transform: scaleX(2.5) rotate(180deg); /* Keep width when rotated */
}

/* Article metadata (source and time) */
.article-meta {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.25rem;
  display: flex;
  gap: 0.5rem;
}

.featured-overlay .article-meta {
  color: #ddd;
  margin-top: 0.5rem;
}

.article-meta .source {
  font-weight: 600;
}

.article-meta .time::before {
  content: "• ";
  margin-right: 0.25rem;
}

/* Article Summary Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
}

.close-button:hover {
  color: #000;
}

.modal-content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.modal-content .source-info {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.modal-content .summary {
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-content .read-full {
  display: inline-block;
  background: #000;
  color: #fff;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.modal-content .read-full:hover {
  background: #333;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
  .world-news-content {
    grid-template-columns: 1fr;
  }

  .featured-article {
    height: 280px;
  }

  #more-headlines-list {
    column-count: 1;
  }
}
/* ===============================
   SECONDARY NEWS LIST
================================ */
#news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.news-item h3 {
  font-size: 1rem;
}

/* ===============================
   FEATURED GRID
================================ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin: 3rem auto;
}

.card {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
}

.card img {
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
}

.card h3 {
  margin: 0.75rem 0;
}

.card a {
  text-decoration: none;
  font-weight: bold;
}

/* ===============================
   CATEGORIES
================================ */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin: 3rem auto;
}

.cat-box h3 {
  margin-bottom: 0.5rem;
}

.cat-box ul {
  list-style: none;
}

.cat-box li {
  margin-bottom: 0.4rem;
}

/* ===============================
   FOOTER
================================ */
.news-footer {
  background: #222;
  color: #fff;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
  .gnews-content {
    grid-template-columns: 1fr;
  }

  .lead-story {
    flex-direction: column;
  }

  .lead-story img {
    width: 100%;
    height: 240px;
  }

  .slide-text {
    max-width: 90%;
  }
}

/* ============================
   SECTION PAGE
   ============================ */
.section-page {
  padding: 2rem 1rem;
}

.section-page-header {
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #000;
  padding-bottom: 0.75rem;
}

.section-page-header h2 {
  font-size: 2rem;
  margin: 0.5rem 0 0;
}

.back-link {
  text-decoration: none;
  color: #666;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #000;
}

/* Featured article on section page */
.section-featured-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 2rem;
}

.section-featured-article img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
}

.section-featured-overlay h3 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.section-featured-overlay h3 a {
  text-decoration: none;
  color: #000;
}

.section-featured-overlay h3 a:hover {
  text-decoration: underline;
}

.section-featured-desc {
  color: #444;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Articles grid */
.section-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-article-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

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

.section-article-card .card-body {
  padding: 0.75rem;
}

.section-article-card h4 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.section-article-card h4 a {
  text-decoration: none;
  color: #000;
}

.section-article-card h4 a:hover {
  text-decoration: underline;
}

.section-article-card p {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

/* Load more button */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background: #000;
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 2rem;
  border-radius: 4px;
}

.load-more-btn:hover {
  background: #333;
}

/* Responsive */
@media (max-width: 900px) {
  .section-featured-article {
    grid-template-columns: 1fr;
  }

  .section-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .section-articles-grid {
    grid-template-columns: 1fr;
  }
}

.world-news-title a {
  text-decoration: none;
  color: inherit;
}

.world-news-title a:hover {
  text-decoration: underline;
}

/* ============================
   ARTICLE PAGE
   ============================ */
.article-page {
  max-width: 800px;
  padding: 2rem 1rem;
}

.article-page-header {
  margin-bottom: 1.5rem;
}

.article-loading {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.article-category {
  margin-bottom: 0.75rem;
}

.article-category a {
  text-decoration: none;
  color: #fff;
  background: #000;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
}

.article-category a:hover {
  background: #333;
}

.article-content h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 0.75rem 0;
}

.article-byline {
  display: flex;
  gap: 1rem;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

.article-source {
  font-weight: bold;
  color: #000;
}

.article-image-container {
  margin-bottom: 1.5rem;
}

.article-image-container img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 4px;
}

.article-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
  margin-bottom: 1.5rem;
}

.article-summary {
  background: #f9f9f9;
  border-left: 4px solid #000;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 4px 4px 0;
}

.article-summary h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.article-summary p {
  margin: 0;
  line-height: 1.6;
  color: #333;
}

.article-description p {
  margin-bottom: 1rem;
}

.article-description p:last-child {
  margin-bottom: 0;
}

.read-full-btn {
  display: block;
  text-align: center;
  background: #000;
  color: #fff;
  padding: 1rem 2rem;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 4px;
  margin-bottom: 3rem;
}

.read-full-btn[hidden] {
  display: none !important;
}


.read-full-btn:hover {
  background: #333;
}

/* Related articles */
.related-section {
  border-top: 2px solid #000;
  padding-top: 1.5rem;
}

.related-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.related-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

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

.related-card-body {
  padding: 0.75rem;
}

.related-card-body h4 {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

.related-card-body h4 a {
  text-decoration: none;
  color: #000;
}

.related-card-body h4 a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .article-content h1 {
    font-size: 1.5rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}