/* =========================================
   1. GLOBAL RESET & VARIABLES
   ========================================= */
html {
  scrollbar-width: none;
}
body {
  -ms-overflow-style: none;
}
body::-webkit-scrollbar,
body::-webkit-scrollbar-button {
  display: none;
}

:root {
  --accent: #FF5F00;         /* Safety Orange */
  --darkblue: #121212;       /* Deep Charcoal (Dark Mode UI Elements / Light Mode Text) */
  --blue: #1E1E1E;           /* Dark Gray (Dark Mode Background) */
  --lightblue: #F2F2F7;      /* Light Grey (Light Mode Background) */
  --sublightblue: #FFFFFF;   /* Pure White (Light Mode Cards) */
  --glass: rgba(255,255,255,0.05);
  --radius: 14px;
  --transition-fast: 180ms;
  --transition-smooth: 360ms;
  --shadow: 0 5px 10px 0 #FF5F00;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s, color 0.3s, filter 0.3s;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--lightblue);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s, filter 0.3s;
  color: var(--darkblue);
  opacity: 0;
  transition: opacity .5s ease-out;
}

body.loaded {
  opacity: 1;
}

body.dark-mode {
  background-color: var(--blue);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode p {
  color: var(--lightblue);
}

body.dark-mode .footer a {
  color: var(--lightblue);
}

body.dark-mode button {
  background-color: var(--lightblue);
  color: var(--blue);
}

body.dark-mode button:hover {
  background-color: var(--accent);
}

h1,
h2,
h3,
p {
  color: var(--darkblue);
}

/* =========================================
   2. UI COMPONENTS (Top Bar, Nav, Search)
   ========================================= */

/* ---------- TOP BAR ---------- */
.top-bar {
  background: rgba(18, 18, 18, 0.85); /* Default Dark */
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  border-radius: 50px;
  z-index: 100;
  height: 80px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Light Mode Override for Top Bar */
body:not(.dark-mode) .top-bar {
  background: rgba(255, 255, 255, 0.85);
  color: var(--darkblue);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.top-bar .logo {
  display: flex;
  align-items: center;
}

.top-bar .logo img {
  width: 60px;
  height: auto;
  margin-right: 10px;
}

.top-bar .logo h1 {
  font-size: 1.2rem;
}

.top-bar .logo-text {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.top-bar .logo-text.visible {
  opacity: 1;
  transform: translateX(0);
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.1);
}

/* ---------- NAVIGATION ---------- */
nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

nav a {
  color: #E0E6ED; /* Default light text for dark bar */
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

/* Nav Links in Light Mode */
body:not(.dark-mode) nav a {
  color: var(--darkblue);
}

nav a:hover {
  color: #fff;
  transform: translateY(-2px);
}
body:not(.dark-mode) nav a:hover {
  color: var(--accent);
}

/* ---------- HAMBURGER ICON ---------- */
.nav-toggle {
  display: none;
  background: transparent !important;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  padding-top: 15px;
  border-radius: 50%;
  position: relative;
  z-index: 110;
  transition: background-color 0.3s;
}

body:not(.dark-mode) .nav-toggle {
  color: var(--darkblue);
}

.nav-toggle svg line {
  stroke: #FFFBEF;
  stroke-width: 2;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

body:not(.dark-mode) .nav-toggle svg line {
  stroke: var(--darkblue);
}

.nav-toggle.active .line-top {
  transform: translateX(10px) rotate(45deg);
}

.nav-toggle.active .line-middle {
  opacity: 0;
}

.nav-toggle.active .line-bottom {
  transform: translateX(-19px) rotate(-45deg) translateY(16px);
}

/* ---------- WAVY UNDERLINE ---------- */
.wavy {
  position: relative;
  background: none;
}

.wavy::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.wavy:hover::after {
  transform: scaleX(1);
  opacity: 1;
  animation: gradient-slide 1.2s linear infinite;
}

@keyframes gradient-slide {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ---------- SEARCH ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  position: relative;
}

.search input {
  border: none;
  background: transparent;
  color: #E0E6ED;
  width: 0;
  opacity: 0;
  outline: none;
  font-size: 14px;
  transition: width var(--transition-smooth) ease-in-out, opacity var(--transition-smooth) ease-in-out;
}

body:not(.dark-mode) .search input {
  color: var(--darkblue);
}

.search.active input {
  width: 140px;
  opacity: 1;
}

.search .icon {
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
  background-color: transparent;
}

.search .icon svg {
  stroke: #FFFBEF;
}

body:not(.dark-mode) .search .icon svg {
  stroke: var(--darkblue);
}

.spin {
  transform: rotate(20deg);
  transition: transform 400ms cubic-bezier(.2,.9,.2,1);
}

/* ---------- UTILITY DOCK (Dark Mode + Language) ---------- */
.utility-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  align-items: flex-end;
}

.utility-btn {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
}

@media (hover: hover) {
  .utility-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
  }
  
  body:not(.dark-mode) .utility-btn:hover {
    background: #fff;
  }
}

/* Light Mode Overrides for Dock */
body:not(.dark-mode) .utility-btn {
  background: rgba(255, 255, 255, 0.8);
  color: var(--darkblue);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Language Dropdown */
.lang-container {
  position: relative;
}

.lang-dropdown {
  position: absolute;
  bottom: 60px; /* Appears above the globe button */
  right: 0;
  background: var(--darkblue);
  padding: 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 120px;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

.lang-dropdown.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

body:not(.dark-mode) .lang-dropdown {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
}

.lang-option {
  text-decoration: none;
  color: var(--lightblue);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

body:not(.dark-mode) .lang-option {
  color: var(--darkblue);
}

.lang-option:hover {
  background: rgba(255,255,255,0.1);
}

body:not(.dark-mode) .lang-option:hover {
  background: rgba(0,0,0,0.05);
}

.lang-option.active {
  background: var(--accent);
  color: #fff !important;
}

/* =========================================
   3. HERO SECTIONS
   ========================================= */

main {
  padding-top: 120px;
}

/* Standard Hero (Home) */
.hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 120px 20px;
  padding-left: 60px;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* HOME PAGE LOGIC:*/
body:not(.dark-mode) .hero {
    background-image: linear-gradient(to bottom right, var(--lightblue), rgba(0,0,0,0.25)), var(--hero-img);
}

body.dark-mode .hero {
    background-image: linear-gradient(to bottom right, var(--darkblue), rgba(0,0,0,0.25)), var(--hero-img);
}

/* ABOUT PAGE OVERRIDES:
  Gradient STACKED on top of the Image 
*/

/* About Page - Light Mode: Heavy White/Grey Gradient + Image */
body.about-page:not(.dark-mode) .hero {
    background-image: linear-gradient(to bottom right, var(--lightblue), rgba(0,0,0,0.25)), var(--hero-img);
}

/* About Page - Dark Mode: Heavy Dark Gradient + Image */
body.about-page.dark-mode .hero {
    background-image: linear-gradient(to bottom right, var(--darkblue), rgba(0,0,0,0.25)), var(--hero-img);
}

.hero-content {
  margin: 0;
  max-width: 800px;
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

/* Add shadow ONLY to Home Page hero text where background is an image without gradient */
body:not(.about-page) .hero-content {
   text-shadow: 0 2px 10px rgba(0,0,0,0.5);
   /* color: white; <-- REMOVED to allow theme switching */
}

.hero-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero h1 {
  font-size: 4em;
  margin-bottom: 20px;
  /* Color is inherited (Dark/Light) unless overridden above for Home page */
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

/* Specific Override for About Page Title */
body.about-page .hero h1 {
  font-size: 3em; /* Adjust this number as needed */
}

/* Small Hero (Articles Hub) */
.small-hero {
  height: 35vh;
  background-image: var(--hero-img);
  background-position: center;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0;
}

.small-hero .hero-content {
  padding-top: 80px;
  color: white !important; /* Force white on small hero image */
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.small-hero .hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: white !important;
}
.small-hero .hero-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  color: white !important;
}

/* Article Page Hero */
.hero.hero-article {
  height: 15vh;
  height: 15dvh;
  align-items: flex-start;
  justify-content: center;
}

.hero.hero-article .hero-content {
  padding-top: 15px;
  max-width: 90vw;
}

.hero.hero-article .hero-content h1 {
  font-size: 2.5em;
}

/* CTA Buttons */
.cta-button {
  padding: 15px 30px;
  font-size: 1.2rem;
  background-color: var(--darkblue);
  color: var(--lightblue);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s, transform var(--transition-fast) ease-in-out;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

@media (hover: hover) {
  .cta-button:hover {
    background-color: var(--accent);
    color: var(--lightblue);
    box-shadow: 0 12px 30px rgba(255,95,0,0.30), 0 0 0 8px rgba(255,95,0,0.15);
    transform: scale(1.1);
  }
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--lightblue);
  cursor: pointer;
  animation: bounce 2s infinite;
  opacity: 0.8;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.scroll-down:hover {
  opacity: 1;
  color: var(--accent);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* =========================================
   4. HOME/LANDING PAGE SECTIONS
   ========================================= */

/* Target Audience */
.target-audience {
  padding: 20px 20px;
  text-align: center;
  background-color: transparent;
}

.target-audience h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.target-audience h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #c2c2c2;
}

.audience-grid {
  display: flex;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  justify-content: center;
}

.audience-grid .card {
  flex: 0 0 30vw;
  max-width: 30vw;
  height: 100%;
}

.audience-card {
  background-color: var(--darkblue);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--shadow);
  text-align: center;
  color: #fff;
}

.audience-card i.fa-solid.fa-user {
  font-size: 3rem;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
  margin-top: 20px;
  color: var(--lightblue);
}

.audience-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #fff;
}

.audience-card p {
  font-size: 1rem;
  color: #c2c2c2;
}

/* Features */
.features {
  padding: 60px 20px;
  background-color: transparent;
  text-align: center;
}

.features h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background-color: var(--darkblue);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--shadow);
  color: #fff;
  text-align: center;
}

.feature-card i {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--lightblue);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #fff;
}

.feature-card p {
  font-size: 1rem;
  color: #c2c2c2;
}

/* =========================================
   5. CAROUSEL & CARDS
   ========================================= */

.featured {
  margin: 28px auto;
  padding-top: 22px;
  padding-bottom: 22px;
  background-color: transparent !important;
}

.section-title {
  display: flex;
  justify-content: space-between;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h3 { margin: 0; font-size: 2rem; letter-spacing: 0.2px; }

.carousel {
  position: relative;
  overflow: visible;
  padding-left: 20px;
  padding-right: 20px;
}

.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(320px, 88%);
  gap: 20px;
  overflow-x: auto;
  padding: 25px 10px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cards::-webkit-scrollbar { display: none; }

/* Card Styles */
.card {
  background: var(--sublightblue);
  border-radius: 12px;
  padding: 12px;
  min-height: 220px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform 360ms, box-shadow 360ms;
  cursor: pointer;
}

body.dark-mode .card {
  background: var(--darkblue);
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  }

  .card:hover .thumb img {
    transform: scale(1.08);
  }
}

.card:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

.card a {
  text-decoration: none;
  color: var(--darkblue);
}
/* From article-style override for light mode links */
.card a {
  color: var(--darkblue); 
}
body.dark-mode .card a {
  color: var(--lightblue);
}

.card a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

/* SHARE BUTTON STYLES */
.share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20; /* Ensure it sits above the card link */
  background: var(--darkblue);
  color: #fff;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.8;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Light mode override for visibility */
body:not(.dark-mode) .share-btn {
  background: #f0f0f0;
  color: var(--darkblue);
}

.share-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  background: var(--accent);
  color: #fff;
}

.share-tooltip {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.share-tooltip.visible {
  opacity: 1;
}

/* Thumb & Content */
.thumb {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  min-height: 120px;
  height: 160px; /* Standardized from hub style */
  background: var(--darkblue);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-smooth);
}

.category {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--lightblue);
  font-weight: 600;
}

/* New Indicator Badge - Height Matched to .category */
.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;       /* Matches .category */
  padding: 6px 8px;      /* Matches .category padding exactly */
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  /* line-height removed to ensure it inherits the same height as .category */
}

