@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@600;700;800;900&display=swap');

:root {
  /* Slate/Navy Premium Theme - Light Mode Default */
  --bg-outer: #f1f5f9;
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #ef4444; /* Bright red from screenshot */
  --primary-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --indigo: #6366f1;
  --indigo-soft: rgba(99, 102, 241, 0.08);
  --border: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --bg-outer: #1a2235;
  --bg: #0d1322;
  --bg-card: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
  --bg-nav: rgba(13, 19, 34, 0.9);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --indigo: #818cf8;
  --indigo-soft: rgba(129, 140, 248, 0.1);
  --border: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-outer); /* Outer slate background */
  color: var(--text);
  line-height: 1.6;
  padding: 0;
}

@media (min-width: 1024px) {
  body { padding: 40px 20px; }
}

.app-wrapper {
  background-color: var(--bg);
  max-width: 1400px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  min-height: 90vh;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; }
a { text-decoration: none; color: inherit; transition: var(--transition); }

.container { max-width: 1500px; margin: 0 auto; padding: 0 24px; }

/* ADVANCED NAVBAR */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--bg); /* Solid navy for navbar to match screenshot */
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-text { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 900; letter-spacing: -1.5px; color: var(--text); }
.logo-text span { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; gap: 32px; align-items: center; justify-content: center; }
.nav-links a { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; position: relative; white-space: nowrap; }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }


.nav-actions { display: flex; align-items: center; gap: 24px; }
#themeToggle {
  background: var(--border); border: none;
  color: var(--text); width: 42px; height: 42px; border-radius: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
#themeToggle:hover { transform: rotate(15deg) scale(1.1); background: var(--primary-gradient); color: #fff; }

/* PREMIUM HERO SLIDER */
.hero-slider {
  position: relative; height: 550px; margin: 40px 0 80px;
  border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.slider-container { display: flex; height: 100%; transition: transform 0.8s cubic-bezier(0.83, 0, 0.17, 1); }
.slide { 
  min-width: 100%; height: 100%; position: relative;
  display: flex; align-items: center; padding: 80px;
}
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transform: scale(1.05); transition: 10s linear; }
.slide:hover .slide-bg { transform: scale(1); }
.slide-overlay { 
  position: absolute; inset: 0; 
  background: linear-gradient(90deg, rgba(3,7,18,0.95) 0%, rgba(3,7,18,0.6) 50%, transparent 100%); 
  z-index: 2;
}
.slide-content { position: relative; z-index: 3; max-width: 700px; color: #fff; transform: translateY(20px); opacity: 0; transition: 0.8s ease forwards; }
.slide.active .slide-content { transform: translateY(0); opacity: 1; }

.slide-cat { 
  display: inline-block; background: var(--primary-gradient); padding: 6px 16px; 
  border-radius: 8px; font-size: 12px; font-weight: 800; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px;
}
.slide h2 { font-size: 52px; font-weight: 900; margin-bottom: 20px; line-height: 1; }
.slide p { font-size: 20px; opacity: 0.9; margin-bottom: 35px; font-weight: 300; }

.btn-premium {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary-gradient); color: #fff;
  padding: 16px 40px; border-radius: 12px; font-weight: 800;
  transition: var(--transition); box-shadow: 0 10px 20px -5px rgba(230, 57, 70, 0.4);
}
.btn-premium:hover { transform: translateY(-5px); box-shadow: 0 20px 30px -5px rgba(230, 57, 70, 0.5); }

