* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Remove default focus outline from interactive elements */
a:focus,
button:focus,
.blog-card:focus,
.hamburger:focus {
  outline: none;
}
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--bg);
  color: var(--text);
}
body.high-contrast {
  --bg: #000000;
  --text: #ffffff;
  --accent: #ffff00;
}

body.high-contrast a {
  text-decoration: underline;
}
body.font-serif {
  --font-family: Georgia, "Times New Roman", serif;
}

body.font-sans {
  --font-family: "Segoe UI", system-ui, sans-serif;
}


:root {
  /* Color */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-warm: #f59e0b;

  /* Typography */
  --font-family: "Segoe UI", system-ui, sans-serif;
  --font-family-display: "Segoe UI", system-ui, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.7;

  /* Spacing */
  --card-gap: 2rem;

  /* Accessibility */
  --bg: #f7f4ef;
  --text: #1b1b1b;
}
/* ============================
   SMOOTH THEME TRANSITION
============================ */

/* Apply transition only after page load */
body.theme-ready,
body.theme-ready * {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    fill 0.35s ease,
    stroke 0.35s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle - Sliding Switch */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  margin-right: 0.75rem;
}

#theme-toggle {
  all: unset;
  cursor: pointer;
  display: block;
}

.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 48px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50px;
  padding: 2px 4px;
  transition: background 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch-thumb {
  position: absolute;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sun-icon,
.moon-icon {
  position: absolute;
  font-size: 0.6rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
  color: #fbbf24;
  opacity: 1;
  transform: scale(1);
}

.moon-icon {
  color: #1e293b;
  opacity: 0;
  transform: scale(0.5);
}

/* Dark mode state */
body.dark-mode .theme-switch-track {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.dark-mode .theme-switch-thumb {
  left: 27px;
}

body.dark-mode .sun-icon {
  opacity: 0;
  transform: scale(0.5);
}

body.dark-mode .moon-icon {
  opacity: 1;
  transform: scale(1);
  color: #fbbf24;
}

#theme-toggle:focus {
  outline: none;
}

#theme-toggle:focus .theme-switch-track {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(102, 126, 234, 0.3);
}

body.dark-mode #theme-toggle:focus .theme-switch-track {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* ============================================================
   STEP 3: Header & Navigation Bar
   ============================================================ */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1.25rem 0; /* fixed height */
  background: rgba(247, 244, 239, 0.92);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    padding: 1.25rem 0; /* SAME padding */
  background: rgba(247, 244, 239, 0.98);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}
#main-header {
    min-height: 64px;              /* LOCK HEIGHT */
    display: flex;
    align-items: center;
    top: 0;
}
header,
header.scrolled {
  padding: 1.25rem 0;
  height: 80px;
}

@media (max-width: 768px) {
  header,
  header.scrolled {
    padding: 0.6rem 0;
    height: 64px;
  }

  nav {
    padding: 0 0.9rem;
  }

  /* Slightly smaller toggle on mobile */
  .theme-switch-track {
    width: 42px;
    height: 22px;
  }

  .theme-switch-thumb {
    width: 16px;
    height: 16px;
  }

  body.dark-mode .theme-switch-thumb {
    left: 23px;
  }

  .sun-icon,
  .moon-icon {
    font-size: 0.55rem;
  }
}

/* ============================================================
   STEP 4: Navigation Layout & Logo
   ============================================================ */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 🔥 critical */
  width: 100%;
  padding: 0 1.2rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    order: 2;
}

.nav-links a {
    text-decoration: none;
  color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:focus {
    outline: none;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
  background: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hamburger Menu Styling */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 6px;
    border: none;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    position: relative;
    z-index: 1201;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
  background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.hamburger:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background-color: var(--text);
    transition: all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    border-radius: 1px;
    display: block;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

body.dark-mode .hamburger {
    background: transparent;
}

body.dark-mode .hamburger:hover {
    background: rgba(59, 130, 246, 0.1);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

body.dark-mode .hamburger {
    color: white;
}

body.dark-mode .hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hero {
    text-align: center;
  padding: 5rem 2rem 4.5rem;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
  min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 46px 46px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 45%, rgba(255, 255, 255, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 55%);
    pointer-events: none;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.hero h1 {
  font-size: 3.4rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease;
    font-weight: 700;
    line-height: 1.1;
    position: relative;
    z-index: 2;
    color: white;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.3s backwards;
    color: white;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    max-width: 600px;
}



/* ============================================================
   STEP 7: Hero Section (Main Page Intro)
   =========================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ============================================================
   STEP 8: Blog Grid Layout
   ============================================================
   Auto-fill responsive grid that adapts to screen size
   Each card minimum 350px, expands to fill available space
   2rem gap between cards for breathing room
   Automatically creates 3-column layout on desktop, 1 on mobile */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.trending-section {
  margin: 3rem auto 2.5rem;
  max-width: 1200px;
  padding: 1.5rem 0;
}

.trending-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0 2rem;
}


.trending-header h3 {
  font-size: 1.5rem;
  color: var(--text);
}

body.dark-mode .trending-header h3 {
  color: #fff;
}

.trending-subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

body.dark-mode .trending-subtitle {
  color: #ffffff;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  padding: 0 2rem;
  margin-bottom: 2rem;
}

/* Responsive: Tablet Large (1024px) */
@media (max-width: 1200px) {
  .trending-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
    padding: 0 1.5rem;
  }
}

/* Responsive: Tablet (768px) */
@media (max-width: 1024px) {
  .trending-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    padding: 0 1rem;
  }
}

/* Responsive: Mobile (640px) */
@media (max-width: 768px) {
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    padding: 0 1rem;
  }
}

/* Responsive: Small Mobile (480px) */
@media (max-width: 640px) {
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0 0.75rem;
  }
}

/* Responsive: Very Small Mobile (375px) */
@media (max-width: 480px) {
  .trending-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
}