.new-dot {
  width: 6px;
  height: 6px;
  background-color: #FFB380;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

body.dark-mode .category {
  background: rgba(255,255,255,0.1);
}

.title {
  font-weight: 700;
  margin: 0;
  font-size: 1.1rem;
  color: var(--darkblue);
}
body.dark-mode .title { color: var(--lightblue) !important; }

.excerpt {
  color: #555 !important;
  font-size: 14px;
  margin: 0; flex: 1;
  line-height: 1.3;
  opacity: 1;
}
body.dark-mode .excerpt { color: #b0b0b0 !important; }

.muted {
  color: #666;
  font-size: .75rem !important;
}
body.dark-mode .muted { color: #999; }

/* Controls */
.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.arrow {
  background: var(--sublightblue);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(5,8,15,0.15);
  cursor: pointer;
  transition: transform .1s;
}

body.dark-mode .arrow {
  background: var(--darkblue);
  box-shadow: 0 6px 16px rgba(5,8,15,0.4);
}

.arrow:active { transform: scale(0.8); }
.arrow svg {
  stroke: var(--darkblue);
  width: 24px;
  height: 24px;
}
body.dark-mode .arrow svg { stroke: var(--lightblue); }

/* =========================================
   6. ARTICLE HUB SPECIFIC (Filters, Loader)
   ========================================= */

/* Filter and Tags Bars */
.filter-bar, .tags-bar {
  max-width: 1200px;
  margin: 20px auto 20px;
  padding: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.filter-btn, .tags-btn {
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--darkblue);
  font-weight: 600;
  cursor: pointer;
  background-color: var(--sublightblue);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

body.dark-mode .filter-btn,
body.dark-mode .tags-btn {
  color: var(--lightblue);
  background-color: rgba(255,255,255,0.05);
}

@media (hover: hover) {
  .filter-btn:hover, .tags-btn:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
  }

  body.dark-mode .filter-btn:hover,
  body.dark-mode .tags-btn:hover {
  color: #fff;
}
}

.filter-btn.active, .tags-btn.active {
  background-color: var(--accent);
  color: #fff;
}

/* Articles Grid Layout */
.articles-grid {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding-top: 20px;
  padding-bottom: 20px;
}

/* Hub Search Bar */
.hub-search-container {
  max-width: 600px;
  margin: -20px auto 20px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.hub-search-wrapper {
  background: var(--sublightblue);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

body.dark-mode .hub-search-wrapper {
  background: var(--darkblue);
  border: 1px solid rgba(255,255,255,0.1);
}

.hub-search-wrapper:focus-within {
  box-shadow: 0 8px 25px rgba(255, 95, 0, 0.25);
  background-color: #fff;
}

body.dark-mode .hub-search-wrapper:focus-within {
  background-color: var(--darkblue);
  border-color: var(--accent);
}

.hub-search-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.1rem;
  color: var(--darkblue);
  padding: 5px 10px;
}

body.dark-mode .hub-search-wrapper input {
  color: var(--lightblue);
}

.hub-search-wrapper input::placeholder {
  color: rgba(0,0,0, 0.6);
}

body.dark-mode .hub-search-wrapper input::placeholder {
  color: rgba(255,255,255, 0.5);
}

.hub-search-wrapper .search-icon {
  color: var(--darkblue);
  font-size: 1.2rem;
  margin-right: 5px;
}

body.dark-mode .hub-search-wrapper .search-icon {
  color: var(--lightblue);
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  background: var(--darkblue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--lightblue);
  font-size: 1.2rem;
  font-family: 'Poppins', sans-serif;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Search Results UI */
.reset-bar {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.resetBtn {
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--darkblue);
  font-weight: 600;
  cursor: pointer;
  background-color: var(--sublightblue);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

body.dark-mode .resetBtn { color: var(--lightblue); background-color: rgba(255,255,255,0.1);}
body.dark-mode .resetBtn:hover { color: #fff; }

@media (hover: hover) {
  .resetBtn:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
  }
}

.result-counter {
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 1rem;
  color: var(--darkblue);
  border-radius: var(--radius);
  background-color: var(--sublightblue);
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode .search-results {
  color: var(--lightblue);
  background-color: var(--darkblue);
}

.articles-count {
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--glass);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: var(--darkblue);
  transition: opacity var(--transition-smooth);
}
body.dark-mode .articles-count { color: var(--lightblue); }

.tags-toggle {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.tags-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--sublightblue);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  color: var(--darkblue);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

body.dark-mode .tags-toggle-btn { color: var(--lightblue); background: rgba(255,255,255,0.1); }

@media (hover: hover) {
  .tags-toggle-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05);
  }
}

#tags-bar {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
  padding: 0 20px;
  margin: 0 auto;
}

#tags-bar.open {
  max-height: 1000px;
  padding: 20px;
  margin: 20px auto;
}

/* =========================================
   7. ARTICLE PAGE SPECIFIC CONTENT
   ========================================= */

/* Main Article Container */
.article-section {
  padding: 20px 20px;
  padding-top: 0 !important;
  max-width: 70vw;
  margin: 0 auto;
  background-color: transparent;
  color: var(--darkblue);
}

body.dark-mode .article-section {
  color: var(--lightblue);
}

.article-section h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--darkblue);
  text-align: center;
}

