/* ============================================
   BETTER FRENCH BLOG — Premium Design System
   ============================================ */

/* ---------- Reset & Variables ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --french-blue: #2563eb;
    --french-blue-hover: #1d4ed8;
    --french-blue-light: rgba(37, 99, 235, 0.06);
    --french-blue-glow: rgba(37, 99, 235, 0.15);

    --ink: #0f172a;
    --ink-secondary: #1e293b;
    --ink-muted: #475569;
    --surface: #f8fafc;
    --surface-elevated: #ffffff;
    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);

    --green-text: #16a34a;
    --green-bg: rgba(34, 197, 94, 0.08);
    --red-text: #dc2626;
    --amber-text: #d97706;
    --amber-bg: rgba(217, 119, 6, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-blue: 0 4px 14px rgba(37, 99, 235, 0.25);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION — glass navbar
   Supports both .blog-header and .navbar
   ============================================ */
.blog-header,
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.blog-header .nav-container,
.navbar .nav-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    gap: 0.4rem;
    transition: opacity 0.2s ease;
}

.logo:hover { opacity: 0.7; }

.logo-b {
    position: relative;
    display: inline-block;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--french-blue);
    border: none;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-blue);
}

.nav-cta:hover {
    background: var(--french-blue-hover);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

/* ============================================
   BREADCRUMB
   Supports both .blog-nav and .breadcrumb
   ============================================ */
.blog-nav,
.breadcrumb {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-nav a,
.breadcrumb a {
    color: var(--ink-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-nav a:hover,
.breadcrumb a:hover {
    color: var(--french-blue);
}

.blog-nav .separator,
.breadcrumb .breadcrumb-sep,
.breadcrumb-sep {
    color: var(--ink-muted);
    opacity: 0.35;
    font-size: 0.75rem;
}

.blog-nav .current {
    color: var(--ink-secondary);
    font-weight: 500;
}

/* ============================================
   ARTICLE CONTAINER
   ============================================ */
.blog-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}

/* When there's no .blog-container wrapper, constrain the article directly */
.blog-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}

.blog-container .blog-article {
    max-width: none;
    padding: 0;
}

/* ============================================
   ARTICLE META
   ============================================ */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 1.75rem;
}

.blog-meta .divider {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink-muted);
    opacity: 0.4;
}

.blog-meta .category-tag,
.blog-meta .blog-meta-tag,
.blog-meta-tag {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--radius-full);
    background: var(--french-blue-light);
    color: var(--french-blue);
}

/* ============================================
   ARTICLE TYPOGRAPHY — the reading experience
   ============================================ */
.blog-article h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 1.75rem;
    letter-spacing: -0.03em;
}

.blog-article h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--french-blue);
}

.blog-article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-article p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ink-secondary);
    margin-bottom: 1.25rem;
}

.blog-article strong {
    color: var(--ink);
    font-weight: 600;
}

.blog-article em {
    font-style: italic;
    color: var(--ink-secondary);
}

.blog-article a {
    color: var(--french-blue);
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.blog-article a:hover {
    text-decoration-color: var(--french-blue);
}

/* Lists */
.blog-article ul,
.blog-article ol {
    margin-bottom: 1.25rem;
    padding-left: 0;
}

.blog-article ul {
    list-style: none;
}

.blog-article ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink-secondary);
}

.blog-article ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--french-blue);
    opacity: 0.5;
}

.blog-article ol {
    padding-left: 1.5rem;
}

.blog-article ol li {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink-secondary);
}

/* Blockquote */
.blog-article blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--french-blue);
    background: var(--french-blue-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.blog-article blockquote p {
    margin-bottom: 0;
    color: var(--ink-secondary);
}

/* Images */
.blog-article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 1.75rem 0;
    box-shadow: var(--shadow-md);
}

/* Inline code */
.blog-article code {
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--ink-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ============================================
   TL;DR BOX
   Supports both .blog-tldr and .tldr-box
   ============================================ */
.blog-tldr,
.tldr-box {
    margin: 1.75rem 0 2rem;
    padding: 1.5rem 1.75rem;
    background: rgba(37, 99, 235, 0.06);
    border: none;
    border-radius: var(--radius-md);
}

.blog-tldr strong,
.tldr-box .tldr-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--french-blue);
    margin-bottom: 0.5rem;
}

.blog-tldr p,
.tldr-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink-secondary);
}

/* ============================================
   TABLES — clean, scannable
   ============================================ */
.blog-article table,
.comparison-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.blog-article th,
.comparison-table th {
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.blog-article td,
.comparison-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--ink-secondary);
    line-height: 1.5;
}

.blog-article tr:nth-child(even) td,
.comparison-table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.02);
}

.blog-article tr:last-child td,
.comparison-table tr:last-child td {
    border-bottom: none;
}

/* Table responsive wrapper */
.comparison-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.75rem 0;
}

/* Comparison table specifics */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.comparison-table th { text-align: center; }
.comparison-table th:first-child { text-align: left; }
.comparison-table td { text-align: center; }
.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--ink);
}

.comparison-table .check,
.check { color: var(--green-text); font-weight: 600; }

.comparison-table .cross,
.cross { color: var(--red-text); font-weight: 600; }

.comparison-table .partial,
.partial { color: var(--amber-text); font-weight: 500; }

/* ============================================
   FAQ SECTION
   Supports both .blog-faq and .faq-section
   ============================================ */
