/* =========================================================
   BLOG ARTICLE DESIGN SYSTEM
   =========================================================
   Shared stylesheet for the site's hand-built long-form articles
   (apush-timeline.php, apush-historical-thinking-skills.php,
   apush-self-grade-essay.php, etc.) -- entirely separate from
   article-content.css, which is scoped only to CMS/DB-rendered
   pages via PostRenderService and must not be touched.

   Every rule here is scoped under .blog-article so this file can be
   loaded globally with zero effect on any page that doesn't opt in.

   Tokens reused from the site's own existing palette (main.css /
   tailwind-build.css), not invented:
     apush-blue   #1d4ed8   apush-purple #7c3aed
     apush-gold   #f59e0b   apush-green  #16a34a
     gray-900 #111827   gray-700 #374151   gray-600 #4b5563
     gray-200 #e5e7eb   gray-100 #f3f4f6
   ========================================================= */

/* --- Reading progress bar ------------------------------------------- */

.blog-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #1d4ed8, #7c3aed);
    z-index: 60;
    transition: width 0.1s ease-out;
}

/* --- Base article typography ----------------------------------------- */

.blog-article h2 {
    letter-spacing: -0.01em;
}

.blog-article .blog-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 0.5rem;
}
.dark .blog-article .blog-eyebrow { color: #60a5fa; }

/* --- Section rhythm: two treatments instead of one repeated card ------ */

.blog-section {
    padding: 1.5rem 0;
    border-top: 1px solid #e5e7eb;
}
.blog-section:first-of-type { border-top: none; padding-top: 0.5rem; }
.dark .blog-section { border-top-color: #374151; }

@media (min-width: 768px) {
    .blog-section { padding: 2rem 0; }
}

.blog-section--card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}
.dark .blog-section--card {
    background: #1f2937;
    border-color: #374151;
}
@media (min-width: 768px) {
    .blog-section--card { padding: 2rem; }
}

/* --- TL;DR / key takeaways box ---------------------------------------- */

.blog-tldr {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1px solid #bfdbfe;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin: 0 0 1.5rem;
}
.dark .blog-tldr {
    background: linear-gradient(135deg, rgba(29,78,216,0.12), rgba(124,58,237,0.12));
    border-color: #1d4ed8;
}
.blog-tldr-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 0.75rem;
}
.dark .blog-tldr-label { color: #93c5fd; }
.blog-tldr ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #1e3a8a;
}
.dark .blog-tldr ul { color: #dbeafe; }
.blog-tldr li { margin-bottom: 0.4rem; }
.blog-tldr li:last-child { margin-bottom: 0; }

/* --- Sticky, scroll-aware table of contents ---------------------------- */

.blog-toc {
    position: sticky;
    top: 5rem;
    z-index: 10;
}

.blog-toc a {
    position: relative;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.blog-toc a.is-active {
    border-left-color: #1d4ed8;
    color: #1d4ed8 !important;
    font-weight: 700;
}
.dark .blog-toc a.is-active { border-left-color: #60a5fa; color: #60a5fa !important; }

/* --- Callouts: one consistent set instead of ad hoc inline color boxes - */

.blog-callout {
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid transparent;
}
.blog-callout p:last-child { margin-bottom: 0; }

.blog-callout--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.dark .blog-callout--info {
    background: rgba(29,78,216,0.12);
    border-color: #1d4ed8;
    color: #dbeafe;
}

.blog-callout--warning {
    background: linear-gradient(to right, #fffbeb, #fff7ed);
    border-color: #fde68a;
    color: #92400e;
}
.dark .blog-callout--warning {
    background: rgba(120,53,15,0.2);
    border-color: #b45309;
    color: #fef3c7;
}

.blog-callout--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}
.dark .blog-callout--success {
    background: rgba(21,128,61,0.15);
    border-color: #16a34a;
    color: #dcfce7;
}

.blog-callout--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}
.dark .blog-callout--danger {
    background: rgba(153,27,27,0.15);
    border-color: #b91c1c;
    color: #fee2e2;
}

/* --- Pull quote: one standout idea per article -------------------------- */

.blog-pullquote {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    color: #111827;
    border-left: 4px solid #7c3aed;
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 2rem 0;
}
.dark .blog-pullquote { color: #f3f4f6; border-left-color: #a78bfa; }

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .blog-progress { transition: none; }
    .blog-toc a { transition: none; }
}