.trending-card {
  display: block;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.08), 0 1px 3px rgba(30, 41, 59, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  min-height: 140px;
  cursor: pointer;
  border: 1px solid #ececec;
  padding: 0.7rem 0.8rem;
  color: inherit;
  text-decoration: none;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Responsive card sizing */
@media (max-width: 1200px) {
  .trending-card {
    min-height: 130px;
    padding: 0.65rem 0.75rem;
  }
}

@media (max-width: 1024px) {
  .trending-card {
    min-height: 150px;
    padding: 0.75rem 0.8rem;
  }
}

@media (max-width: 768px) {
  .trending-card {
    min-height: 160px;
    padding: 0.8rem 0.9rem;
  }
}

@media (max-width: 640px) {
  .trending-card {
    min-height: 140px;
    padding: 0.7rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .trending-card {
    min-height: 150px;
    padding: 0.75rem 0.8rem;
  }
}

.trending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

body.dark-mode .trending-card {
  background: #23272f;
  border: 1px solid #2d323c;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18), 0 1.5px 4px rgba(0,0,0,0.10);
}


.trending-card:hover .trending-image img {
  transform: scale(1.05);
}

.trending-content {
  padding: 0.5rem 0 0 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .trending-content {
    padding: 0.6rem 0 0 0;
  }
}

.trending-meta {
  display: flex;
  gap: 0.4rem;
  color: #667eea;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .trending-meta {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .trending-meta {
    font-size: 0.8rem;
  }
}

.trending-content h4 {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
  flex-grow: 1;
}

@media (max-width: 1024px) {
  .trending-content h4 {
    font-size: 0.85rem;
    line-height: 1.25;
  }
}

@media (max-width: 768px) {
  .trending-content h4 {
    font-size: 0.9rem;
    line-height: 1.3;
  }
}

@media (max-width: 640px) {
  .trending-content h4 {
    font-size: 0.8rem;
    line-height: 1.2;
  }
}

body.dark-mode .trending-content h4 {
  color: #ffffff;
}


/* Base blog card styles */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}


/* ============================================================
   STEP 10: Blog Card Image & Content
   ============================================================
   Image section uses gradient background with emoji
   Content area has padding with typography hierarchy
   Meta info (date/category) in smaller, lighter text
   Title prominent, excerpt brief for quick scanning */
/* Image */
.blog-image {
  width: 100%;
  aspect-ratio: 16 / 9; /* 🔥 responsive height */
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
.blog-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}


/* Meta */
.blog-meta {
    font-size: .8rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: .6rem;
}

.blog-title {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: #0F172A;
}

