/**
 * SiloPress — Frontend Article Styles
 * Editorial Magazine Aesthetic — Refined, Sophisticated, Memorable
 * 
 * Design Direction: High-end science magazine meets modern editorial
 * Typography: Playfair Display (display) + Source Serif 4 (body)
 * Color: Deep ink tones with warm amber accents
 * 
 * @package SiloPress
 * @since   2.5.0
 */

/* ==========================================================================
   Font Imports — Distinctive Typography
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400;1,8..60,500&family=DM+Mono:wght@400;500&display=swap');

/* ==========================================================================
   CSS Variables — Editorial Magazine Palette
   ========================================================================== */
:root {
    /* Ink & Paper — The Foundation */
    --sp-ink: #1a1a1a;
    --sp-ink-soft: #2d2d2d;
    --sp-ink-muted: #6b6b6b;
    --sp-ink-faded: #999999;
    --sp-paper: #faf9f7;
    --sp-paper-warm: #f5f3ef;
    --sp-paper-cream: #fffef9;
    
    /* Accent — Warm Amber/Gold */
    --sp-accent: #c9a227;
    --sp-accent-deep: #a68419;
    --sp-accent-glow: #e8c547;
    --sp-accent-subtle: rgba(201, 162, 39, 0.08);
    
    /* Secondary — Deep Teal */
    --sp-teal: #1a5f5f;
    --sp-teal-soft: #2a7a7a;
    
    /* Semantic */
    --sp-success: #2d6a4f;
    --sp-warning: #b8860b;
    --sp-error: #9b2c2c;
    --sp-info: #2c5282;
    
    /* Typography */
    --sp-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --sp-font-body: 'Source Serif 4', Georgia, serif;
    --sp-font-mono: 'DM Mono', 'Consolas', monospace;
    
    /* Spacing Scale */
    --sp-space-1: 0.25rem;
    --sp-space-2: 0.5rem;
    --sp-space-3: 0.75rem;
    --sp-space-4: 1rem;
    --sp-space-6: 1.5rem;
    --sp-space-8: 2rem;
    --sp-space-12: 3rem;
    --sp-space-16: 4rem;
    --sp-space-24: 6rem;
    
    /* Layout */
    --sp-content-width: 680px;
    --sp-wide-width: 920px;
    
    /* Effects */
    --sp-shadow-editorial: 0 2px 40px rgba(0, 0, 0, 0.06);
    --sp-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
    --sp-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --sp-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --sp-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ==========================================================================
   Article Container — The Canvas
   ========================================================================== */
.sp-article,
.entry-content,
.post-content,
article .content {
    font-family: var(--sp-font-body);
    font-size: 1.1875rem;
    font-weight: 400;
    line-height: 1.85;
    color: var(--sp-ink);
    max-width: var(--sp-content-width);
    margin: 0 auto;
    padding: var(--sp-space-8) var(--sp-space-6);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Paragraphs — The Prose
   ========================================================================== */
.sp-article-paragraph,
.entry-content p,
article p {
    margin: 0 0 var(--sp-space-6);
    color: var(--sp-ink-soft);
    letter-spacing: -0.003em;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* Lead Paragraph — Editorial Opening */
.sp-article-paragraph:first-of-type,
.entry-content > p:first-of-type {
    font-size: 1.375rem;
    line-height: 1.75;
    color: var(--sp-ink);
    font-weight: 400;
    margin-bottom: var(--sp-space-8);
}

/* Drop Cap — Magazine Signature */
.sp-article-paragraph:first-of-type::first-letter,
.entry-content > p:first-of-type::first-letter {
    float: left;
    font-family: var(--sp-font-display);
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 0.75;
    margin: 0.1em 0.15em 0 0;
    color: var(--sp-ink);
    text-transform: uppercase;
}

/* ==========================================================================
   Section Headings — Editorial Hierarchy
   ========================================================================== */
.sp-article-section,
.entry-content h2,
article h2 {
    font-family: var(--sp-font-display);
    font-size: 2rem;
    font-weight: 600;
    font-style: normal;
    color: var(--sp-ink);
    margin: var(--sp-space-16) 0 var(--sp-space-6);
    padding: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
    position: relative;
}

/* Accent Line — Subtle Editorial Touch */
.sp-article-section::before,
.entry-content h2::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--sp-accent);
    margin-bottom: var(--sp-space-4);
}

/* Subsection Headings */
.sp-article-subsection,
.entry-content h3,
article h3 {
    font-family: var(--sp-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
    color: var(--sp-ink);
    margin: var(--sp-space-12) 0 var(--sp-space-4);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Key Takeaways — Editorial Callout Box
   ========================================================================== */
.sp-article-takeaways {
    background: var(--sp-paper-warm);
    border: none;
    border-left: 4px solid var(--sp-accent);
    padding: var(--sp-space-8);
    margin: var(--sp-space-12) 0;
    position: relative;
}

.sp-article-takeaways::before {
    content: 'Ce qu\'il faut retenir';
    display: block;
    font-family: var(--sp-font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sp-accent-deep);
    margin-bottom: var(--sp-space-4);
}

.sp-article-takeaways-title {
    display: none;
}

.sp-article-takeaways ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-article-takeaways li {
    position: relative;
    padding-left: var(--sp-space-6);
    margin-bottom: var(--sp-space-3);
    font-family: var(--sp-font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--sp-ink-soft);
}

.sp-article-takeaways li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--sp-accent);
    font-weight: 500;
}

/* ==========================================================================
   Table of Contents — Refined Navigation
   ========================================================================== */
.sp-article-toc {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    padding: var(--sp-space-6) var(--sp-space-6) var(--sp-space-4);
    margin: var(--sp-space-8) 0 var(--sp-space-12);
}

.sp-article-toc-title {
    display: flex;
    align-items: center;
    gap: 0.35em;
    font-family: var(--sp-font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--sp-ink-muted);
    margin-bottom: var(--sp-space-4);
    padding-bottom: var(--sp-space-3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sp-article-toc-title::before {
    content: none;
}

.sp-article-toc-title[role="button"]:hover {
    color: var(--sp-ink-soft);
}

.sp-article-toc .sp-toc-chevron {
    background: rgba(0, 0, 0, 0.04);
}

.sp-article-toc .sp-toc-chevron::after {
    border-color: var(--sp-ink-muted);
}

.sp-article-toc-title[role="button"]:hover .sp-toc-chevron {
    background: rgba(0, 0, 0, 0.07);
}

.sp-article-toc.sp-toc-collapsed .sp-article-toc-title {
    border-bottom-color: transparent;
}

.sp-article-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.sp-article-toc li {
    counter-increment: toc;
    margin-bottom: 0;
}

.sp-article-toc a {
    font-family: var(--sp-font-body);
    font-size: 0.95rem;
    color: var(--sp-ink-soft);
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 2px;
    transition: color 0.2s var(--sp-ease-out), background-color 0.2s ease;
}

.sp-article-toc a::before {
    content: counter(toc, decimal-leading-zero) '.';
    flex-shrink: 0;
    min-width: 1.6rem;
    color: var(--sp-accent);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
}

.sp-article-toc a:hover {
    color: var(--sp-ink);
    background: rgba(0, 0, 0, 0.03);
}

/* Sub-list (H3) */
.sp-article-toc ol.sp-toc-sub a {
    font-size: 0.88rem;
    color: var(--sp-ink-muted);
    padding: 0.28rem 0.5rem;
}

.sp-article-toc ol.sp-toc-sub a:hover {
    color: var(--sp-ink-soft);
}

.sp-article-toc ol.sp-toc-sub a::before {
    content: counter(toc) '.' counter(sp-toc-sub);
    min-width: 1.8rem;
    font-size: 0.75rem;
}

/* ==========================================================================
   Figures & Images — Editorial Photography
   ========================================================================== */
.sp-article-figure,
.entry-content figure,
article figure {
    margin: var(--sp-space-12) calc(-1 * var(--sp-space-6));
    padding: 0;
    position: relative;
}

@media (min-width: 800px) {
    .sp-article-figure,
    .entry-content figure,
    article figure {
        margin-left: calc((var(--sp-wide-width) - var(--sp-content-width)) / -2);
        margin-right: calc((var(--sp-wide-width) - var(--sp-content-width)) / -2);
        max-width: var(--sp-wide-width);
    }
}

.sp-article-figure img,
.entry-content figure img,
article figure img {
    width: 100%;
    height: auto;
    display: block;
}

.sp-article-figure figcaption,
.entry-content figcaption,
article figcaption {
    font-family: var(--sp-font-body);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--sp-ink-muted);
    text-align: left;
    padding: var(--sp-space-4) var(--sp-space-6) 0;
    max-width: var(--sp-content-width);
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Blockquotes — Editorial Pull Quotes
   ========================================================================== */
.entry-content blockquote,
article blockquote {
    margin: var(--sp-space-12) 0;
    padding: 0;
    border: none;
    position: relative;
}

.entry-content blockquote::before,
article blockquote::before {
    content: '"';
    display: block;
    font-family: var(--sp-font-display);
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--sp-accent);
    opacity: 0.3;
    position: absolute;
    top: -1.5rem;
    left: -0.5rem;
}

.entry-content blockquote p,
article blockquote p {
    font-family: var(--sp-font-display);
    font-size: 1.625rem;
    font-weight: 500;
    font-style: italic;
    line-height: 1.45;
    color: var(--sp-ink);
    margin: 0;
    padding-left: var(--sp-space-8);
    border-left: 3px solid var(--sp-accent);
}

.entry-content blockquote cite,
article blockquote cite {
    display: block;
    font-family: var(--sp-font-body);
    font-size: 0.9375rem;
    font-style: normal;
    font-weight: 500;
    color: var(--sp-ink-muted);
    margin-top: var(--sp-space-4);
    padding-left: var(--sp-space-8);
        
}
cite {
    letter-spacing: normal !important;

}

.entry-content blockquote cite::before,
article blockquote cite::before {
    content: '— ';
    color: var(--sp-accent);
}

/* Generic ul/ol/li styles REMOVED — they break WooCommerce pagination,
   product grids, widget lists, and other non-article list UX.
   List styling is intentionally left to the active theme. */

/* ==========================================================================
   Links — Subtle & Refined
   ========================================================================== */
.sp-internal-link,
.entry-content a,
article a {
    color: var(--sp-ink);
    text-decoration: none;
    background-image: linear-gradient(var(--sp-accent), var(--sp-accent));
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--sp-ease-out), color 0.2s;
}

.sp-internal-link:hover,
.entry-content a:hover,
article a:hover {
    color: var(--sp-accent-deep);
    background-size: 100% 2px;
}

/* ==========================================================================
   FAQ Section — Accordion Revelation
   ========================================================================== */
.sp-article-faq {
    margin: var(--sp-space-16) 0;
    padding: 0;
    background: transparent;
}

.sp-article-faq > h2.sp-article-section {
    font-family: var(--sp-font-display);
    font-size: 1.375rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--sp-ink);
    margin: 0 0 var(--sp-space-6);
    padding: 0.25em 0 0.35em var(--sp-space-4);
    border-bottom: none;
    border-left: 3px solid var(--sp-accent);
    display: flex;
    align-items: center;
    gap: var(--sp-space-4);
    line-height: 1.2;
}

