/* Blog Index */
.blog-index {
  width: min(1100px, calc(100vw - 48px));
  margin: 12px auto 72px;
  padding-top: 28px;
}

.blog-index-header {
  margin-bottom: 48px;
}

.blog-index-header h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.blog-index-header > p:not(.eyebrow) {
  max-width: 50ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28, 32, 36, 0.08);
}

.blog-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

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

.blog-card-content h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.blog-card-date {
  margin: 8px 0 0;
  color: var(--muted-light);
  font-size: 13px;
}

/* Blog Post Page */
.blog-page {
  width: min(760px, calc(100vw - 48px));
  margin: 12px auto 72px;
  padding-top: 20px;
}

.blog-post {
  margin-bottom: 64px;
}

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

.blog-back {
  margin: 0 0 20px;
  font-size: 14px;
}

.blog-back a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.blog-back a:hover {
  color: var(--ink);
}

.blog-header h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.blog-date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.blog-hero {
  margin: 0 0 36px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.blog-hero img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Blog Content Styles */
.blog-content {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
}

.blog-content h2,
.blog-content .blog-h2 {
  margin: 40px 0 16px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.blog-content h3 {
  margin: 32px 0 12px;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.blog-content p {
  margin: 0 0 18px;
}

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

.blog-content li {
  margin-bottom: 10px;
}

.blog-content li:last-child {
  margin-bottom: 0;
}

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

.blog-content a:hover {
  color: #181b22;
}

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

.blog-content em {
  font-style: italic;
}

.blog-content blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--brand-ink);
  background: var(--soft);
  border-radius: 0 8px 8px 0;
}

.blog-content blockquote p {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.blog-content code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: #41454e;
  font-family: var(--sans);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.blog-content pre {
  margin: 24px 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1c2024;
}

.blog-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8e8ec;
  font-size: 14px;
}

/* Tables */
.blog-table-wrap {
  margin: 24px 0;
  overflow-x: auto;
}

.blog-content figure,
.blog-table {
  margin: 0;
}

.blog-content table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

.blog-content th,
.blog-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.blog-content th {
  background: var(--soft);
  font-weight: 600;
}

.blog-content tr:last-child td {
  border-bottom: 0;
}

/* Images */
.blog-content img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.blog-content figure img {
  margin: 0;
}

.blog-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Embedded Videos */
.blog-content iframe,
.blog-iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

.blog-related h2 {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

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

.blog-related-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  transition: transform 150ms ease;
}

.blog-related-item:hover {
  transform: translateY(-2px);
}

.blog-related-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.blog-related-item h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 809px) {
  .blog-index {
    margin-top: 8px;
    padding-top: 20px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-page {
    margin-top: 8px;
    padding-top: 12px;
  }

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

  .blog-related-item {
    flex-direction: row;
    align-items: center;
  }

  .blog-related-item img {
    width: 100px;
    flex-shrink: 0;
  }
}

@media (max-width: 499px) {
  .blog-index-header h1 {
    font-size: 32px;
  }

  .blog-header h1 {
    font-size: 26px;
  }

  .blog-content {
    font-size: 16px;
  }

  .blog-content h2,
  .blog-content .blog-h2 {
    font-size: 20px;
  }

  .blog-content h3 {
    font-size: 16px;
  }
}
