/* =============================================================
   PP Article Detail — Styles for individual article pages
   Loaded AFTER pp-courses.css (which contains the full ppv2
   design system: tokens, navbar, buttons, reveal, footer, etc.)
   ============================================================= */

/* =====================================================
   ARTICLE HEADER — dark hero with breadcrumb
   ===================================================== */
.article-header {
  position: relative;
  padding: 140px 0 64px;
  background: var(--deep-1);
  overflow: hidden;
}
.article-header::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(167,139,250,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.article-header__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(20,184,166,0.08) 0%, transparent 40%);
}
.article-header__inner {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 56px;
  align-items: stretch;
}
.article-header__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Hero image — stretches to match text column height */
.article-header__image {
  border-radius: var(--radius-lg, 20px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.article-header__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Category pill */
.article-header__category {
  display: inline-block;
  width: fit-content;
  padding: 5px 14px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--teal-light);
  background: rgba(20,184,166,0.12);
  border: 1px solid rgba(20,184,166,0.2);
  margin-bottom: 16px;
}

/* Title */
.article-header__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15;
  color: var(--text-light); letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* Subtitle */
.article-header__subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.08rem); line-height: 1.65;
  color: var(--text-light-60);
  max-width: 640px;
  margin-bottom: 24px;
}

/* Meta row */
.article-header__meta {
  display: flex; align-items: center; gap: 20px;
  font-size: 0.8rem; color: var(--text-light-60);
  flex-wrap: wrap;
}
.article-header__meta-item {
  display: inline-flex; align-items: center; gap: 5px;
}
.article-header__meta-item svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
a.article-header__meta-item--author {
  color: var(--text-light-60);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.2);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
a.article-header__meta-item--author:hover {
  color: var(--text-light, #fff);
  border-color: var(--accent-light, #A78BFA);
}

/* =====================================================
   ARTICLE BODY — warm bg, centered prose
   ===================================================== */
.article-body {
  background: var(--warm-bg);
  padding: 64px 0 100px;
}
.article-body__inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Prose defaults */
.article-body__inner p {
  font-size: 1.05rem; line-height: 1.75;
  color: var(--text-dark-70);
  margin-bottom: 1.5rem;
}
.article-body__inner h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem); line-height: 1.25;
  color: var(--text-dark); letter-spacing: -0.01em;
  margin-top: 3rem; margin-bottom: 1rem;
  scroll-margin-top: 100px;
}
.article-body__inner h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.25rem); line-height: 1.3;
  color: var(--text-dark);
  margin-top: 2rem; margin-bottom: 0.75rem;
}
.article-body__inner a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.article-body__inner a:hover { color: var(--accent-light); }

.article-body__inner ul,
.article-body__inner ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.article-body__inner li {
  font-size: 1.05rem; line-height: 1.75;
  color: var(--text-dark-70);
  margin-bottom: 0.5rem;
}
.article-body__inner strong {
  color: var(--text-dark);
  font-weight: 600;
}

/* =====================================================
   KEY TAKEAWAYS — always first element, comet border
   ===================================================== */
.key-takeaways {
  position: relative;
  background: #fff;
  border: 1px solid var(--warm-border, #E8E0D8);
  border-radius: var(--radius-md, 12px);
  padding: 28px 32px;
  max-width: 740px;
  margin: 0 auto 2.5rem;
  overflow: hidden;
}

/* comet tail that orbits the key-takeaways border */
.key-takeaways::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--spark-angle, 0deg),
    transparent 0%,
    transparent 25%,
    rgba(167,139,250,0.02) 35%,
    rgba(167,139,250,0.08) 50%,
    rgba(167,139,250,0.2) 65%,
    #A78BFA 82%,
    #8B5CF6 90%,
    #22D3EE 97%,
    #fff 99.5%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: spark-rotate 5s linear infinite;
  pointer-events: none;
  opacity: 0.85;
}