.blog-footer {
    margin-top: auto;
}
.blog-excerpt {
    color: #0F172A;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* ============================================================
   STEP 11: Call-to-Action Button (Read More)
   ============================================================
   Gradient button with smooth scaling on hover
   Inviting purple-to-pink color scheme
   Padding and border-radius for modern appearance
   Scale transform creates interactive feel on hover */
.read-more {
    display: inline-block;
    padding: .55rem 1.4rem;
    background: #0F172A;
    color: #fff;
    border-radius: 999px;
    font-size: .85rem;
    transition: background .25s ease, transform .25s ease;
}

.read-more:hover {
    transform: scale(1.05);
}
.read-more {
  display: none !important;
}

/* --- FOOTER & SOCIALS --- */
footer {
    background: #111; /* Darker background for contrast */
    color: white;
    padding-top: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-content h3 {
    font-size: 1.8rem;
    font-weight: 500;
    text-transform: capitalize;
    line-height: 3rem;
    margin-bottom: 0.5rem;
}

.footer-content p {
    max-width: 500px;
    margin: 10px auto;
    line-height: 28px;
    font-size: 14px;
    color: #cacdd2;
}

.socials {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0 2rem 0;
}

.socials li {
    margin: 0 10px;
}

.socials a {
    text-decoration: none;
    color: white;
    border: 1.1px solid white;
    padding: 5px;
    border-radius: 50%;
    display: flex; /* Centers the icon inside the circle */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.4s ease;
}

.socials a i {
    font-size: 1.1rem;
    transition: color 0.4s ease;
}

/* Hover Effect: Turn white circle into Brand Purple */
.socials a:hover {
    background: #667eea;
    border-color: #667eea;
}

.socials a:hover i {
    color: white;
}

/* ============================================================
   STEP 13: Footer Bottom Copyright Section
   ============================================================
   Darker background for visual separation
   Contains copyright notice and other legal info
   Different text color to distinguish from main footer */
.footer-bottom {
    background: #000;
    padding: 20px;
    font-size: 14px;
    text-align: center;
}

.footer-bottom p {
    color: #cacdd2;
}

/* ============================================================
   STEP 14: Responsive Design - Mobile Adjustments
   ============================================================
   At 768px or smaller screens:
   - Hero text becomes smaller (2.5rem instead of 3.5rem)
   - Blog grid changes to single column
   - Navigation menu collapses to hamburger
   - All adjustments maintain usability on small screens */

/* Add this to styles.css to align the icons */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* --- ARTICLE PAGE STYLES --- */

/* Article Hero Section */
.article-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    padding: 4rem 2rem;
    background-size: cover;
    background-position: center;
    color: #fff;
    z-index: 1; /* LOWER layer */
}

.article-header-content {
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================================
   STEP 16: Article Category Tag
   ============================================================
   Semi-transparent white background
   Uppercase text with letter spacing
   Sits above main article title
   Indicates article category visually */
.category-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-hero h1 {
    font-size: 3rem;
    margin: 1.5rem 0;
    line-height: 1.2;
}

/* ============================================================
   STEP 17: Article Metadata
   ============================================================
   Displays date, author, and reading time info
   Flexbox layout for horizontal alignment
   Light text color with appropriate contrast
   Responsive: stacks vertically on mobile */
.article-meta {
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    justify-content: center;
    gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.article-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
}

.share-btn.copied {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(37, 99, 235, 0.9);
}

/* ============================================================
   STEP 18: Article Body Content
   ============================================================
   Narrower container (750px) for optimal reading line length
   White card with subtle shadow floats above hero
   Proper typography hierarchy and spacing
   Maximum reading comfort with 1.8 line-height */

/* Article Body Typography */
.single-article {
    position: relative;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}



@media (max-width: 768px) {
    .article-layout {
        margin-top: -60px;
    }

    .single-article {
        padding: 1.5rem;
    }
}


.intro-text {
    font-size: 1.25rem;
    color: #444;
    font-weight: 300;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.single-article p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: var(--line-height-base);
    color: #444;
}

.single-article h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem 0;
    color: #2d3748;
}

.single-article ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.single-article li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* ============================================================
   STEP 19: Blockquote Styling
   ============================================================
   Left border in brand color indicates important quotes
   Light background for visual separation
   Italic text distinguishes from regular content
   Rounded corners for modern aesthetic */

/* Blockquote Styling */
blockquote {
    border-left: 5px solid #667eea;
    background: #f7fafc;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.2rem;
    color: #555;
    border-radius: 0 10px 10px 0;
}

/* ============================================================
   STEP 20: Back Button Navigation
   ============================================================
   Returns user to homepage or previous section
   Purple color matches brand theme
   Underlines on hover for clear interactivity
   Positioned below article content */

/* Navigation Button */
.back-btn {
    display: inline-block;
    margin-top: 2rem;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Mobile Adjustments for Article */
@media (max-width: 768px) {
    .article-hero h1 { font-size: 2rem; }
    .single-article { padding: 1.5rem; }
    
    .article-meta { 
        flex-direction: column; 
        gap: 0.3rem; 
        font-size: 0.85rem;
        align-items: center;
        text-align: center;
    }
    
    .article-meta .meta-sep {
      display: none; /* Hide bullets on mobile */
    }
    
    .article-meta strong {
        display: inline; /* Keep author name inline */
    }
}
/* ============================================================
   STEP 22: Contact Form Elements
   ============================================================
   Individual form groups stack vertically
   Two-column layout for name/email on desktop
   Focus state highlights with purple border
   Subtle box-shadow on focus indicates interactivity */
   .contact-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Two columns for Name and Email on desktop */
.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

input, textarea {
    padding: 0.8rem 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Focus Effect: The Border turns purple */
input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Error state styling */
input.error, textarea.error {
    border-color: #ef4444;
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #fbbf24;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   STEP 23: Submit Button Styling
   ============================================================
   Full-width button with gradient background
   Lifts up slightly on hover with shadow
   Active state returns button to normal
   Provides clear visual feedback for interaction */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn:focus {
    outline: none;
}

.contact-form:focus {
    outline: none;
}

/* Mobile adjustments for form */
@media (max-width: 600px) {
    .form-group-row {
        grid-template-columns: 1fr; /* Stack name and email */
        gap: 0;
    }
    
    .contact-wrapper {
        padding: 1.5rem;
    }
}
/* --- SCROLL TO TOP BUTTON --- */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    font-size: 1.2rem;
    border: none;
    outline: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%; /* Makes it a circle */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    
    /* Animation Properties */
    opacity: 0;           /* Hidden by default */
    pointer-events: none; /* Not clickable when hidden */
    transition: all 0.4s ease;
    transform: translateY(20px); /* Starts slightly lower */
}

/* Class added by JS when user scrolls down */
#scrollTopBtn.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#scrollTopBtn:hover {
    transform: translateY(-5px); /* Bounces up slightly on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

#scrollTopBtn:focus {
    outline: none;
}
/* --- DARK MODE STYLES --- */
/* The Toggle Icon */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
} /* <-- ADD THIS CLOSING BRACE */

/* --- THE DARK THEME OVERRIDES --- */
body.dark-mode {
  background: #0b0f12;
  color: #e7e2da;
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #0b0f12 0%, #0f172a 60%, #0b0f12 100%);
}

body.dark-mode .hero h1 {
    color: #fff;
  background: linear-gradient(135deg, #5eead4 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .hero p {
  color: #cfd8dc;
}

/* Header/Nav Dark Mode */
body.dark-mode header {
  background: rgba(11, 15, 18, 0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

body.dark-mode header.scrolled {
    background: rgba(18, 18, 18, 0.98);
}
body.dark-mode .nav-links a {
    color: #f0f0f0;
}

body.dark-mode .hamburger span {
    background-color: #f0f0f0;
}
/* =========================
   SETTINGS BUTTON – DARK MODE
========================= */

body.dark-mode .settings-btn {
  color: #f0f0f0;
}

body.dark-mode .settings-btn:hover {
  color: var(--accent);
}
/* Cards & Articles */
body.dark-mode .blog-card,
body.dark-mode .single-article,
body.dark-mode .contact-wrapper {
    background: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .blog-title, 
body.dark-mode .contact-header h2,
body.dark-mode .single-article h2 {
    color: #fff;
}

body.dark-mode .blog-excerpt,
body.dark-mode .blog-meta,
body.dark-mode .intro-text,
body.dark-mode .single-article p,
body.dark-mode label {
    color: #bbb;
}

/* Inputs in Dark Mode */
body.dark-mode input,
body.dark-mode textarea {
    background: #2d2d2d;
    border-color: #444;
    color: white;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus {
    border-color: #667eea;
}

/* Dark mode error messages */
body.dark-mode .error-message {
    color: #fca5a5;
}

body.dark-mode input.error,
body.dark-mode textarea.error {
    border-color: #ef4444;
}

/* Footer in Dark Mode */
body.dark-mode footer,
body.dark-mode .footer-bottom {
    background: #000;
}

/* Horizontal Rule in Articles */
.single-article hr {
    border: none;
    border-top: 2px solid #eee;
    margin: 2.5rem 0;
}

/* Navigation Area */
.navigation-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

/* Dark mode for About section */
body.dark-mode .profile-placeholder {
    background: #2d2d2d;
    border-color: #1e1e1e;
    color: #667eea;
}

/* Dark mode for legal links */
body.dark-mode .legal-links a {
    color: #888;
}

body.dark-mode .legal-links a:hover {
    color: #667eea;
}

/* Dark mode for blockquote */
body.dark-mode blockquote {
    background: #2d2d2d;
    border-left-color: #667eea;
    color: #ccc;
}

/* Dark mode for contact section background */
body.dark-mode .contact-section {
    background: #0a0a0a;
}

/* Contact page styling */
.contact-form {
  max-width: 100%;
}

body.static-page .container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.contact-header p {
  font-size: 1.1rem;
  color: #666;
  margin-top: 0.5rem;
}

body.dark-mode .contact-header p {
  color: #aaa;
}
/* --- ABOUT PAGE STYLES --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Image takes 1 part, Text takes 2 parts */
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-placeholder {
    width: 200px;
    height: 200px;
    background: #e2e8f0;
    border-radius: 50%; /* Circle shape */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 5rem;
    color: #a0aec0;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- FOOTER LEGAL LINKS --- */
.legal-links {
    margin-top: 10px;
    font-size: 0.85rem;
}

.legal-links a {
    color: #888;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s;
}

.legal-links a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Mobile Adjustments for About Page */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        text-align: center;
    }
}
/* --- HERO WORD ANIMATION --- */
/* Ensure the hero text container doesn't flash before animation */
.hero h1, .hero p {
    opacity: 1; /* Overrides previous fade-in if any */
    visibility: visible;
}
/* --- SEARCH BAR --- */
.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto 3rem auto; /* Center it with spacing below */
}

.search-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.1rem;
}

#searchInput {
    width: 100%;
    padding: 15px 20px 15px 50px; /* Left padding makes room for icon */
    border: 2px solid #e2e8f0;
    border-radius: 50px; /* Pill shape */
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#searchInput:focus {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    outline: none;
}

/* Dark Mode Support for Search */
body.dark-mode #searchInput {
    background: #2d2d2d;
    border-color: #444;
    color: white;
}

body.dark-mode #searchInput:focus {
    border-color: #667eea;
}
/* --- SIDEBAR LAYOUT STYLES --- (Corrected) */

/* 1. The Grid Container */
.article-layout {
    position: relative;
    /* max-width: 900px;*/
    margin: -0.5px auto 0 auto; /* overlaps hero cleanly */
    padding: 0 1.5rem;
    z-index: 2; /* ABOVE hero */
}

/* 2. The Sidebar Container - NEW RULE */
/* This makes the WHOLE sidebar (both widgets) stick together */

/* 3. Reset specific styles on the article card so it fits the grid */
.article-layout .single-article {
    width: 100%;
    padding: 2.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f3f5;
    color: #333;
}

.recent-posts-list li {
    margin-bottom: 1rem;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 0.5rem;
}

.recent-posts-list li:last-child {
    border: none;
}

.recent-posts-list a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    transition: color 0.2s;
}

