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

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #111827;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  transition: all 0.3s ease;
  min-height: 100vh;
}

/* ================= THEME VARIABLES ================= */
:root {
  --primary: #3a7bd5;
  --primary-dark: #2563eb;
  --accent: #00d4ff;
  --accent-hover: #00b8e6;
  --muted: #6b7280;
  --bg-light: #f8fafc;
  --bg-light2: #e2e8f0;
  --bg-dark: #0f172a;
  --bg-dark2: #1e293b;
  --card-light: #ffffff;
  --card-dark: #334155;
  --text-dark: #1e293b;
  --text-light: #f1f5f9;
  --border-light: #e2e8f0;
  --border-dark: #475569;
  --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ================= DARK MODE ================= */
body.dark-mode {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-light);
}

body.dark-mode .newsCard,
body.dark-mode .mega-menu,
body.dark-mode .search-box,
body.dark-mode .topHeadlines {
  background: var(--card-dark);
  color: var(--text-light);
  border: 1px solid var(--border-dark);
}

/* Fix for news card text in dark mode */
body.dark-mode .newsCard .title p,
body.dark-mode .newsCard .title a,
body.dark-mode .topHeadlines .text .title a,
body.dark-mode .topHeadlines .text .title h2 {
  color: var(--text-light) !important;
}

body.dark-mode .newsCard .description,
body.dark-mode .topHeadlines .text .description {
  color: #cbd5e1;
}

body.dark-mode .mega-column a {
  color: var(--text-light);
}

body.dark-mode .mega-column a:hover {
  color: var(--accent);
}

body.dark-mode .footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.dark-mode .suggestions {
  background: var(--card-dark);
  border: 1px solid var(--border-dark);
}

body.dark-mode .suggestions li {
  color: var(--text-light);
}

body.dark-mode .suggestions li:hover {
  background: var(--bg-dark2);
}

body.dark-mode .news .title h2 {
  color: var(--accent);
}

body.dark-mode .topHeadlines h2 {
  color: var(--accent);
}

/* ================= HEADER ================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  box-shadow: var(--shadow-medium);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--primary);
  transition: all 0.3s ease;
}

.header .logo {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header .logo:hover {
  color: var(--primary);
  transform: scale(1.05);
  text-shadow: 0 4px 8px rgba(58, 123, 213, 0.4);
}

/* ================= NAVIGATION ================= */
.mega-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ================= MEGA MENU ================= */
.has-mega:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--card-light);
  color: var(--text-dark);
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-heavy);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 1200;
  min-width: 480px;
  border: 1px solid var(--border-light);
}

.mega-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.mega-column h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.mega-column a {
  font-size: 0.9rem;
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.mega-column a:hover {
  color: var(--primary);
  background: var(--bg-light);
  transform: translateX(4px);
}

/* ================= SEARCH BAR ================= */
.nav-search {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 1rem;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  background: var(--card-light);
  border-radius: 50px;
  padding: 0.25rem 0.5rem;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.search-box:hover,
.search-box:focus-within {
  box-shadow: var(--shadow-medium);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  font-size: 0.95rem;
  border-radius: 50px;
  background: transparent;
  color: var(--text-dark);
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box button {
  padding: 0.75rem;
  border: none;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(58, 123, 213, 0.4);
}

/* ================= SUGGESTIONS DROPDOWN ================= */
.suggestions {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: var(--card-light);
  border-radius: 16px;
  box-shadow: var(--shadow-medium);
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1200;
  display: none;
  border: 1px solid var(--border-light);
}

.suggestions li {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  color: var(--text-dark);
}

.suggestions li:hover {
  background: var(--bg-light2);
  color: var(--primary);
}

/* ================= NAVIGATION ACTIONS ================= */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
}

.dark-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--shadow-medium);
}

.bar {
  display: none;
  cursor: pointer;
  color: #fff;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  z-index: 1350;
}

.bar .open,
.bar .close {
  position: absolute;
  font-size: 1.4rem;
  transition: all 0.3s ease;
  top: 50%;
  left: 50%;
  color: #fff;
  pointer-events: none;
}

.bar .open {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

.bar .close {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(180deg);
}

.bar.active .open {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-180deg);
}