/* glow layer — wider, blurred copy of the tail */
.key-takeaways::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 4px;
  background: conic-gradient(
    from var(--spark-angle, 0deg),
    transparent 0%,
    transparent 30%,
    rgba(167,139,250,0.03) 45%,
    rgba(167,139,250,0.1) 60%,
    rgba(139,92,246,0.25) 78%,
    rgba(34,211,238,0.35) 93%,
    rgba(255,255,255,0.5) 99%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: blur(5px);
  animation: spark-rotate 5s linear infinite;
  pointer-events: none;
  opacity: 0.6;
}

/* @property and keyframe — only defined if not already present from pp-designv2 */
@property --spark-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes spark-rotate {
  to { --spark-angle: 360deg; }
}

.key-takeaways h2,
.key-takeaways h3 {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; line-height: 1.3;
  color: var(--accent);
  margin: 0 0 12px 0;
}
.key-takeaways ul {
  position: relative; z-index: 1;
  list-style: none; padding: 0; margin: 0;
}
.key-takeaways li {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem; line-height: 1.6;
  color: var(--text-dark-70);
  margin-bottom: 8px;
}
.key-takeaways li:last-child {
  margin-bottom: 0;
}
.key-takeaways li::before {
  content: '';
  position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .key-takeaways::before,
  .key-takeaways::after { animation: none; opacity: 0; }
  .key-takeaways { border-left: 4px solid var(--accent); }
}

/* =====================================================
   TIP BOX
   ===================================================== */