.sp-article-faq > h2.sp-article-section::before { content: none; }

/* Amber "FAQ" tag — right side */
.sp-article-faq > h2.sp-article-section::after {
    content: 'FAQ';
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    background: var(--sp-accent);
    color: var(--sp-paper-cream);
    font-family: var(--sp-font-mono);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px 3px;
    border-radius: 2px;
}

/* Spacing between heading and first item */
.sp-article-faq > h2.sp-article-section + * {
    margin-top: 0;
    padding-top: 0;
}

/* --- Each FAQ item -------------------------------------------------------- */
.sp-faq-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    transition: background 0.2s var(--sp-ease-out);
}

.sp-faq-item:last-child { border-bottom: none; }

/* Question — accordion trigger */
.sp-faq-item h3 {
    font-family: var(--sp-font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    font-style: normal;
    color: var(--sp-ink);
    margin: 0;
    padding: 1.25rem 0;
    line-height: 1.42;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-space-4);
    transition: color 0.22s var(--sp-ease-out);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    position: relative;
}

/* "Q" badge — outlined amber square */
.sp-faq-item h3::before {
    content: 'Q';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 1.5px solid var(--sp-accent);
    color: var(--sp-accent);
    font-family: var(--sp-font-display);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-top: 0.06em;
    background: transparent;
    transition: background 0.25s var(--sp-ease-out), color 0.25s var(--sp-ease-out),
                border-color 0.25s var(--sp-ease-out);
}

