/* =====================================================================
   FARHAN'S ENGINEERING BLOG — MODERN EDITORIAL & READABILITY STYLESHEET
   Researched for Human Eye Comfort, Optimal Ergonomics & UX Excellence
   ===================================================================== */

:root {
  --blog-bg: #07090e;
  --blog-bg-surface: #0e121d;
  --blog-bg-card: #121826;
  --blog-bg-card-hover: #161e30;
  --blog-border: rgba(255, 255, 255, 0.08);
  --blog-border-hover: rgba(56, 189, 248, 0.35);

  /* Human Eye Ergonomics: Slate Palette reduces optical fatigue */
  --blog-text-body: #cbd5e1;       /* Slate 300 - soft high legibility */
  --blog-text-bright: #f8fafc;     /* Slate 50 - headings & primary focus */
  --blog-text-muted: #94a3b8;      /* Slate 400 - meta & secondary details */
  --blog-text-dim: #64748b;        /* Slate 500 - minor stamps */

  /* Vibrant Accents */
  --blog-accent-blue: #38bdf8;     /* Sky 400 */
  --blog-accent-indigo: #818cf8;   /* Indigo 400 */
  --blog-accent-purple: #c084fc;   /* Purple 400 */
  --blog-accent-emerald: #34d399;  /* Emerald 400 */
  --blog-accent-amber: #fbbf24;    /* Amber 400 */

  --blog-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --blog-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --blog-radius-lg: 16px;
  --blog-radius-md: 12px;
  --blog-radius-sm: 8px;
  --blog-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
   READING PROGRESS BAR (Fixed at viewport top)
   ===================================================================== */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
  z-index: 10000;
  transition: width 0.08s ease-out;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* =====================================================================
   BASE & RESET
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: hidden;
  max-width: 100vw;
}

body.blog-body {
  margin: 0;
  padding: 0;
  background-color: var(--blog-bg);
  color: var(--blog-text-body);
  font-family: var(--blog-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

img, svg, video {
  max-width: 100%;
}

/* Ambient glow background */
.blog-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(192, 132, 252, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(52, 211, 153, 0.04) 0%, transparent 45%);
}

.blog-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* =====================================================================
   HEADER & NAVBAR (Consistent with Portfolio)
   ===================================================================== */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--blog-border);
  transition: var(--blog-transition);
}

.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.blog-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-decoration: none;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blog-accent-blue);
  box-shadow: 0 0 10px var(--blog-accent-blue);
}

.blog-badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: var(--blog-accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-nav-link {
  color: var(--blog-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--blog-transition);
}

.blog-nav-link:hover,
.blog-nav-link.active {
  color: #ffffff;
}

.blog-hire-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--blog-transition);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.blog-hire-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* =====================================================================
   BLOG HERO & LIST INTRO
   ===================================================================== */
.blog-hero {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--blog-accent-blue);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.blog-hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 1rem;
  line-height: 1.15;
}

.blog-hero-title .highlight {
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero-desc {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  font-size: 1.1rem;
  color: var(--blog-text-muted);
  line-height: 1.65;
}

/* Search & Filter Toolbar */
.blog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto 3rem;
}

.blog-search-box {
  position: relative;
  width: 100%;
}

.blog-search-input {
  width: 100%;
  padding: 0.9rem 1.25rem 0.9rem 3rem;
  background: var(--blog-bg-surface);
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--blog-transition);
  outline: none;
  box-sizing: border-box;
}

.blog-search-input:focus {
  border-color: var(--blog-accent-blue);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  background: var(--blog-bg-card);
}

.blog-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blog-text-dim);
  pointer-events: none;
}

/* Category Filter Pills */
.blog-categories {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-pill {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: var(--blog-bg-surface);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--blog-transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.category-pill:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.category-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--blog-accent-blue);
  color: var(--blog-accent-blue);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

/* =====================================================================
   FEATURED HERO POST
   ===================================================================== */
.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.25rem;
  background: linear-gradient(135deg, rgba(19, 25, 42, 0.8) 0%, rgba(14, 18, 29, 0.9) 100%);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-lg);
  padding: 1.75rem;
  margin-bottom: 3.5rem;
  transition: var(--blog-transition);
  position: relative;
  overflow: hidden;
}

.featured-card:hover {
  border-color: var(--blog-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.1);
}

.featured-media {
  position: relative;
  border-radius: var(--blog-radius-md);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: #0f131a;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.featured-card:hover .featured-img {
  transform: scale(1.04);
}

