/* =============================================
   MORTGAGE ADVISORY NETWORK — blog.css
   Blog-specific styles (loaded in addition to main.css)
   ============================================= */

/* ── Blog index ─────────────────────────────── */

.blog-hero {
  background-color: var(--color-dark);
  color: var(--color-white);
  padding: 64px 0 48px;
  position: relative;
  overflow: hidden;
}
.blog-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 80L80 0M0 40L40 0M40 80L80 40' stroke='white' stroke-opacity='0.025' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}
.blog-hero__content {
  position: relative;
  z-index: 1;
}
.blog-hero h1 { color: var(--color-white); margin-bottom: 10px; }
.blog-hero p  { color: rgba(255,255,255,0.65); max-width: 50ch; font-size: 1.0625rem; }

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.blog-filter-btn {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1.5px solid var(--color-light-grey);
  background: var(--color-white);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.blog-filter-btn:hover,
.blog-filter-btn.active {
  border-color: var(--color-magenta);
  color: var(--color-magenta);
  background-color: rgba(198,42,126,0.06);
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px)  { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card--placeholder .blog-card__image {
  background: linear-gradient(135deg, var(--color-light-grey) 0%, #d8d6d3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* ── Blog post ──────────────────────────────── */

.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
  padding: 60px 0;
}
@media (min-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr 320px;
    gap: 64px;
  }
}

/* Article content */
.post-content {
  min-width: 0;
}

.post-header {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-light-grey);
}
.post-header .post-category {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-magenta);
  margin-bottom: 12px;
}
.post-header h1 {
  margin-bottom: 16px;
  line-height: 1.15;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.post-meta span { display: flex; align-items: center; gap: 5px; }

.post-featured-image {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  background-color: var(--color-light-grey);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Rich text body */
.post-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
}
.post-body h2 {
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  margin: 40px 0 16px;
}
.post-body h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  margin: 32px 0 12px;
}
.post-body p {
  margin-bottom: 1.25rem;
  max-width: 70ch;
  color: var(--color-text-muted);
}
.post-body p:last-child { margin-bottom: 0; }
.post-body ul, .post-body ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--color-text-muted);
}
.post-body li { margin-bottom: 6px; line-height: 1.65; }
.post-body strong { color: var(--color-text); font-weight: 600; }
.post-body a { color: var(--color-magenta); text-decoration: underline; }
.post-body a:hover { text-decoration: none; }
.post-body a.btn { color: #fff; text-decoration: none; }
.post-body a.btn:hover { color: #fff; }
/* Auto-style CTA links as buttons regardless of whether .btn class is set */
.post-body .cta a, .post-body section.cta a {
  display: inline-block;
  background: var(--color-magenta);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  margin-top: 8px;
  transition: opacity .2s;
}
.post-body .cta a:hover, .post-body section.cta a:hover { opacity: .88; color: #fff; }
.post-body blockquote {
  border-left: 3px solid var(--color-magenta);
  padding: 16px 24px;
  background-color: rgba(198,42,126,0.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--color-text);
}

/* Share buttons */
.post-share {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-light-grey);
}
.post-share p {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 12px;
  color: var(--color-text);
  max-width: none;
}
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1.5px solid var(--color-light-grey);
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
}
.share-btn:hover { border-color: var(--color-magenta); color: var(--color-magenta); }

/* Related posts */
.related-posts { margin-top: 48px; }
.related-posts h2 { font-size: 1.5rem; margin-bottom: 24px; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* Sidebar */
.post-sidebar {
  position: sticky;
  top: 92px;
}
.sidebar-widget {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.sidebar-widget h3 {
  font-size: 1.125rem;
  margin-bottom: 16px;
}
.sidebar-widget p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
  max-width: none;
}
.sidebar-widget .btn { width: 100%; }

.sidebar-disclaimer {
  background: none;
  box-shadow: none;
  padding: 0;
}
.sidebar-disclaimer p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-magenta);
  z-index: 999;
  transition: width 0.1s linear;
  width: 0%;
}

/* Post disclaimer */
.post-disclaimer {
  margin-top: 40px;
  padding: 20px;
  background-color: rgba(232,95,43,0.06);
  border: 1px solid rgba(232,95,43,0.15);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.post-disclaimer strong { color: var(--color-orange); }