.recent-posts-list a:hover {
    color: #667eea;
}

.mini-date {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: bold;
}
body.dark-mode .recent-posts-list a {
    color: #ccc;
}

body.dark-mode .recent-posts-list a:hover {
    color: #667eea;
}

body.dark-mode .tag {
    background: #333;
    color: #ccc;
}

/* Mobile */
@media (max-width: 768px) {
    .article-layout {
        margin-top: -40px;
    }

    .article-layout .single-article {
        padding: 1.5rem;
    }
}
/* --- READING PROGRESS BAR --- */
#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 1001;
  background: transparent;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.15s ease-out;
}

/* --- CATEGORY FILTER --- */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: none;
    background: #e5e5e5;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #333;
}

/* Active State (Blue) */
.filter-btn.active, .filter-btn:hover {
    background: #0071E3; /* Apple Blue */
    color: white;
}

.filter-btn:focus {
    outline: none;
}

/* Dark Mode Support */
body.dark-mode .filter-btn {
    background: #333;
    color: #ccc;
}
body.dark-mode .filter-btn.active {
    background: #0A84FF; /* Apple Dark Mode Blue */
    color: white;
}
/* --- RELATED ARTICLES --- */
.section-heading {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 700;
}
/* =========================
   RELATED POSTS – RESPONSIVE CARD
========================= */

/* =========================
   RELATED POSTS – HARD LOCK
========================= */
/* GLOBAL GRID WRAPPER – DO NOT CHANGE */
.grid-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 🔥 FIXED */
  gap: 1.5rem;
}

