/* ── Blog Page ──────────────────────────────────────────────────────────── */

/* ── Hero ──────────────────────────────────────────────────────────────── */
.blog-hero {
  padding: 120px 0 56px;
  /* background removed L-5: visual-bg system now provides cinematic dark backdrop */
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  top: -10%; left: 50%; transform: translateX(-50%);
  width: 700px; height: 350px;
  background: radial-gradient(ellipse, rgba(0,174,239,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.15;
}
.blog-hero p {
  font-size: 17px;
  color: rgba(255,255,255,0.5);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Tag Filter ─────────────────────────────────────────────────────────── */
.tag-filter-wrapper {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: rgba(5, 16, 36, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(41, 151, 255, 0.1);
  padding: 10px 0;
}
#tag-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 4px;
  scrollbar-width: none;
}
#tag-filter::-webkit-scrollbar { display: none; }
.tag-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tag-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(0,174,239,0.06);
}
.tag-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(0,174,239,0.3);
}

/* ── Blog Grid ────────────────────────────────────────────────────────────────────── */
#blog-grid {
  padding: 40px 0 60px;
  /* H-1: deep-links clear nav (64px) + sticky tag bar (~56px) */
  scroll-margin-top: calc(var(--nav-height, 64px) + 56px);
}

/* Two equal columns — cards stacked vertically inside each */
.blog-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.blog-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Blog Card ──────────────────────────────────────────────────────────── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  height: 100%;
}
.blog-card:hover {
  border-color: rgba(41, 151, 255, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* Thumbnail */
.blog-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111b2e;
  overflow: hidden;
  flex-shrink: 0;
}
.blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card__thumb img {
  transform: scale(1.05);
}
.blog-card__thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, #0d1b33, #111827);
}

/* Card body */
.blog-card__body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Meta row */
.blog-card__meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blog-card__tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-primary);
  background: rgba(0,174,239,0.1);
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}
.blog-card__date {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* Title */
.blog-card__title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Excerpt */
.blog-card__excerpt {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read more link at bottom */
.blog-card__footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.blog-card__read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}
.blog-card:hover .blog-card__read-more {
  gap: 10px;
}

/* ── Featured Card (Full-width top card) ─────────────────────────────────── */
.blog-card--featured .blog-card__thumb {
  aspect-ratio: 21 / 9;
}
@media (max-width: 600px) {
  .blog-card--featured .blog-card__thumb { aspect-ratio: 16 / 9; }
}
.blog-card--featured .blog-card__body {
  padding: 24px 28px 28px;
}
.blog-card--featured .blog-card__title {
  font-size: clamp(20px, 3vw, 28px);
  -webkit-line-clamp: 2;
}
.blog-card--featured .blog-card__excerpt {
  -webkit-line-clamp: 3;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 80px 24px;
}
.blog-empty__icon { font-size: 56px; margin-bottom: 16px; }
.blog-empty__title { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: rgba(255,255,255,0.6); }
.blog-empty__text { font-size: 15px; color: rgba(255,255,255,0.35); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 0 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 16px;
}
.page-btn {
  min-width: 38px; height: 38px;
  padding: 0 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) {
  border-color: rgba(41,151,255,0.4);
  color: var(--color-primary);
  background: rgba(41,151,255,0.06);
}
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(0,174,239,0.3);
}
.page-btn--arrow {
  font-size: 18px;
  color: rgba(255,255,255,0.4);
}
.page-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.page-ellipsis {
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   BLOG DETAIL PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Article Hero ────────────────────────────────────────────────────────── */
.blog-detail-hero {
  padding: 100px 0 0;
  background: var(--color-bg-dark);
}
.blog-detail-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: gap 0.2s;
}
.blog-detail-hero__back:hover { gap: 10px; }

.blog-detail-hero__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.blog-detail-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-primary);
  background: rgba(0,174,239,0.1);
  border: 1px solid rgba(0,174,239,0.2);
  padding: 4px 12px;
  border-radius: 6px;
}

.blog-detail-hero__title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: #fff;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 900px;
  margin-bottom: 16px;
}
/* Subtitle / excerpt below the H1 */
.blog-detail-hero__subtitle {
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  max-width: 720px;
  margin-bottom: 24px;
}
.blog-detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.blog-detail-hero__meta-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
}

/* Cover image — with side margin so it doesn't touch screen edges */
.blog-detail-hero__cover {
  width: calc(100% - 48px); /* 24px breathing room each side */
  margin: 0 auto 0;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: #111;
  border-radius: 16px;
}
@media (max-width: 768px) {
  .blog-detail-hero__cover {
    width: calc(100% - 32px);
    aspect-ratio: 16 / 9;
    border-radius: 12px;
  }
}
.blog-detail-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Article Layout: body + sidebar ────────────────────────────────────── */
.blog-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 48px 100px;  /* 48px side padding so content doesn't touch edges */
}
@media (max-width: 1200px) {
  .blog-detail-layout { padding: 48px 32px 80px; }
}
@media (max-width: 1024px) {
  .blog-detail-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 24px 72px;
  }
}

/* Article Body */
.blog-detail-body {
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255,255,255,0.8);
  min-width: 0;
}
.blog-detail-body h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: #fff;
  margin: 52px 0 16px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.blog-detail-body h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: #fff;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
.blog-detail-body p {
  margin-bottom: 24px;
}
.blog-detail-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.blog-detail-body img {
  width: 100%;
  border-radius: 12px;
  margin: 28px 0;
}
.blog-detail-body ul,
.blog-detail-body ol {
  padding-left: 28px;
  margin-bottom: 24px;
}
.blog-detail-body li {
  margin-bottom: 10px;
}
.blog-detail-body blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 20px 28px;
  margin: 36px 0;
  background: rgba(0,174,239,0.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  font-size: 19px;
}
.blog-detail-body strong {
  color: #fff;
  font-weight: 600;
}
.blog-detail-body hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 48px 0;
}
.blog-detail-body code {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.9em;
  color: rgba(41,151,255,0.9);
  font-family: monospace;
}

/* Article footer CTA */
.blog-detail-footer-cta {
  margin-top: 60px;
  padding: 40px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,174,239,0.1), rgba(100,60,220,0.08));
  border: 1px solid rgba(41,151,255,0.2);
  text-align: center;
}
.blog-detail-footer-cta h3 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.blog-detail-footer-cta p {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 20px;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.blog-detail-sidebar {
  position: sticky;
  top: calc(var(--nav-height, 64px) + 20px); /* H-6: was magic number 90px */
  align-self: start;
}
@media (max-width: 1024px) {
  .blog-detail-sidebar { display: none; }
}

.sidebar-card {
  background: var(--color-surface-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.sidebar-card__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 16px;
}

/* TOC */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-item a {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  line-height: 1.4;
}
.toc-item a:hover,
.toc-item.active a {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

/* Related Posts sidebar */
.sidebar-related-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: opacity 0.2s;
}
.sidebar-related-item:last-child { border-bottom: none; }
.sidebar-related-item:hover { opacity: 0.75; }
.sidebar-related-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #111b2e;
}
.sidebar-related-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.sidebar-related-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Back link row below article */
.blog-detail-back-row {
  text-align: center;
  padding: 40px 24px 72px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-two-col { grid-template-columns: 1fr; }
  .blog-detail-hero__title { font-size: 28px; }
  .blog-detail-body { font-size: 16px; }
  .blog-detail-body h2 { font-size: 22px; }
  .blog-detail-body blockquote { font-size: 17px; }
  .blog-detail-layout { padding: 28px 16px 56px; }
}
