/* ============================================
   SUBSTACK-STYLE ARTICLE TEMPLATE
   Typographie claire, espacement généreux,
   lecture immersive façon newsletter premium.
   ============================================ */

/* ---- Layout ---- */
.substack-article {
    background: #ffffff;
    min-height: 100vh;
}

.substack-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Header ---- */
.substack-header {
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.substack-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.substack-category-tag {
    display: inline-block;
    padding: 5px 14px;
    background: var(--gold-subtle, rgba(250, 182, 0, 0.13));
    color: var(--navy-800, #121338);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 100px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.substack-category-tag:hover {
    background: var(--gold, #fab600);
    color: var(--navy-900, #0d0e30);
}

.substack-title {
    font-family: var(--font-heading, 'Inter', -apple-system, sans-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--navy-900, #0d0e30);
    margin: 0 0 1rem;
}

.substack-subtitle {
    font-size: 1.3rem;
    line-height: 1.55;
    color: var(--gray-500, #6b7280);
    font-weight: 400;
    margin: 0 0 2rem;
    max-width: 640px;
}

/* ---- Meta / Author Row ---- */
.substack-meta {
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100, #e5e7eb);
}

.substack-author-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.substack-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-100, #e5e7eb);
}

.substack-author-avatar--team {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gray-100, #e5e7eb);
    background: var(--navy-900, #0d0e30);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gold, #fab600);
}

.substack-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.substack-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy-800, #121338);
}

.substack-meta-details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-400, #9ca3af);
    font-weight: 400;
}

.substack-meta-sep {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ---- Featured Image ---- */
.substack-featured-image {
    margin-bottom: 3rem;
}

.substack-featured-image .substack-container {
    max-width: 900px;
}

.substack-hero-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    max-height: 520px;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ---- Article Content ---- */
.substack-content-wrapper {
    padding-bottom: 3rem;
}

.substack-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    line-height: 1.85;
    color: #1a1a2e;
    letter-spacing: -0.003em;
}

/* Paragraphs */
.substack-content p {
    margin-bottom: 1.6em;
}

/* Drop cap for first paragraph */
.substack-content > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 3.5em;
    line-height: 0.8;
    font-weight: 800;
    color: var(--navy-900, #0d0e30);
    margin-right: 0.08em;
    margin-top: 0.08em;
}

/* Headings inside article */
.substack-content h2 {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy-900, #0d0e30);
    margin-top: 2.5em;
    margin-bottom: 0.8em;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.substack-content h3 {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy-900, #0d0e30);
    margin-top: 2em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}

.substack-content h4 {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-800, #121338);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* Links */
.substack-content a {
    color: var(--royal, #1c3a6e);
    text-decoration: underline;
    text-decoration-color: var(--gold, #fab600);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.substack-content a:hover {
    color: var(--gold, #fab600);
    text-decoration-color: var(--royal, #1c3a6e);
}

/* Images */
.substack-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.5em auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.substack-content figure {
    margin: 2.5em 0;
}

.substack-content figure img {
    margin-bottom: 0;
}

.substack-content figcaption {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    color: var(--gray-400, #9ca3af);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Blockquotes */
.substack-content blockquote {
    position: relative;
    margin: 2em 0;
    padding: 1.5em 1.75em;
    border-left: 4px solid var(--gold, #fab600);
    background: var(--gray-50, #f9fafb);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #374151;
}

.substack-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Lists */
.substack-content ul,
.substack-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.substack-content li {
    margin-bottom: 0.65em;
    padding-left: 0.25em;
}

.substack-content ul li::marker {
    color: var(--gold, #fab600);
}

.substack-content ol li::marker {
    color: var(--navy-800, #121338);
    font-weight: 700;
}

/* Horizontal Rule */
.substack-content hr {
    border: none;
    text-align: center;
    margin: 3em 0;
}

.substack-content hr::after {
    content: '···';
    font-size: 1.5em;
    letter-spacing: 1em;
    color: var(--gray-300, #d1d5db);
}

/* Code */
.substack-content pre,
.substack-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
}

.substack-content code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--navy-800, #121338);
}

.substack-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 1.5em;
    border-radius: 10px;
    overflow-x: auto;
    margin: 2em 0;
    line-height: 1.6;
}

.substack-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Tables */
.substack-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
}

.substack-content th,
.substack-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100, #e5e7eb);
    text-align: left;
}

.substack-content th {
    font-weight: 700;
    color: var(--navy-800, #121338);
    border-bottom-width: 2px;
    border-bottom-color: var(--gray-200, #d1d5db);
}

.substack-content tbody tr:hover {
    background: #f9fafb;
}

/* ---- Tags section ---- */
.substack-tags-section {
    padding: 2rem 0 1rem;
}

.substack-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.substack-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gray-50, #f4f3ee);
    color: var(--gray-600, #505864);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 100px;
    text-decoration: none;
    border: 1px solid var(--gray-100, #e2e1dc);
    transition: all 0.2s ease;
}

.substack-tag:hover {
    background: var(--navy-900, #0d0e30);
    color: #ffffff;
    border-color: var(--navy-900, #0d0e30);
}

/* ---- Divider ---- */
.substack-divider {
    border: none;
    border-top: 1px solid var(--gray-100, #e5e7eb);
    margin: 2rem 0;
}

/* ---- Author Bio Section ---- */
.substack-author-bio-section {
    padding: 1rem 0 3rem;
}

.substack-author-bio-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 2rem;
    background: var(--gray-50, #f4f3ee);
    border-radius: 12px;
    border: 1px solid var(--gray-100, #e2e1dc);
}

.substack-author-bio-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.substack-author-bio-avatar--team {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    background: var(--navy-900, #0d0e30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold, #fab600);
}

.substack-author-bio-content {
    flex: 1;
}

.substack-author-bio-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400, #9ca3af);
    display: block;
    margin-bottom: 4px;
}

.substack-author-bio-name {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-900, #0d0e30);
    margin: 0 0 8px;
    line-height: 1.3;
}

.substack-author-bio-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-600, #505864);
    margin: 0;
}

/* ---- CTA Section ---- */
.substack-cta-section {
    padding-bottom: 5rem;
}

.substack-cta-box {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--navy-900, #0d0e30) 0%, var(--navy-700, #171840) 100%);
    color: #ffffff;
}

.substack-cta-text {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.substack-cta-btn {
    background: var(--gold, #fab600) !important;
    color: var(--navy-900, #0d0e30) !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 0.9rem 2rem !important;
    border-radius: 8px !important;
}

.substack-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(250, 182, 0, 0.35);
}

/* ---- Progress Bar (scroll indicator) ---- */
.substack-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold, #fab600), var(--gold-light, #fccf4d));
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .substack-header {
        padding-top: 2.5rem;
        padding-bottom: 1.5rem;
    }

    .substack-title {
        font-size: clamp(1.6rem, 6vw, 2.25rem);
    }

    .substack-subtitle {
        font-size: 1.1rem;
    }

    .substack-content {
        font-size: 1.08rem;
        line-height: 1.75;
    }

    .substack-content > p:first-of-type::first-letter {
        font-size: 2.8em;
    }

    .substack-hero-img {
        border-radius: 8px;
        max-height: 320px;
    }

    .substack-featured-image .substack-container {
        padding: 0 16px;
    }

    .substack-container {
        padding: 0 16px;
    }

    .substack-author-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .substack-cta-box {
        padding: 2rem 1.25rem;
    }

    .substack-content h2 {
        font-size: 1.4rem;
    }

    .substack-content h3 {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .substack-title {
        font-size: 1.5rem;
    }

    .substack-content {
        font-size: 1rem;
    }

    .substack-content > p:first-of-type::first-letter {
        font-size: 2.4em;
    }
}
