
/* blog.css - blog-specific small-scope overrides
   Safe to include site-wide but scoped to article and .posts-grid to avoid breaking header/footer.
   Keep selectors specific and non-invasive. */

:root{
  --blog-max-width: 820px;
  --lead-size: 1.15rem;
  --lead-line-height: 1.8;
  --body-font-size: 1rem;
  --muted-color: #58606a;
  --blockquote-bg: #f6f7f9;
  --blockquote-border: #dfe6ee;
  --sidebar-width: 300px;
}

/* Ensure blog content uses a comfortable measure similar to Wikipedia */
article { 
  max-width: var(--blog-max-width);
  margin-left: auto;
  margin-right: auto;
  font-size: var(--body-font-size);
  line-height: 1.65;
  color: #0b1b2b;
}

/* Larger, readable lead paragraph */
article .lead {
  font-size: var(--lead-size);
  line-height: var(--lead-line-height);
  margin-bottom: 1.1rem;
  color: #0b1b2b;
  font-weight: 500;
}

/* Muted metadata */
.section .small.muted, article .small.muted {
  color: var(--muted-color);
  font-size: .92rem;
}

/* Headings style tuned for reading */
article h2, article h3, article h4 {
  color: #09213a;
  margin-top: 1.2rem;
  margin-bottom: .6rem;
  line-height: 1.3;
}

/* Paragraph spacing */
article p { margin: .6rem 0; }

/* Nice blockquote similar to Wikipedia feel */
article blockquote {
  background: var(--blockquote-bg);
  border-left: 4px solid var(--blockquote-border);
  padding: .9rem 1rem;
  margin: 1rem 0;
  border-radius: 6px;
  color: #1b2b3a;
  font-style: normal;
}

/* Code / pre styling within articles */
article pre {
  background: #f4f6f8;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", monospace;
  font-size: .95rem;
}

/* Lists readability */
article ul, article ol { margin: .6rem 0 1rem 1.2rem; }
article li { margin: .35rem 0; }

/* Post cards on blog listing */
.posts-grid .card {
  background: #fff;
  border: 1px solid rgba(10,20,30,0.04);
  padding: 12px;
  border-radius: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.posts-grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(9,21,35,0.06);
}

/* Buttons inside posts */
article .btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Small, unobtrusive author / meta box (optional) */
.article-meta {
  display:flex;
  gap:12px;
  align-items:center;
  margin:10px 0 14px 0;
  color: var(--muted-color);
  font-size: .92rem;
}

/* Sidebar for resources - floats on wide screens but collapses on small screens */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media(min-width:1100px){
  .blog-layout {
    grid-template-columns: 1fr minmax(auto, var(--sidebar-width));
    align-items:start;
  }
  .blog-sidebar {
    position: sticky;
    top: 86px; /* keeps below header */
    align-self: start;
    background: #fbfdff;
    border: 1px solid rgba(10,20,30,0.04);
    padding: 12px;
    border-radius: 8px;
    font-size: .95rem;
  }
}

/* Fine-tune images inside article to not exceed content width */
article img { max-width: 100%; height: auto; border-radius:8px; display:block; margin: .6rem 0; }

/* Wikipedia-like content width hint for long paragraphs - improves readability */
article p:last-child { margin-bottom: 1.1rem; }

/* Accessibility: increase focus outline for interactive elements inside article */
article a:focus, .posts-grid .card a:focus {
  outline: 3px solid rgba(10,90,255,0.12);
  outline-offset: 2px;
}

/* Small tweaks to not touch header/footer: highly specific selectors */
header.site-header, footer.site-footer { /* no changes here - selector exists to emphasize intentional non-modification */ }


/* Blog polish overlay — minimal, safe & scoped to blog pages */
/* Place this at the end of assets/css/blog.css so it overrides earlier rules */

.site-main .blog-container { 
  /* ensures we do not affect other pages */
  --blog-desktop-max: 980px; /* slightly wider on large screens for nicer typesetting */
  margin: 0 auto;
  max-width: var(--blog-desktop-max);
  padding: 0 1rem;
}

/* Align article with site rhythm and use the same type color */
.site-main .blog-container article {
  max-width: 100%;
  margin: 0 auto 1.6rem;
  color: var(--md-text); /* from style.css */
  font-size: 1rem;
  line-height: 1.7;
}

/* Hero: coordinated with site hero feel but scoped */
.site-main .blog-container .article-hero {
  display:block;
  margin: 0.6rem auto 1rem;
  width:100%;
  max-width:820px; /* limits footprint and avoids full-bleed on wide screens */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--elevation-1);
}

/* On large screens, convert hero into a two-column layout
   so image + key point can sit side-by-side (like index hero) */
@media (min-width:1100px) {
  .site-main .blog-container .article-hero {
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: center;
  }
  .site-main .blog-container .article-hero img,
  .site-main .blog-container .article-hero picture {
    width:100%;
    height:auto;
    display:block;
    border-radius: 10px;
  }
}

/* Lead paragraph: larger and brand-weighted */
.site-main .blog-container .lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--md-muted);
  margin-bottom: 1rem;
}

/* Headings to match index style */
.site-main .blog-container h1,
.site-main .blog-container h2,
.site-main .blog-container h3 {
  color: var(--md-primary);
  font-weight: 800;
  line-height: 1.2;
}

/* Post list / cards: use site card elevation & radius */
.site-main .blog-container .posts-grid .card {
  border: 0;
  box-shadow: var(--elevation-1);
  border-radius: var(--radius);
  padding: 14px;
  display:flex;
  flex-direction:column;
}

/* Thumbnail cropping keeps same visual rhythm as service cards */
.site-main .blog-container .posts-grid .card img {
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:10px;
}

/* Use the site's small muted color */
.site-main .blog-container .muted,
.site-main .blog-container .small.muted {
  color: var(--md-muted);
}

/* Expand article column a bit on very large screens (avoids wasted space) */
@media (min-width:1400px) {
  .site-main .blog-container {
    max-width: 1100px;
  }
}

/* Keep header/footer untouched */
header.site-header, footer.site-footer { pointer-events: auto; }

.article-banner .banner-picture img, .article-banner .banner-picture source, .article-banner .banner-picture {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
@media (min-width: 1400px) {
    .article-banner img {
        height: 520px;
        object-fit: cover;
    }
}
@media (min-width: 900px) {
    .article-banner img {
        width: 100%;
        height: 420px;
        object-fit: cover;
    }
}

@media (min-width: 1400px) {
    .article-banner {
        max-height: 520px;
    }
}
@media (min-width: 900px) {
    .article-banner {
        max-height: 420px;
    }
}
.article-banner {
    width: 100%;
    display: block;
    margin: 0 auto 18px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--elevation-1);
}
