/* ============================================================
   ARTICLE PAGES — Epiphany Foster Care
   Base styles first, ALL media queries at the bottom.
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.article-hero {
  background: var(--purple);
  padding: 10rem 0 3rem;
  color: #fff;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color .2s;
}
.article-back:hover { color: var(--gold); }
.article-meta-top {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.article-cat {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .75rem;
  border-radius: 2rem;
}
.article-date, .article-read {
  color: rgba(255,255,255,.6);
  font-size: .85rem;
}
.article-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.2;
  max-width: 800px;
  margin: 0 0 1.5rem;
  color: #fff;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.article-byline img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.3);
}
.byline-name { font-weight: 600; font-size: .9rem; }
.byline-role { color: rgba(255,255,255,.6); font-size: .8rem; }

/* ── Cover image ──────────────────────────────────────────── */
.article-cover {
  height: 420px;
  overflow: hidden;
  background: var(--purple-d);
}
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Two-column layout ────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  align-items: start;
  background: #fff;
}

/* ── Sidebar (desktop: sticky left column) ─────────────────── */
.article-sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sidebar-card {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e8e3d8;
}
.sidebar-cta { background: var(--purple); border-color: var(--purple); color: #fff; }
.sidebar-cta p { color: rgba(255,255,255,.8); font-size: .88rem; line-height: 1.5; }
.sidebar-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  margin-bottom: .75rem;
}
.sidebar-cta .sidebar-label { color: var(--gold); }
.sidebar-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.sidebar-toc a {
  color: #444;
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.4;
  transition: color .2s;
  display: block;
  padding-left: .75rem;
  border-left: 2px solid transparent;
}
.sidebar-toc a:hover {
  color: var(--purple);
  border-left-color: var(--gold);
}

/* ── Article body ─────────────────────────────────────────── */
.article-body {
  min-width: 0;
  max-width: 720px;
}
.article-lead {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #333;
  font-weight: 500;
  border-left: 3px solid var(--gold);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}
.article-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  color: var(--purple);
  margin: 2.5rem 0 1rem;
  padding-top: .5rem;
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple);
  margin: 1.75rem 0 .75rem;
}
.article-body p {
  color: #444;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.article-quote {
  background: var(--cream);
  border-left: 4px solid var(--gold);
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.05rem;
  color: #333;
  line-height: 1.7;
}
.article-quote cite {
  display: block;
  margin-top: .75rem;
  font-style: normal;
  font-size: .85rem;
  font-weight: 600;
  color: var(--purple);
}
.article-list {
  margin: 1rem 0 1.5rem 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.article-list li {
  color: #444;
  line-height: 1.7;
  padding-left: 1.5rem;
  position: relative;
}
.article-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ── Info box ─────────────────────────────────────────────── */
.article-infobox {
  background: rgba(44,26,107,.06);
  border: 1px solid rgba(44,26,107,.15);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.article-infobox strong {
  display: block;
  color: var(--purple);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.article-infobox p { margin: 0; font-size: .92rem; }

/* ── Footer CTA ───────────────────────────────────────────── */
.article-footer-cta {
  background: var(--purple);
  color: #fff;
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin-top: 3rem;
}
.article-footer-cta h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  margin: 0 0 .5rem;
  color: #fff;
}
.article-footer-cta p {
  color: rgba(255,255,255,.8);
  margin-bottom: 1.25rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-outline-purple {
  border: 2px solid var(--purple);
  color: var(--purple);
  background: transparent;
  padding: .7rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .25s, color .25s;
}
.btn-outline-purple:hover { background: var(--purple); color: #fff; }
.btn-sm { padding: .6rem 1.25rem; font-size: .85rem; }

/* Outline button inside dark CTA — needs to be white, not purple-on-purple */
.article-footer-cta .btn-outline-purple {
  border-color: rgba(255,255,255,.55);
  color: #fff;
}
.article-footer-cta .btn-outline-purple:hover {
  background: rgba(255,255,255,.15);
  border-color: #fff;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — ALL media queries come after all base rules
   so overrides win the cascade correctly.
══════════════════════════════════════════════════════════ */

/* Tablet: collapse to single column, sidebar becomes static */
@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 4rem;
  }
  /* CRITICAL: remove sticky so sidebar doesn't float over article text */
  .article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .article-cover { height: 260px; }
  .article-hero { padding: 8rem 0 2.5rem; }
}

/* Mobile: single column for everything */
@media (max-width: 600px) {
  .article-sidebar {
    grid-template-columns: 1fr;
  }
  .article-hero { padding: 7rem 0 2rem; }
  .article-title { font-size: 1.55rem; }
  .article-cover { height: 200px; }
  .article-layout { padding: 1.75rem 1rem 3rem; }
  .article-body h2 { font-size: 1.3rem; }
  .article-quote { padding: 1.1rem 1.25rem; font-size: .95rem; }
  .article-footer-cta { padding: 1.5rem; }
  .article-footer-cta div[style*="flex"] { flex-direction: column !important; }
  .article-footer-cta .btn { width: 100%; justify-content: center; }
}