/* Card */
.related-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Animated gradient border */
.related-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(45deg, 
    #667eea, 
    #764ba2, 
    #f093fb, 
    #4facfe,
    #00f2fe,
    #667eea
  );
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: borderRotate 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.related-card:hover::before {
  opacity: 1;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.related-card:focus {
  outline: none;
}

/* Image – RESPONSIVE */
.related-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content */
.related-content {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

/* Title */
.related-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #111;
}

/* Excerpt – compact */
.related-excerpt {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
}
/* Author text */
.related-author {
  font-size: 0.75rem;
  color: #777;
  margin-top: auto; /* keeps author at bottom */
}
/* Medium laptops */
@media (max-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Tablets */
@media (max-width: 900px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .related-excerpt {
    display: none; /* 🔥 optional: hide excerpt on very small screens */
  }
}

/* Related Section Container */
.related-section {
  padding: 3rem 0;
  background: #fafafa;
}

/* Dark Mode Support */
body.dark-mode .related-section {
    background: #111;
    border-top: 1px solid #333;
}
body.dark-mode .related-card {
  background: #1e1e1e;
}

body.dark-mode .related-card::before {
  background: linear-gradient(45deg, #8b9dff, #a075d9, #ff9ff3, #00d4ff, #4facfe, #8b9dff);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#1e1e1e 0 0) content-box, linear-gradient(#1e1e1e 0 0);
  mask: linear-gradient(#1e1e1e 0 0) content-box, linear-gradient(#1e1e1e 0 0);
}

body.dark-mode .related-title {
  color: #f1f1f1;
}

body.dark-mode .related-excerpt,
body.dark-mode .related-author {
  color: #aaa;
}

body.dark-mode .section-heading { color: white; }
/* --- LIGHTBOX (Image Zoom) --- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Black background with opacity */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 80%;
    max-height: 80%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    animation: zoomIn 0.3s;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-lightbox:hover {
    color: #667eea;
}

@keyframes zoomIn {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

/* Make images in article clickable */
.single-article img {
    cursor: zoom-in;
    transition: 0.3s;
}

.single-article img:hover {
    opacity: 0.9;
}
/* --- HERO BACK BUTTON --- */
.hero-back-btn {
    position: absolute;
    top: 30px;  /* Adjust distance from top */
    left: 30px; /* Adjust distance from left */
    
    /* Styling */
    color: white;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

.hero-back-btn:hover {
    background: white;
    color: #667eea; /* Turns purple on hover */
    transform: scale(1.1);
}

/* Mobile Adjustment: Move it slightly if screen is small */
@media (max-width: 768px) {
    .hero-back-btn {
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
    }
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 🔥 show FULL image */
  background: #f3f4f6; /* prevents ugly gaps */
}
.article-header-content {
  max-width: 900px;
}

.category-tag {
  background: #2563eb;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 15px;
}

.skeleton-card {
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 37%,
    #e5e7eb 63%
  );
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
}

@keyframes skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.skeleton {
  height: 320px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 37%,
    #e5e7eb 63%
  );
  background-size: 400% 100%;
  animation: skeleton 1.4s infinite;
}
/* Make entire card clickable */
.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Remove focus outline from card links */
.blog-card-link:focus {
    outline: none;
}

.blog-card-link:focus .blog-card {
    outline: none;
}

/* Keep Read More fixed at bottom */
.read-more {
    margin-top: auto;
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: #0F172A;
    color: #fff;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.25s ease, background 0.25s ease;
}

/* Hover effect when hovering anywhere on card */
.blog-card-link:hover .read-more {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Optional: hover lift */
.blog-card-link:hover .blog-card {
    transform: translateY(-6px);
}
/* ==========================================================
   GLOBAL MOBILE HARDENING (SAFE PATCH)
========================================================== */

/* Prevent horizontal scroll on all devices */
html, body {
  overflow-x: hidden;
}

/* Images NEVER overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Containers adapt on very small screens */
@media (max-width: 480px) {
  .container {
    padding: 2rem 1rem;
  }
}

/* Blog grid – hard guarantee 1 column on phones */
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Article hero text scaling */
@media (max-width: 768px) {
  .article-hero {
    padding: 3rem 1.2rem;
    min-height: 300px;
  }

  .article-hero h1 {
    font-size: 2rem;
  }
}

/* Article card spacing fix */
@media (max-width: 600px) {
  .single-article {
    padding: 1.2rem;
  }
}
.blog-image img,
.related-image img,
.single-article img {
  content-visibility: auto;
}
/* =========================
   FIX EMPTY HERO SPACE
   (Static Pages)
========================= */

.static-page .article-hero {
  min-height: auto;
  padding: 0;
  background: none;
}
.static-page .container {
  padding-top: 2rem;
}
.single-article {
  max-width: 1024px;
  margin: auto;
}

@media (max-width: 600px) {
  .single-article p {
    font-size: 1rem;
    line-height: 1.8;
  }
}
/* ============================
   CONTACT FORM – TABLET FIX
============================ */

/* Prevent grid items from overflowing */
.form-group-row > .form-group {
  min-width: 0;
}

/* Force inputs to stay inside container */
.contact-form input,
.contact-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Tablet-specific refinement */
@media (max-width: 1024px) and (min-width: 601px) {
  .form-group-row {
    gap: 1rem;
  }
}
#nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 999;
  backdrop-filter: blur(2px);
}

#nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================
   NAVIGATION – FINAL FIX
============================ */

/* DESKTOP */
.nav-links {
    list-style: none;   /* 🔥 removes dots */
  display: flex;
  gap: 2rem;
  margin-left: auto; /* 🔥 THIS FIXES CENTERING */
  margin-right: 2rem; /* Space before nav-controls */
}



.hamburger {
  display: none;
}

@media (max-width: 768px) {

  /* LOGO LEFT */
  .logo-link {
    margin-right: auto;
  }

  /* HAMBURGER RIGHT */
  .hamburger {
    display: flex;
    margin-left: auto;
    cursor: pointer;
    gap: 5px;
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* HIDE DESKTOP MENU - SLIDE FROM TOP */
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;

    background: var(--bg);
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;

    padding: 1.5rem 0;
    margin: 0;

    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;

    transition: transform 0.35s ease, opacity 0.3s ease;
    z-index: 1000;
  }

  .nav-links::-webkit-scrollbar {
    width: 6px;
  }

  .nav-links::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
  }

  .nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.dark-mode .nav-links {
    background: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }

  body.dark-mode .nav-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
  }

  body.dark-mode .nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  .nav-links li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-links a {
    padding: 1rem 1.5rem;
    border-bottom: none;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    position: relative;
    background: transparent;
    width: 100%;
    text-align: center;
  }

  .nav-links a:active {
    transform: scale(0.98);
  }

  .nav-links a:hover {
    background: rgba(37, 99, 235, 0.1);
  }

  /* Theme item special styling */
  .nav-links .theme-item {
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    margin-top: 0.5rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    gap: 10px;
    position: relative;
    transition: all 0.25s ease;
    width: 100%;
  }

  .nav-links .theme-toggle-wrapper {
    display: flex;
    align-items: center;
  }

  body.dark-mode .nav-links a {
    color: rgba(255, 255, 255, 0.95);
  }

  body.dark-mode .nav-links a:hover {
    background: rgba(59, 130, 246, 0.12);
  }

  body.dark-mode .nav-links .theme-item {
    border-top-color: rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 768px) {
  .nav-links a {
    pointer-events: auto;
    touch-action: manipulation;
  }
}
/* =========================
   LOGO – RESPONSIVE
========================= */

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0; /* 🔥 prevents collapse */
  /* margin-right: auto; */
  font-size: 0;
  line-height: 0;
}

.logo-link:focus {
  outline: none;
}

/* Common logo styling */
.logo {
    height: 180px;
  width: auto;
  font-size: 1.8rem;
  font-weight: bold;
  /* 🔥 THIS pushes everything else right */
  white-space: nowrap;
}

/* Logo visibility (one logo per device) */
.logo-desktop,
.logo-mobile {
  display: none;
}

/* Default: desktop light */
.logo-desktop.logo-light {
  display: block;
}

/* Dark mode: desktop dark */
body.dark-mode .logo-desktop.logo-light {
  display: none;
}

body.dark-mode .logo-desktop.logo-dark {
  display: block;
}

/* Mobile & Tablet */
@media (max-width: 768px) {
  .logo-desktop,
  .logo-desktop.logo-light,
  body.dark-mode .logo-desktop.logo-dark {
    display: none !important;
  }

  .logo-mobile.logo-light {
    display: block !important;
    height: 140px;
  }

  body.dark-mode .logo-mobile.logo-light {
    display: none !important;
  }

  body.dark-mode .logo-mobile.logo-dark {
    display: block !important;
    height: 140px;
  }
}
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: #ffffff;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 1.5rem;
    padding: 2rem 0;

    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;

    transition: transform 0.35s ease, opacity 0.3s ease;
    z-index: 1200;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    pointer-events: auto;   /* 🔥 ensures clicks always work */
    touch-action: manipulation;
  }
}

/* =========================
   ARTICLE CATEGORY – MOBILE FIX
========================= */

@media (max-width: 768px) {
  .article-header-content {
    padding: 60px 1rem 2rem 1rem;
    text-align: center;
  }

  .category-tag {
    margin-top: 10px;
    display: inline-block;
    font-size: 0.75rem;
  }
  
  .article-hero h1 {
    font-size: 1.75rem;
    margin: 1rem 0;
    line-height: 1.3;
  }
}
/* =========================
   ARTICLE CONTENT STRUCTURE
========================= */

#articleContent {
  max-width: 720px;
  margin: 0 auto;
}

/* Paragraphs */
#articleContent p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.4rem;
  color: #444;
}

/* Headings */
#articleContent h1,
#articleContent h2,
#articleContent h3 {
  margin: 2.2rem 0 1rem;
  line-height: 1.3;
  color: #111;
}

#articleContent h2 {
  font-size: 1.7rem;
}

#articleContent h3 {
  font-size: 1.4rem;
}

/* Lists */
#articleContent ul,
#articleContent ol {
  margin: 1.2rem 0 1.6rem 1.4rem;
}

#articleContent li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
}
/* =========================
   ARTICLE IMAGES – CENTERED
========================= */

#articleContent img {
  display: block;                 /* 🔥 required */
  max-width: 100%;                /* responsive */
  height: auto;
  margin: 2rem auto;              /* 🔥 centers image */
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
@media (max-width: 600px) {
  #articleContent img {
    margin: 1.5rem auto;
    border-radius: 10px;
  }

  #articleContent p {
    font-size: 1rem;
  }
}
body.dark-mode #articleContent p {
  color: #ccc;
}

body.dark-mode #articleContent h1,
body.dark-mode #articleContent h2,
body.dark-mode #articleContent h3 {
  color: #fff;
}