body.dark-mode .article-section h1 {
  color: var(--lightblue);
}

/* Article Meta Info */
.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--darkblue);
}

body.dark-mode .article-meta {
  color: var(--lightblue);
}

.article-meta .category {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--darkblue);
  font-weight: 600;
}
body.dark-mode .article-meta .category {
    color: var(--lightblue);
}

.article-meta .muted {
  color: #666;
}

body.dark-mode .article-meta .muted {
  color: #aaa;
}

/* Article Main Image */
.article-image {
  width: 60%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 30px;
  box-shadow: 0 4px 8px var(--shadow);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Article Text Content */
.article-content {
  line-height: 1.8;
  font-size: 1.1rem;
}

.article-content p {
  margin-bottom: 20px;
  color: var(--darkblue);
}

body.dark-mode .article-content p {
  color: var(--lightblue);
}

.article-content h2 {
  font-size: 1.8rem;
  margin: 30px 0 15px;
  color: var(--darkblue);
}

body.dark-mode .article-content h2 {
  color: var(--lightblue);
}

.article-content ul,
.article-content ol {
  margin: 20px 0;
  padding-left: 30px;
}

.article-content li {
  margin-bottom: 10px;
  color: var(--darkblue);
}

body.dark-mode .article-content li {
  color: var(--lightblue);
}

.accentline {
  height: .5rem;
  background-color: var(--accent);
  border-radius: .25rem;
}

  /* =========================================
   8. FOOTER
   ========================================= */
.footer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .75) 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
}

