/* ============================================
   Console Blog — blog.consoleng.com
   Extends parent styles-v2.css
   ============================================ */

/* ---- Skip Link (Accessibility) ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent, #d32f2f);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
}

/* ---- Blog Header ---- */
.blog-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, padding .3s ease, box-shadow .3s ease;
}

.blog-header[data-elevated="true"] {
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

.blog-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.blog-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.blog-header-left .brand {
  display: flex;
  align-items: center;
}

.blog-header-left .brand-logo img {
  height: 34px;
  width: auto;
}

.blog-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 0, 0, .15), rgba(255, 51, 51, .07));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}

.blog-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.blog-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
  border: 1px solid transparent;
}

.blog-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--panel2) 50%, transparent);
}

.blog-nav a.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--panel2) 70%, transparent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

.blog-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.blog-nav-back svg {
  width: 14px;
  height: 14px;
}

.blog-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.blog-header-actions .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.blog-header-actions .theme-toggle:hover {
  color: var(--text);
  background: var(--panel2);
}

.blog-header-actions .theme-toggle svg {
  width: 18px;
  height: 18px;
}

.blog-header-actions .lang-toggle-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 24px 6px 10px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: color .15s, border-color .15s;
}

.blog-header-actions .lang-toggle-select:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

/* ---- Section Head ---- */
.blog-section-head {
  text-align: center;
  margin-bottom: 48px;
  padding-top: 32px;
}

.blog-section-head h1 {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 12px;
}

.blog-section-head p {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ---- Blog Cards Grid ---- */
.blog-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.blog-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blog-card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  outline: none;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.blog-card-image {
  display: block;
  overflow: hidden;
  position: relative;
  background: var(--panel2);
}

.blog-card-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #ffffff; /* Logos usually have white bg */
  display: block;
  transition: transform 300ms ease;
  padding: 10px; /* Add some breathing room for logos */
}

/* For dark mode, maybe a subtle grey or keep white if it's a logo */
[data-theme="dark"] .blog-card-image img {
  background: #2a2b35;
}

[data-theme="dark"] .blog-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .blog-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  background: rgba(255, 255, 255, 0.08);
}

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

.blog-card-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  color: var(--muted);
}

.blog-card-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: .4;
}

.blog-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}


.blog-card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 8px;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

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

.blog-card-excerpt {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.blog-card-readmore {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .15s;
}

.blog-card-readmore:hover {
  gap: 8px;
}

.blog-card-readmore svg {
  width: 14px;
  height: 14px;
}

/* ---- Pagination ---- */
.blog-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 48px;
  padding-bottom: 32px;
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}

.blog-pagination a:hover {
  color: var(--text);
  background: var(--panel2);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.blog-pagination .is-current {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 0, 0, .15), rgba(255, 51, 51, .07));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  font-weight: 600;
}

/* ---- Single Article ---- */
.blog-article-hero {
  margin-bottom: 32px;
}

.blog-article-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.blog-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 48px;
}

.blog-article-header {
  margin-bottom: 32px;
}

.blog-article-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.blog-article-title {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 16px;
}

.blog-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.blog-article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Article content typography */
.blog-article-content {
  line-height: 1.78;
  font-size: 16px;
  color: var(--text);
}

.blog-article-content h2 {
  font-size: 22px;
  font-weight: 650;
  margin: 2em 0 .6em;
  color: var(--text);
}

.blog-article-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.6em 0 .5em;
  color: var(--text);
}

.blog-article-content p {
  margin: 0 0 1.2em;
}

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

.blog-article-content ul,
.blog-article-content ol {
  padding-left: 24px;
  margin: 0 0 1.2em;
}

.blog-article-content li {
  margin-bottom: .4em;
}

.blog-article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 0 12px 20px;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
  background: color-mix(in srgb, var(--panel) 50%, transparent);
  border-radius: 0 var(--radiusSm) var(--radiusSm) 0;
}

.blog-article-content code {
  background: var(--panel2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
  font-family: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
}

.blog-article-content pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radiusSm);
  padding: 16px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.blog-article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.blog-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radiusSm);
  margin: 1.2em 0;
  display: block;
}

/* ---- Related Posts ---- */
.blog-related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.blog-related h2 {
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 24px;
  color: var(--text);
}