body.dark-mode #articleContent img {
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* =========================
   GLOBAL CONTENT FORMAT
   (Applies to ALL pages)
========================= */

.content-body,
#articleContent,
#pageContent {
  max-width: 720px;
  margin: 0 auto;
}
/* Paragraphs */
.content-body p,
#articleContent p,
#pageContent p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 0.9rem;
  color: #444;
}

.content-body p:last-child,
#articleContent p:last-child,
#pageContent p:last-child {
  margin-bottom: 0;
}

/* Headings */
.content-body h1,
#articleContent h1,
#pageContent h1,
.content-body h2,
#articleContent h2,
#pageContent h2,
.content-body h3,
#articleContent h3,
#pageContent h3 {
  margin: 2.2rem 0 1rem;
  line-height: 1.3;
  color: #111;
}

#articleContent h2,
#pageContent h2 {
  font-size: 1.7rem;
}

#articleContent h3,
#pageContent h3 {
  font-size: 1.4rem;
}
/* =========================
   GLOBAL IMAGE HANDLING
========================= */

.content-body img,
#articleContent img,
#pageContent img {
  display: block;          /* 🔥 mandatory */
  max-width: 100%;
  height: auto;
  margin: 2rem auto;       /* 🔥 center image */
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
/* Lists */
.content-body ul,
#articleContent ul,
#pageContent ul,
.content-body ol,
#articleContent ol,
#pageContent ol {
  margin: 1.2rem 0 1.6rem 1.4rem;
}

.content-body li,
#articleContent li,
#pageContent li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

/* Blockquotes */
.content-body blockquote,
#articleContent blockquote,
#pageContent blockquote {
  border-left: 4px solid #2563eb;
  background: #f7f9fc;
  padding: 1.4rem 1.8rem;
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 12px 12px 0;
}
@media (max-width: 600px) {
  .content-body,
  #articleContent,
  #pageContent {
    padding: 0 1rem;
  }

  .content-body p,
  #articleContent p,
  #pageContent p {
    font-size: 1rem;
  }

  .content-body img,
  #articleContent img,
  #pageContent img {
    margin: 1.5rem auto;
    border-radius: 10px;
  }
}
body.dark-mode .content-body p,
body.dark-mode #articleContent p,
body.dark-mode #pageContent p {
  color: #ccc;
}

body.dark-mode .content-body h1,
body.dark-mode #articleContent h1,
body.dark-mode #pageContent h1,
body.dark-mode .content-body h2,
body.dark-mode #articleContent h2,
body.dark-mode #pageContent h2 {
  color: #fff;
}

body.dark-mode .content-body img,
body.dark-mode #articleContent img,
body.dark-mode #pageContent img {
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
/* =========================
   AUTO-STYLED TABLES (GLOBAL)
========================= */

.content-body table,
#articleContent table,
#pageContent table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Table header */
.content-body thead,
#articleContent thead,
#pageContent thead {
  background: #2563eb;
  color: #fff;
}

.content-body th,
#articleContent th,
#pageContent th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
}

/* Table cells */
.content-body td,
#articleContent td,
#pageContent td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

/* Zebra rows */
.content-body tbody tr:nth-child(even),
#articleContent tbody tr:nth-child(even),
#pageContent tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Last row fix */
.content-body tbody tr:last-child td,
#articleContent tbody tr:last-child td,
#pageContent tbody tr:last-child td {
  border-bottom: none;
}
@media (max-width: 600px) {
  .content-body table,
  #articleContent table,
  #pageContent table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
body.dark-mode .content-body table,
body.dark-mode #articleContent table,
body.dark-mode #pageContent table {
  background: #1e1e1e;
}

body.dark-mode .content-body thead,
body.dark-mode #articleContent thead,
body.dark-mode #pageContent thead {
  background: #334155;
}

body.dark-mode .content-body td,
body.dark-mode #articleContent td,
body.dark-mode #pageContent td {
  border-color: #333;
}

body.dark-mode .content-body tbody tr:nth-child(even),
body.dark-mode #articleContent tbody tr:nth-child(even),
body.dark-mode #pageContent tbody tr:nth-child(even) {
  background: #181818;
}
/* =========================
   CODE BLOCKS (GLOBAL)
========================= */

.content-body pre,
#articleContent pre,
#pageContent pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 1.4rem 1.6rem;
  border-radius: 14px;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Code text */
.content-body pre code,
#articleContent pre code,
#pageContent pre code {
  font-family: "Fira Code", Consolas, Monaco, monospace;
  background: none;
  padding: 0;
  color: inherit;
}
/* Inline code */
.content-body p code,
#articleContent p code,
#pageContent p code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}
body.dark-mode .content-body pre,
body.dark-mode #articleContent pre,
body.dark-mode #pageContent pre {
  background: #020617;
  color: #e5e7eb;
}

body.dark-mode .content-body p code,
body.dark-mode #articleContent p code,
body.dark-mode #pageContent p code {
  background: #1e293b;
  color: #e5e7eb;
}
@media (max-width: 600px) {
  .content-body pre,
  #articleContent pre,
  #pageContent pre {
    font-size: 0.85rem;
    padding: 1.2rem;
  }
}
/* =========================
   HEADING HIERARCHY (GLOBAL)
========================= */

.content-body h1,
#articleContent h1,
#pageContent h1 {
  font-size: 2.2rem;
  margin: 3rem 0 1.5rem;
  line-height: 1.25;
}

.content-body h2,
#articleContent h2,
#pageContent h2 {
  font-size: 1.7rem;
  margin: 2.6rem 0 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e5e7eb;
}

.content-body h3,
#articleContent h3,
#pageContent h3 {
  font-size: 1.35rem;
  margin: 2.2rem 0 1rem;
}

.content-body h4,
#articleContent h4,
#pageContent h4 {
  font-size: 1.1rem;
  margin: 1.8rem 0 0.8rem;
  color: #555;
}

/* Dark mode */
body.dark-mode .content-body h2,
body.dark-mode #articleContent h2,
body.dark-mode #pageContent h2 {
  border-color: #334155;
}
/* =========================
   LINK STYLING (GLOBAL)
========================= */

.content-body a,
#articleContent a,
#pageContent a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.content-body a:hover,
#articleContent a:hover,
#pageContent a:hover {
  color: #1e40af;
}
/* Dark mode */
body.dark-mode .content-body a,
body.dark-mode #articleContent a,
body.dark-mode #pageContent a {
  color: #60a5fa;
}
/* =========================
   COPY CODE BUTTON
========================= */

.copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.copy-code-btn:hover {
  background: #1e40af;
}
/* =========================
   IMAGE AUTO-CAPTION
========================= */

