/* ==========================================================================
   1. GLOBAL STYLES
   ========================================================================== */
body {
  background-color: #f3f4f6 !important;
  font-family: 'Poppins', sans-serif, 'Playfair Display', serif;
  margin: 0;
  padding: 2rem;
  box-sizing: border-box;
}

/* ==========================================================================
   2. MAIN CONTAINER CONSTRAINTS
   ========================================================================== */
.news-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 1.5rem;
  padding: 10rem 1rem;
  margin: 30px; 
}

/* ==========================================================================
   3. THE REFINED CARD LAYOUT
   ========================================================================== */
.news-card {
  background-color: #ffffff !important;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  width: 95%;
  align-self: center;
  height: 250px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.card-image-box {
  width: 30%;
  min-width: 30%;
  max-width: 30%;
  height: 100%;
  background-color: #e5e7eb;
  position: relative;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-text-box {
  width: 60%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

/* ==========================================================================
   4. TYPOGRAPHY & BUTTONS
   ========================================================================== */
.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
  color: #0078ff;
  margin: 15px 5px 5px 5px;
}

.card-description {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  color: #111111;
  margin: 0.5rem 0;
}

.card-time {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  margin: 0.5rem;
  background-color: #ff007f;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  transition: background-color 0.2s ease;
}

.filter-btn:hover {
  background-color: #0078ff;
}

/* ==========================================================================
   5. NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: flex-end;
  z-index: 9999 !important; 
  pointer-events: none;
}

.navbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  pointer-events: auto;
  font-weight: 700;
  list-style: none !important;
}

.navbar ul {
  list-style: none !important;
}

.navbar nav a {
  color: #0078ff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar nav a:hover,
.navbar nav a.active {
  opacity: 0.6;
}

.navbar nav a:hover {
  transform: translateY(-2px);
}

.filter-nav {
  margin-top: 6rem;
}

/* ==========================================================================
   6. MOBILE RESPONSIVE FIXES (Screens 768px and smaller)
   ========================================================================== */
@media (max-width: 768px) {
  /* Complete Reset for the Outer Viewport Edge */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden; /* Stops horizontal shift/scrolling */
  }

  /* 1. Navbar Adjustments */
  .navbar {
    position: relative; 
    padding: 1rem !important;
    justify-content: center; 
    width: 100% !important;
  }

  .navbar nav {
    column-gap: 1rem;
    row-gap: 0.3rem;
  }

  .navbar nav a {
    font-size: 0.9rem; 
    font-weight: 700 !important;
  }

  /* 2. Filter Buttons Carousel */
  .filter-nav {
    margin-top: 1rem !important;
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem !important; /* Kept minimal breathing room just for the button line */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    width: 100% !important;
  }

  .filter-nav::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    margin: 0;
    flex-shrink: 0;
  }

  /* 3. Grid Container - Forces True Full Viewport Width Edge to Edge */
  .news-grid-container {
    grid-template-columns: 1fr !important;
    padding: 0 !important; /* CRITICAL: Wipes out internal spacing entirely */
    gap: 1rem; /* Space between cards stacking vertically */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important; 
  }

  /* 4. Column Layout Transition */
  .news-card {
    flex-direction: column !important; 
    height: auto !important; 
    max-height: none;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    border-left: none !important;  /* Removes boundary borders if they distort full-bleed look */
    border-right: none !important;
    border-radius: 0 !important;   /* Option: Square edges look better for true full-bleed edge cards */
  }

  .card-image-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: 220px;
  }

  .card-text-box {
    width: 100% !important;
    padding: 1.2rem 1rem !important; /* Restores padding only inside the card text container */
  }
  
  .card-title {
    font-size: 1.2rem;
    -webkit-line-clamp: none;
    margin: 5px 0; /* Clean up desktop offsets */
  }

  .card-description {
    font-size: 0.95rem;
    margin: 10px 0;
  }
}