.featured-badge-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--blog-accent-amber);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.5px;
}

.featured-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  font-size: 0.82rem;
  color: var(--blog-text-dim);
  margin-bottom: 0.85rem;
}

.post-cat-tag {
  --cat-color: var(--blog-accent-blue);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-block;
  color: var(--cat-color);
  background: color-mix(in srgb, var(--cat-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color) 25%, transparent);
}

.featured-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.featured-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--blog-transition);
}

.featured-title a:hover {
  color: var(--blog-accent-blue);
}

.featured-excerpt {
  font-size: 1rem;
  color: var(--blog-text-muted);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.author-meta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--blog-border);
  padding-top: 1rem;
  margin-top: auto;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.author-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--blog-border);
}

.author-name-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.author-role-text {
  font-size: 0.75rem;
  color: var(--blog-text-dim);
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--blog-accent-blue);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--blog-transition);
}

.read-more-link:hover {
  gap: 0.65rem;
  color: #ffffff;
}

/* =====================================================================
   BLOG GRID (CARDS)
   ===================================================================== */
.blog-grid-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.blog-card {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--blog-transition);
}

.blog-card:hover {
  border-color: var(--blog-border-hover);
  transform: translateY(-4px);
  background: var(--blog-bg-card-hover);
  box-shadow: 0 16px 35px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.08);
}

.card-media-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background: #0f131a;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.blog-card:hover .card-img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  margin: 0.65rem 0 0.75rem;
  letter-spacing: -0.015em;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--blog-transition);
}

.card-title a:hover {
  color: var(--blog-accent-blue);
}

.card-excerpt {
  font-size: 0.92rem;
  color: var(--blog-text-muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--blog-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Empty State */
.blog-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-lg);
  margin-bottom: 4rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* =====================================================================
   BLOG DETAIL PAGE (EDITORIAL READING & TABLE OF CONTENTS)
   ===================================================================== */
.article-page {
  padding: 3.5rem 0 5rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--blog-text-dim);
  margin-bottom: 2rem;
  word-break: break-word;
}

.breadcrumb-nav a {
  color: var(--blog-text-muted);
  text-decoration: none;
  transition: var(--blog-transition);
}

.breadcrumb-nav a:hover {
  color: var(--blog-accent-blue);
}

.article-header {
  max-width: 860px;
  margin: 0 auto 2.75rem;
  text-align: left;
  scroll-margin-top: 110px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--blog-text-bright);
  margin: 1rem 0 1.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
  scroll-margin-top: 110px;
}

.article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--blog-border);
  border-bottom: 1px solid var(--blog-border);
}

.article-hero-cover {
  max-width: 1040px;
  margin: 0 auto 3.5rem;
  border-radius: var(--blog-radius-lg);
  overflow: hidden;
  border: 1px solid var(--blog-border);
  background: #0f131a;
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.7);
}

.article-hero-cover img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

/* =====================================================================
   TWO-COLUMN EDITORIAL LAYOUT (PROSE + STICKY TOC)
   ===================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3.5rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Prose Reading Aesthetics */
.article-prose {
  font-size: 1.125rem;            /* 18px */
  line-height: 1.85;              /* Generous, anti-fatigue line spacing */
  color: var(--blog-text-body);
  max-width: 720px;               /* 65-75 chars per line: Golden reading ergonomic ratio */
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--blog-radius-md);
  display: block;
  margin: 1.75rem 0;
}

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
}

.article-prose th,
.article-prose td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--blog-border);
  font-size: 0.9rem;
}

.article-prose p {
  margin-top: 0;
  margin-bottom: 1.75rem;
}

.article-prose strong {
  color: #ffffff;
  font-weight: 700;
}

.article-prose a {
  color: var(--blog-accent-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: var(--blog-transition);
}

.article-prose a:hover {
  color: #ffffff;
}

/* Headings with smooth scroll-margin for sticky header clearance */
.article-prose h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--blog-text-bright);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 3.25rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 100px;
  word-break: break-word;
}

.article-prose h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.015em;
  line-height: 1.4;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  scroll-margin-top: 100px;
  word-break: break-word;
}

.article-prose ul,
.article-prose ol {
  margin-top: 0;
  margin-bottom: 1.75rem;
  padding-left: 1.6rem;
}

.article-prose li {
  margin-bottom: 0.65rem;
  line-height: 1.75;
}

