/* /css/blog.css
   Minimal, blog-only Markdown styling.
   Scope: Wrap rendered markdown in <article class="md">...</article>
*/

/* -----------------------------
   0) Design tokens
   ----------------------------- */
:root {
  --blog-ink: #6d7880;         /* body text */
  --blog-ink-strong: #111111;  /* headings + strong emphasis */
  --blog-link: #0b57d0;

  --blog-green: #98ca4b;       /* requested */
  --blog-red: #cc0000;         /* requested */

  --blog-ivory: #f9fafb;      /* light ivory background */
  --blog-border: #999999;
  --blog-border-soft: rgba(0, 0, 0, 0.07);
  --blog-shadow-soft: rgba(0, 0, 0, 0.04);

  --blog-radius: 14px;
}

/* -----------------------------
   1) Page background (ivory + subtle grid)
   ----------------------------- */

/* Apply background to page. If you only want it behind the article,
   move this background to .md instead of body. */
html, body {
  height: 100% !important;
}

body {
  background-color: var(--blog-ivory) !important;

  /* Subtle checkered/grid pattern (CSS-only).
     Very low contrast to avoid “busy” look.
     If you don't want it, delete the background-image lines. */
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.028) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  background-position: 0 0 !important;

  /* Override Webflow's body defaults */
  font-family: Inter, sans-serif !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: #333 !important;

  /* Layout styles */
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* override webflow background on blog articles */
body.body.bg-gray {
  background-color: var(--blog-ivory) !important;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.028) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
  background-position: 0 0 !important;
}

/* -----------------------------
   2) Scoped reset
   ----------------------------- */
.md, .md * { box-sizing: border-box; }

.md img, .md video, .md iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

.md table { border-collapse: collapse; border-spacing: 0; }

/* -----------------------------
   3) Reading layout + base type
   ----------------------------- */
.md {
  max-width: 1200px;  /* Changed from 78ch to match tile alignment */
  margin-left: auto;
  margin-right: auto;

  padding: 28px 18px;

  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.70;

  color: var(--blog-ink);
  background: transparent; /* requested: page bg shows through */
}

/* Slightly larger “lede” first paragraph (magazine feel) */
.md > p:first-of-type {
  font-size: 1.06em;
  line-height: 1.75;
}

/* Spacing rhythm */
.md p { margin: 0 0 0.95em; }

/* -----------------------------
   4) Headings (Markdown h1–h6)
   ----------------------------- */

/* Force all heading tags to use Montserrat, never inherit Inter */
.md h1,
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
  font-family: Montserrat, sans-serif;
  color: var(--blog-ink-strong);

  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;

  margin: 1.25em 0 0.6em;
}

/* Individual heading sizing */
.md h1 {
  font-size: clamp(2.05rem, 3.4vw, 2.75rem);
  margin-top: 0.25em;
}

.md h2 {
  font-size: clamp(1.45rem, 2.1vw, 1.9rem);
  padding-top: 0.55em;
  border-top: 1px solid var(--blog-border);
}

.md h3 { font-size: 1.28rem; }
.md h4 { font-size: 1.12rem; }
.md h5 { font-size: 1.02rem; }
.md h6 { font-size: 0.94rem; }

/* Tighten spacing when a paragraph follows a heading */
.md h1 + p,
.md h2 + p,
.md h3 + p,
.md h4 + p,
.md h5 + p,
.md h6 + p {
  margin-top: 0.2em;
}

/* -----------------------------
   5) Links + inline emphasis
   ----------------------------- */
.md a {
  color: var(--blog-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.09em;
}

.md a:hover { text-decoration-thickness: 0.13em; }

.md strong { color: var(--blog-ink-strong); font-weight: 700; }
.md em { font-style: italic; }

.md del { opacity: 0.75; }
.md mark { padding: 0.08em 0.22em; }

/* -----------------------------
   6) Blockquotes
   ----------------------------- */
.md blockquote {
  margin: 1.15em 0;
  padding: 0.95em 1.1em;

  border-left: 4px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.35);
  border-radius: 10px;

  color: rgba(0,0,0,0.70);
}

.md blockquote > :last-child { margin-bottom: 0; }

/* -----------------------------
   7) Horizontal rules
   ----------------------------- */
.md hr {
  border: 0;
  border-top: 1px solid var(--blog-border);
  margin: 1.5em 0;
}

/* -----------------------------
   8) Lists
   ----------------------------- */
.md ul, .md ol {
  margin: 0 0 1.05em;
  padding-left: 1.35em;
}

.md li { margin: 0.35em 0; }
.md li > p { margin: 0.35em 0; }

/* Keep ordered list semantics */
.md ol { list-style: decimal; }

/* Improve unordered lists subtly (no gimmicks) */
.md ul { list-style-type: disc; }
.md ul ul { list-style-type: circle; }
.md ul ul ul { list-style-type: square; }

/* -----------------------------
   9) Checkmarks / Unicode helpers (no background, no box)
   ----------------------------- */