.footer-links {
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--darkblue);
  margin: 0 10px;
  text-decoration: none;
  display: inline-block;
  transition: transform var(--transition-fast) ease, color var(--transition-fast) ease;
}

.footer-links a:hover {
  color: var(--accent);
  /* MODIFIED: Reduced from 1.1 to 1.05 */
  transform: scale(1.05);
}

body.dark-mode .footer-links a {
  color: var(--lightblue);
}

body.dark-mode .footer-links a:hover {
  color: var(--accent);
  /* MODIFIED: Reduced from 1.1 to 1.05 */
  transform: scale(1.05);
}

.social-media a {
  color: var(--darkblue);
  margin: 0 10px;
  font-size: 1.5rem;
  display: inline-block;
  transition: transform var(--transition-fast) ease, color var(--transition-fast) ease;
}

.social-media a:hover {
  color: var(--accent);
  /* MODIFIED: Reduced from 1.25 to 1.1 */
  transform: scale(1.1);
  margin: 0 10px;
  font-size: 1.5rem;
}

body.dark-mode .social-media a {
  color: var(--lightblue);
}

body.dark-mode .social-media a:hover {
  color: var(--accent);
  /* MODIFIED: Reduced from 1.25 to 1.1 */
  transform: scale(1.1);
  margin: 0 10px;
  font-size: 1.5rem;
}

