/* ===================================
   Articles - Light readable theme
   Brand: Tom Xavier - La Formule Retour
   =================================== */

/* Variables */
:root {
    --color-primary: #E63946;
    --color-primary-dark: #C62D39;
    --color-secondary: #FF6B35;
    --color-gradient: linear-gradient(135deg, #E63946 0%, #FF6B35 100%);
    --bg: #FFFFFF;
    --bg-alt: #F8F9FA;
    --bg-dark: #0D0D0D;
    --text: #333333;
    --text-heading: #1A1A1A;
    --text-muted: #666666;
    --border: #E5E5E5;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --max-w: 720px;
    --max-w-wide: 1100px;
    --radius: 8px;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; height: auto; }

/* ---- NAVBAR ---- */
.article-nav {
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.article-body h2[id],
.article-body h3[id],
.article-body h4[id] {
    scroll-margin-top: 80px;
}

.nav-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-logo-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: #FFFFFF;
    line-height: 1.2;
}

.nav-logo-tag {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-articles {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-articles:hover {
    color: #FFFFFF;
}

.nav-cta {
    display: inline-block;
    background: var(--color-gradient);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition: transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
    color: #FFFFFF;
}

/* ---- BREADCRUMBS ---- */
.breadcrumbs {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.bc-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bc-inner a {
    color: var(--color-primary);
}

.bc-inner a:hover {
    text-decoration: underline;
}

.bc-sep {
    margin: 0 0.4rem;
    opacity: 0.4;
}

.bc-current {
    color: var(--text);
}

/* ---- ARTICLE ---- */
.article-main {
    min-height: 60vh;
}

.article {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* Header */
.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-badge {
    display: inline-block;
    background: rgba(230, 57, 70, 0.08);
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

.article-header h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text-heading);
    margin-bottom: 0.8rem;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-meta strong {
    color: var(--text-heading);
}

.meta-sep {
    margin: 0 0.5rem;
    opacity: 0.3;
}

/* ---- ARTICLE BODY ---- */
.article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}

.article-body h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--color-primary);
    line-height: 1.3;
}

.article-body h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-heading);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    line-height: 1.35;
}

.article-body h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-heading);
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(230, 57, 70, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color var(--transition);
}

.article-body a:hover {
    text-decoration-color: var(--color-primary);
}

.article-body strong {
    color: var(--text-heading);
    font-weight: 600;
}

.article-body em {
    font-style: italic;
}

/* Lists */
.article-body ul, .article-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body ul li::marker {
    color: var(--color-primary);
}

.article-body ol li::marker {
    color: var(--color-primary);
    font-weight: 600;
}

/* Blockquotes (testimonials) */
.article-body blockquote {
    background: #FFF5F5;
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text);
}

.article-body blockquote p {
    margin-bottom: 0.6rem;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

.article-body blockquote strong {
    font-style: normal;
}

/* Horizontal rules */
.article-body hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
}

.article-body thead {
    display: table-header-group;
}

.article-body tbody {
    display: table-row-group;
}

.article-body tr {
    display: table-row;
}

.article-body th, .article-body td {
    display: table-cell;
    padding: 0.7rem 0.8rem;
    text-align: left;
    border: 1px solid var(--border);
    vertical-align: top;
}

.article-body th {
    background: var(--bg-alt);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-heading);
    white-space: nowrap;
}

.article-body td {
    background: var(--bg);
}

.article-body tr:nth-child(even) td {
    background: var(--bg-alt);
}

/* ---- CTA SECTION ---- */
.article-cta {
    background: var(--bg-dark);
    padding: 3rem 1.5rem;
}

.cta-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.cta-inner h2 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.6rem;
    color: #FFFFFF;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.cta-inner p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-gradient);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.9rem 2rem;
    border-radius: var(--radius);
    transition: transform var(--transition), box-shadow var(--transition);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(230, 57, 70, 0.5);
    color: #FFFFFF;
}

/* ---- RELATED ARTICLES ---- */
.related {
    background: var(--bg-alt);
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border);
}

.related-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
}

.related-inner h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}

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

.related-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.related-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.related-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.related-card h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-heading);
    line-height: 1.35;
    flex-grow: 1;
    margin-bottom: 0.8rem;
}

.related-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* ---- FOOTER ---- */
.article-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.6);
    padding: 2.5rem 1.5rem 1.5rem;
}

.footer-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand p {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    max-width: 350px;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.footer-links a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #FFFFFF;
}

.footer-bottom {
    padding-top: 1rem;
    font-size: 0.75rem;
    opacity: 0.4;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
    }

    .article-body h3 {
        font-size: 1.1rem;
    }

    .article-body table {
        font-size: 0.8rem;
    }

    .article-body th, .article-body td {
        padding: 0.5rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .cta-inner h2 {
        font-size: 1.3rem;
    }

    .nav-cta {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .article {
        padding: 1.5rem 1rem 2rem;
    }

    .article-header h1 {
        font-size: 1.3rem;
    }

    .article-body h2 {
        font-size: 1.15rem;
    }

    .article-body blockquote {
        padding: 0.8rem 1rem;
    }

    .bc-inner {
        font-size: 0.7rem;
    }
}

/* ---- SHARED: NAV ACTIVE STATE ---- */
.nav-articles-active {
    color: #FFFFFF !important;
}

/* ---- ARTICLE CARDS (shared by hub popular + category pages) ---- */
.index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.index-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.index-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}

.index-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: var(--color-primary);
}

.index-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.index-card h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-heading);
    line-height: 1.4;
    flex-grow: 1;
    margin-bottom: 0.8rem;
}

.index-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-card .index-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.index-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* ---- HUB PAGE /articles/ ---- */
.hub-hero {
    background: var(--bg-dark);
    padding: 4.5rem 1.5rem 3.5rem;
    text-align: center;
}

.hub-hero h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 2.2rem;
    color: #FFFFFF;
    margin-bottom: 0.8rem;
}

.hub-hero p {
    color: rgba(255,255,255,0.55);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.hub-main {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
}

.cat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--color-primary);
}

.cat-card h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-heading);
    margin-bottom: 0.6rem;
}

.cat-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.cat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cat-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Hub popular section */
.hub-popular {
    background: var(--bg-alt);
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border);
}

.hub-popular-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
}

.hub-popular h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}

.hub-popular-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ---- CATEGORY PAGE /articles/{slug}/ ---- */
.cat-hero {
    background: var(--bg-alt);
    padding: 2.5rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.cat-hero-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
}

.cat-hero h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--text-heading);
    margin-bottom: 0.6rem;
}

.cat-hero p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.cat-hero-count {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(230, 57, 70, 0.08);
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
}

.cat-main {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .index-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .index-grid-2col {
        grid-template-columns: repeat(2, 1fr);
    }
    .cat-grid {
        grid-template-columns: 1fr;
    }
    .hub-hero h1 {
        font-size: 1.6rem;
    }
    .hub-hero {
        padding: 3.5rem 1.5rem 2.5rem;
    }
    .cat-hero h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .index-grid,
    .index-grid-2col {
        grid-template-columns: 1fr;
    }
    .hub-hero h1 {
        font-size: 1.4rem;
    }
    .cat-hero h1 {
        font-size: 1.25rem;
    }
}
