/* =====================================================
   DEVXP BLOG - MERGED STYLES
   - Theme variables
   - Blog listing (hero, filters, grid)
   - Kept article styles intact (unchanged behavior)
   ===================================================== */

/* =========================
   THEME VARIABLES
   (use exactly what you supplied)
   ========================= */
:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-hero2: linear-gradient(135deg, #bee948 0%, #64e258 100%);
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #26272b;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #eef2f5;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #ebecf7;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* ================
   GLOBAL LAYOUT
   ================ */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-secondary);
  background: var(--bg-primary);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Page title area (kept compatible with your markup) */
.page-header {
  padding: var(--spacing-2xl) 0;
  background: transparent;
}
.page-header-content .breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  margin: 0.35rem 0 0.6rem;
  color: var(--text-primary);
}
.page-description {
  margin: 0;
  color: var(--text-muted);
}

/* =========================
   HERO + FILTER BAR (NEW)
   ========================= */
.hero-hero {
  padding: var(--spacing-2xl) 0;
  background: var(--gradient-hero);
  color: var(--text-white);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--spacing-xl);
  align-items: center;
}
.hero-panel {
  padding: var(--spacing-xl);
  margin: 5%;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}
.hero-panel h1 {
  margin: 0 0 0.5rem 0;
  color: var(--text-white);
  font-size: 2.25rem;
  line-height: 1.08;
}
.hero-panel p { color: rgba(255,255,255,0.9); margin: 0 0 1rem 0; }

/* small stats under hero */
.hero-stats {
  display:flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}
.hero-stat {
  display:flex;
  gap: 0.6rem;
  align-items:center;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.95);
}

/* hero image / illustration area */
.hero-visual {
  display:flex;
  align-items:center;
  justify-content:center;
}
.hero-visual .card {
  width:100%;
  max-width:320px;
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-xl);
  text-align:center;
}

/* FILTER BAR (card that sits below hero, overlaps visually) */
.filter-card {
  margin-top: calc(var(--spacing-xs));
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-md);
  display:flex;
  gap: var(--spacing-md);
  align-items:center;
  justify-content: space-between;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

/* search */
.filter-left {
  display:flex;
  gap: var(--spacing-md);
  align-items:center;
  flex: 1 1 auto;
}
.filter-search {
  display:flex;
  align-items:center;
  gap: 0.6rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  min-width: 260px;
  border: 1px solid rgba(15,23,42,0.04);
}
.filter-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  width:100%;
}
.filter-controls {
  display:flex;
  gap: 0.6rem;
  align-items:center;
}

/* category pills / sort */
.pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid rgba(15,23,42,0.06);
  color: var(--text-primary);
}
.pill.active {
  background: var(--gradient-primary);
  color: var(--text-white);
  border: none;
  box-shadow: var(--shadow-sm);
}

/* view toggle */
.view-toggle {
  display:flex;
  gap: 0.5rem;
  align-items:center;
}
.view-toggle button {
  background: transparent;
  border: 1px solid rgba(15,23,42,0.06);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor:pointer;
}
.view-toggle button.active {
  background: var(--primary-dark);
  color: var(--text-white);
  border-color: var(--primary-dark);
}

/* ===========================
   FEATURED POST (kept visually refined)
   =========================== */
.featured-post-section {
    padding: var(--spacing-xl) 0;
    background: transparent;
}
.featured-post {
    display: grid;
    grid-template-columns: 1fr 1.9fr;
    gap: var(--spacing-xl);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    text-decoration: none;
    border: 1px solid rgba(15, 23, 42, 0.04);
}
.featured-post:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}
.featured-post-image {
    position: relative;
    background: var(--gradient-primary);
    padding: var(--spacing-2xl);
    display:flex;
    align-items:center;
    justify-content:center;
}
.featured-post-image .featured-icon { font-size:5rem; color:var(--text-white); }
.featured-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: var(--accent-color);
    color: white;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}
.featured-post-content { padding: var(--spacing-lg); }
.post-category {
    display:inline-block;
    background: rgba(99,102,241,0.08);
    color: var(--primary-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}
.featured-post-content h3 { color: var(--text-primary); margin: 0.25rem 0 0.6rem; }

/* ===========================
   BLOG GRID (redesigned but compatible)
   =========================== */
.blog-section {
  padding: var(--spacing-2xl) 0;
  background: transparent;
}

/* grid layout: 3 columns on large, 2 on medium, 1 on small */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
}