.blog-faq,
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.blog-faq h2,
.faq-section h2 {
    border-left: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.blog-faq h3,
.faq-section .faq-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-faq p,
.faq-section .faq-answer {
    font-size: 0.95rem;
    color: var(--ink-secondary);
    line-height: 1.75;
    margin-bottom: 0;
}

.faq-item {
    margin-bottom: 1rem;
}

/* ============================================
   CTA BOX
   Supports both .blog-cta and .cta-box
   ============================================ */
.blog-cta,
.cta-box {
    margin: 3rem 0;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.1));
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--radius-lg);
    text-align: center;
}

.blog-cta h2,
.blog-cta h3,
.cta-box h2,
.cta-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.5rem;
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

.blog-cta p,
.cta-box p {
    font-size: 0.95rem;
    color: var(--ink-muted);
    margin-bottom: 1.25rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.blog-cta .cta-button,
.cta-box .cta-btn,
.cta-button,
.cta-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--french-blue);
    border: none;
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-blue);
}

.blog-cta .cta-button:hover,
.cta-box .cta-btn:hover,
.cta-button:hover,
.cta-btn:hover {
    background: var(--french-blue-hover);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

/* ============================================
   RELATED ARTICLES
   Supports both .blog-related and .related-posts
   ============================================ */
.blog-related,
.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.blog-related h2,
.related-posts h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-left: 0;
    border-left: none;
}

.blog-related-grid,
.related-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    list-style: none;
    padding: 0;
}

/* Kill inherited blue dot bullets from .blog-article ul li */
.related-posts-list li,
.blog-related-grid li {
    padding-left: 0;
}

.related-posts-list li::before,
.blog-related-grid li::before {
    display: none;
}

.blog-related-card,
.related-posts-list li a,
.related-posts-list a {
    display: block;
    padding: 1.25rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.blog-related-card:hover,
.related-posts-list li a:hover,
.related-posts-list a:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.blog-related-card .card-category {
    display: block;
    width: fit-content;
    margin: 0 auto 0.75rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-full);
    background: var(--french-blue-light);
    color: var(--french-blue);
}

.blog-related-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
    line-height: 1.4;
    margin-top: 0;
    border-left: none;
    padding-left: 0;
    text-align: center;
}

.blog-related-card p {
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 0;
    text-align: center;
}

/* ============================================
   FOOTER
   Supports both .blog-footer naming variants
   ============================================ */
.blog-footer {
    padding: 2rem 1.5rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
    border-top: 1px solid var(--border);
    background: rgba(248, 250, 252, 0.5);
}

.blog-footer-links,
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.blog-footer-links a,
.footer-links a {
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-footer-links a:hover,
.footer-links a:hover {
    color: var(--french-blue);
}

.blog-footer-divider,
.footer-divider {
    color: var(--ink-muted);
    opacity: 0.4;
}

.blog-footer p {
    font-size: 0.8rem;
    color: var(--ink-muted);
}

/* ============================================
   BLOG INDEX PAGE — HERO
   ============================================ */
.blog-hero {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2.5rem;
    text-align: center;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.blog-hero p {
    font-size: 1.05rem;
    color: var(--ink-muted);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto;
}

/* ============================================
   BLOG INDEX PAGE — ARTICLE CARD GRID
   ============================================ */
.blog-grid-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.blog-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.blog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.blog-card .card-category {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--radius-full);
    background: var(--french-blue-light);
    color: var(--french-blue);
}

/* Guide category gets green */
.blog-card .card-category[class*=""]:not(:empty) {
    /* Default blue — overridden below for specific text */
}

.blog-card .card-time {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.blog-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    margin-bottom: 0.6rem;
    border-left: none;
    padding-left: 0;
    margin-top: 0;
}

.blog-card p {
    font-size: 0.875rem;
    color: var(--ink-muted);
    line-height: 1.55;
    margin-bottom: auto;
    flex-grow: 1;
}

.blog-card .read-more {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--french-blue);
}

.blog-card .read-more .arrow {
    transition: transform 0.2s ease;
    display: inline-block;
}

.blog-card:hover .read-more .arrow {
    transform: translateX(3px);
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e2e8f0;
        --ink-secondary: #cbd5e1;
        --ink-muted: #94a3b8;
        --surface: #0f172a;
        --surface-elevated: #1e293b;
        --border: rgba(226, 232, 240, 0.08);
        --border-hover: rgba(226, 232, 240, 0.15);
        --french-blue-light: rgba(37, 99, 235, 0.12);
    }

    .blog-header,
    .navbar {
        background: rgba(15, 23, 42, 0.85);
    }

    .blog-article th,
    .comparison-table th {
        background: #1e293b;
    }

    .blog-cta,
    .cta-box {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.15));
    }

    .blog-tldr,
    .tldr-box {
        background: rgba(37, 99, 235, 0.08);
    }

    .blog-footer {
        background: rgba(15, 23, 42, 0.85);
        border-top-color: rgba(226, 232, 240, 0.08);
    }

    .blog-footer-links a,
    .footer-links a {
        color: #e2e8f0;
    }

    .blog-footer-divider,
    .footer-divider {
        color: #64748b;
    }

    .blog-footer p {
        color: #94a3b8;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-related-grid,
    .related-posts-list {
        grid-template-columns: 1fr;
    }

    .blog-article h1 {
        font-size: 1.65rem;
    }

    .blog-article h2 {
        font-size: 1.2rem;
    }

    .blog-article table,
    .comparison-table-wrap {
        font-size: 0.8rem;
    }

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

@media (max-width: 480px) {
    .blog-hero { padding: 2.5rem 1rem 1.5rem; }
    .blog-container,
    .blog-article { padding-left: 1rem; padding-right: 1rem; }
    .blog-nav,
    .breadcrumb { padding-left: 1rem; padding-right: 1rem; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
