/* ==========================================================================
   Kru-Marc Inc. Blog — extends styles.css
   ========================================================================== */

/* ==========================================================================
   Blog Card Grid
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.card {
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--green-300);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-img-link {
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--gray-200);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.card-body {
  padding: 28px 28px 32px;
}

.tag {
  display: inline-flex;
  padding: 6px 12px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green-700);
  transition: color 0.2s ease, gap 0.2s ease;
}

.card-link:hover {
  color: var(--green-500);
  gap: 10px;
}

.card-link::after {
  content: "\2192";
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green-700);
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover {
  color: var(--green-500);
}

.back-link::before {
  content: "\2190";
}

/* ==========================================================================
   Article Hero Image
   ========================================================================== */

.article-hero-img {
  width: 100%;
  max-width: 760px;
  margin-top: 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

/* ==========================================================================
   Article Author
   ========================================================================== */

.article-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-200);
}

.article-author-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--green-100);
  transition: border-color 0.2s ease;
}

.article-author-img:hover {
  border-color: var(--green-400);
}

.article-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.article-author-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.article-original-link {
  color: var(--green-700);
  font-weight: 600;
  transition: color 0.2s ease;
}

.article-original-link:hover {
  color: var(--green-500);
}

/* ==========================================================================
   Article Body
   ========================================================================== */

.article-body {
  max-width: 760px;
  padding-top: 40px;
}

.article-section {
  margin-top: 48px;
}

.article-section:first-child {
  margin-top: 0;
}

.article-section h2 {
  margin-bottom: 16px;
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green-100);
}

.article-section p,
.article-section li {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.02rem;
}

.article-section p + p {
  margin-top: 18px;
}

.article-section ul,
.article-section ol {
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 24px;
}

.article-section code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gray-100);
  font-size: 0.88em;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--green-800);
}

.article-section pre {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--green-950);
  border: 1px solid var(--green-900);
  overflow-x: auto;
  line-height: 1.65;
}

.article-section pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.86rem;
  white-space: pre;
  color: var(--green-200);
}

/* DAX Syntax Highlighting */
.dax-func { color: #6ee7a8; font-weight: 600; }
.dax-keyword { color: #93c5fd; font-weight: 600; }
.dax-string { color: #fca5a5; }
.dax-column { color: #fde68a; }
.dax-number { color: #c4b5fd; }
.dax-comment { color: #6b7280; font-style: italic; }
.dax-variable { color: #f9fafb; font-weight: 600; }

/* ==========================================================================
   Article Figures
   ========================================================================== */

.article-figure {
  margin: 28px 0 16px;
  padding: 0;
}

.article-figure img {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Article Table
   ========================================================================== */

.article-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.article-table th,
.article-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.article-table th {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  background: var(--green-900);
}

.article-table td {
  color: var(--text-secondary);
}

.article-table tbody tr:hover {
  background: var(--green-50);
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Article Footer (callout box)
   ========================================================================== */

.article-footer {
  margin-top: 56px;
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  background: var(--green-50);
  border-left: 4px solid var(--green-500);
}

.article-footer p {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ==========================================================================
   Footer LinkedIn (shared across blog pages)
   ========================================================================== */

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-social a:hover {
  background: var(--green-700);
  color: var(--white);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

@media (max-width: 680px) {
  .card-img {
    height: 160px;
  }

  .card-body {
    padding: 20px 20px 24px;
  }
}