/* Rotating chevron — right side */
.sp-faq-item h3::after {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-left: auto;
    margin-top: 0.22em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a227' stroke-width='2.2' 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;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

/* Hover */
.sp-faq-item h3:hover { color: var(--sp-accent-deep); }
.sp-faq-item h3:hover::before { background: var(--sp-accent-subtle); }
.sp-faq-item h3:hover::after  { opacity: 1; }

/* Open state */
.sp-faq-item.sp-faq-open h3::before {
    background: var(--sp-accent);
    color: var(--sp-paper-cream);
    border-color: var(--sp-accent);
}
.sp-faq-item.sp-faq-open h3::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* Answer — JS sets all height/overflow/opacity via setProperty('…','important').
   CSS here is a fallback only (no !important so JS inline-important always wins). */
.sp-faq-item h3 + div {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.44s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}

.sp-faq-item.sp-faq-open h3 + div {
    opacity: 1;
    pointer-events: auto;
}

/* Answer paragraph */
.sp-faq-item p {
    font-family: var(--sp-font-body);
    font-size: 1.0625rem;
    line-height: 1.82;
    color: var(--sp-ink-soft);
    margin: 0;
    padding: 0 0 var(--sp-space-6) 3.2rem;
    position: relative;
}

/* Vertical accent line beside answer */
.sp-faq-item p::before {
    content: '';
    position: absolute;
    left: 1.875rem;
    top: 0.3em;
    bottom: var(--sp-space-6);
    width: 1.5px;
    background: linear-gradient(to bottom, var(--sp-accent) 0%, transparent 100%);
    opacity: 0.28;
}

/* ==========================================================================
   Sources Section — Collapsible Research Footnotes
   ========================================================================== */
.sp-article-sources {
    margin: var(--sp-space-16) 0 var(--sp-space-8);
    padding: var(--sp-space-6) 0 0;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Heading — acts as expand/collapse trigger */
.sp-article-sources > h2.sp-article-section {
    font-family: var(--sp-font-display);
    font-size: 1.125rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--sp-ink);
    margin: 0;
    padding: 0.35em 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: var(--sp-space-3);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    transition: color 0.2s var(--sp-ease-out);
    line-height: 1.2;
}

.sp-article-sources > h2.sp-article-section::before { content: none; }
.sp-article-sources > h2.sp-article-section:hover { color: var(--sp-ink); }

/* Count badge — injected by JS */
.sp-sources-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-accent-subtle);
    border: 1px solid rgba(201, 162, 39, 0.25);
    color: var(--sp-accent-deep);
    font-family: var(--sp-font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 2px;
    min-width: 1.6rem;
    text-align: center;
    letter-spacing: 0;
    line-height: 1.5;
    flex-shrink: 0;
}