.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.blog-related-card {
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 16px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.blog-related-card:hover {
  background: var(--panel2);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.blog-related-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.35;
}

.blog-related-card time {
  font-size: 12px;
  color: var(--muted);
}

/* ---- No Posts ---- */
.blog-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.blog-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.blog-empty p {
  font-size: 16px;
}

/* ---- Category Header ---- */
.blog-category-header {
  text-align: center;
  margin-bottom: 48px;
  padding-top: 32px;
}

.blog-category-header .blog-cat-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.blog-category-header h1 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .blog-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .blog-nav a {
    padding: 5px 9px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .blog-header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .blog-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 0;
    scrollbar-width: none;
  }

  .blog-nav::-webkit-scrollbar {
    display: none;
  }

  .blog-header-actions {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .blog-cards {
    grid-template-columns: 1fr;
  }

  .blog-related-grid {
    grid-template-columns: 1fr;
  }

  .blog-section-head h1 {
    font-size: 24px;
  }

  .blog-article-title {
    font-size: 24px;
  }

  .blog-card-content {
    padding: 20px;
  }
}

/* ---- Article Detail Page ---- */
.blog-article {
  max-width: 860px;
  margin: 0 auto 60px;
  background: color-mix(in srgb, var(--panel) 60%, var(--bg));
  padding: 40px 50px;
  border-radius: var(--radius, 12px);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

[data-theme="dark"] .blog-article {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.post-header {
  text-align: center;
  margin-bottom: 40px;
}

.post-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.post-cat {
  background: rgba(230, 0, 0, 0.1);
  color: var(--accent, #d32f2f);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
}

.post-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel2);
  padding: 4px 10px;
  border-radius: 20px;
}

.post-title {
  font-size: 32px;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.post-cover {
  width: 100%;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  margin-bottom: 40px;
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.post-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.post-body h2, .post-body h3 {
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 16px;
}

.post-body p {
  margin-bottom: 20px;
}

.post-body ul, .post-body ol {
  margin-bottom: 20px;
  padding-left: 40px;
}

.post-body ul {
  list-style-type: disc;
}

.post-body ol {
  list-style-type: decimal;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin-left: 0;
  margin-right: 0;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 20px;
}

.post-body .ql-align-center { text-align: center; }
.post-body .ql-align-right { text-align: right; }
.post-body .ql-align-justify { text-align: justify; }
.post-body .ql-indent-1 { padding-left: 3em; }
.post-body .ql-indent-2 { padding-left: 6em; }
.post-body .ql-indent-3 { padding-left: 9em; }
.post-body .ql-indent-4 { padding-left: 12em; }
.post-body .ql-indent-5 { padding-left: 15em; }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

.post-body pre {
  background: var(--panel);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.post-tag {
  background: var(--panel2);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .blog-article {
    padding: 24px 20px;
  }
  .post-title {
    font-size: 24px;
  }
}

/* ---- Author Profiles ---- */
.blog-card-author-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.blog-card-author-sm img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel2);
}

.post-author-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border-radius: 50px;
  width: fit-content;
  margin-inline: auto;
  border: 1px solid var(--border);
}

.post-author-box img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.post-author-info {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.post-author-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.post-author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* Fix for dark mode box background */
[data-theme="dark"] .post-author-box {
  background: rgba(255,255,255, 0.03);
}

@media (max-width: 560px) {
  .post-author-box {
    padding: 10px 20px;
    gap: 12px;
  }
  .post-author-box img {
    width: 36px;
    height: 36px;
  }
  .post-author-name {
    font-size: 14px;
  }
}

/* =============================================
   Block Content Styles
   ============================================= */

.block-text {
  margin: 1.5rem 0;
}

.block-summary {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--accent, #cc0000);
  background: color-mix(in srgb, var(--accent, #cc0000) 6%, var(--bg, #fff));
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.block-summary p { margin: 0.5em 0; }
.block-summary p:first-child { margin-top: 0; }
.block-summary p:last-child { margin-bottom: 0; }

.block-image {
  margin: 2rem 0;
}
.block-image img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.block-image figcaption {
  text-align: center;
  font-size: 0.9em;
  color: var(--muted, #888);
  margin-top: 0.5rem;
}

.block-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 2rem 0;
}
.block-gallery-item {
  margin: 0;
}
.block-gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.block-gallery-item figcaption {
  text-align: center;
  font-size: 0.85em;
  color: var(--muted, #888);
  margin-top: 0.4rem;
}
@media (max-width: 560px) {
  .block-gallery {
    grid-template-columns: 1fr;
  }
}

.block-table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
  -webkit-overflow-scrolling: touch;
}
.block-table-caption {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 0.5rem;
  color: var(--text, #111);
}
.block-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
.block-table th,
.block-table td {
  padding: 10px 14px;
  border: 1px solid var(--border, #ddd);
  text-align: left;
}
.block-table th {
  background: color-mix(in srgb, var(--accent, #cc0000) 10%, var(--bg, #fff));
  font-weight: 600;
  white-space: nowrap;
}
.block-table tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg, #fff) 95%, var(--text, #111));
}

.block-files {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--bg, #fff) 96%, var(--text, #111));
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
}
.block-files ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.block-files li {
  margin: 0.5rem 0;
}
.block-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text, #111);
  transition: background 0.15s;
}
.block-file-link:hover {
  background: color-mix(in srgb, var(--accent, #cc0000) 8%, var(--bg, #fff));
}
.block-file-icon {
  font-size: 1.2em;
}
.block-file-name {
  flex: 1;
  font-weight: 500;
}
.block-file-size {
  font-size: 0.85em;
  color: var(--muted, #888);
}

.block-code-wrap {
  margin: 2rem 0;
}
.block-code-caption {
  font-size: 0.9em;
  color: var(--muted, #888);
  margin-bottom: 0.4rem;
}
.block-code {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9em;
  line-height: 1.6;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}
.block-code code {
  font-family: inherit;
}

/* =============================================
   Search Bar
   ============================================= */
.blog-search-wrap {
  margin-top: 1.5rem;
  max-width: 520px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.blog-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.blog-search-input:focus {
  border-color: var(--accent);
}
.blog-search-input::placeholder {
  color: var(--muted);
}

/* =============================================
   Featured Tags
   ============================================= */
.blog-featured-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 0 4px;
}
.featured-tags-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.featured-tag-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.featured-tag-btn:hover {
  color: var(--text);
  background: var(--panel2);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.featured-tag-btn.active {
  color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 0, 0, .12), rgba(255, 51, 51, .05));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  font-weight: 600;
}

/* =============================================
   Blog Layout (main + sidebar)
   ============================================= */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 980px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Sidebar
   ============================================= */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  padding: 20px;
}

[data-theme="dark"] .sidebar-widget {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sidebar-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-post-item {
  margin-bottom: 2px;
}

.sidebar-post-item a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.sidebar-post-item a:hover {
  background: var(--panel2);
}

.sidebar-post-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-post-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* Newsletter */
.sidebar-newsletter .sidebar-title {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.newsletter-input:focus {
  border-color: var(--accent);
}

.newsletter-input::placeholder {
  color: var(--muted);
}

.newsletter-btn {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.newsletter-btn:hover {
  opacity: 0.9;
}

/* =============================================
   Card Variants
   ============================================= */

/* Glossary card: no image, compact */
.blog-card--glossary {
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  border-left: 3px solid var(--accent);
}

.blog-card--glossary .blog-card-content {
  padding: 20px 24px;
}

.blog-card--glossary .blog-card-title {
  font-size: 18px;
  font-weight: 700;
}

.blog-card--glossary .blog-card-excerpt {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Case Study card: metric highlight */
.blog-card--case-study .blog-card-metric {
  margin-bottom: 8px;
}

.blog-card--case-study .metric-value {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ff6600));
}

.blog-card-industry {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
}

/* Guide card: difficulty badge */
.blog-card-difficulty {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.difficulty-beginner {
  background: rgba(76, 175, 80, 0.12);
  color: #4caf50;
}

.difficulty-intermediate {
  background: rgba(255, 152, 0, 0.12);
  color: #ff9800;
}

.difficulty-advanced {
  background: rgba(244, 67, 54, 0.12);
  color: #f44336;
}

@media (max-width: 980px) {
  .blog-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-widget {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 560px) {
  .blog-sidebar {
    flex-direction: column;
  }
  .sidebar-widget {
    min-width: auto;
  }
  .blog-featured-tags {
    gap: 6px;
  }
  .featured-tag-btn {
    font-size: 11px;
    padding: 3px 10px;
  }
}