/* Code Blocks & Inlines */
.article-prose code {
  font-family: var(--blog-font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-prose pre {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--blog-radius-md);
  padding: 2.25rem 1.25rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  box-sizing: border-box;
}

.article-prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #38bdf8;
  display: block;
  word-break: normal;
  overflow-wrap: normal;
  white-space: pre;
}

/* Blockquotes / Callout Highlights */
.article-prose blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.6rem;
  border-left: 3px solid var(--blog-accent-blue);
  background: rgba(56, 189, 248, 0.05);
  border-radius: 0 var(--blog-radius-sm) var(--blog-radius-sm) 0;
  color: #e2e8f0;
  font-style: normal;
}

.article-prose blockquote p:last-child {
  margin-bottom: 0;
}

/* =====================================================================
   BLOG YOUTUBE VIDEO SHOWCASE COMPONENT
   Responsive 16:9, Direct Watch Button, Fallback for Blocked Embeds
   ===================================================================== */
.blog-video-card {
  margin: 0 0 2.5rem 0;
  background: linear-gradient(145deg, #0d131f 0%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--blog-radius-lg);
  padding: 1.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-video-card:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.12), 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.blog-video-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.video-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.video-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.video-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ff4e4e;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.22);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  width: fit-content;
}

.video-live-pill .yt-badge-icon {
  flex-shrink: 0;
  color: #ff0000;
}

.video-card-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

/* Primary "Watch on YouTube" Button */
.yt-watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #ff0000;
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  text-decoration: none !important;
  transition: all 0.22s ease-in-out;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.35);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.yt-watch-btn:hover {
  background: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.55);
}

.yt-watch-btn:active {
  transform: translateY(0);
}

.yt-watch-btn .yt-play-icon {
  flex-shrink: 0;
}

.yt-watch-btn .yt-external-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.yt-watch-btn:hover .yt-external-icon {
  transform: translate(2px, -2px);
}

/* 16:9 Responsive Video Container */
.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--blog-radius-md);
  overflow: hidden;
  background: #000000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 1;
}

@supports not (aspect-ratio: 16 / 9) {
  .video-player-container {
    height: 0;
    padding-top: 56.25%;
  }
}

.video-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Fallback notice banner beneath video player */
.video-fallback-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--blog-radius-sm);
  position: relative;
  z-index: 1;
}

.video-fallback-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.video-fallback-info .video-info-icon {
  color: #fbbf24;
  flex-shrink: 0;
}

.video-fallback-text {
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  line-height: 1.4;
}

.yt-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #38bdf8 !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.yt-fallback-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc !important;
  transform: translateX(2px);
}

/* Mobile & Tablet Responsiveness for Video Showcase */
@media (max-width: 768px) {
  .blog-video-card {
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: var(--blog-radius-md);
  }

  .video-card-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .video-card-title {
    font-size: 1.05rem;
  }

  .yt-watch-btn {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .video-fallback-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    text-align: left;
    padding: 0.8rem;
  }

  .yt-fallback-btn {
    justify-content: center;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .blog-video-card {
    padding: 0.85rem;
    margin-bottom: 1.75rem;
  }

  .video-live-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .video-card-title {
    font-size: 0.98rem;
  }

  .video-fallback-text {
    font-size: 0.78rem;
  }
}

/* Bottom Author CTA */
.article-author-cta {
  margin-top: 3.5rem;
  padding: 2rem;
  background: var(--blog-bg-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-md);
  min-width: 0;
}

.article-author-cta-inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.article-author-cta-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blog-accent-blue);
  flex-shrink: 0;
}

.article-author-cta-info {
  flex: 1;
  min-width: 0;
}

.article-author-cta-info h3 {
  margin: 0 0 0.35rem;
  color: #ffffff;
  font-size: 1.15rem;
}

.article-author-cta-info p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--blog-text-muted);
  line-height: 1.6;
}

/* Blog Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

/* Related articles grid on detail page */
.related-blog-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* =====================================================================
   STICKY TABLE OF CONTENTS & ACTIVE SCROLLSPY HIGHLIGHT
   ===================================================================== */
.article-sidebar {
  position: sticky;
  top: 95px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.toc-card {
  background: var(--blog-bg-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-md);
  padding: 1.35rem;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--blog-border);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-item {
  position: relative;
}

.toc-link {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--blog-text-muted);
  text-decoration: none;
  padding: 0.4rem 0.65rem 0.4rem 0.85rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: var(--blog-transition);
}

.toc-link.h3-link {
  padding-left: 1.6rem;
  font-size: 0.82rem;
}

.toc-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