/* Chevron — injected by JS */
.sp-sources-chevron {
    display: inline-block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-left: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a227' stroke-width='2' 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;
    background-position: center;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.65;
}

.sp-article-sources.sp-sources-open .sp-sources-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Divider that appears when open */
.sp-article-sources.sp-sources-open > h2.sp-article-section {
    padding-bottom: var(--sp-space-4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 0;
}

/* ── Collapsed content — JS drives all height/overflow via setProperty('…','important').
   CSS here is a fallback only (no !important so JS inline-important always wins).
   Targets both article-writer (.sp-sources-primary/.sp-sources-additional with plain <li>)
   and metabox (.sp-sources-list with .sp-source-item) structures.          */
.sp-article-sources .sp-sources-primary,
.sp-article-sources .sp-sources-additional,
.sp-article-sources .sp-sources-list,
.sp-article-sources .sp-sources-subheading {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    transition: max-height 0.44s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin 0.28s ease;
}

/* Open state: JS drives max-height/overflow via inline styles; CSS handles opacity + spacing. */
.sp-article-sources.sp-sources-open .sp-sources-primary,
.sp-article-sources.sp-sources-open .sp-sources-additional,
.sp-article-sources.sp-sources-open .sp-sources-list {
    opacity: 1;
    padding-top: var(--sp-space-3);
}

.sp-article-sources.sp-sources-open .sp-sources-subheading {
    opacity: 1;
    margin-top: var(--sp-space-6);
    margin-bottom: var(--sp-space-2);
}

/* ── Subheading (article-writer: h3.sp-sources-subheading) ──────────────── */
.sp-sources-subheading {
    font-family: var(--sp-font-display);
    font-size: 0.5625rem;
    font-weight: 700;
    font-style: normal !important;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sp-ink-faded);
    padding: 0;
    border: none;
    line-height: 1.2;
}

