/* ================================================================
   BLOG STYLES — quantitybreak.com/blog
   Extends the base styles.css design tokens
   ================================================================ */

/* ── Override global heading constraints from styles.css ── */
.blog-hero h1,
.blog-body h1,
.blog-body h2,
.blog-body h3,
.blog-index-hero h1,
.blog-cta h2,
.blog-cta__panel h2,
.app-card h3,
.key-takeaways h2 {
  max-width: none;
  text-wrap: unset;
  line-height: 1.25;
}

/* ── Blog Hero ── */
.blog-hero {
  width: min(calc(100% - 2rem), 1200px);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 0 0;
}

.blog-hero__content {
  margin: 0 auto 2rem;
  text-align: center;
}

.blog-hero__content h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0.75rem auto 1rem;
  max-width: 900px;
}

.blog-hero__lede {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 720px;
  margin: 0 auto;
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.blog-meta__sep {
  opacity: 0.4;
}

.blog-hero__image {
  margin-top: 2rem;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.08));
}

.blog-hero__image img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Blog Body ── */
.blog-body {
  width: min(calc(100% - 2rem), 1200px);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) 0 2rem;
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.78;
  color: var(--text-primary);
}

.blog-body > p,
.blog-body > ul,
.blog-body > ol,
.blog-body > blockquote,
.blog-body > .table-wrap {
  margin-bottom: 1.5rem;
}

.blog-body section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 2rem;
}

.blog-body section:first-of-type {
  border-top: none;
  margin-top: 2rem;
  padding-top: 0;
}

.blog-body h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.15rem;
  line-height: 1.25;
  padding-left: 0.85rem;
  border-left: 4px solid var(--brand, #1e4bd8);
}

.blog-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.25rem 0 0.75rem;
  line-height: 1.3;
}

.blog-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.blog-body ul,
.blog-body ol {
  padding-left: 1.5rem;
}

.blog-body li {
  margin-bottom: 0.5rem;
}

.blog-body a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(30, 75, 216, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

.blog-body a:hover {
  text-decoration-color: var(--brand);
}

.blog-body strong {
  font-weight: 600;
}

/* ── Key Takeaways ── */
.key-takeaways {
  background: linear-gradient(135deg, rgba(30, 75, 216, 0.08), rgba(216, 255, 87, 0.08));
  border: 1px solid var(--brand, #1e4bd8);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem 2rem;
  margin: 2rem 0 2.5rem;
}

.key-takeaways h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand, #1e4bd8);
  margin: 0 0 1rem;
}

.key-takeaways ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.key-takeaways li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.key-takeaways li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand, #1e4bd8);
  font-weight: 700;
}

.key-takeaways li:last-child {
  margin-bottom: 0;
}

/* ── Table of Contents ── */
.blog-toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem 2rem;
  margin: 2rem 0 2.5rem;
}

.blog-toc h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
}

.blog-toc ol {
  padding-left: 1.25rem;
  margin: 0;
  columns: 2;
  column-gap: 2rem;
}

.blog-toc li {
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  break-inside: avoid;
}

.blog-toc a {
  color: var(--brand);
  text-decoration: none;
}

.blog-toc a:hover {
  text-decoration: underline;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border);
}

.blog-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  white-space: nowrap;
}

.blog-body thead {
  background: var(--bg-soft);
}

.blog-body th {
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-strong);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-body td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.blog-body tbody tr:last-child td {
  border-bottom: none;
}

.blog-body tbody tr:hover {
  background: var(--bg-soft);
}

.comparison-table__highlight {
  background: rgba(30, 75, 216, 0.04);
}

.comparison-table__highlight td {
  color: var(--text-primary);
  font-weight: 500;
}

.table-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ── App Cards ── */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 2rem 0;
  transition: box-shadow 0.25s ease;
}

.app-card:hover {
  box-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.06));
}

.app-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem;
  line-height: 1.3;
}

.app-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.app-card__image {
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

.app-card__image img {
  display: block;
  width: 100%;
  height: auto;
}

.app-card__source {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 1rem;
  font-style: italic;
}

.app-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--star {
  background: #fff8e1;
  color: #b8860b;
  border: 1px solid #f0d78c;
}

.badge--green {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.badge--blue {
  background: rgba(30, 75, 216, 0.08);
  color: var(--brand);
  border: 1px solid rgba(30, 75, 216, 0.2);
}

.badge--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.app-card__cta {
  margin-top: 1.5rem;
}

.app-card__cta .button {
  display: inline-flex;
}

/* Secondary button style for non-primary apps */
.button--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 1.5rem;
  border-radius: 100px;
  text-decoration: none;
  background: var(--white);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  transition: all 0.2s ease;
  cursor: pointer;
}

.button--secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(30, 75, 216, 0.1);
}

/* ── FAQ ── */
.faq-list {
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.5rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: '\2212';
}

.faq-item summary h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.4;
}

.faq-item > p {
  padding: 0 1.5rem 1.25rem;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* ── Blog CTA ── */
.blog-cta {
  width: min(calc(100% - 2rem), 1200px);
  margin: 2rem auto 3rem;
  padding: 0;
}

.blog-cta__panel {
  background: var(--text-primary);
  color: var(--white);
  border-radius: var(--radius-xl, 24px);
  padding: clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}

.blog-cta__panel h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  margin: 0.5rem 0 1rem;
  line-height: 1.2;
}

.blog-cta__panel p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.blog-cta__panel .eyebrow--lime {
  color: var(--accent);
}

.blog-cta__panel .cta-microcopy--light {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .blog-toc ol {
    columns: 1;
  }

  .blog-body table {
    font-size: 0.82rem;
  }

  .blog-body th,
  .blog-body td {
    padding: 0.5rem 0.65rem;
  }

  .app-card {
    padding: 1.25rem;
  }

  .app-card__badges {
    gap: 0.35rem;
  }

  .badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }

  .faq-item summary {
    padding: 0.85rem 1rem;
  }

  .faq-item > p {
    padding: 0 1rem 1rem;
  }
}

/* ── Blog Index Hero ── */
.blog-index-hero {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
}

.blog-index-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text-primary);
  margin: 0.75rem 0 1rem;
}

.blog-index-hero > p {
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 580px;
  margin: 0 auto;
}

/* ── Blog Card Grid ── */
.blog-grid {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

/* ── Blog Card ── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.blog-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.blog-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft, #f8f8fc);
}

.blog-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.04);
}

.blog-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand, #1e4bd8);
  background: rgba(30, 75, 216, 0.08);
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.blog-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 0.65rem;
}

.blog-card:hover .blog-card__title {
  color: var(--brand, #1e4bd8);
}

.blog-card__excerpt {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.blog-card__meta time {
  font-weight: 500;
}

/* ── Responsive — Blog Grid ── */
@media (max-width: 480px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-card__body {
    padding: 1.15rem;
  }
}

/* ── Blog-specific breadcrumb adjustment ── */
.blog-post .breadcrumb {
  max-width: 860px;
  margin: 0 auto;
}
