/* ===== Magazine Layout Styles ===== */
/* Applied to articles with rich HTML (mag-* classes) from Supabase */

/* Global rule: ALL article images have rounded corners */
.article-body img,
.article-page img {
  border-radius: 12px;
}

/* --- Drop Cap --- */
.mag-dropcap::first-letter {
  float: left;
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 4.5rem;
  line-height: 0.75;
  font-weight: 800;
  color: #7c3aed;
  padding-right: 12px;
  padding-top: 8px;
  margin-bottom: -4px;
}

/* --- Intro --- */
.mag-intro {
  margin-bottom: 32px;
}
.mag-intro p {
  font-size: 1.18rem;
  line-height: 1.75;
  color: #1f2937;
  letter-spacing: -0.01em;
}

/* --- Hero Figure --- */
.mag-hero {
  margin: 40px -20px;
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}
.mag-hero img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  transition: transform 0.4s ease;
}
.mag-hero:hover img {
  transform: scale(1.02);
}
.mag-hero figcaption {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  padding: 10px 40px 0;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --- Pull Quote --- */
.mag-pullquote {
  margin: 40px 0;
  padding: 28px 36px;
  border-left: 4px solid #a78bfa;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(139, 92, 246, 0.02));
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  color: #1f2937;
  font-style: italic;
  position: relative;
}
.mag-pullquote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 4rem;
  color: #a78bfa;
  font-family: Georgia, serif;
  line-height: 1;
  opacity: 0.4;
}

/* --- Media Row (image + text side by side) --- */
.mag-media-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
  margin: 40px 0;
}
.mag-media-row--reverse {
  grid-template-columns: 1fr 300px;
}
.mag-media-row--reverse .mag-figure { order: 2; }
.mag-media-row--reverse .mag-media-text { order: 1; }

/* --- Figure --- */
.mag-figure {
  overflow: hidden;
  border-radius: 14px;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.mag-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.mag-figure:hover img {
  transform: scale(1.03);
}
.mag-figure--round {
  border-radius: 50%;
  aspect-ratio: 1;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.15);
}
.mag-figure--round img {
  aspect-ratio: 1;
  object-fit: cover;
}
.mag-figure--portrait img {
  max-height: 420px;
}

/* --- Media Text --- */
.mag-media-text p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #374151;
  margin: 0 0 16px;
}
.mag-media-text p:first-child {
  margin-top: 0;
}
.mag-media-text p:last-child {
  margin-bottom: 0;
}

/* --- Section Headers (h3 inside magazine articles) --- */
.article-body h3 {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
  letter-spacing: -0.01em;
}
.article-body h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: #7c3aed;
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: middle;
}

/* --- Body paragraphs refinement --- */
.article-body > p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 24px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .mag-hero {
    margin: 24px -12px;
    border-radius: 12px;
  }
  .mag-hero img {
    max-height: 300px;
    border-radius: 12px;
  }
  .mag-media-row,
  .mag-media-row--reverse {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .mag-media-row--reverse .mag-figure,
  .mag-media-row--reverse .mag-media-text { order: unset; }
  .mag-figure--round {
    max-width: 180px;
    margin: 0 auto;
  }
  .mag-pullquote {
    font-size: 1.1rem;
    padding: 20px 24px;
    margin: 28px 0;
  }
  .mag-pullquote::before {
    font-size: 3rem;
    top: -4px;
    left: 8px;
  }
  .mag-dropcap::first-letter {
    font-size: 3.5rem;
  }
  .article-body h3 {
    font-size: 1.3rem;
    margin: 36px 0 12px;
  }
}