.sp-sources-subheading::before,
.sp-sources-subheading::after { content: none !important; }

/* ── Article-writer source lists (plain <li>, no classes) ───────────────── */
.sp-sources-primary,
.sp-sources-additional {
    list-style: none !important;
    margin: 0;
    padding: 0 !important;
}

/* Kill any theme li::before bullets (■, •, etc.) */
.sp-sources-primary > li::before,
.sp-sources-additional > li::before {
    content: none !important;
    display: none !important;
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
}

.sp-sources-primary > li,
.sp-sources-additional > li {
    list-style: none !important;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    line-height: 1.45;
    margin: 0;
}

.sp-sources-primary > li:last-child,
.sp-sources-additional > li:last-child { border-bottom: none; }

/* Link */
.sp-sources-primary > li > a,
.sp-sources-additional > li > a {
    font-family: var(--sp-font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--sp-ink-soft);
    text-decoration: none;
    background: none !important;
    background-image: none !important;
    line-height: 1.45;
    transition: color 0.18s var(--sp-ease-out);
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
}

.sp-sources-primary > li > a:hover,
.sp-sources-additional > li > a:hover {
    color: var(--sp-accent-deep);
    background: none !important;
    background-image: none !important;
}

/* Domain / lang meta (<small> after <a>) */
.sp-sources-primary > li > small,
.sp-sources-additional > li > small {
    font-family: var(--sp-font-mono);
    font-size: 0.5625rem;
    color: var(--sp-ink-faded);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.6;
}

/* ── Metabox source list (.sp-sources-list with .sp-source-item) ─────────── */
.sp-sources-list {
    list-style: none !important;
    margin: 0;
    padding: 0 !important;
    counter-reset: sp-src-num;
}

/* Kill theme li::before generically within the list */
.sp-sources-list > li::before {
    content: none !important;
    display: none !important;
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
}