.bar.active .close {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

.bar:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.bar.active {
  background: rgba(255, 255, 255, 0.1);
}

/* ================= CRITICAL MOBILE NAVIGATION FIX ================= */

/* Mobile navigation overlay - BEHIND the menu, only covers LEFT side */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 25%; /* Only covers the LEFT side, not the menu area */
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1250; /* LOWER than navigation menu */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Ensure mega menu items are clickable */
.mega-menu.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.mega-menu.active .mega-column a {
  pointer-events: auto;
}

/* ================= TOP HEADLINES SECTION ================= */
.topHeadlines {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  padding: 2rem;
  background: var(--card-light);
  border-radius: 20px;
  margin: 2rem auto;
  max-width: 1200px;
  box-shadow: var(--shadow-medium);
  animation: fadeIn 0.8s ease;
  border: 1px solid var(--border-light);
}

.topHeadlines h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topHeadlines .left .img {
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
}

.topHeadlines .left .img img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.topHeadlines .left .img:hover img {
  transform: scale(1.05);
}

.topNews {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ================= NEWS SECTIONS ================= */
.page2 {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.news {
  margin-bottom: 3rem;
}

.news .title h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.newsBox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ================= NEWS CARDS ================= */
.newsCard {
  background: var(--card-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid var(--border-light);
  cursor: pointer;
}

.newsCard:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--primary);
}

.newsCard img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.newsCard:hover img {
  transform: scale(1.05);
}

.newsCard .text {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.newsCard .title p {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.newsCard .description {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  flex-grow: 1;
}

.newsCard .badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  z-index: 10;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(58, 123, 213, 0.3);
}

/* ================= FOOTER ================= */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-light);
  padding: 4rem 2rem 2rem;
  border-top: 3px solid var(--primary);
  border-radius: 20px 20px 0 0;
  margin-top: 5rem;
}

.footer .box {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.footer .left,
.footer .right {
  flex: 1;
  min-width: 280px;
}

.footer .categories,
.footer .contactUs,
.footer .newsletter {
  margin-bottom: 2rem;
}

.footer p {
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
}

.footer .contactUs div,
.footer .categories div {
  margin: 0.5rem 0;
  color: #cbd5e1;
}

.footer .icon {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer .icon i {
  font-size: 1.5rem;
  color: var(--text-light);
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.footer .icon i:hover {
  color: var(--accent);
  transform: scale(1.2) rotate(10deg);
  background: rgba(0, 212, 255, 0.2);
}

.footer .newsletter .email {
  display: flex;
  gap: 0;
  margin-top: 1rem;
}

.footer .newsletter .email input {
  flex: 1;
  padding: 0.875rem 1rem;
  border-radius: 25px 0 0 25px;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: var(--card-light);
  color: var(--text-dark);
}

.footer .newsletter .email button {
  padding: 0.875rem 1.5rem;
  border-radius: 0 25px 25px 0;
  border: none;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer .newsletter .email button:hover {
  background: linear-gradient(45deg, var(--primary-dark), var(--accent-hover));
  transform: scale(1.05);
}

.copyrights {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-dark);
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ================= FLOATING QUICK NAV ================= */
.quick-nav {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-light);
  z-index: 1100;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.quick-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(58, 123, 213, 0.2);
}

.quick-nav-toggle {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: none;
  padding: 0.2rem;
}

.quick-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.quick-nav a {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 12px;
}

.quick-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================= RESPONSIVE DESIGN ================= */

/* Tablet styles */
@media (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }
  
  .header {
    padding: 0.75rem 1rem;
    width: 100%;
  }
  
  .nav-search {
    margin: 0 0.5rem;
  }
  
  .search-box {
    max-width: 400px;
  }
  
  .mega-menu {
    min-width: 380px;
    gap: 1.5rem;
    padding: 1.25rem;
  }
  
  .topHeadlines {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    margin: 1.5rem 1rem;
    width: calc(100% - 2rem);
  }
  
  .page2 {
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
  }
  
  .newsBox {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  
  .footer {
    padding: 2.5rem 1rem 2rem;
    margin-top: 3rem;
    width: 100%;
  }
  
  .quick-nav {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 25px;
    width: auto;
    height: auto;
    justify-content: flex-start;
  }
  
  .quick-nav-toggle {
    display: none;
  }
  
  .quick-links {
    display: flex;
    position: static;
    background: transparent;
    padding: 0;
    border-radius: 0;
    flex-direction: row;
    gap: 0.5rem;
    min-width: auto;
    box-shadow: none;
  }
  
  .quick-nav a {
    width: auto;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    gap: 0.3rem;
  }
}

/* Mobile styles - COMPLETE WITH ALL PROPERTIES */
@media (max-width: 768px) {
  body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    width: 100vw;
  }
  
  /* Overlay only covers the area OUTSIDE the menu */
  .nav-overlay {
    width: 25%; /* Menu is 75% from right, so overlay is 25% from left */
    right: auto;
    left: 0;
  }
  
  .header {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem;
    gap: 0.5rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .header .logo {
    flex-shrink: 0;
  }
  
  .nav-search {
    order: 2;
    flex: 1;
    margin: 0 0.5rem;
    min-width: 0;
  }
  
  .mega-nav {
    order: 3;
    flex-shrink: 0;
  }
  
  .search-box {
    width: 100%;
    border-radius: 20px;
    padding: 0.15rem 0.3rem;
    min-width: 0;
  }
  
  .search-box input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 0;
  }
  
  .search-box button {
    width: 32px;
    height: 32px;
    padding: 0.5rem;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  
  /* CLEAN Mobile navigation menu */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.96);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 4rem 1.25rem 1.5rem 1.25rem;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
    border-left: 2px solid var(--primary);
    z-index: 1300; /* HIGHER than overlay - menu is on top */
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto; /* CRITICAL: Allow clicks */
  }
  
  .nav-links.active {
    display: flex;
    transform: translateX(0);
    pointer-events: auto; /* CRITICAL: Ensure clicks work when active */
  }
  
  .nav-links li {
    width: 100%;
    margin: 0.3rem 0;
    pointer-events: auto; /* CRITICAL: Allow clicks on list items */
  }
  
  .nav-links a {
    width: 100%;
    padding: 1rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    pointer-events: auto; /* CRITICAL: Allow clicks on links */
    cursor: pointer; /* Show it's clickable */
  }
  
  .nav-links a:hover,
  .nav-links a:active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    transform: translateX(4px);
  }
  
  /* Hamburger button - HIGHEST z-index */
  .bar {
    display: flex;
    position: relative;
    z-index: 1400; /* HIGHEST - always on top */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    pointer-events: auto;
  }
  
  .bar.active {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1400; /* Still highest when active */
    background: rgba(255, 255, 255, 0.2);
    pointer-events: auto;
  }
  
  /* Mega menu for mobile */
  .mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    padding: 4rem 1.5rem 1.5rem;
    border-radius: 0;
    min-width: unset;
    overflow-y: auto;
    background: var(--card-light);
    z-index: 1310; /* Between nav-links and hamburger */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* Disabled when hidden */
  }
  
  .mega-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable when active */
  }
  
  .mega-column {
    margin-bottom: 1.5rem;
    pointer-events: auto;
  }
  
  .mega-column h4 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0;
  }
  
  .mega-column a {
    font-size: 1rem;
    padding: 0.75rem;
    margin: 0.2rem 0;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
  }
  
  .mega-column a:hover,
  .mega-column a:active {
    border-color: var(--primary);
    background: var(--bg-light);
  }
  
  .topHeadlines {
    margin: 0.75rem;
    padding: 1rem;
    border-radius: 14px;
    max-width: calc(100% - 1.5rem);
    width: auto;
  }
  
  .topHeadlines h2 {
    font-size: 1.15rem;
  }
  
  .page2 {
    margin: 1.5rem auto;
    padding: 0 0.75rem;
    width: 100%;
    max-width: 100%;
  }
  
  .newsBox {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }
  
  .newsCard {
    border-radius: 10px;
    width: 100%;
  }
  
  .newsCard .text {
    padding: 0.875rem;
  }
  
  .footer {
    padding: 2rem 0.75rem 1.25rem;
    border-radius: 14px 14px 0 0;
    margin-top: 2.5rem;
    width: 100%;
  }
  
  .footer .box {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .footer .left,
  .footer .right {
    min-width: unset;
  }
  
  .footer .newsletter .email {
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .footer .newsletter .email input,
  .footer .newsletter .email button {
    border-radius: 20px;
    width: 100%;
  }
  
  .quick-nav {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    width: auto;
    height: auto;
    max-width: calc(100vw - 2rem);
    justify-content: flex-start;
  }
  
  .quick-nav-toggle {
    display: none;
  }
  
  .quick-links {
    display: flex;
    position: static;
    background: transparent;
    padding: 0;
    border-radius: 0;
    flex-direction: row;
    gap: 0.4rem;
    min-width: auto;
    box-shadow: none;
    flex-wrap: nowrap;
  }
  
  .quick-nav a {
    width: auto;
    justify-content: center;
    padding: 0.25rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .header {
    padding: 0.6rem;
    gap: 0.4rem;
  }
  
  .header .logo {
    font-size: 1.2rem;
    flex-shrink: 0;
  }
  
  .nav-search {
    margin: 0 0.3rem;
    min-width: 0;
  }
  
  .search-box input {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: 0;
  }
  
  .search-box button {
    width: 28px;
    height: 28px;
    padding: 0.35rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  
  .nav-links {
    width: 85%; /* Menu takes more space on small screens */
  }
  
  .nav-overlay {
    width: 15%; /* Overlay is smaller on small screens */
  }
  
  .bar.active {
    top: 0.6rem;
    right: 0.6rem;
  }
  
  .topHeadlines {
    margin: 0.5rem;
    padding: 0.75rem;
    max-width: calc(100% - 1rem);
  }
  
  .topHeadlines .left .img img {
    height: 160px;
  }
  
  .newsCard img {
    height: 140px;
  }
  
  .newsCard .text {
    padding: 0.75rem;
  }
  
  .newsCard .title p {
    font-size: 0.85rem;
  }
  
  .page2 {
    padding: 0 0.5rem;
  }
  
  .quick-nav {
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.3rem 0.4rem;
    border-radius: 15px;
    max-width: calc(100vw - 1.5rem);
  }
  
  .quick-nav a {
    padding: 0.2rem 0.3rem;
    font-size: 0.7rem;
    gap: 0.2rem;
    border-radius: 8px;
  }
  
  .quick-nav a span {
    display: none;
  }
}

/* Prevent zoom on iOS */
input[type="text"],
input[type="email"],
button {
  font-size: 16px;
}

/* Improve accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary: #0056b3;
    --accent: #0080ff;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}