.content-body img[alt]:not([alt=""]),
#articleContent img[alt]:not([alt=""]),
#pageContent img[alt]:not([alt=""]) {
  display: block;
}

.content-body img[alt]::after {
  content: attr(alt);
}
.img-caption {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

/* Dark mode */
body.dark-mode .img-caption {
  color: #aaa;
}

/* =========================
   FIX DARK MODE FLICKER
   (Dynamic Content)
========================= */

/* Disable transitions inside article content */
#articleContent,
#articleContent *,
#pageContent,
#pageContent * {
  transition: none !important;
}
.meta-top {
  margin-bottom: 0.3rem;
}
/* =========================
   BLOG CARD – FINAL FIX
========================= */

/* Card styling */
.blog-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Animated gradient border */
.blog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(45deg, 
    #667eea, 
    #764ba2, 
    #f093fb, 
    #4facfe,
    #00f2fe,
    #667eea
  );
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: borderRotate 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover::before {
  opacity: 1;
}

@keyframes borderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Image – SAME SIZE FOR ALL */
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .card-image img {
  transform: scale(1.05);
}

/* Content */
.card-content {
  padding: 0.9rem 1rem 1.1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* TITLE – THEME AWARE */
.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text); /* 🔥 auto black / white */
}

/* Remove any leftover meta styles */
.meta-top,
.category,
.date {
  display: none !important;
}

/* =========================
   DARK MODE FIX
========================= */
body.dark-mode .blog-card {
  background: #1e1e1e;
}

