/**
 * blog-article.css — Editorial styles for Depli blog articles
 * Loaded in <head> to prevent FOUC (flash of unstyled content)
 */

/* Page entry animation — smooth fade-in instead of instant pop */
.article-hero, .article, .share-bar, .article-nav, .related-articles {
    animation: blog-fade-in 0.3s ease both;
}
.article-hero { animation-delay: 0s; }
.article { animation-delay: 0.05s; }
.share-bar { animation-delay: 0.08s; }
.article-nav { animation-delay: 0.1s; }
.related-articles { animation-delay: 0.1s; }
@keyframes blog-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .article-hero, .article, .share-bar, .article-nav, .related-articles { animation: none; }
}

/* Theme toggle (for pages that don't have it inline) */
.theme-toggle { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.08); background: transparent; color: rgba(13,13,18,0.5); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; margin-left: 4px; }
.theme-toggle:hover { background: rgba(0,0,0,0.06); color: rgba(13,13,18,0.8); }
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,0.1); color: rgba(245,244,248,0.5); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,0.08); color: rgba(245,244,248,0.8); }

/* Progress bar */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; }
.reading-progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, #b8a4fb, #7ab4fc); transition: width 0.1s linear; border-radius: 0 2px 2px 0; }

/* TOC */
.toc { position: fixed; top: 120px; width: 200px; z-index: 50; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toc.is-visible { opacity: 1; pointer-events: auto; }
.toc__title { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--text-25); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.toc__nav { display: flex; flex-direction: column; border-left: 1px solid rgba(0,0,0,0.06); }
.toc__link { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text-25); padding: 5px 0 5px 14px; text-decoration: none; transition: all 0.2s; border-left: 2px solid transparent; margin-left: -1px; line-height: 1.4; }
.toc__link:hover { color: var(--text-50); }
.toc__link.is-active { color: var(--text-80); border-left-color: #b8a4fb; }

/* Mobile TOC */
.toc--mobile { position: fixed; top: auto; bottom: 60px; left: 16px !important; right: 16px; width: auto; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 16px; padding: 20px; border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 8px 32px rgba(0,0,0,0.1); opacity: 0; transform: translateY(10px); pointer-events: none !important; transition: opacity 0.25s, transform 0.25s; z-index: 95; }
.toc--mobile.is-visible { opacity: 0; pointer-events: none !important; }
.toc--mobile.is-mobile-open { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto !important; }
.toc-toggle { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 91; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: rgba(13,13,18,0.4); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.toc-toggle:hover { background: rgba(255,255,255,0.95); color: rgba(13,13,18,0.8); }
.toc-toggle.is-active { background: #b8a4fb; color: white; border-color: #b8a4fb; }

/* Related articles */
.related-articles { max-width: 680px; margin: 0 auto; padding: 0 var(--margin) 24px; }
.related-articles__title { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--text-25); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.related-articles__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.related-articles__link { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; transition: color 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.related-articles__link::before { content: '\2192'; font-size: 12px; color: var(--text-25); }
.related-articles__link:hover { color: var(--text); }

/* Newsletter CTA — hide original content until JS replaces it */
.article-subscribe { opacity: 0; transition: opacity 0.3s ease 0.1s; }
.article-subscribe.is-ready { opacity: 1; }
.article-subscribe__form { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.article-subscribe__input { flex: 1; font-family: var(--sans); font-size: 14px; padding: 10px 16px; border-radius: 40px; border: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.6); color: var(--text); outline: none; transition: border-color 0.2s; }
.article-subscribe__input:focus { border-color: #b8a4fb; }
.article-subscribe__input::placeholder { color: var(--text-25); }
@media (max-width: 480px) { .article-subscribe__form { flex-direction: column; } }

/* Sticky back to blog */
.sticky-back { position: fixed; top: 120px; z-index: 90; display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--text-50); background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 8px 14px 8px 10px; border-radius: 40px; border: 1px solid rgba(0,0,0,0.06); text-decoration: none; opacity: 0; transition: opacity 0.3s, background 0.15s; pointer-events: none; }
.sticky-back.is-visible { opacity: 1; pointer-events: auto; }
.sticky-back:hover { background: rgba(255,255,255,0.95); color: var(--text); }
.sticky-back svg { width: 14px; height: 14px; }
@media (max-width: 1100px) { .sticky-back { top: auto !important; bottom: 80px; left: 16px !important; transform: none !important; } }

/* Section nav arrows */
.blog-section-nav { position: fixed; bottom: 32px; left: 32px; display: flex; flex-direction: column; gap: 6px; z-index: 90; }
.blog-section-nav__btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: rgba(13,13,18,0.4); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; position: relative; }
.blog-section-nav__btn:hover { background: rgba(255,255,255,0.95); color: rgba(13,13,18,0.8); }
.blog-section-nav__hint { position: absolute; left: calc(100% + 10px); white-space: nowrap; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-25); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.blog-section-nav__btn.is-holding .blog-section-nav__hint { opacity: 1; }
.blog-section-nav__btn::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; opacity: 0; transition: opacity 0.3s; }
.blog-section-nav__btn[data-dir="up"]::after { box-shadow: 0 0 12px 3px rgba(184,164,251,0.5); }
.blog-section-nav__btn[data-dir="down"]::after { box-shadow: 0 0 12px 3px rgba(122,180,252,0.5); }
.blog-section-nav__btn.is-holding::after { opacity: 1; }
.blog-section-nav__btn.is-jumping { background: rgba(255,255,255,0.95); }
.blog-section-nav__btn[data-dir="up"].is-jumping { box-shadow: 0 0 16px 4px rgba(184,164,251,0.4); }
.blog-section-nav__btn[data-dir="down"].is-jumping { box-shadow: 0 0 16px 4px rgba(122,180,252,0.4); }

/* ── Editorial styles ── */

/* Highlights */
.hl-v { background: linear-gradient(180deg, transparent 60%, rgba(184,164,251,0.25) 60%); padding: 0 2px; }
.hl-b { background: linear-gradient(180deg, transparent 60%, rgba(122,180,252,0.25) 60%); padding: 0 2px; }
.hl-g { background: linear-gradient(180deg, transparent 60%, rgba(110,231,183,0.25) 60%); padding: 0 2px; }
.hl-y { background: linear-gradient(180deg, transparent 60%, rgba(252,211,77,0.3) 60%); padding: 0 2px; }

/* Strikethrough correction */
.str { text-decoration: line-through; text-decoration-color: rgba(231,76,60,0.35); text-decoration-thickness: 2px; color: var(--text-50); }
.fix { background: rgba(110,231,183,0.15); padding: 1px 5px; border-radius: 3px; color: var(--text); font-weight: 600; }

/* Pull quote */
.pull-q { margin: 48px -40px; padding: 0; text-align: center; }
.pull-q p { font-family: var(--sans); font-size: clamp(22px, 2.5vw, 28px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.35; color: var(--text); margin-bottom: 0; }
.pull-q p em { font-style: normal; color: #b8a4fb; }
@media (max-width: 768px) { .pull-q { margin-left: 0; margin-right: 0; } }

/* Callout insight */
.callout-i { margin: 32px 0; padding: 22px 26px; border-radius: 18px; display: flex; gap: 14px; align-items: flex-start; background: rgba(184,164,251,0.06); border: 1px solid rgba(184,164,251,0.12); }
.callout-i__icon { font-size: 14px; flex-shrink: 0; margin-top: 3px; opacity: 0.5; }
.callout-i p { margin-bottom: 0; font-size: 15px; line-height: 1.6; color: #7b6aad; }
.callout-i strong { color: var(--text); }

/* Stat row */
.stat-r { display: flex; gap: 32px; margin: 40px 0; justify-content: center; }
.stat-r__item { text-align: center; }
.stat-r__num { font-family: var(--sans); font-size: 42px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.stat-r__label { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--text-25); margin-top: 6px; }
.stat-r__sep { width: 1px; background: rgba(0,0,0,0.08); align-self: stretch; }
@media (max-width: 600px) { .stat-r { flex-direction: column; gap: 20px; } .stat-r__sep { display: none; } }

/* Dropcap — applied via CSS selector, no JS needed */
.dropcap::first-letter { font-family: var(--sans); font-size: 4em; float: left; line-height: 0.75; margin-right: 10px; margin-top: 4px; color: var(--text); font-weight: 700; }
/* Auto-dropcap: first p after article-back link */
.article-back + h2 + p:first-of-type::first-letter,
.article-back + p:first-of-type::first-letter { font-family: var(--sans); font-size: 4em; float: left; line-height: 0.75; margin-right: 10px; margin-top: 4px; color: var(--text); font-weight: 700; }
.article[data-no-dropcap] .article-back + h2 + p:first-of-type::first-letter,
.article[data-no-dropcap] .article-back + p:first-of-type::first-letter { font-size: inherit; float: none; line-height: inherit; margin: 0; }

/* Side note */
.side-n { font-family: var(--sans); font-size: 13px; color: var(--text-50); border-left: 2px solid rgba(184,164,251,0.5); padding-left: 14px; margin: 12px 0 20px; line-height: 1.5; }

/* Placeholder images — gradient backgrounds applied via CSS, no JS flash */
.article-media__placeholder {
    background: linear-gradient(135deg, rgba(184,164,251,0.15), rgba(122,180,252,0.12), rgba(110,231,183,0.08)) !important;
    color: rgba(13,13,18,0.08) !important;
    position: relative;
    overflow: hidden;
}
.article-media__placeholder:nth-of-type(2n) {
    background: linear-gradient(135deg, rgba(122,180,252,0.15), rgba(110,231,183,0.12), rgba(252,211,77,0.08)) !important;
}
.placeholder-shapes { position: absolute; inset: 0; pointer-events: none; }
.ph-shape { position: absolute; border-radius: 12px; opacity: 0.6; }
.ph-shape--1 { width: 120px; height: 80px; left: var(--x); top: var(--y); background: rgba(184,164,251,0.12); border: 1px solid rgba(184,164,251,0.15); transform: translate(-50%,-50%) rotate(-6deg); }
.ph-shape--2 { width: 90px; height: 60px; left: var(--x); top: var(--y); background: rgba(122,180,252,0.12); border: 1px solid rgba(122,180,252,0.15); transform: translate(-50%,-50%) rotate(4deg); }
.ph-shape--3 { width: 70px; height: 50px; left: var(--x); top: var(--y); background: rgba(110,231,183,0.10); border: 1px solid rgba(110,231,183,0.15); transform: translate(-50%,-50%) rotate(-2deg); }