.newsletter input {
  padding: 10px;
  margin-right: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.newsletter button {
  padding: 10px 20px;
  background-color: var(--darkblue);
  color: var(--lightblue);
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

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

.version-tag {
  font-size: 11px;
  margin-top: 20px;
  opacity: 0.3;
  letter-spacing: 1px;
}

  /* =========================================
   9. RESPONSIVE ADJUSTMENTS
   ========================================= */

@media screen and (max-width: 1000px) {
  .top-bar {
    transform: none;
    padding: 15px 20px;
    left: 20px;
    width: calc(100% - 40px);
  }

  .top-bar .logo h1 {
    font-size: 1.5rem;
  }

  section {
    padding: 20px;
  }

  .nav-toggle {
    display: block;
  }

  .audience-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .audience-grid .card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Mobile Menu */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    height: 400px;
    width: 250px;
    background: var(--darkblue);
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: right 0.4s ease;
    z-index: 105;
    border-radius: 40px;
    background-color: var(--darkblue);
  }

  nav.active {
    right: 0;
    opacity: 0.95;
  }

  nav.wavy {
    font-size: 1rem;
    padding: 0;
  }

  nav a {
    font-size: 1.3rem;
    padding: 12px;
  }

  .search {
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .search .icon {
    height: 50px;
    width: 50px;
  }

  .filter-bar, .tags-bar {
    max-width: 90vw;
  }

  /* Hero Adjustments */
  .hero {
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    width: 100%;
  }

  .hero.hero-article {
    height: 30dvh;
    height: 30vh;
  }

  .hero.hero-article .hero-content h1 {
    font-size: 1.4rem;
  }

  .small-hero .hero-content h1 {
    font-size: 2.0rem;
  }

  /* Article Content Adjustments */
  .article-section {
    max-width: 90vw;
    padding: 10px 15px;
  }

  .article-section h1 {
    font-size: 2rem;
  }

  .article-image {
    max-height: 300px;
    width: 100%;
  }
  
  /* Carousel Focus */
  .card-link.center-focused .card {
    transform: scale(1.08);
    z-index: 10;
    border: 1px solid rgba(255, 95, 0, 0.3);
  }

  body.dark-mode .card-link.center-focused .card {
    border: 1px solid rgba(136, 170, 255, 0.3);
  }
}

@media screen and (max-width: 480px) {
  .top-bar .logo h1 {
    font-size: 1rem; /* Unified to smaller size for mobile */
  }

  .article-section h1 {
    font-size: 1.8rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .small-hero .hero-content h1 {
    font-size: 1.6rem;
  }

  .hub-search-wrapper input {
    font-size: 14px; /* Reduced from 1.1rem */
  }
}

/* FORCE ACTIVE STATE FOR TAGS */
.tags-btn.active, 
.filter-btn.active {
  background-color: #FF5F00 !important; /* Forces Safety Orange */
  color: #FFFFFF !important;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(255, 95, 0, 0.3); /* Adds a subtle glow */
}

/* Ensure hover doesn't weirdly interact with active state */
@media (hover: hover) {
  .tags-btn.active:hover,
  .filter-btn.active:hover {
    background-color: #e55600 !important;
  }
}

/* =========================================
   10. VOTING SYSTEM (VS BAR)
   ========================================= */
.voting-container {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--sublightblue);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    /* Ensure relative positioning for contained absolute elements if needed */
    position: relative; 
}

body.dark-mode .voting-container {
    background: var(--darkblue);
    border: 1px solid rgba(255,255,255,0.05);
}

.vote-question {
    font-size: 1.4rem;
    font-weight: 700;
    /* INCREASED MARGIN: Creates headroom for the pills above the bar */
    margin-bottom: 55px; 
    color: var(--darkblue);
}
body.dark-mode .vote-question { color: var(--lightblue); }

.vote-bar-wrapper {
    display: flex;
    width: 100%;
    height: 50px;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.vote-option {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s;
    position: relative;
    overflow: hidden;
    width: 50%;
}

.vote-option.opt-a { background: #2C3E50; }
.vote-option.opt-b { background: var(--accent); }

.vote-option:hover { filter: brightness(1.1); }

.vote-label {
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Post-Vote State */
.voting-container.voted .vote-bar-wrapper { cursor: default; }

.vote-percent {
    position: absolute;
    /* ELEVATION LOGIC:
       0px bottom = bottom of the wrapper div
       20px bottom = top of wrapper (bottom of bar)
       70px bottom = top of bar
       85px bottom = 15px clearance above bar */
    bottom: 85px; 
    
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    
    /* Animation: Slide UP into position */
    transform: translateY(10px); 
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    color: var(--darkblue);
    padding: 5px 14px;
    background: rgba(0,0,0,0.06);
    border-radius: 50px;
    letter-spacing: 0.5px;
    pointer-events: none; /* Prevents blocking clicks on the question area */
}

body.dark-mode .vote-percent { 
    color: var(--lightblue); 
    background: rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.voting-container.voted .vote-percent { 
    opacity: 1; 
    transform: translateY(0);
}