body.dark-mode .blog-card::before {
  background: linear-gradient(45deg, #8b9dff, #a075d9, #ff9ff3, #00d4ff, #4facfe, #8b9dff);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#1e1e1e 0 0) content-box, linear-gradient(#1e1e1e 0 0);
  mask: linear-gradient(#1e1e1e 0 0) content-box, linear-gradient(#1e1e1e 0 0);
}

body.dark-mode .card-title {
  color: #ffffff;
}

/* =========================
   ENGAGEMENT SECTION (Like & Comments)
========================= */
.engagement-section {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

body.dark-mode .engagement-section {
  border-top-color: #374151;
}

/* Like Section */
.like-section {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
  background: white;
  border: 2px solid #667eea;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.like-btn i {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.like-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.like-btn:hover i {
  transform: scale(1.1);
}

.like-btn.liked {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.like-btn.liked i {
  animation: heartbeat 0.6s ease;
}

body.dark-mode .like-btn {
  background: #1e293b;
  border-color: #3b82f6;
  color: #3b82f6;
}

body.dark-mode .like-btn:hover,
body.dark-mode .like-btn.liked {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: white;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.25); }
}

@keyframes slideIn {
  0% {
    transform: translateX(-20px);
    opacity: 0;
  }
  50% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.like-btn.sliding {
  animation: slideIn 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.like-btn.sliding i {
  animation: slideIn 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.like-btn.sliding span {
  animation: slideIn 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.like-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Comment Section */
.comment-section {
  max-width: 800px;
  margin: 0 auto;
}

.comment-heading {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-mode .comment-heading {
  color: #f3f4f6;
}

.comment-heading i {
  color: #667eea;
}

body.dark-mode .comment-heading i {
  color: #3b82f6;
}

/* Comment Form */
.comment-form-wrapper {
  background: #f9fafb;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  border: 1px solid #e5e7eb;
}

body.dark-mode .comment-form-wrapper {
  background: #1e293b;
  border-color: #374151;
}

.comment-auth-prompt {
  text-align: center;
  padding: 2rem;
}

.comment-auth-prompt p {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.comment-auth-prompt i {
  margin-right: 0.5rem;
}

body.dark-mode .comment-auth-prompt p {
  color: #9ca3af;
}

.comment-form .form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: white;
  color: #1f2937;
}

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
  background: #0f172a;
  border-color: #374151;
  color: #f3f4f6;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-mode .comment-form input:focus,
body.dark-mode .comment-form textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form textarea {
  resize: vertical;
  min-height: 100px;
}

.char-count {
  position: absolute;
  bottom: -1.5rem;
  right: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

body.dark-mode .char-count {
  color: #9ca3af;
}

.submit-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.submit-comment-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.submit-comment-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

body.dark-mode .submit-comment-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

/* Comments List */
.comments-list {
  margin-top: 2.5rem;
}

.loading-comments {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 1rem;
}

body.dark-mode .loading-comments {
  color: #9ca3af;
}

.no-comments {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
  font-size: 1.1rem;
}

body.dark-mode .no-comments {
  color: #9ca3af;
}

.comment-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.3s ease;
}

.comment-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .comment-item {
  background: #1e293b;
  border-color: #374151;
}

body.dark-mode .comment-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.commenter-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.commenter-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

body.dark-mode .commenter-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.commenter-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
}

body.dark-mode .commenter-name {
  color: #f3f4f6;
}

.comment-date {
  font-size: 0.875rem;
  color: #6b7280;
}

body.dark-mode .comment-date {
  color: #9ca3af;
}

.comment-text {
  color: #4b5563;
  line-height: 1.6;
  font-size: 1rem;
}

body.dark-mode .comment-text {
  color: #d1d5db;
}

/* =========================
   AUTH MODAL
========================= */
.auth-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}

.auth-modal-content {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.dark-mode .auth-modal-content {
  background: #1e293b;
  color: #f3f4f6;
}

.auth-modal-close {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.auth-modal-close:hover {
  color: #1f2937;
}

body.dark-mode .auth-modal-close:hover {
  color: #f3f4f6;
}

.auth-form h2 {
  margin: 0 0 0.5rem 0;
  color: #1f2937;
  font-size: 1.75rem;
}

body.dark-mode .auth-form h2 {
  color: #f3f4f6;
}

.auth-subtitle {
  color: #6b7280;
  margin-bottom: 2rem;
  font-size: 1rem;
}

body.dark-mode .auth-subtitle {
  color: #9ca3af;
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
  font-weight: 600;
  font-size: 0.875rem;
}

body.dark-mode .auth-form label {
  color: #d1d5db;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: white;
  color: #1f2937;
}

body.dark-mode .auth-form input,
body.dark-mode .auth-form select {
  background: #0f172a;
  border-color: #374151;
  color: #f3f4f6;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  color: #6b7280;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #667eea;
}

body.dark-mode .password-toggle {
  color: #9ca3af;
}

body.dark-mode .password-toggle:hover {
  color: #60a5fa;
}

body.dark-mode .auth-form input:focus,
body.dark-mode .auth-form select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  min-height: 20px;
  display: none;
  padding: 0.75rem;
  background: #fee2e2;
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

body.dark-mode .auth-error {
  background: #7f1d1d;
  color: #fca5a5;
}

.auth-success {
  color: #10b981;
  font-size: 0.875rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  min-height: 20px;
  display: none;
  padding: 0.75rem;
  background: #d1fae5;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

body.dark-mode .auth-success {
  background: #064e3b;
  color: #6ee7b7;
}

.password-strength {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
}

/* Color-coded strength indicators */
.password-strength[style*="color: #ef4444"] {
  background-color: #fee2e2;
}

.password-strength[style*="color: #f59e0b"] {
  background-color: #fef3c7;
}

.password-strength[style*="color: #10b981"] {
  background-color: #d1fae5;
}

body.dark-mode .password-strength[style*="color: #ef4444"] {
  background-color: #7f1d1d;
  color: #fca5a5;
}

body.dark-mode .password-strength[style*="color: #f59e0b"] {
  background-color: #78350f;
  color: #fcd34d;
}

body.dark-mode .password-strength[style*="color: #10b981"] {
  background-color: #064e3b;
  color: #6ee7b7;
}

.input-error-msg {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

body.dark-mode .input-error-msg {
  color: #fca5a5;
}

.auth-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

body.dark-mode .auth-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

body.dark-mode .auth-switch {
  color: #9ca3af;
}

.auth-switch a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

body.dark-mode .auth-switch a {
  color: #3b82f6;
}

/* User Menu in Header */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
}

body.dark-mode .user-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.login-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-btn i {
  display: none;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body.dark-mode .login-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 0.5rem 0;
  display: none;
  z-index: 1000;
}

.user-dropdown.show {
  display: block;
}

body.dark-mode .user-dropdown {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-dropdown-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
}

body.dark-mode .user-dropdown-header {
  border-bottom-color: #374151;
  color: #f3f4f6;
}

.user-dropdown-item {
  padding: 0.75rem 1.25rem;
  color: #374151;
  text-decoration: none;
  display: block;
  transition: background 0.3s ease;
  font-size: 0.875rem;
}

.user-dropdown-item:hover {
  background: #f3f4f6;
}

body.dark-mode .user-dropdown-item {
  color: #d1d5db;
}

body.dark-mode .user-dropdown-item:hover {
  background: #374151;
}

.user-dropdown-item i {
  margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-modal-content {
    padding: 2rem 1.5rem;
  }

  .auth-form h2 {
    font-size: 1.5rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .engagement-section {
    margin: 2rem 0;
  }

  .like-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .comment-form-wrapper {
    padding: 1.5rem;
  }

  .comment-heading {
    font-size: 1.25rem;
  }

  .comment-item {
    padding: 1.25rem;
  }
}

/* =========================
   RESPONSIVE BREAKPOINTS
========================= */

/* Desktop & Large Laptop: 4 columns */
@media (min-width: 1441px) {
  .blog-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Tablets & Small Laptops (including Samsung Tab S9): 2 columns */
@media (max-width: 1440px) and (min-width: 601px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Phones: 1 column */
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr !important;
  }
  
  .container {
    padding: 2rem 1rem;
  }
}
/* ====== COOKIE CONSENT BANNER ====== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  color: var(--text);
  padding: 1.5rem;
  border-top: 3px solid var(--accent);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cookie-consent-text h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.cookie-consent-text p {
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.8;
  color: var(--text);
}

.cookie-consent-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: fit-content;
}

.cookie-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.cookie-btn.accept-btn {
  background: var(--accent);
  color: white;
}

.cookie-btn.accept-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.cookie-btn.reject-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.cookie-btn.reject-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.cookie-btn.preference-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.cookie-btn.preference-btn:hover {
  background: rgba(37, 99, 235, 0.05);
}

body.high-contrast .cookie-btn.reject-btn {
  border-color: var(--accent);
  color: var(--accent);
}

body.high-contrast .cookie-btn.reject-btn:hover {
  background: rgba(255, 255, 0, 0.1);
}

/* COOKIE MODAL */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.cookie-modal.show {
  display: flex;
}

.cookie-modal-content {
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--accent);
  overflow: hidden;
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--accent);
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--accent);
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  opacity: 1;
}

.cookie-modal-body {
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.cookie-category {
  margin-bottom: 1.5rem;
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.large-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
  cursor: pointer;
  accent-color: var(--accent);
}

.large-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-category h4 {
  margin: 0 0 0.3rem 0;
  font-size: 1rem;
  color: var(--text);
}

.category-desc {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.4;
  color: var(--text);
}

.cookie-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--accent);
  display: flex;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    text-align: center;
  }

  .cookie-modal-content {
    width: 95%;
  }
}

@media (max-width: 600px) {
  .share-buttons {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .share-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    gap: 0.35rem;
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .trending-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .trending-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================
   AUTHOR PAGE STYLES
============================ */

.comment-subscribe {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border: 2px dashed var(--accent);
  border-radius: 0.5rem;
}

body.dark .comment-subscribe {
  background: rgba(37, 99, 235, 0.1);
}

.subscribe-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
}

.subscribe-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.subscribe-checkbox span {
  line-height: 1;
}

.notification-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.notification-toast.show {
  opacity: 1;
  transform: translateY(0);
}

body.dark .notification-toast {
  background: var(--accent-strong);
}

.author-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  padding: 4rem 0 3rem;
  margin-bottom: 3rem;
}

body.dark .author-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.author-profile {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.author-avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.3);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar svg {
  color: rgba(255, 255, 255, 0.8);
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
}

.author-bio {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  opacity: 0.95;
  max-width: 600px;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.author-stat strong {
  font-weight: 700;
  font-size: 1.2rem;
}

.author-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.author-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.author-posts {
  padding: 2rem 0 4rem;
}

.author-posts .section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

.author-posts .posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-posts {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text);
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .author-hero {
    padding: 3rem 0 2rem;
  }

  .author-profile {
    flex-direction: column;
    text-align: center;
  }

  .author-name {
    font-size: 2rem;
  }

  .author-bio {
    max-width: 100%;
  }

  .author-meta {
    justify-content: center;
  }

  .author-links {
    justify-content: center;
  }

  .author-posts .section-title {
    font-size: 1.5rem;
  }

  .author-posts .posts-grid {
    grid-template-columns: 1fr;
  }
}
/* ===========================
   PHASE 4: LAZY LOADING
=========================== */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img.lazy-loaded {
  opacity: 1;
}

/* Fallback blur effect while loading */
img[data-src]:not(.lazy-loaded) {
  filter: blur(10px);
  background: var(--bg-surface);
}