/* Override for actual .sp-source-item — restore counter as numbered badge */
.sp-sources-list .sp-source-item {
    counter-increment: sp-src-num;
    display: grid;
    grid-template-columns: 1.75rem 1fr auto;
    grid-template-rows: auto auto;
    column-gap: var(--sp-space-3);
    align-items: start;
    padding: var(--sp-space-3) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    list-style: none !important;
    position: relative;
}

.sp-sources-list .sp-source-item:last-child { border-bottom: none; }

/* Counter number — higher specificity beats the li::before suppression above */
.sp-sources-list .sp-source-item::before {
    content: counter(sp-src-num) !important;
    display: block !important;
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    grid-column: 1;
    grid-row: 1 / 3;
    font-family: var(--sp-font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--sp-accent);
    opacity: 0.65;
    padding-top: 0.35em;
    align-self: start;
    line-height: 1;
    border-radius: 0 !important;
}

/* Source link */
.sp-source-link {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--sp-font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--sp-ink-soft);
    text-decoration: none;
    background: none;
    display: block;
    line-height: 1.45;
    transition: color 0.18s var(--sp-ease-out);
    padding: 0;
    margin: 0;
}

.sp-source-link:hover {
    color: var(--sp-ink);
    background: none;
    background-image: none;
}

/* Domain chip */
.sp-source-domain {
    grid-column: 2;
    grid-row: 2;
    display: inline-block;
    font-family: var(--sp-font-mono);
    font-size: 0.625rem;
    color: var(--sp-ink-faded);
    background: var(--sp-paper-warm);
    padding: 1px 6px;
    border-radius: 1px;
    margin-top: 3px;
    letter-spacing: 0.01em;
    align-self: start;
    line-height: 1.6;
}

/* Expand toggle — injected by JS (column 3) */
.sp-source-expand-btn {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--sp-accent);
    font-family: var(--sp-font-mono);
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.18s, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sp-sources-list .sp-source-item:hover .sp-source-expand-btn { opacity: 0.8; }
.sp-sources-list .sp-source-item.sp-source-open .sp-source-expand-btn {
    opacity: 1;
    transform: rotate(45deg);
}

/* Snippet — slides open */
.sp-source-snippet {
    grid-column: 2 / 4;
    font-family: var(--sp-font-body);
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--sp-ink-muted);
    font-style: italic;
    margin: 0;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s var(--sp-ease-out),
                margin-top 0.25s var(--sp-ease-out);
}

.sp-sources-list .sp-source-item.sp-source-open .sp-source-snippet {
    max-height: 240px !important;
    overflow: visible !important;
    opacity: 1;
    margin-top: var(--sp-space-2);
}

/* Mobile: always show expand hint */
@media (max-width: 600px) {
    .sp-source-expand-btn { opacity: 0.5; }
}

/* ==========================================================================
   Call to Action — Elegant Invitation
   ========================================================================== */
.sp-article-cta {
    margin: var(--sp-space-12) 0;
    padding: var(--sp-space-8);
    background: var(--sp-ink);
    color: var(--sp-paper);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sp-article-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--sp-accent);
}

.sp-article-cta-title {
    font-family: var(--sp-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--sp-space-2);
    color: var(--sp-paper);
}

.sp-article-cta-text {
    font-family: var(--sp-font-body);
    font-size: 1rem;
    color: var(--sp-ink-faded);
    margin-bottom: var(--sp-space-6);
}

.sp-article-cta-button {
    display: inline-block;
    padding: var(--sp-space-3) var(--sp-space-8);
    background: var(--sp-accent);
    color: var(--sp-ink);
    font-family: var(--sp-font-display);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.25s var(--sp-ease-out);
}

.sp-article-cta-button:hover {
    background: var(--sp-accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3);
}

/* ==========================================================================
   Info Boxes — Editorial Asides
   ========================================================================== */
.sp-article-info {
    margin: var(--sp-space-8) 0;
    padding: var(--sp-space-6);
    font-family: var(--sp-font-body);
    font-size: 0.9375rem;
    line-height: 1.65;
    border-left: 3px solid;
}

