/* =============================================================================
   AUTODIT Blog – Stylesheet
   ============================================================================= */

:root {
  --blog-bg: #0b1220;
  --blog-text: #e0e6ed;
  --blog-text-muted: #8892a4;
  --blog-accent: #3b82f6;
  --blog-accent-hover: #60a5fa;
  --blog-card-bg: #111827;
  --blog-border: #1f2937;
  --blog-code-bg: #1e293b;
  --blog-max-width: 860px;
  --blog-wide-width: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: var(--blog-bg);
  color: var(--blog-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blog-accent); text-decoration: none; }
a:hover { color: var(--blog-accent-hover); }

img { max-width: 100%; height: auto; }

/* Header */
.blog-header {
  border-bottom: 1px solid var(--blog-border);
  padding: 1rem 2rem;
}
.blog-header__inner {
  max-width: var(--blog-wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.blog-header__logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.1rem; color: #fff;
}
.blog-header__logo img { border-radius: 4px; }
.blog-header__nav { display: flex; gap: 1.5rem; }
.blog-header__nav a { color: var(--blog-text-muted); font-size: .9rem; }
.blog-header__nav a:hover { color: #fff; }

/* Main */
.blog-main {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Footer */
.blog-footer {
  border-top: 1px solid var(--blog-border);
  text-align: center;
  padding: 2rem 1rem;
  color: var(--blog-text-muted);
  font-size: .85rem;
}

/* Blog Index */
.blog-index__title { font-size: 2rem; margin-bottom: .5rem; color: #fff; }
.blog-index__description { color: var(--blog-text-muted); margin-bottom: 2.5rem; }
.blog-index__posts { display: flex; flex-direction: column; gap: 2rem; }
.blog-index__empty { color: var(--blog-text-muted); font-style: italic; }

/* Blog Card */
.blog-card {
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s;
}
.blog-card:hover { border-color: var(--blog-accent); }
.blog-card__image-link img {
  width: 100%; height: 220px; object-fit: cover; display: block;
}
.blog-card__body { padding: 1.25rem 1.5rem; }
.blog-card__title { font-size: 1.25rem; margin-bottom: .5rem; }
.blog-card__title a { color: #fff; }
.blog-card__title a:hover { color: var(--blog-accent); }
.blog-card__date { font-size: .8rem; color: var(--blog-text-muted); display: block; margin-bottom: .5rem; }
.blog-card__excerpt { color: var(--blog-text-muted); font-size: .95rem; }

/* Blog Post */
.blog-post__header { margin-bottom: 2.5rem; }
.blog-post__title { font-size: 2.2rem; line-height: 1.3; color: #fff; margin-bottom: .75rem; }
.blog-post__meta { color: var(--blog-text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.blog-post__featured-image img {
  width: 100%; border-radius: 8px; margin-bottom: 1rem;
}

/* Article Content */
.blog-post__content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; color: #fff; }
.blog-post__content h3 { font-size: 1.25rem; margin: 1.75rem 0 .75rem; color: #fff; }
.blog-post__content h4 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: #fff; }
.blog-post__content p { margin-bottom: 1.25rem; }
.blog-post__content ul,
.blog-post__content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.blog-post__content li { margin-bottom: .4rem; }
.blog-post__content blockquote {
  border-left: 3px solid var(--blog-accent);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--blog-text-muted);
  background: var(--blog-code-bg);
  border-radius: 0 6px 6px 0;
}
.blog-post__content pre {
  background: var(--blog-code-bg);
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  line-height: 1.5;
}
.blog-post__content code {
  background: var(--blog-code-bg);
  padding: .15rem .4rem;
  border-radius: 3px;
  font-size: .9em;
}
.blog-post__content pre code {
  background: none; padding: 0;
}
.blog-post__content img {
  border-radius: 6px; margin: 1rem 0;
}
.blog-post__content a { text-decoration: underline; }
.blog-post__content hr {
  border: none; border-top: 1px solid var(--blog-border);
  margin: 2rem 0;
}
.blog-post__content table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.5rem;
}
.blog-post__content th,
.blog-post__content td {
  border: 1px solid var(--blog-border);
  padding: .6rem .8rem; text-align: left;
}
.blog-post__content th { background: var(--blog-code-bg); color: #fff; }

/* Post Footer */
.blog-post__footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--blog-border); }
.blog-post__back { color: var(--blog-accent); font-size: .95rem; }

/* Responsive images from eleventy-img */
.blog-post__content picture {
  display: block; margin: 1.5rem 0;
}
.blog-post__content picture img {
  width: 100%; border-radius: 6px;
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blog-accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-index__title { font-size: 1.75rem; }
  .blog-post__title { font-size: 1.8rem; }
  .blog-main { padding: 2.5rem 1.25rem; }
  .blog-card__image-link img { height: 180px; }
  .blog-header { padding: 1rem 1.25rem; }
  .blog-header__nav { gap: 1rem; }
}

@media (max-width: 640px) {
  .blog-post__title { font-size: 1.6rem; }
  .blog-main { padding: 2rem 1rem; }
  .blog-card__image-link img { height: 160px; }
  .blog-header__nav { gap: .75rem; font-size: .85rem; }
}