/* Important limitation:
   CSS cannot reliably “find and color” raw ✓ characters inside plain text nodes.
   For consistent styling, you need either:
   - list class: <ul class="checklist">...</ul>
   - inline span: <span class="u-check">✓</span>
*/

/* Inline unicode helpers (no background) */
.md .u-check, .md .u-ok { color: var(--blog-green); font-weight: 800; }
.md .u-x, .md .u-bad { color: var(--blog-red); font-weight: 800; }

/* Checklist list: green ✓ with no box/background */
.md ul.checklist {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.md ul.checklist > li {
  position: relative;
  padding-left: 1.6em;
}

.md ul.checklist > li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.08em;
  color: var(--blog-green);
  font-weight: 800;
  line-height: 1;
}

/* Optional: “X” list */
.md ul.xlist {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.md ul.xlist > li {
  position: relative;
  padding-left: 1.6em;
}

.md ul.xlist > li::before {
  content: "✕";
  position: absolute;
  left: 0;
  top: 0.08em;
  color: var(--blog-red);
  font-weight: 900;
  line-height: 1;
}

/* -----------------------------
   10) Code + pre
   ----------------------------- */
.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  padding: 0.12em 0.38em;

  border: 1px solid var(--blog-border);
  border-radius: 8px;

  color: rgba(0,0,0,0.80);
  background: rgba(255,255,255,0.45);
}

.md pre {
  margin: 1.15em 0;
  padding: 1em 1.1em;

  overflow: auto;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);

  background: rgba(255,255,255,0.55);
  box-shadow: 0 1px 0 var(--blog-shadow-soft);
}

.md pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.92em;
}

/* Optional: keyboard tags if your markdown uses them */
.md kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 0.12em 0.35em;
  border: 1px solid var(--blog-border);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: rgba(255,255,255,0.60);
  color: rgba(0,0,0,0.75);
}

/* -----------------------------
   11) Tables
   ----------------------------- */
.md table {
  width: 100%;
  margin: 1.2em 0;

  border: 1px solid var(--blog-border);
  outline: 1px solid var(--blog-border);
  outline-offset: -1px;
  border-radius: 12px;
  overflow: hidden;

  background: rgba(255,255,255,0.40);
}

.md th, .md td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--blog-border-soft);
  vertical-align: top;
}

/* Header row background (light gray, readable with normal text) */
.md thead th {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.78);
}

/* Fallback for renderers that don’t emit <thead> */
.md table tr:first-child th {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.78);
}

.md th { font-weight: 700; }
.md tr:last-child td { border-bottom: 0; }

/* -----------------------------
   12) Images + figures
   ----------------------------- */
.md img {
  margin: 1.05em 0;
  border-radius: var(--blog-radius);
  box-shadow: 0 1px 0 var(--blog-shadow-soft);
}

/* If your markdown renderer emits figure/figcaption */
.md figure { margin: 1.15em 0; }
.md figcaption {
  margin-top: 0.5em;
  font-size: 0.92em;
  color: rgba(0,0,0,0.62);
  text-align: center;
}

/* -----------------------------
   13) Misc Markdown elements
   ----------------------------- */
.md sup, .md sub { font-size: 0.75em; }

.md details {
  margin: 1.0em 0;
  padding: 0.85em 1.0em;
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.45);
}

.md summary {
  cursor: pointer;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
}

/* -----------------------------
   14) Responsive tweaks
   ----------------------------- */
@media (max-width: 760px) {
  .md {
    padding: 20px 14px;
    max-width: 92vw;
  }
}

/* -----------------------------
   15) Blog directory page (articles.aspx) grid and tiles
   ----------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-tile {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.blog-tile:hover {
  transform: translateY(-5px);
}

.blog-tile img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-tile-content {
  padding: 20px;
}

.blog-tile h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: bold;
}

.blog-tile p {
  margin: 0 0 15px 0;
  color: #666;
  line-height: 1.5;
}

.blog-tile a {
  color: #007bff;
  text-decoration: none;
}

.blog-tile a:hover {
  text-decoration: underline;
}

/* Article container for blog pages */
.article-container {
  padding-top: 38px;  /* Increased from 72px for more top space */
  padding-bottom: 72px;
  max-width: 1200px;  /* Changed from 1240px to match .blog-grid */
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Load More button */
.load-more-btn {
  background: var(--blog-green);
  border: 2px solid var(--blog-green);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin: 40px auto 20px auto;  /* Doubled top margin from 20px to 40px */
  display: block;
  font-size: 16px;
  transition: background 0.3s, color 0.3s;
}

.load-more-btn:hover {
  background: transparent;
  color: var(--blog-green);
}

.read-more {
    color: #999 !important;
    text-decoration: none;
}

.read-more:hover {
    color: #555 !important;
}

a.read-more {
    color: #999 !important;
    text-decoration: none;
}

a.read-more:hover {
    color: #555 !important;
}