.sp-article-info.sp-info-tip {
    background: var(--sp-accent-subtle);
    border-color: var(--sp-accent);
}

.sp-article-info.sp-info-warning {
    background: rgba(184, 134, 11, 0.08);
    border-color: var(--sp-warning);
}

.sp-article-info.sp-info-important {
    background: rgba(155, 44, 44, 0.06);
    border-color: var(--sp-error);
}

.sp-article-info.sp-info-success {
    background: rgba(45, 106, 79, 0.06);
    border-color: var(--sp-success);
}

.sp-article-info-title {
    font-family: var(--sp-font-display);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--sp-space-2);
    color: inherit;
}

/* ==========================================================================
   Statistics Highlight — Data Emphasis
   ========================================================================== */
.sp-article-stat {
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-space-1);
    font-family: var(--sp-font-body);
}

.sp-article-stat-value {
    font-family: var(--sp-font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--sp-accent-deep);
}

.sp-article-stat-label {
    font-size: 0.9375rem;
    color: var(--sp-ink-muted);
}

/* ==========================================================================
   Strong & Emphasis — Typography Details
   ========================================================================== */
.entry-content strong,
article strong {
    font-weight: 600;
    color: var(--sp-ink);
}

.entry-content em,
article em {
    font-style: italic;
}

/* ==========================================================================
   Code — Monospace Elements
   ========================================================================== */
.entry-content code,
article code {
    font-family: var(--sp-font-mono);
    font-size: 0.875em;
    background: var(--sp-paper-warm);
    padding: 0.15em 0.4em;
    border-radius: 2px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .sp-article,
    .entry-content,
    .post-content,
    article .content {
        padding: var(--sp-space-6) var(--sp-space-4);
        font-size: 1.0625rem;
    }
    
    .sp-article-paragraph:first-of-type::first-letter,
    .entry-content > p:first-of-type::first-letter {
        font-size: 4rem;
    }
    
    .sp-article-section,
    .entry-content h2,
    article h2 {
        font-size: 1.625rem;
        margin-top: var(--sp-space-12);
    }
    
    .sp-article-figure,
    .entry-content figure,
    article figure {
        margin-left: calc(-1 * var(--sp-space-4));
        margin-right: calc(-1 * var(--sp-space-4));
    }
    
    .entry-content blockquote p,
    article blockquote p {
        font-size: 1.375rem;
    }
}

/* ==========================================================================
   Print Styles — Clean Output
   ========================================================================== */
@media print {
    .sp-article-cta,
    .sp-article-toc {
        display: none !important;
    }
    
    .sp-article,
    .entry-content {
        max-width: 100%;
        padding: 0;
        font-size: 11pt;
    }
    
    .sp-article-figure,
    .entry-content figure {
        margin: 1.5em 0;
        page-break-inside: avoid;
    }
    
    .sp-article-section,
    .entry-content h2 {
        page-break-after: avoid;
    }
    
    a {
        color: inherit !important;
        text-decoration: underline;
    }
}

/* ==========================================================================
   Animations — Subtle Reveals
   ========================================================================== */
@keyframes sp-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-article-section,
.sp-article-figure,
.sp-faq-item {
    animation: sp-fade-up 0.6s var(--sp-ease-out) both;
}

.sp-article-section:nth-of-type(1) { animation-delay: 0.1s; }
.sp-article-section:nth-of-type(2) { animation-delay: 0.15s; }
.sp-article-section:nth-of-type(3) { animation-delay: 0.2s; }
.sp-article-section:nth-of-type(4) { animation-delay: 0.25s; }
.sp-article-section:nth-of-type(5) { animation-delay: 0.3s; }

/* ==========================================================================
   Info Boxes — Expert Tips & Warnings (Reader Retention Elements)
   ========================================================================== */