/* blog card - keep original structure but enhance visuals */
.blog-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid rgba(15,23,42,0.04);
}
.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}
.blog-link { color: inherit; text-decoration:none; display:flex; flex-direction:column; height:100%; }

/* image/top area */
.blog-image {
  position: relative;
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(99,102,241,0.85), rgba(139,92,246,0.85));
}
.blog-icon { font-size: 3.5rem; color: white; }
.blog-category {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: rgba(255,255,255,0.95);
  color: var(--primary-dark);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight:600;
  font-size:0.85rem;
}

/* content */
.blog-content {
  padding: var(--spacing-lg);
  display:flex;
  flex-direction:column;
  gap: 0.6rem;
  flex:1 1 auto;
}
.blog-title {
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.35;
  margin:0;
}
.blog-excerpt {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0.15rem 0 0.6rem;
  flex:1 1 auto;
}
.blog-meta {
  display:flex;
  gap: var(--spacing-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  align-items:center;
}

/* list / compact layout modifier */
.blog-grid.list-view .blog-card {
  flex-direction: row;
  gap: 0;
}
.blog-grid.list-view .blog-image {
  min-width: 180px;
  min-height: 140px;
  flex: 0 0 180px;
  border-radius: 0;
}
.blog-grid.list-view .blog-content { padding: var(--spacing-md); }

/* =========================
   RESOURCES + FOOTER
   ========================= */
.resources-section {
  padding: var(--spacing-2xl) 0;
  background: var(--bg-tertiary);
}
.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
}
.resource-card {
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15,23,42,0.04);
}

/* =========================
   KEEP ARTICLE PAGE STYLES (UNCHANGED)
   ========================= */

/* The following section is copied from your "BLOG.CSS - FINAL RESPONSIVE VERSION"
   to ensure article pages keep exact styles and behavior. Do NOT remove. */

.article-hero {
  padding: 5rem 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.5));
}

.article-hero-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.hero-left { padding-right: 1rem; }
.hero-right { padding-left: 1rem; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.breadcrumb a { color: var(--primary-color); text-decoration: none; }
.breadcrumb i { color: var(--text-muted); }

/* ARTICLE HEADER */
.article-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 2% 0 3%;
}

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tags .tag {
  margin-left: 0.4rem;
  background: var(--bg-primary);
  border: 1px solid var(--bg-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--primary-dark);
}

/* Lead paragraph */
.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  background: linear-gradient(90deg, rgba(99,102,241,0.03), rgba(16,185,129,0.02));
  padding: 1rem;
  border-radius: 0.6rem;
  margin-bottom: 1.5rem;
}

/* ARTICLE BODY */
.article-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.content {
  width: 100%;
  background: transparent;
}

.sidebar {
  width: 100%;
  position: relative;
}

/* Typography */
.content h2 {
  font-size: 1.6rem;
  margin-top: 1.2rem;
  color: var(--text-primary);
}
.content h3 {
  font-size: 1.25rem;
  margin-top: 1rem;
  color: var(--text-primary);
}
.content p, .content li {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.content ul, .content ol { margin-left: 1.25rem; }

/* Code blocks */
pre {
  background: #0b1220;
  color: #ffffff;
  padding: 1rem;
  border-radius: 0.6rem;
  overflow-x: auto;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.95rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-lg);
}
code {
  background: rgba(62, 62, 92, 0.25);
  backdrop-filter: blur(2px);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  color: #ffffff;
  font-family: "Fira Code", monospace;
}

/* SIDEBAR ELEMENTS */
.toc-card {
  position: sticky;
  top: 96px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.toc-title { font-weight: 600; margin-bottom: 0.6rem; color: var(--text-primary); }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0.45rem 0; }
.toc-list a { color: var(--primary-color); text-decoration: none; font-size: 0.95rem; }
.toc-list a:hover { text-decoration: underline; }

.related, .cta-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.related-link {
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: var(--text-primary);
}
.related-link:last-child { border-bottom: none; }
.related-link .excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

/* FOOTER TAGS */
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 1.2rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.post-tags .tag {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1100px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .resources-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .filter-card { flex-direction: column; align-items: stretch; gap: var(--spacing-sm); }
}

@media (max-width: 720px) {
  .blog-grid { grid-template-columns: 1fr; }
  .article-body { grid-template-columns: 1fr; }
  .article-hero-inner { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .hero-panel h1 { font-size: 1.5rem; }
  .hero-panel p { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Accessibility focus */
a:focus, button:focus, input:focus {
  outline: 3px solid rgba(99,102,241,0.18);
  outline-offset: 2px;
  border-radius: 6px;
}