/* BENTO STYLE GRID */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.section-title { font-size: 32px; font-weight: 900; letter-spacing: -1px; }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 40px; }
.post-card { 
  background: var(--bg-card); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); transition: var(--transition);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.post-card:hover { transform: translateY(-12px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.post-card-img { height: 240px; overflow: hidden; position: relative; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.8s; }
.post-card:hover .post-card-img img { transform: scale(1.1) rotate(1deg); }

.post-card-body { padding: 30px; }
.post-card-body .cat { color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 15px; display: block; letter-spacing: 1px; }
.post-card-body h3 { font-size: 22px; font-weight: 800; margin-bottom: 15px; line-height: 1.3; }
.post-card-body p { color: var(--text-muted); font-size: 15px; margin-bottom: 25px; line-height: 1.6; }

/* ARTICLE PAGE ADVANCED STYLING */
.article-header { text-align: center; max-width: 900px; margin: 60px auto; padding: 0 20px; }
.article-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  margin: 15px 0 25px;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -1.5px;
  word-wrap: break-word;
}
.article-category {
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 50px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.meta-item { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.meta-item i { color: var(--primary); }
.meta-item a { color: var(--primary); font-weight: 700; }
.meta-sep { color: var(--border); }

.article-body { font-size: 19px; line-height: 1.9; color: var(--text); max-width: 950px; margin: 0 auto; }
.article-body p { margin-bottom: 20px; }
.article-excerpt {
  font-size: 22px; color: var(--text-muted); font-weight: 400;
  border-left: 5px solid var(--primary); padding-left: 32px;
  margin: 40px 0; font-style: italic; line-height: 1.6;
}
.article-body h2 {
  font-size: 26px; color: var(--indigo); margin: 50px 0 20px;
  font-weight: 800; background: rgba(99, 102, 241, 0.06);
  padding: 16px 24px; border-radius: 12px; border-left: 5px solid var(--indigo);
  line-height: 1.3; scroll-margin-top: 100px;
}
.article-body h3 {
  font-size: 22px; color: #a78bfa; margin: 35px 0 16px;
  font-weight: 700; padding-left: 16px;
  border-left: 3px solid #a78bfa;
}
.article-body b, .article-body strong { color: var(--text); font-weight: 800; border-bottom: 2px solid rgba(230, 57, 70, 0.3); }

/* ARTICLE LISTS */
.article-body ul, .article-body ol {
  margin: 20px 0 28px 0; padding-left: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.article-body li {
  font-size: 17px; line-height: 1.7;
  padding-left: 8px; position: relative;
}
.article-body ul li::marker { color: var(--primary); font-size: 20px; }
.article-body ol li::marker { color: var(--indigo); font-weight: 800; }

/* ARTICLE BLOCKQUOTES */
.article-body blockquote {
  margin: 30px 0; padding: 24px 28px;
  background: rgba(99, 102, 241, 0.06);
  border-left: 4px solid var(--indigo);
  border-radius: 0 12px 12px 0;
  font-size: 18px; font-style: italic;
  color: var(--text-muted); line-height: 1.7;
}

/* TABLE OF CONTENTS */
.article-body .table-of-contents ol { gap: 6px; }
.article-body .table-of-contents li { font-size: 14px; padding-left: 4px; }
.article-body .table-of-contents li::marker { color: var(--text-muted); }

/* KEY TAKEAWAYS */
.article-body .key-takeaways ul { gap: 8px; }
.article-body .key-takeaways li { font-size: 15px; }
.article-body .key-takeaways li::marker { color: #6366f1; }

/* ARTICLE IMAGES (inline) */
.article-body img {
  max-width: 100%; height: auto; border-radius: 16px;
  margin: 30px 0; box-shadow: var(--shadow-md);
}

/* FOOTER */
footer { background: var(--bg-card); padding: 80px 0 40px; border-top: 1px solid var(--border); }

/* INTERNAL LINK BUTTONS (MUST READ) - REDESIGNED */
.must-read-card {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important; /* Centered as requested */
  gap: 20px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-left: 4px solid var(--primary) !important;
  padding: 15px 25px !important;
  border-radius: 4px !important;
  margin: 30px 0 !important;
  transition: var(--transition);
  text-decoration: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.must-read-card:hover {
  background: var(--bg) !important;
  border-color: var(--primary) !important;
}
.must-read-label {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.must-read-title {
  font-size: 18px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  text-align: left !important;
  flex-grow: 1 !important;
  display: block !important;
}

/* ARTICLE CONTENT LINKS */
.article-body a:not(.must-read-card) {
  color: #3b82f6 !important; /* Premium Blue */
  text-decoration: underline !important;
  font-weight: 700 !important;
}
.article-body a:not(.must-read-card):hover {
  color: #60a5fa !important;
}





.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-logo { font-size: 32px; font-weight: 900; margin-bottom: 20px; }
.footer-about { color: var(--text-muted); font-size: 15px; max-width: 350px; }
.footer-links h4 { font-size: 18px; margin-bottom: 25px; font-weight: 800; }
.footer-links ul li { margin-bottom: 15px; color: var(--text-muted); font-size: 15px; }
.footer-links ul li:hover { color: var(--primary); padding-left: 5px; }

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .slide h2 { font-size: 36px; }
  .slide { padding: 40px; }
  .home-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
  .fixed-trending-sidebar { position: static !important; width: 100% !important; margin-top: 40px; }
}
@media (max-width: 768px) {
  .navbar { padding: 15px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-slider { height: 450px; }
  .slide h2 { font-size: 28px; }
  .posts-grid { grid-template-columns: 1fr !important; }
  .nav-actions { gap: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-article { height: auto !important; min-height: 400px; padding: 25px !important; }
  .hero-article h2 { font-size: 28px !important; }
  .hero-article p { font-size: 13px !important; }
  .latest-cards-grid { grid-template-columns: 1fr !important; }
  body { padding: 0 !important; }
  .app-wrapper { border-radius: 0; }
  .container { padding: 0 15px; }
}



/* SLIDER DOTS */
.slider-dots { display: flex; justify-content: center; gap: 10px; position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: var(--transition); }
.dot.active, .dot:hover { background: #fff; transform: scale(1.2); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; transition: var(--transition); text-decoration: none; border: none; }
.btn-red { background: var(--primary-gradient); color: #fff; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-red:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-outline { border: 1px solid var(--border); background: transparent; color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* AUTH PAGES */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 440px; background: #fff;
  border-radius: 20px; padding: 40px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
  --text: #1e293b; /* Ensure text/logo is dark on white card */
}
.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-title { text-align: center; font-size: 26px; font-weight: 900; margin-bottom: 8px; color: #1e293b; }
.auth-subtitle { text-align: center; font-size: 14px; color: #94a3b8; margin-bottom: 30px; }
.auth-btn {
  width: 100%; padding: 16px; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: var(--primary-gradient); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: var(--transition);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(230,57,70,0.4); }
.auth-divider {
  text-align: center; margin: 20px 0; font-size: 12px; color: #cbd5e1; font-weight: 700;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: #e2e8f0;
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-switch { text-align: center; font-size: 14px; color: #94a3b8; }
.auth-switch a { color: var(--primary); font-weight: 700; }

/* INPUT ICONS */
.input-icon {
  position: relative; display: flex; align-items: center;
}
.input-icon i {
  position: absolute; left: 16px; color: #94a3b8; font-size: 14px; z-index: 1;
}
.input-icon input, .input-icon select {
  width: 100%; padding: 14px 16px 14px 44px; border: 1px solid #e2e8f0; border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #f8fafc; color: #1e293b;
  outline: none; transition: var(--transition);
}
.input-icon input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230,57,70,0.1); background: #fff; }

/* ALERTS */
.alert {
  padding: 14px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* FOOTER LIST RESET */
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links ul a { color: var(--text-muted); transition: var(--transition); }
.footer-links ul a:hover { color: var(--primary); }


/* -----------------------------------------------------------
   MUST READ SECTION — Professional Internal Linking
   ----------------------------------------------------------- */
.must-read-section {
  margin: 50px 0 30px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.must-read-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  background: var(--primary-gradient);
  color: #fff;
}
.must-read-icon { font-size: 20px; }
.must-read-heading {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
}
.must-read-list {
  display: flex;
  flex-direction: column;
}
.must-read-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.must-read-item:last-child { border-bottom: none; }
.must-read-item:hover {
  background: var(--bg);
  color: var(--primary);
  padding-left: 32px;
}
.must-read-arrow {
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  width: 24px;
  text-align: center;
}
.must-read-item:hover .must-read-arrow {
  transform: translateX(5px);
}
.must-read-title {
  flex: 1;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .must-read-item { padding: 14px 16px; font-size: 13px; }
  .must-read-header { padding: 14px 16px; }
}

/* -----------------------------------------------------------
   TRENDING NOW SIDEBAR — Professional Sticky Design
   ----------------------------------------------------------- */

.trending-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: none;
}
.trending-sidebar::-webkit-scrollbar { display: none; }

/* HEADER */
.trending-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  background: var(--primary-gradient);
  position: sticky;
  top: 0;
  z-index: 10;
}
.trending-fire { font-size: 20px; }
.trending-label {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  flex: 1;
}
.trending-live-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* TRENDING ITEM */
.trending-list { display: flex; flex-direction: column; }

.trending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all 0.25s ease;
  position: relative;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover {
  background: var(--bg);
  padding-left: 20px;
}
.trending-item:hover .trending-title { color: var(--primary); }

/* RANK NUMBER */
.trending-rank {
  font-size: 22px;
  font-weight: 900;
  color: var(--border);
  min-width: 32px;
  text-align: center;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -1px;
  transition: color 0.25s ease;
}
.trending-rank.rank-top { color: var(--primary); }
.trending-item:hover .trending-rank { color: var(--primary); }

/* THUMBNAIL */
.trending-thumb {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
}
.trending-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.trending-item:hover .trending-thumb img { transform: scale(1.08); }

.trending-category-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 64px;
  text-overflow: ellipsis;
}

/* INFO */
.trending-info { flex: 1; min-width: 0; }
.trending-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.trending-meta i { margin-right: 3px; color: var(--primary); font-size: 10px; }

/* FOOTER */
.trending-footer {
  padding: 14px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.trending-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: gap 0.2s ease;
}
.trending-view-all:hover { gap: 12px; }
.trending-view-all i { font-size: 12px; }

@media (max-width: 900px) {
  .trending-sidebar { display: none; }
  .home-grid { grid-template-columns: 1fr !important; }
}

/* -----------------------------------------------------------
   GLOBAL FIXES — overflow, body, mobile
   ----------------------------------------------------------- */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Top bar hidden on mobile */
@media (max-width: 768px) { .topbar { display: none; } }

/* -----------------------------------------------------------
   HAMBURGER MENU
   ----------------------------------------------------------- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1001;
}
.hamburger:hover { background: var(--bg); }
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
/* Animated X when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* NAV OVERLAY */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}
.nav-overlay.active { display: block; opacity: 1; }

/* NAV CLOSE BUTTON */
.nav-close {
  display: none;
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 16px;
  line-height: 1;
  font-weight: 300;
}

/* MOBILE AUTH LINKS — hidden on desktop */
.nav-mobile-auth { display: none; }

/* --- MOBILE NAVBAR ----------------------------------- */
@media (max-width: 900px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
  }
  .nav-links.open { left: 0; }

  .nav-close {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border);
    padding: 20px 20px;
    margin-bottom: 10px;
  }

  .nav-links a {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--text) !important;
  }
  .nav-links a:hover, .nav-links a.active {
    background: var(--bg);
    color: var(--primary) !important;
    padding-left: 32px;
  }

  .nav-mobile-auth {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--border);
  }
  .nav-mobile-auth a {
    padding: 12px 20px !important;
    border-radius: 10px;
    border: 1px solid var(--border) !important;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid var(--border) !important;
  }
  .mobile-join-btn {
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border: none !important;
  }
}

/* -----------------------------------------------------------
   TABLET FIXES (768px - 900px)
   ----------------------------------------------------------- */
@media (max-width: 900px) {
  /* Center content when sidebar hidden */
  .home-grid { grid-template-columns: 1fr !important; max-width: 720px; margin: 0 auto; }
  .latest-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* -----------------------------------------------------------
   MOBILE FIXES (max 600px)
   ----------------------------------------------------------- */
@media (max-width: 600px) {
  /* Single column cards */
  .latest-cards-grid { grid-template-columns: 1fr !important; }

  /* Article H1 font size */
  .article-header h1 { font-size: 30px !important; letter-spacing: -1px !important; line-height: 1.2 !important; }
  .article-header { margin: 30px auto !important; }


  /* Read More button fix */
  a[href*="/post/"][style*="padding: 6px"] {
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 10px !important;
  }

  /* Hero article height */
  .hero-article { height: 320px !important; padding: 24px !important; }
  .hero-article h2 { font-size: 26px !important; }

  /* Container padding */
  .container { padding-left: 16px !important; padding-right: 16px !important; }

  /* Share bar stack on mobile */
  div[style*="Share this insight"] > div { flex-wrap: wrap; gap: 20px; }

  /* Ticker wrap */
  .ticker-wrap { display: none; }

  /* Nav actions icons only */
  .nav-actions span { display: none; }
}

/* Hide desktop auth on mobile */
@media (max-width: 900px) {
  .nav-desktop-auth { display: none !important; }
}

/* -----------------------------------------------------------
   MUST READ — COMPACT REDESIGN (Override)
   ----------------------------------------------------------- */
.must-read-section {
  margin: 32px 0 20px !important;
  border-radius: 12px !important;
}

/* Compact header */
.must-read-header {
  padding: 10px 18px !important;
  gap: 8px !important;
}
.must-read-icon { font-size: 15px !important; }
.must-read-heading {
  font-size: 12px !important;
  letter-spacing: 1.5px !important;
}

/* Compact items */
.must-read-item {
  padding: 11px 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  gap: 10px !important;
}
.must-read-item:hover { padding-left: 24px !important; }

.must-read-arrow {
  font-size: 15px !important;
  width: 18px !important;
}

@media (max-width: 600px) {
  .must-read-item { padding: 10px 14px !important; font-size: 12px !important; }
  .must-read-header { padding: 10px 14px !important; }
}

/* -----------------------------------------------------------
   NAVBAR FINAL FIX — Override old conflicting CSS
   ----------------------------------------------------------- */

/* Desktop: show nav-links horizontal, hide hamburger */
@media (min-width: 901px) {
  .hamburger { display: none !important; }
  .nav-close { display: none !important; }
  .nav-mobile-auth { display: none !important; }
  .nav-overlay { display: none !important; }
  .nav-links {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    flex-direction: row !important;
    display: flex !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    padding: 0 !important;
    gap: 32px !important;
  }
}

/* Mobile: show hamburger, hide nav-links until open */
@media (max-width: 900px) {
  .hamburger { display: flex !important; }
  .nav-desktop-auth { display: none !important; }
  .nav-inner {
    grid-template-columns: 1fr auto auto !important;
    gap: 12px !important;
  }
  .nav-links {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: rgba(13, 19, 34, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    display: flex !important;
    gap: 0 !important;
    padding: 0 !important;
    z-index: 1000 !important;
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1) !important;
    border-right: 1px solid var(--border) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: 4px 0 30px rgba(0,0,0,0.5) !important;
    justify-content: flex-start !important;
  }
  .nav-links.open { left: 0 !important; }
  .nav-links a {
    width: 100% !important;
    padding: 15px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid var(--border) !important;
    overflow-x: hidden !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
}

/* -----------------------------------------------------------
   POST PAGE — 3-COLUMN PROFESSIONAL LAYOUT
   ----------------------------------------------------------- */
.post-page-grid {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 40px;
  max-width: 1500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.post-article-center {
  min-width: 0;
}

/* LEFT SIDEBAR */
.post-left-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* SIDEBAR WIDGET */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.sidebar-widget-header i { font-size: 14px; }
.sidebar-widget-body { padding: 14px 18px; }

/* CATEGORY LINKS */
.sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.sidebar-cat-link:last-child { border-bottom: none; }
.sidebar-cat-link i { color: var(--primary); font-size: 10px; transition: transform 0.2s; }
.sidebar-cat-link:hover { color: var(--primary); padding-left: 6px; }
.sidebar-cat-link:hover i { transform: translateX(3px); }

/* POPULAR POSTS */
.sidebar-popular-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}
.sidebar-popular-item:last-child { border-bottom: none; }
.sidebar-popular-item:hover { background: var(--bg); }
.sidebar-popular-item:hover .sidebar-popular-title { color: var(--primary); }
.sidebar-popular-rank {
  font-size: 22px;
  font-weight: 900;
  color: var(--border);
  min-width: 28px;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}
.sidebar-popular-item:nth-child(1) .sidebar-popular-rank { color: var(--primary); }
.sidebar-popular-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.sidebar-popular-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.sidebar-popular-meta i { color: var(--primary); margin-right: 3px; }

/* NEWSLETTER WIDGET */
.sidebar-newsletter .sidebar-widget-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

/* HIDE SIDEBAR ON TABLET/MOBILE/SMALL LAPTOPS */
@media (max-width: 1200px) {
  .post-page-grid { 
    display: block !important; 
    max-width: 1000px !important; 
    grid-template-columns: 1fr !important; 
  }
  .post-left-sidebar { display: none !important; }
  .trending-sidebar { display: none !important; }
}

/* Write/Create Article: HIDDEN ON MOBILE */
@media (max-width: 900px) {
  a[href="/create-post"] { display: none !important; }
  .nav-mobile-auth a[href="/create-post"] { display: none !important; }
}

/* ─────────────────────────────────────────────────────────────
   CSS NEWS TICKER — Replaces deprecated <marquee> element
   ───────────────────────────────────────────────────────────── */
.news-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: news-ticker-scroll 45s linear infinite;
  will-change: transform;
}
.news-ticker-track:hover {
  animation-play-state: paused;
}
@keyframes news-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — Focus Visible
   ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────
   CLS PREVENTION — Reserve space for images
   ───────────────────────────────────────────────────────────── */
.post-card-img img,
.trending-thumb img {
  aspect-ratio: 16/9;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.trending-thumb img {
  aspect-ratio: 1/1;
}

/* ─────────────────────────────────────────────────────────────
   PRINT STYLES — Clean print version for articles
   ───────────────────────────────────────────────────────────── */
@media print {
  .navbar, .footer, .trending-sidebar, .post-left-sidebar,
  #aiChatWidget, #aiChatToggle, #scrollTop, .topbar { display: none !important; }
  body { background: white !important; color: black !important; font-size: 12pt; }
  .article-body { font-size: 11pt; max-width: 100% !important; }
  a { color: black !important; text-decoration: underline !important; }
}