.sp-info-box {
    border-radius: 6px;
    padding: var(--sp-space-6) var(--sp-space-8);
    margin: var(--sp-space-8) 0;
    font-family: var(--sp-font-body);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.sp-info-box p {
    margin: 0 0 var(--sp-space-2);
}

.sp-info-box p:last-child {
    margin-bottom: 0;
}

.sp-info-box p strong {
    font-size: 1rem;
}

/* Tip Box — Expert advice (emerald) */
.sp-info-box-tip {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-left: 5px solid #34d399;
    color: #fff;
}
.sp-info-box-tip strong { color: #fff; }
.sp-info-box-tip a { color: #a7f3d0; }

/* Warning Box — Common mistakes (amber) */
.sp-info-box-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: none;
    border-left: 5px solid #fbbf24;
    color: #fff;
}
.sp-info-box-warning strong { color: #fff; }
.sp-info-box-warning a { color: #fde68a; }

/* Important Box — Critical information (red) */
.sp-info-box-important {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    border-left: 5px solid #f87171;
    color: #fff;
}
.sp-info-box-important strong { color: #fff; }
.sp-info-box-important a { color: #fecaca; }

/* Research Box — Study context & findings (indigo) */
.sp-info-box-research {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    border-left: 5px solid #818cf8;
    color: #fff;
}
.sp-info-box-research strong { color: #fff; }
.sp-info-box-research a { color: #c7d2fe; }

/* Definition Box — Terminology (cyan) */
.sp-info-box-definition {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border: none;
    border-left: 5px solid #22d3ee;
    color: #fff;
}
.sp-info-box-definition strong { color: #fff; }
.sp-info-box-definition a { color: #a5f3fc; }

/* Contraindication Box — Medical safety (rose) */
.sp-info-box-contraindication {
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    border: none;
    border-left: 5px solid #fb7185;
    color: #fff;
}
.sp-info-box-contraindication strong { color: #fff; }
.sp-info-box-contraindication a { color: #fecdd3; }

/* Urgent Box — Emergency / consult a doctor (burnt orange) */
.sp-info-box-urgent {
    background: linear-gradient(135deg, #9a3412 0%, #7c2d12 100%);
    border: none;
    border-left: 5px solid #fb923c;
    color: #fff;
}
.sp-info-box-urgent strong { color: #fff; }
.sp-info-box-urgent a { color: #fed7aa; }
.sp-info-box-urgent ul { color: #fff; }

/* Fact-check Box — Verified claims (deep blue) */
.sp-info-box-fact-check {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border: none;
    border-left: 5px solid #60a5fa;
    color: #fff;
}
.sp-info-box-fact-check strong { color: #fff; }
.sp-info-box-fact-check a { color: #bfdbfe; }


/* ==========================================================================
   Statistics Highlight — Data Points That Stand Out
   ========================================================================== */
.sp-statistic {
    display: inline;
}

.sp-statistic-value {
    font-family: var(--sp-font-display);
    font-weight: 700;
    font-size: 1.1em;
    color: var(--sp-accent-deep, #4338ca);
}

.sp-statistic-label {
    font-size: 0.95em;
    color: var(--sp-ink-soft);
}

/* ==========================================================================
   Call-to-Action — Engagement Driver
   ========================================================================== */
.sp-call-to-action {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: var(--sp-space-8);
    margin: var(--sp-space-10) 0;
    text-align: center;
}

.sp-call-to-action-title {
    font-family: var(--sp-font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sp-ink);
    margin: 0 0 var(--sp-space-2);
}

.sp-call-to-action-text {
    font-size: 0.9375rem;
    color: var(--sp-ink-soft);
    margin: 0 0 var(--sp-space-4);
}

.sp-call-to-action-button {
    display: inline-block;
    background: var(--sp-accent, #4f46e5);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.sp-call-to-action-button:hover {
    background: var(--sp-accent-deep, #4338ca);
    color: #fff !important;
    text-decoration: none;
}