/* ACTIVE SCROLLSPY READING HIGHLIGHT */
.toc-link.active {
  color: var(--blog-accent-blue) !important;
  font-weight: 600;
  border-left-color: var(--blog-accent-blue);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 2px 0 0 var(--blog-accent-blue);
}

/* Sidebar Author Promo Card */
.sidebar-cta-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(14, 18, 29, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--blog-radius-md);
  padding: 1.35rem;
}

.sidebar-cta-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.sidebar-cta-card p {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
}

/* Share Buttons */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blog-bg-surface);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: var(--blog-transition);
}

.share-btn:hover {
  color: #ffffff;
  border-color: var(--blog-accent-blue);
  background: rgba(56, 189, 248, 0.15);
}

/* Toast message for link copied */
#copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 10000;
  animation: fadeInOut 2.5s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* =====================================================================
   RESPONSIVE DESIGN (Tablets & Mobile Screens)
   ===================================================================== */
@media (max-width: 1024px) {
  .featured-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .article-sidebar {
    position: static;
    max-height: none;
    margin-top: 2rem;
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Navigation & Container */
  .blog-container {
    padding: 0 1.15rem;
  }

  .blog-nav {
    height: 58px;
  }

  .blog-brand {
    font-size: 1.12rem;
    gap: 0.45rem;
  }

  .blog-badge-tag {
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
  }

  .blog-nav-menu {
    display: none;
  }

  .blog-hire-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
  }

  /* Blog List Hero & Toolbar */
  .blog-hero {
    padding: 2.75rem 0 1.5rem;
  }

  .blog-hero-title {
    font-size: 1.95rem;
    line-height: 1.22;
  }

  .blog-hero-desc {
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
  }

  .blog-toolbar {
    margin-bottom: 2rem;
    gap: 1rem;
  }

  .blog-search-input {
    font-size: 0.88rem;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
  }

  .blog-search-icon {
    left: 0.9rem;
    width: 16px;
    height: 16px;
  }

  .category-pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }

  /* Featured Card */
  .featured-card {
    padding: 1.25rem;
    gap: 1.25rem;
    margin-bottom: 2.25rem;
    border-radius: var(--blog-radius-md);
  }

  .featured-title {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 0.65rem;
  }

  .featured-excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.15rem;
  }

  .author-meta-box {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
  }

  /* Blog Grid & Related Grid */
  .blog-grid,
  .related-blog-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
  }

  .blog-grid-section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .card-content {
    padding: 1.15rem;
  }

  .card-title {
    font-size: 1.15rem;
    line-height: 1.35;
  }

  .card-excerpt {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  /* Article Detail Header & Content */
  .article-page {
    padding: 1.75rem 0 3.5rem;
  }

  .breadcrumb-nav {
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
  }

  .article-title {
    font-size: 1.75rem;
    line-height: 1.25;
    margin: 0.5rem 0 1rem;
  }

  .article-author-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 0;
  }

  .share-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .article-hero-cover {
    margin: 0 auto 1.75rem;
    border-radius: var(--blog-radius-md);
  }

  .article-hero-cover img {
    max-height: 280px;
  }

  .article-prose {
    font-size: 1.02rem;
    line-height: 1.75;
  }

  .article-prose h2 {
    font-size: 1.45rem;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.4rem;
  }

  .article-prose h3 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
    margin-bottom: 0.65rem;
  }

  .article-prose pre {
    padding: 2.2rem 1rem 1rem;
    margin: 1.5rem 0;
    border-radius: var(--blog-radius-sm);
  }

  .article-prose pre code {
    font-size: 0.82rem;
  }

  .article-prose blockquote {
    padding: 0.95rem 1.15rem;
    margin: 1.5rem 0;
  }

  /* Bottom Author Box & Toast */
  .article-author-cta {
    padding: 1.25rem;
    margin-top: 2.5rem;
  }

  .article-author-cta-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .article-author-cta-avatar {
    width: 48px;
    height: 48px;
  }

  #copy-toast {
    bottom: 1.5rem;
    right: 50%;
    transform: translateX(50%);
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .blog-container {
    padding: 0 1rem;
  }

  .blog-hero-title {
    font-size: 1.6rem;
  }

  .featured-card {
    padding: 1rem;
  }

  .author-meta-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .read-more-link {
    width: 100%;
    justify-content: flex-end;
  }

  .article-title {
    font-size: 1.45rem;
  }

  .article-prose {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .blog-pagination .category-pill {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }
}
