/* ===================================================================
   IMYX Blog — blog.css
   Styles for blog index, article pages, listings.
   Inherits CSS variables from style.css (teal theme).
   =================================================================== */

.blog-hero {
  padding: 100px 24px 48px;
  text-align: center;
  background: var(--gradient-subtle);
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.15;
}
.blog-hero p {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
}

.blog-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Filter tabs ── */
.blog-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  justify-content: center;
}
.blog-filter a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.blog-filter a:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.blog-filter a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Article card grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.blog-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.blog-card a.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.blog-card .cover {
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  background-size: cover;
  background-position: center;
}
.blog-card .cover-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  padding: 16px;
  text-align: center;
}
.blog-card .body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card .cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 8px;
}
.blog-card h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
}
.blog-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.blog-card .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Pagination ── */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.blog-pagination a, .blog-pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  font-size: 14px;
  transition: all var(--transition);
}
.blog-pagination a:hover { background: var(--surface-hover); }
.blog-pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.blog-pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ── Breadcrumbs ── */
.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-top: 16px;
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span.sep { margin: 0 8px; opacity: 0.5; }

/* ── Article page ── */
.article-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 100px 24px 64px;
}
.article-header {
  margin-bottom: 32px;
}
.article-header .cat {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 12px;
}
.article-header h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
}
.article-header .lead {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
  margin-bottom: 36px;
  background: var(--bg-alt);
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.article-body h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 16px;
  line-height: 1.25;
  color: var(--text);
}
.article-body h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.3;
  color: var(--text);
}
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol {
  margin: 0 0 24px 28px;
}
.article-body li {
  margin-bottom: 10px;
  line-height: 1.7;
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 8px 20px;
  margin: 24px 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body code {
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 14px;
}
.article-body pre code { background: transparent; padding: 0; }
.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--primary-dark); }
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}
.article-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 24px 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 15px;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.article-body th {
  background: var(--bg-alt);
  font-weight: 700;
}

/* ── TOC ── */
.article-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  margin-bottom: 32px;
}
.article-toc .toc-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.article-toc ol { margin: 0 0 0 20px; }
.article-toc li { margin-bottom: 6px; line-height: 1.4; }
.article-toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.article-toc a:hover { color: var(--primary); }

/* ── Article CTA ── */
.article-cta {
  margin: 48px 0 32px;
  padding: 32px;
  background: var(--gradient-subtle);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.article-cta h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.article-cta p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.article-cta .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Related articles ── */
.article-related {
  margin: 56px 0 32px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.article-related h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.related-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  display: block;
}
.related-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.related-card .rel-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}
.related-card .rel-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── FAQ block in article ── */
.article-faq {
  margin: 48px 0 32px;
}
.article-faq h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.article-faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
}
.article-faq summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
}
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after {
  content: '+';
  position: absolute;
  right: 20px;
  font-size: 22px;
  color: var(--primary);
  font-weight: 400;
  transition: transform var(--transition);
}
.article-faq details[open] summary::after { content: '−'; }
.article-faq .faq-body {
  padding: 0 20px 18px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Tag cloud ── */
.blog-tags {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-tags a {
  padding: 4px 12px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
}
.blog-tags a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

/* ── Responsive ── */
@media (max-width: 640px) {
  .blog-hero { padding: 90px 16px 36px; }
  .blog-container { padding: 32px 16px 60px; }
  .article-wrap { padding: 90px 16px 48px; }
  .blog-grid { grid-template-columns: 1fr; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 24px; margin: 36px 0 12px; }
  .article-body h3 { font-size: 19px; margin: 24px 0 10px; }
}
