/* ========================================================== 
   Global Styles and Variables
   ========================================================== */
:root {
  /* Colors */
  --primary-color: #121212;
  --secondary-color: #333;
  --accent-color: #c31;
  --background-color: #f9f9f9;
  --card-background: #ffffff;
  --text-color: #333;
  --text-light: #666;
  --text-lighter: #999;
  --border-color: #e0e0e0;
  --hover-color: #ac1d1d;
  --light-gray: #f5f5f5;
  
  /* Typography */
  --font-sans: 'Source Sans Pro', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-size-3xl: 48px;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  
  /* Border Radius */
  --border-radius-sm: 2px;
  --border-radius-md: 4px;
  --border-radius-lg: 8px;
  
  /* Transition */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ========================================================== 
   Reset and Base Styles
   ========================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: 0 !important;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--hover-color);
}

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

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  transition: all var(--transition-fast);
}

/* Lists */
ul, ol {
  list-style: none;
}

/* ========================================================== 
   Header Styles
   ========================================================== */
.site-header {
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.header-top {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-container {
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.top-nav .separator {
  color: var(--border-color);
}

.top-nav a {
  color: var(--text-color);
}

.header-main {
  padding: var(--spacing-sm) 0;
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 1199px) {
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo-container {
    flex: 1;
  }
  
  .main-navigation {
    flex: 2;
    text-align: center;
  }
  
  .mobile-menu-toggle {
    flex: 0 0 auto;
  }
  
  /* Ensure logo and menu button are on the same line on mobile */
  .site-title {
    font-size: var(--font-size-lg);
    margin: 0;
  }
  
  .mobile-toggle-button {
    font-size: var(--font-size-xl);
    padding: 0;
  }
}

.site-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin: 0;
}

.main-navigation {
  display: none;
}

.nav-links {
  display: flex;
  gap: var(--spacing-sm);
}

.nav-item a {
  color: var(--text-color);
  font-weight: 600;
  position: relative;
  padding: var(--spacing-xs) 0;
}

.nav-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition-normal);
}

.nav-item a:hover::after {
  width: 100%;
}

.search-container button {
  font-size: var(--font-size-lg);
  color: var(--text-color);
  padding: var(--spacing-xs);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  justify-content: flex-end;
  padding: var(--spacing-sm);
}

/* Mobile Menu Toggle for mobile */
@media (max-width: 1199px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

.mobile-toggle-button {
  font-size: var(--font-size-xl);
  color: var(--text-color);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--card-background);
  z-index: 1000;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  transition: right var(--transition-normal);
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-navigation {
  padding: var(--spacing-sm);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.mobile-nav-item a {
  color: var(--text-color);
  font-weight: 600;
  display: block;
  padding: var(--spacing-xs) 0;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-overlay.active {
  display: flex;
}

.search-overlay-content {
  width: 100%;
  max-width: 600px;
  padding: var(--spacing-sm);
}

.search-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  font-size: var(--font-size-2xl);
  color: white;
}

.search-form {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.search-form input {
  flex: 1;
  padding: var(--spacing-sm);
  font-size: var(--font-size-lg);
  border: none;
  border-radius: var(--border-radius-sm);
}

.search-form button {
  background-color: var(--accent-color);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
}

/* ========================================================== 
   Main Content Styles
   ========================================================== */
.main-content {
  padding: var(--spacing-sm) 0;
}

/* Featured Story */
.featured-story {
  margin-bottom: var(--spacing-sm);
}

.featured-article {
  background-color: var(--card-background);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.featured-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.featured-article:hover .featured-image img {
  transform: scale(1.03);
}

.featured-content {
  padding: var(--spacing-sm);
}

.category-badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--spacing-sm);
}

.featured-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-sm);
}

.featured-title a {
  color: var(--primary-color);
}

.featured-title a:hover {
  color: var(--accent-color);
}

.featured-excerpt {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

.article-meta {
  display: flex;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-lighter);
}

/* News Grid */
.news-grid {
  margin-bottom: var(--spacing-sm);
}

