/* Blog — Lovable style aligned with main site */

/* Reading progress indicator */
.blog-article {
  --progress: 0%;
}

.blog-article::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: var(--progress, 0%);
  height: 2px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s ease;
}

.blog-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  padding-inline: max(2rem, env(safe-area-inset-left));
  padding-inline-end: max(2rem, env(safe-area-inset-right));
  animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
  opacity: 0;
  transform: translateY(20px);
}

.blog-hero {
  text-align: left;
  margin-bottom: 4rem;
}

.blog-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.blog-hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 400;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.blog-post-card:hover {
  border-color: var(--border-hover);
  transform: scale(1.01);
}

.blog-post-card-inner {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.blog-post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post-date::before {
  content: '📅';
  font-size: 0.85rem;
}

.blog-post-card h2 {
  font-size: clamp(1.25rem, 2vw, 1.45rem);
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.blog-post-card h2 a {
  color: var(--text-primary);
  transition: color var(--transition);
}

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

.blog-post-excerpt {
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.blog-read-more {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition);
}

.blog-read-more::after {
  content: '→';
  transition: transform var(--transition);
}

.blog-read-more:hover {
  color: var(--accent-hover);
  opacity: 1;
}

.blog-read-more:hover::after {
  transform: translateX(4px);
}

/* Single post page */
.blog-article {
  max-width: 900px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  padding-inline: max(2rem, env(safe-area-inset-left));
  padding-inline-end: max(2rem, env(safe-area-inset-right));
  animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-article {
  transform: translateY(20px);
}

.blog-article .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 3rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.blog-article .back-link:hover {
  color: var(--text-primary);
  transform: translateX(-4px);
  background: rgba(255, 255, 255, 0.03);
  opacity: 1;
}

.blog-article h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  line-height: 1.15;
  color: var(--text-primary);
}

.blog-article .article-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 400;
}

.blog-article .article-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.blog-article .article-body {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 400;
}

.blog-article .article-body p {
  margin-bottom: 1.75rem;
  text-align: left;
}

.blog-article .article-body p:first-of-type {
  font-size: clamp(1.05rem, 1.25vw, 1.15rem);
  line-height: 1.8;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.blog-article .article-body h3 {
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1rem;
}

.blog-article .article-body h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.25rem;
  background: var(--accent);
  border-radius: 2px;
}

.blog-article .article-body h3:first-of-type {
  margin-top: 0;
}

/* Section heading */
.blog-article .article-body h2 {
  font-size: clamp(1.6rem, 2.25vw, 1.85rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.blog-article .article-body h2:first-of-type {
  margin-top: 2.5rem;
}

.blog-article .article-body em {
  font-style: italic;
  color: var(--text-primary);
}

.blog-article .article-body ul {
  margin: 1.5rem 0 2rem;
  padding-left: 0;
  list-style: none;
}

.blog-article .article-body li {
  margin-bottom: 1rem;
  line-height: 1.8;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.blog-article .article-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}

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

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

.blog-article .article-body a {
  color: var(--accent);
  font-weight: 500;
  transition: color var(--transition);
}

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

/* Before / After image comparison */
.before-after-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 3rem 0;
  padding: 2rem;
  width: 100vw;
  max-width: 960px;
  margin-left: max(-120px, calc(360px - 50vw));
  margin-right: max(-120px, calc(360px - 50vw));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-sizing: border-box;
}

.comparison-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comparison-item img {
  width: 100%;
  height: auto;
  min-height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: all var(--transition);
  background: var(--bg-dark);
}

.comparison-item:hover img {
  transform: scale(1.01);
  border-color: var(--border-hover);
}

.before-after-comparison .image-credit {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.before-after-comparison .image-credit a {
  color: var(--accent);
  font-weight: 500;
}

.before-after-comparison .image-credit a:hover {
  color: var(--accent-hover);
}

.comparison-item figcaption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 0.4rem 0.8rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 9999px;
  display: inline-block;
  align-self: center;
}

/* Responsive YouTube/video embed */
.video-container,
.video-embed-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 3rem auto;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.video-container iframe,
.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Break out comparison on larger screens only */
@media (max-width: 999px) {
  .before-after-comparison {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 600px) {
  .blog-article {
    padding: 6rem 1.5rem 3rem;
  }

  .blog-article h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .blog-article .article-body {
    font-size: 1rem;
  }

  .blog-article .article-body p:first-of-type {
    font-size: 1.05rem;
  }

  .before-after-comparison {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .comparison-item img {
    min-height: 220px;
  }

  .comparison-item figcaption {
    font-size: 0.75rem;
  }
}

/* ===== Group Collaborator Table ===== */
.group-table-wrapper {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.group-table thead {
  background: rgba(167, 139, 250, 0.08);
}

.group-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.group-table td {
  padding: 0.9rem 1.25rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.group-table tbody tr:last-child td {
  border-bottom: none;
}

.group-table tbody tr {
  transition: background 0.2s ease;
}

.group-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.group-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.group-table a {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.2s ease;
}

.group-table a:hover {
  color: var(--accent-hover);
}

/* ===== Audio Embed / SoundCloud ===== */
.audio-embed-wrapper {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.audio-embed-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
}

.audio-placeholder {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .group-table th,
  .group-table td {
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
  }
}

/* ===== Meme Analysis Sections ===== */
.meme-section {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s ease;
}

.meme-section:hover {
  border-color: var(--border-hover);
}

.meme-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.meme-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.meme-section p {
  margin-bottom: 0.75rem;
}

.meme-section .cite {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--accent);
  opacity: 0.8;
}

.conclusion-section {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(167, 139, 250, 0.04) 100%);
  border-color: rgba(167, 139, 250, 0.15);
}

/* Meme Image Figures */
.meme-figure {
  margin: 1.5rem 0;
  text-align: center;
}

.meme-figure img {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.meme-figure img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.meme-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 600px) {
  .meme-section {
    padding: 1.25rem;
    margin: 2rem 0;
  }

  .meme-section h2 {
    font-size: 1.25rem;
  }
}
