/* ============================================================
   redaktion.ai – Article Stylesheet v1.0
   Dark Theme | Poppins | Violet Accents
   ============================================================ */

/* === DESIGN TOKENS (shared with Landing Page) === */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #0f0f13;
    --bg-card: #13131a;
    --bg-card-hover: #1a1a24;
    --text-primary: #f0eef5;
    --text-secondary: #9492a6;
    --text-muted: #5c5a6e;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-glow-strong: rgba(139, 92, 246, 0.25);
    --accent-subtle: rgba(139, 92, 246, 0.06);
    --border: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.2);
    --gold: #e0b850;
    --gradient-1: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --gradient-2: linear-gradient(135deg, #8b5cf6, #ec4899);
    --gradient-text: linear-gradient(135deg, #a78bfa, #818cf8);
    --content-width: 760px;
    --wide-width: 900px;
}

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === GLOW BACKGROUND (same as landing) === */
.bg-grid {
    position: fixed; inset: 0;
    background-image: linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none; z-index: 0;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
}

/* === NAVIGATION (same as landing) === */
nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000; padding: 18px 0; transition: all 0.4s;
}
nav.scrolled {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.nav-inner {
    max-width: 1120px; margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-weight: 800; font-size: 1.4rem;
    color: var(--text-primary); text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-secondary); text-decoration: none;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
    font-size: 0.82rem; font-weight: 600; color: white;
    background: var(--accent); padding: 10px 24px; border-radius: 8px;
    text-decoration: none; transition: all 0.3s;
}
.nav-cta:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.nav-cta { color: white; font-size: 0.82rem; font-weight: 600; background: var(--accent); padding: 10px 24px; border-radius: 8px; }
.nav-links a.nav-cta:hover { background: var(--accent-hover); box-shadow: 0 4px 20px var(--accent-glow); }

/* === ARTICLE LAYOUT === */
.article-wrapper {
    position: relative; z-index: 2;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 120px 24px 80px;
}

/* === ARTICLE HEADER === */
.article-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}
.article-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}
.article-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.article-meta strong { color: var(--text-secondary); }

/* Featured Image */
.featured-image {
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* === ARTICLE BODY === */
.article-body p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 56px 0 20px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
    border-left: 3px solid var(--accent);
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text-primary);
}

/* Links */
.article-body a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(167, 139, 250, 0.3);
    transition: all 0.2s;
}
.article-body a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* Lists */
.article-body ul, .article-body ol {
    margin: 0 0 28px 0;
    padding-left: 0;
    list-style: none;
}
.article-body ul li, .article-body ol li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
}
.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 11px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.article-body ol { counter-reset: ol-counter; }
.article-body ol li { counter-increment: ol-counter; }
.article-body ol li::before {
    content: counter(ol-counter) '.';
    position: absolute;
    left: 0; top: 0;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
}

/* Inline Images */
.article-body img {
    width: calc(100% + 80px);
    margin-left: -40px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 8px;
    margin-bottom: 32px;
}

/* === DIRECT ANSWER BOX === */
.direct-answer {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 24px 28px;
    margin: 32px 0;
}
.direct-answer p {
    font-size: 1rem !important;
    color: var(--text-secondary) !important;
    margin-bottom: 0 !important;
    line-height: 1.7 !important;
}
.direct-answer strong {
    color: var(--accent-light);
}

/* === TL;DR SUMMARY === */
.tldr-summary {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(139, 92, 246, 0.03));
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    padding: 28px 32px;
    margin: 32px 0 48px;
}
.tldr-summary > p:first-child {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--accent-light) !important;
    margin-bottom: 16px !important;
}
.tldr-summary ul {
    margin-bottom: 0 !important;
}
.tldr-summary ul li {
    font-size: 0.95rem !important;
    color: var(--text-secondary) !important;
    padding-left: 0 !important;
}
.tldr-summary ul li::before {
    display: none;
}

/* === TABLES === */
.article-body table {
    width: calc(100% + 80px);
    margin-left: -40px;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}
.article-body thead th {
    background: var(--bg-card);
    color: var(--accent-light);
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.article-body tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}
.article-body tbody tr:last-child td {
    border-bottom: none;
}
.article-body tbody tr:hover {
    background: rgba(139, 92, 246, 0.03);
}
.article-body tbody td strong {
    color: var(--text-primary);
}

/* === YOUTUBE EMBED === */
.youtube-embed {
    position: relative;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: 8px;
    margin-bottom: 32px;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.youtube-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
/* Privacy-friendly: Lazy-load thumbnail with play button */
.youtube-facade {
    position: relative;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: 8px;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
}
.youtube-facade img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}
.youtube-facade:hover img {
    opacity: 0.8;
}
.youtube-facade .play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 72px; height: 72px;
    background: rgba(139, 92, 246, 0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
}
.youtube-facade:hover .play-btn {
    background: var(--accent);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.6);
}
.youtube-facade .play-btn::after {
    content: '';
    display: block;
    width: 0; height: 0;
    margin-left: 4px;
    border-style: solid;
    border-width: 12px 0 12px 22px;
    border-color: transparent transparent transparent white;
}

/* === BLOCKQUOTE === */
.article-body blockquote:not(.direct-answer) {
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 28px 0;
    font-style: italic;
}
.article-body blockquote:not(.direct-answer) p {
    color: var(--text-secondary) !important;
    font-size: 1rem !important;
    margin-bottom: 0 !important;
}

/* === FAQ SECTION === */
.article-body h2 + h3 {
    margin-top: 28px;
}

/* === AUTHOR BIO === */
.author-info {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
    margin: 64px 0 0;
}
.author-info > p:first-child {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--accent-light) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px !important;
}
.author-info > p:nth-child(2) {
    font-size: 0.95rem !important;
    line-height: 1.75 !important;
    color: var(--text-secondary) !important;
}
.author-note {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* === FOOTER === */
footer {
    position: relative; z-index: 2;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}
.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .article-wrapper { padding: 100px 16px 60px; }
    .article-header h1 { font-size: 1.8rem; }

    .featured-image,
    .article-body img,
    .article-body table,
    .youtube-embed,
    .youtube-facade {
        width: 100%;
        margin-left: 0;
    }

    .nav-links { display: none; }
    .logo { font-size: 1.1rem; }
    .nav-cta { padding: 8px 12px; font-size: 0.75rem; }

    .tldr-summary { padding: 20px; }
    .direct-answer { padding: 20px; }
    .author-info { padding: 24px; }
}

/* === PRINT STYLES === */
@media print {
    body { background: white; color: #1a1a1a; }
    nav, .bg-grid, footer { display: none; }
    .article-wrapper { padding: 0; max-width: 100%; }
    .article-body a { color: #333; text-decoration: underline; }
    .tldr-summary, .direct-answer, .author-info {
        border: 1px solid #ddd; background: #f9f9f9;
    }
}