.grid-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.section-title {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

.articles-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Reduce gap on mobile */
@media (max-width: 768px) {
  .articles-container {
    gap: var(--spacing-sm);
  }
  
  /* Further reduce spacing on smaller screens */
  @media (max-width: 480px) {
    .articles-container {
      gap: var(--spacing-xs);
    }
    
    .news-article {
      margin-bottom: var(--spacing-xs);
    }
  }
}

.news-article {
  display: flex;
  flex-direction: column;
  background-color: var(--card-background);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: var(--spacing-sm);
}

/* Reduce margin on mobile */
@media (max-width: 768px) {
  .news-article {
    margin-bottom: var(--spacing-sm);
  }
}

.article-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.news-article:hover .article-image img {
  transform: scale(1.03);
}

.article-content {
  padding: var(--spacing-sm);
}

.article-title {
  margin-bottom: var(--spacing-sm);
}

.article-title a {
  color: var(--primary-color);
}

.article-title a:hover {
  color: var(--accent-color);
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

/* Ad Placeholder */
.ad-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--light-gray);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-lighter);
}

.ad-content {
  background-color: var(--card-background);
  border: 1px dashed var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 250px;
}

/* Sidebar */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.sidebar-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--border-color);
}

/* Trending News */
.trending-news {
  background-color: var(--card-background);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.trending-number {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
}

.trending-title {
  flex: 1;
  font-weight: 600;
  line-height: 1.4;
}

.trending-item a {
  color: var(--text-color);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.trending-item a:hover .trending-title {
  color: var(--accent-color);
}

/* Editor's Picks */
.editors-picks {
  background-color: var(--card-background);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.picks-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.pick-article {
  display: flex;
  gap: var(--spacing-sm);
}

.pick-image {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  overflow: hidden;
}

.pick-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pick-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pick-title {
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

.pick-date {
  font-size: var(--font-size-sm);
  color: var(--text-lighter);
}

/* Newsletter Signup */
.newsletter-signup {
  background-color: var(--light-gray);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  text-align: center;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.newsletter-form input {
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: inherit;
}

.newsletter-form button {
  background-color: var(--accent-color);
  color: white;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
}

.newsletter-form button:hover {
  background-color: var(--hover-color);
}

/* Featured Categories */
.featured-categories {
  margin-bottom: var(--spacing-sm);
}

.categories-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.category-block {
  background-color: var(--card-background);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
}

.category-articles {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.category-link {
  color: var(--text-color);
  padding: var(--spacing-xs) 0;
  display: block;
  border-bottom: 1px solid var(--border-color);
}

.category-link:last-child {
  border-bottom: none;
}

.category-link:hover {
  color: var(--accent-color);
  padding-left: var(--spacing-xs);
}

/* ========================================================== 
   Footer Styles
   ========================================================== */
.site-footer {
  background-color: var(--primary-color);
  color: white;
  padding: var(--spacing-xs) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.footer-logo h2 {
  color: white;
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-sm);
}

.footer-logo p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--spacing-sm);
}

.footer-social {
  display: flex;
  gap: var(--spacing-sm);
}

.footer-social a {
  color: white;
  font-size: var(--font-size-xl);
}

.footer-social a:hover {
  color: var(--accent-color);
}

.footer-title {
  color: white;
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  display: inline-flex;
  flex-direction: row;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ========================================================== 
   Media Queries
   ========================================================== */

/* Tablet (768px and above) */
@media (min-width: 768px) {
  .nav-links {
    gap: var(--spacing-sm);
  }
  
  .featured-content {
    padding: var(--spacing-sm);
  }
  
  .featured-title {
    font-size: var(--font-size-3xl);
  }
  
  .news-article {
    flex-direction: row;
    height: 200px;
  }
  
  .article-image {
    width: 300px;
    height: 100%;
  }
  
  .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .categories-container {
    flex-direction: row;
    gap: var(--spacing-sm);
  }
  
  .category-block {
    flex: 1;
  }
  
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .footer-column {
    flex: 1;
  }
}

/* Desktop (1200px and above) */
@media (min-width: 1200px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .main-navigation {
    display: block;
  }
  
  .grid-content {
    flex-direction: row;
    gap: var(--spacing-sm);
  }
  
  .main-column {
    flex: 3;
  }
  
  .sidebar-column {
    flex: 1;
  }
  
  .featured-image {
    height: 400px;
  }
  
  .featured-article {
    display: flex;
    height: 400px;
  }
  
  .featured-image {
    width: 60%;
    height: 100%;
  }
  
  .featured-content {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

/* ========================================================== 
   Utility Classes
   ========================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.mb-0 {
  margin-bottom: 0;
}

.mt-0 {
  margin-top: 0;
}