/* ============================================================
   BigLobster — Blog Design System
   ============================================================
   Comprehensive CSS for blog index (listing) and individual
   articles. Works alongside style.css, style-dark.css, and
   style-mobile.css.
   ============================================================ */

/* ── BLOG INDEX ── */

/* Blog hero (listing page) */
.blog-hero {
  margin-bottom: 6.4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -.025em;
  margin-bottom: 1.6rem;
  max-width: 80rem;
}

.blog-hero p {
  font-size: clamp(1.6rem, 2vw, 2rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 72rem;
}

/* Blog grid */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.2rem;
  margin-bottom: 8rem;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
  }
}

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

/* Blog card */
.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
  border-color: var(--accent);
}

[data-theme="dark"] .blog-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}

.blog-card-content {
  padding: 2.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.8vw, 1.8rem);
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -.01em;
  margin-bottom: 1.2rem;
  margin-top: 0;
}

.blog-card h2 a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

.blog-card h2 a:hover {
  color: var(--accent);
}

.blog-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.2rem;
}

.blog-card-badge {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: .3rem .8rem;
  border-radius: 4px;
  line-height: 1.3;
}

.blog-card .blog-date {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  order: -1;
}

.blog-card .blog-excerpt {
  font-size: 1.45rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  flex: 1;
}

.blog-card-footer {
  margin-top: auto;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-card-footer .btn-primary {
  font-size: 1.4rem;
  padding: .8rem 1.6rem;
}

/* Article tags (also used in listing page) */
.article-tag {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: .4rem 1rem;
  border-radius: 4px;
  transition: background .2s, color .2s;
}

.article-tag:hover {
  background: var(--accent);
  color: #fff;
}

/* ── ARTICLE DETAIL ── */

/* Article Hero (individual article) */
.article-hero {
  margin-bottom: 4.8rem;
  padding-bottom: 3.2rem;
  border-bottom: 1px solid var(--border);
}

.article-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 1.6rem;
}

.article-hero .article-meta {
  font-size: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 0;
  display: flex;
  gap: 1.6rem;
}

.article-hero .article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.6rem;
}

/* Article Body */
.article-body {
  max-width: 70ch;
  margin-inline: auto;
  line-height: 1.8;
  font-size: 1.7rem;
}

.article-body p {
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  color: var(--text-primary);
  letter-spacing: -.01em;
  margin-top: 4.8rem;
  margin-bottom: 1.6rem;
  line-height: 1.25;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--text-primary);
  margin-top: 3.2rem;
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body ul,
.article-body ol {
  margin-bottom: 2rem;
  padding-left: 2.4rem;
}

.article-body li {
  margin-bottom: .8rem;
  color: var(--text-secondary);
}

.article-body li::marker {
  color: var(--accent);
}

.article-body ul li {
  list-style-type: disc;
}

.article-body ol li {
  list-style-type: decimal;
}

.article-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .2s;
}

.article-body a:hover {
  color: var(--accent-hover);
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2.4rem auto;
  border-radius: 8px;
}

.article-body blockquote {
  margin: 2.4rem 0;
  padding: 1.6rem 2rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .9em;
  background: var(--bg-subtle);
  padding: .2rem .5rem;
  border-radius: 3px;
  color: var(--accent);
}

.article-body pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  overflow-x: auto;
  margin-bottom: 2rem;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: .85em;
  color: var(--text-secondary);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.article-body th,
.article-body td {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-primary);
}

.article-body td {
  color: var(--text-secondary);
}

/* Pull Quote */
.pull-quote {
  margin: 4rem 0;
  padding: 2.4rem 3.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.pull-quote::before {
  content: '"';
  position: absolute;
  top: .4rem;
  left: 1rem;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--accent);
  opacity: .25;
  font-family: var(--font-display);
}

.pull-quote p {
  margin: 0;
}

.pull-quote cite {
  display: block;
  margin-top: 1.2rem;
  font-size: 1.4rem;
  font-style: normal;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* Stats Block */
.stats-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  margin: 4rem 0;
  padding: 3.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .stats-block {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.4rem;
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  color: var(--accent);
  line-height: 1.1;
  font-weight: 400;
}

.stat-label {
  font-size: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 20ch;
}

/* Section Divider */
.section-divider {
  width: 4rem;
  height: 2px;
  background: var(--accent-teal);
  opacity: .4;
  margin: 4.8rem auto;
  border-radius: 2px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 3.2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

.breadcrumb a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-secondary);
}

/* Article Footer */
.article-footer {
  margin-top: 4.8rem;
  padding-top: 3.2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.article-footer p {
  font-size: 1.6rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .blog-hero {
    margin-bottom: 4.8rem;
    padding-bottom: 2.4rem;
  }
  
  .blog-card-content {
    padding: 1.6rem;
  }
  
  .blog-card-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .article-hero {
    margin-bottom: 3.2rem;
    padding-bottom: 2.4rem;
  }

  .article-body {
    font-size: 1.6rem;
  }

  .article-body h2 {
    margin-top: 3.2rem;
  }

  .article-body h3 {
    margin-top: 2.4rem;
  }

  .pull-quote {
    padding: 1.6rem 2rem;
    margin: 3.2rem 0;
  }

  .stats-block {
    padding: 2rem;
    margin: 3.2rem 0;
  }

  .section-divider {
    margin: 3.2rem auto;
  }

  .article-body table {
    font-size: 1.3rem;
  }

  .article-body th,
  .article-body td {
    padding: .6rem .8rem;
  }
}

/* ── DARK MODE ADJUSTMENTS ── */
[data-theme="dark"] .blog-card {
  background: var(--bg-subtle);
}

[data-theme="dark"] .pull-quote {
  background: var(--bg-subtle);
  border-left-color: var(--accent);
}

[data-theme="dark"] .stats-block {
  background: var(--bg-subtle);
}

[data-theme="dark"] .article-tag {
  color: var(--accent);
}