/* Hero Section */
.blog-hero {
    position: relative;
    height: clamp(300px, 50vh, 500px);
    overflow: hidden;
}

.blog-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            var(--primary),
            transparent,
            transparent);
            pointer-events: none;
}

/* Blog Content Section */
.blog-section {
    padding: 4rem 1.5rem;
}

.blog-container {
    max-width: 1400px;
    margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
    .blog-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    }
}

/* Blog Header */
.blog-header {
    margin-bottom: 2rem;
}

.blog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-meta-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

/* Share Buttons */
.blog-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.blog-share-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
}

.share-btn {
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
}

.share-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Blog Content */
.blog-content {
    margin: 3rem 0;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--muted);
}

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content h2 {
    color: var(--white);
    font-size: 1.75rem;
    margin: 2rem 0 1rem;
}

.blog-content h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.blog-content ul,
.blog-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

/* Tags Section */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.blog-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.25rem;
    color: var(--accent);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.blog-tag:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
}

/* Related Articles */
.related-section {
    margin-top: 3rem;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.related-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.related-card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.related-card-content {
    padding: 1rem;
}

.related-card-title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.3s;
}

.related-card:hover .related-card-title {
    color: var(--accent);
}

.related-card-date {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px; /* adjust based on header height */
    height: fit-content;
}

.sidebar-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

/* Author Card */
.author-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

.author-details h4 {
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.author-details p {
    color: var(--muted);
    font-size: 0.75rem;
}

.author-bio {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Quick Links */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--white);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.quick-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent);
}

.quick-link.primary {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.quick-link.primary:hover {
    background: rgba(59, 130, 246, 0.9);
}

.quick-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .blog-hero {
        height: 300px;
    }

    .blog-title {
        font-size: 1.875rem;
    }

    .blog-section {
        padding: 2rem 1rem;
    }

    .blog-sidebar {
        position: static;
    }

    .blog-content {
        margin: 2rem 0;
    }

    .blog-grid {
        gap: 1rem;
    }
}

/* ======================================================
   BLOG CONTENT TYPOGRAPHY
   Scoped only to blog content
   ====================================================== */

.blog-content {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.75;
  color: #e5e7eb;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  color: #f8fafc; /* slate-50 */
}

/* ----------------------
   Headings
   ---------------------- */

.blog-content h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  line-height: 1.2;
  margin: 2.5rem 0 1.5rem;
  font-weight: 700;
}

.blog-content h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.875rem);
  line-height: 1.3;
  margin: 2.5rem 0 1.25rem;
  font-weight: 600;
}

.blog-content h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  line-height: 1.4;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

/* ----------------------
   Paragraphs & Text
   ---------------------- */

.blog-content p {
  margin: 0 0 1.25rem;
}

.blog-content strong {
  font-weight: 600;
}

/* ----------------------
   Lists
   ---------------------- */

.blog-content ul,
.blog-content ol {
  padding-left: 1.25rem;
  margin: 1rem 0 1.5rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

/* ----------------------
   Links
   ---------------------- */

.blog-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content a:hover {
  text-decoration-thickness: 2px;
}

/* ----------------------
   FAQ spacing polish
   ---------------------- */

.blog-content h2 + h3 {
  margin-top: 1.5rem;
}

/* ======================================================
   Mobile Readability Enhancements
   ====================================================== */

@media (max-width: 480px) {
  .blog-content {
    line-height: 1.8;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--secondary);
  border: 1px solid var(--gray);
}

th, td {
  padding: 14px 18px;
  text-align: left;
  border: 1px solid var(--gray);
  color: var(--white);
}

.blog-table-wrapper {
  max-width: 90vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 30px 0;
}

.blog-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.blog-table-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.blog-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.blog-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

/* Firefox scrollbar */
.blog-table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(15, 23, 42, 0.5);
}

thead {
  background-color: rgba(59, 130, 246, 0.15); /* subtle accent */
}

th {
  color: var(--accent);
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.08);
  transition: background 0.2s ease;
}

/* ──────────────────────────────────────────────────────
   BLOG HERO CAROUSEL
   Only active when .blog-hero--carousel is present.
   The base .blog-hero styles (height, overflow) still apply.
   ────────────────────────────────────────────────────── */

.blog-hero--carousel {
  overflow: hidden;   /* clips the peek slides at the hero boundary */
  position: relative;
}

/* KEY FIX: swiper must be overflow:visible so peek slides bleed out.
   The parent .blog-hero--carousel clips them at the right boundary. */
.blog-hero-swiper {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Each slide */
.blog-hero-slide {
  position: relative;
  height: clamp(300px, 50vh, 500px);
  border-radius: 0.5rem;
  overflow: hidden;
}

.blog-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Optional caption overlay at bottom of each slide */
.blog-hero-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Pagination dots */
.blog-hero-pagination {
  position: absolute;
  bottom: 16px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10;           
  display: flex;
  gap: 6px;
  width:auto !important;
}

.blog-hero-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  opacity: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.blog-hero-pagination .swiper-pagination-bullet-active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ──────────────────────────────────────────────────────
   BLOG VIDEO PLAYER
   Injected via [VIDEO] placeholder in html_content.
   ────────────────────────────────────────────────────── */

.blog-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
  margin: 2rem 0;
  cursor: pointer;
}

.blog-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Play button overlay */
.blog-video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  cursor: pointer;
  transition: background 0.25s;
  z-index: 2;
}

.blog-video-play-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.blog-video-play-btn svg {
  width: 64px;
  height: 64px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s;
}

.blog-video-play-btn:hover svg {
  transform: scale(1.1);
}

/* Hide play button once video is playing */
.blog-video-wrapper.is-playing .blog-video-play-btn {
  display: none;
}

/* ──────────────────────────────────────────────────────
   RESPONSIVE OVERRIDES
   ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .blog-video-play-btn svg {
    width: 48px;
    height: 48px;
  }
}