.tip-box {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-left: 4px solid var(--success, #22C55E);
  border-radius: 0 var(--radius-md, 12px) var(--radius-md, 12px) 0;
  padding: 20px 24px;
  margin-bottom: 1.5rem;
}
.tip-box p {
  font-size: 0.95rem !important; line-height: 1.6;
  color: var(--text-dark-70); margin: 0 !important;
}

/* =====================================================
   WARNING BOX
   ===================================================== */
.warning-box {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  border-left: 4px solid var(--warning, #F59E0B);
  border-radius: 0 var(--radius-md, 12px) var(--radius-md, 12px) 0;
  padding: 20px 24px;
  margin-bottom: 1.5rem;
}
.warning-box p {
  font-size: 0.95rem !important; line-height: 1.6;
  color: var(--text-dark-70); margin: 0 !important;
}

/* =====================================================
   NOTE BOX
   ===================================================== */
.note-box {
  background: rgba(124,58,237,0.04);
  border: 1px solid rgba(124,58,237,0.12);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md, 12px) var(--radius-md, 12px) 0;
  padding: 20px 24px;
  margin-bottom: 1.5rem;
}
.note-box p {
  font-size: 0.95rem !important; line-height: 1.6;
  color: var(--text-dark-70); margin: 0 !important;
}

/* =====================================================
   EXAMPLE BOX
   ===================================================== */
.example-box {
  background: #fff;
  border: 1px solid var(--warm-border, #E8E0D8);
  border-radius: var(--radius-md, 12px);
  padding: 24px;
  margin-bottom: 1.5rem;
}
.example-box p {
  font-size: 0.95rem !important; line-height: 1.6;
  color: var(--text-dark-70); margin: 0 !important;
}

/* =====================================================
   STAT CALLOUT
   ===================================================== */
.stat-callout {
  display: flex; align-items: center; gap: 20px;
  background: #fff;
  border: 1px solid var(--warm-border, #E8E0D8);
  border-radius: var(--radius-md, 12px);
  padding: 24px 28px;
  margin-bottom: 1.5rem;
}
.stat-callout .stat-number {
  font-family: var(--font-display); font-weight: 800;
  font-size: 2.5rem; line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}
.stat-callout .stat-text p {
  font-size: 0.95rem !important; line-height: 1.6;
  color: var(--text-dark-70); margin: 0 !important;
}

/* =====================================================
   PROMPT EXAMPLE
   ===================================================== */
.prompt-example {
  background: var(--deep-2, #16102B);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.prompt-example__label {
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-light);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.prompt-example__text {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem; line-height: 1.7;
  color: var(--text-light-80, rgba(255,255,255,0.8));
  white-space: pre-wrap;
}

/* =====================================================
   PULL QUOTE
   ===================================================== */
.pull-quote {
  border-left: 4px solid var(--accent);
  padding: 8px 0 8px 24px;
  margin: 2rem 0;
}
.pull-quote p {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem !important; line-height: 1.5;
  color: var(--text-dark) !important;
  margin: 0 !important;
}

/* =====================================================
   READER QUESTION
   ===================================================== */
.reader-question {
  background: rgba(124,58,237,0.04);
  border-radius: var(--radius-md, 12px);
  padding: 24px 28px;
  margin: 2rem 0;
  text-align: center;
}
.reader-question p {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.1rem !important; line-height: 1.4;
  color: var(--text-dark) !important;
  margin: 0 !important;
}

/* =====================================================
   FAQ SECTION — dark full-width band, collapsible accordion
   ===================================================== */
.article-faq {
  background: var(--deep-2, #16102B);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.article-faq::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(167,139,250,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.article-faq__inner {
  position: relative; z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}
.article-faq h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem); line-height: 1.25;
  color: var(--text-light, #fff);
  margin: 0 0 2rem 0;
}
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md, 12px);
  transition: background 0.3s, border-color 0.3s;
}
.faq-item[open] {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.faq-item summary {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.95rem; line-height: 1.35;
  color: var(--text-light, #fff);
  padding: 20px 28px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; content: ''; }
.faq-item summary::after {
  content: '';
  width: 18px; height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after {
  transform: rotate(180deg);
}
.faq-item p {
  font-size: 0.88rem !important; line-height: 1.6;
  color: var(--text-light-60, rgba(255,255,255,0.6));
  padding: 0 28px 20px !important;
  margin: 0 !important;
}

/* =====================================================
   CLOSING CTA — full-width gradient band
   ===================================================== */
.article-cta {
  position: relative;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}
.article-cta__bg {
  position: absolute; inset: 0;
  background: var(--gradient-brand, linear-gradient(135deg, #1A1038 0%, #2D1B69 45%, #1B6B7A 100%));
}
.article-cta__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.25), transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(20,184,166,0.2), transparent 60%);
}
.article-cta__inner {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto;
  padding: 0 24px;
}
.article-cta__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2;
  color: #fff;
  margin-bottom: 14px;
}
.article-cta__text {
  font-size: 1rem; line-height: 1.65;
  color: rgba(255,255,255,0.8);
  margin-bottom: 28px;
}
.article-cta .btn-primary {
  display: inline-flex;
}

/* =====================================================
   RELATED ARTICLES — "Keep Reading" vertical cards
   ===================================================== */
.article-related {
  background: var(--warm-bg-2, #F3EDE6);
  padding: 80px 0;
}
.article-related__header {
  text-align: center;
  margin-bottom: 40px;
}
.article-related__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem); line-height: 1.25;
  color: var(--text-dark);
}
.article-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}
.related-card {
  background: #fff;
  border: 1px solid var(--warm-border, #E8E0D8);
  border-radius: var(--radius-lg, 20px);
  padding: 28px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--accent, #7C3AED);
}
.related-card__category {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
}
.related-card__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; line-height: 1.3;
  color: var(--text-dark);
  margin: 0;
}
.related-card__excerpt {
  font-size: 0.85rem; line-height: 1.55;
  color: var(--text-dark-50, rgba(26,16,56,0.5));
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card__meta {
  font-size: 0.78rem; color: var(--text-dark-50);
  margin-top: auto;
  display: flex; align-items: center; gap: 12px;
}
.related-card__meta-item {
  display: inline-flex; align-items: center; gap: 4px;
}
.related-card__meta-item svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1023px) {
  .article-header__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 780px;
  }
  .article-header__image img { aspect-ratio: 1200 / 630; height: auto; }
}

@media (max-width: 768px) {
  .article-header { padding: 120px 0 48px; }
  .article-header__inner { padding: 0 20px; }
  .article-body__inner { padding: 0 20px; }
  .article-body__inner ul,
  .article-body__inner ol { padding-left: 1.1rem; }
  .stat-callout { flex-direction: column; text-align: center; }
  .article-related__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .related-card { transition: none; }
}
