/* blog.css — responsive overrides for blog posts
   Uses tokens + fonts from main.css
   Palette: cream/navy/slate/rose/blush
   Fonts: Cormorant Garamond (headings), Montserrat (body)
*/

/* Layout scales with viewport */
.blog-post {
  max-width: min(900px, 92vw);
  margin: 0 auto;
  padding: 0 clamp(0.85rem, 2.5vw, 1.5rem);
  color: var(--text);
  font-family: var(--font-body);
}

/* Header hierarchy */
.blog-header h1 {
  margin-bottom: 0.35rem;

  letter-spacing: -0.02em;
  line-height: 1.12;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 600;
}

.blog-post .blog-content h2 {
  margin: 0 0 0.6rem -1rem;

  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  color: var(--slate);
  font-family: var(--font-heading);
  font-weight: 500;
}

.blog-post .blog-content h3 {
  margin: 0 0.4rem 1rem -1rem;

  color: var(--accent-2);
  font-family: var(--font-heading);
  font-weight: 600;
}

/* Meta scales down slightly on mobile */
.blog-meta {
  margin: 0 0 1rem 0;
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  opacity: 0.75;
  color: var(--text-muted);
}

.blog-tags {
  color: var(--rose);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Title + image side-by-side */
.blog-title-container {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.6fr);
  gap: clamp(1.2rem, 3vw, 2.5rem);
  align-items: center;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* Big editorial title */
.blog-title-container h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1.05;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 0.75rem 0;
}

/* Meta under title */
.blog-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Inline hero tweaks */
.blog-hero-inline {
  margin: 0;
  max-width: 260px; /* keeps image small */
  justify-self: end; /* push to right edge */
}

/* Mobile: stack image below title */
@media (max-width: 820px) {
  .blog-title-container {
    grid-template-columns: 1fr;
  }

  .blog-hero-inline {
    max-width: 320px;
    justify-self: start;
    margin-top: 1rem;
  }
}

/* Hero image scales + keeps a nice shape */
.blog-hero {
  margin: clamp(0.9rem, 2vw, 1.25rem) 0;
  border-radius: clamp(10px, 1.2vw, 16px);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(52, 51, 88, 0.1);
  border: 1px solid var(--border);
}
.blog-hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* Abstract becomes a readable callout, padding scales */
.blog-abstract {
  margin-top: clamp(0.75rem, 1.6vw, 1.1rem);
  padding: clamp(0.75rem, 1.6vw, 1.05rem) clamp(0.85rem, 1.8vw, 1.15rem);
  border-left: 4px solid var(--rose);
  background: rgba(198, 129, 136, 0.1); /* rose tint */
  border-radius: clamp(10px, 1.2vw, 14px);
  color: var(--text);
}

/* Hide empty abstract so it doesn’t create blank space */
.blog-abstract:empty {
  display: none;
}

.blog-abstract p {
  margin: 0.6rem 0;
}

/* Body typography: fluid font size + comfortable line length */
.blog-content {
  margin-top: clamp(1.2rem, 2vw, 1.75rem);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: clamp(1.62, 1.2vw, 1.78);
  color: var(--text);
  font-family: var(--font-body);
}

/* Keep your utility-ish callouts consistent with main.css */
.blog-content .highlight {
  color: var(--slate);
  font-weight: 600;
}

.blog-content .note {
  color: var(--muted); /* slate-muted */
  font-style: italic;
  font-size: 1em;
}

.blog-content li {
  color: var(--text);
}

/* Headings: fluid size + spacing */
.blog-content h2 {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: clamp(0.55rem, 1.2vw, 0.8rem);
  letter-spacing: -0.01em;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 600;
}

.blog-resources h2,
.blog-content h2,
.blog-references h2 {
  color: var(--navy);
}

.blog-content h3 {
  margin-top: clamp(1.1rem, 2vw, 1.75rem);
  margin-bottom: 0.5rem;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 600;
}

/* Links: match main.css (dotted underline) */
.blog-post a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted rgba(52, 51, 88, 0.35);
  transition: color var(--t-fast), border-color var(--t-fast);
}

.blog-post a:hover {
  color: var(--link-hover);
  border-bottom-color: transparent;
}

/* Code blocks */
.blog-post pre {
  overflow-x: auto;
  padding: clamp(0.7rem, 1.6vw, 1rem) clamp(0.8rem, 1.7vw, 1.15rem);
  border-radius: clamp(10px, 1.2vw, 14px);
  background: rgba(52, 51, 88, 0.05); /* navy tint */
  border: 1px solid rgba(52, 51, 88, 0.12);
}

.blog-post code {
  font-size: 0.95em;
}

/* MathJax blocks: keep readable on phones (horizontal scroll) */
.blog-post mjx-container[jax="CHTML"][display="true"] {
  margin: clamp(0.85rem, 1.8vw, 1.15rem) 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

/* References */
.blog-references {
  margin-top: clamp(1.8rem, 3vw, 2.6rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid var(--border);
}

.reference-list {
  padding-left: clamp(1.1rem, 2vw, 1.5rem);
}

/* If you want bullets for references specifically */
.reference-list {
  list-style: disc;
}

.reference-list li {
  margin: clamp(0.55rem, 1.2vw, 0.9rem) 0;
}

/* Footer */
.blog-footer {
  margin-top: clamp(1.8rem, 3vw, 2.6rem);
  padding-top: clamp(0.8rem, 1.8vw, 1.2rem);
  border-top: 1px solid var(--border);
  opacity: 0.95;
  color: var(--text-muted);
}

/* Optional: slightly tighter on very small screens */
@media (max-width: 420px) {
  .blog-meta {
    line-height: 1.35;
  }
}
