/* =============================================
   DATA BLOG — Custom Theme for Mikael Paulhiout
   Tech Lead Snowflake | Light & Energetic
   ============================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-header: #ffffff;
    --border-subtle: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.12);
    --accent-light: #e0f2fe;
    --accent-gradient: linear-gradient(135deg, #0ea5e9, #6366f1);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    --shadow-card-hover: 0 8px 24px rgba(14, 165, 233, 0.18), 0 2px 8px rgba(0,0,0,0.06);
}

/* ---- Reset / Base ---- */
html { scroll-behavior: smooth; }
body.data-blog {
    background-color: #f0f4f8 !important;
    color: #0f172a !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.data-blog h1, body.data-blog h2, body.data-blog h3, body.data-blog h4, body.data-blog h5, body.data-blog h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em;
    line-height: 1.25 !important;
}
body.data-blog h1 { font-size: 2.5rem !important; }
body.data-blog h2 { font-size: 1.875rem !important; margin-top: 2.5rem !important; margin-bottom: 1rem !important; }
body.data-blog h3 { font-size: 1.5rem !important; margin-top: 2rem !important; margin-bottom: 0.75rem !important; }
body.data-blog h4 { font-size: 1.25rem !important; }

body.data-blog p { color: #334155 !important; }

body.data-blog a {
    color: #0ea5e9 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}
body.data-blog a:hover { color: #0284c7 !important; text-decoration: underline; }

/* ---- Header / Navbar ---- */
#header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    backdrop-filter: blur(12px);
}
#header .navbar {
    background: transparent !important;
}
#header .navbar-section.logo a,
#header .navbar-section.logo span {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a !important;
    letter-spacing: -0.03em;
    white-space: nowrap;
}
#header .navbar-section.logo a:hover {
    color: #0ea5e9 !important;
    text-decoration: none;
}
#header .dropmenu ul li a,
#header .dropmenu a,
#header .navbar a,
#header .navbar-section a,
#header nav a,
#header .mobile-menu .button_container span {
    color: #0f172a !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}
#header .dropmenu ul li a:hover,
#header .dropmenu ul li.active a,
#header .dropmenu a:hover {
    color: #0ea5e9 !important;
    background: rgba(14, 165, 233, 0.08);
}
#header .navbar .fa,
#header .navbar .fas,
#header .navbar i {
    color: #0f172a !important;
}

/* ---- Hero (Accueil & Articles) ---- */
#hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #c7d2fe 50%, #e0e7ff 100%) !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 4rem 0 !important;
    text-align: center;
}
#hero h1 {
    font-size: 3rem !important;
    font-weight: 800;
    background: linear-gradient(to right, #0f172a, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}
#hero h2, .hero p {
    color: #475569 !important;
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 680px;
    margin: 0 auto;
}

/* ---- Cards (Blog listing) ---- */
.card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
    margin-bottom: 2rem;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: #cbd5e1 !important;
}
.card-image {
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}
.card-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
    display: block;
}
.card:hover .card-image img { transform: scale(1.03); }
.card-header { padding: 1.5rem 1.5rem 0.5rem; }
.card-title h5 {
    font-size: 1.25rem !important;
    font-weight: 700;
    margin: 0.25rem 0 0.5rem;
    color: #0f172a !important;
    line-height: 1.3;
}
.card-title a { color: inherit !important; }
.card-title a:hover { color: #0ea5e9 !important; text-decoration: none; }
.card-subtitle {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card-body {
    padding: 0.5rem 1.5rem;
    color: #334155 !important;
    font-size: 0.95rem;
    line-height: 1.65;
}
.card-footer {
    padding: 0 1.5rem 1.5rem;
    border-top: none !important;
}

/* ---- Tags / Taxonomy ---- */
.blog-content-item .e-content a,
.taxonomy-item a,
.taxonomy a {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0ea5e9 !important;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s;
    margin: 0.15rem 0.25rem 0.15rem 0;
}
.taxonomy-item a:hover,
.taxonomy a:hover {
    background: #bae6fd;
    color: #0284c7 !important;
    text-decoration: none;
}

/* ---- Article Page ---- */
.blog-listing { padding-top: 2.5rem; }
.content-title h2 {
    font-size: 2.25rem !important;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}
.content-title h3 {
    font-size: 1.25rem !important;
    color: #475569 !important;
    font-weight: 400;
    margin-top: 0;
}
.p-content p,
.e-content p {
    margin-bottom: 1.25rem;
    color: #334155 !important;
}
.p-content h2, .e-content h2,
.p-content h3, .e-content h3 {
    color: #0f172a !important;
    margin-top: 2.5rem;
}
.p-content h2::after, .e-content h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    border-radius: 2px;
    margin-top: 0.5rem;
}
.e-content ul, .e-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
.e-content ul li, .e-content ol li {
    color: #334155 !important;
    margin-bottom: 0.5rem;
}

/* ---- Code blocks ---- */
pre, code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace !important;
}
code {
    background: rgba(14, 165, 233, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
    color: #0ea5e9 !important;
    border: 1px solid rgba(14, 165, 233, 0.15);
}
pre {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    position: relative;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
pre code {
    background: transparent !important;
    border: none;
    padding: 0;
    color: #334155 !important;
    font-size: 0.875rem;
    line-height: 1.65;
}
pre::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #f472b6);
    border-radius: 8px 8px 0 0;
    opacity: 0.7;
}

/* ---- Tables (Markdown) ---- */
.e-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.e-content table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.e-content table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155 !important;
}
.e-content table tr:nth-child(even) { background: rgba(240, 244, 248, 0.5); }
.e-content table tr:hover { background: rgba(14, 165, 233, 0.03); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 8px;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    font-weight: 500;
    transition: all 0.2s;
}
.pagination a:hover {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
    color: #0ea5e9 !important;
    text-decoration: none;
}
.pagination .current {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
    color: #0ea5e9 !important;
    font-weight: 600;
}

/* ---- Footer ---- */
#footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0;
    padding: 2.5rem 0;
    text-align: center;
}
#footer p {
    color: #64748b !important;
    font-size: 0.85rem;
    margin: 0;
}
#footer a { color: #0ea5e9 !important; }
#footer a:hover { color: #0284c7 !important; }

/* ---- Breadcrumbs ---- */
.breadcrumbs-container {
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.breadcrumbs a { color: #94a3b8 !important; font-size: 0.85rem; }
.breadcrumbs a:hover { color: #0ea5e9 !important; }
.breadcrumbs .breadcrumb-item::after {
    content: '/';
    color: #cbd5e1;
    margin: 0 0.5rem;
}
.breadcrumbs .active { color: #64748b !important; font-size: 0.85rem; }

/* ---- Buttons ---- */
body.data-blog .btn {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s;
}
body.data-blog .btn:hover {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
    color: #0ea5e9 !important;
}
body.data-blog .btn.btn-primary,
body.data-blog .btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600;
}
body.data-blog .btn.btn-primary:hover,
body.data-blog .btn-primary:hover {
    background: linear-gradient(135deg, #38bdf8, #818cf8) !important;
    color: #ffffff !important;
}

/* ---- Prev/Next ---- */
.prev-next { margin-top: 3rem; }
.prev-next .btn { margin: 0 0.25rem; }

/* ---- Sidebar ---- */
.sidebar {
    padding-left: 2rem;
}
.sidebar h4 {
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8 !important;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.archives-list a, .related-pages a {
    color: #334155 !important;
    font-size: 0.9rem;
    display: block;
    padding: 0.35rem 0;
    transition: color 0.2s;
}
.archives-list a:hover, .related-pages a:hover {
    color: #0ea5e9 !important;
    text-decoration: none;
}

/* ---- Mobile menu ---- */
.mobile-menu .button_container span {
    background: #94a3b8;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f0f4f8; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Images ---- */
.e-content img {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

/* ---- Selection ---- */
::selection {
    background: rgba(14, 165, 233, 0.2);
    color: #0f172a;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 768px) {
    h1 { font-size: 2rem !important; }
    #hero { padding: 2.5rem 0 !important; }
    #hero h1 { font-size: 2rem !important; }
    .card { margin-bottom: 1.5rem; }
    .card-header, .card-body, .card-footer { padding-left: 1rem; padding-right: 1rem; }
    pre { padding: 1rem; }
}

/* ---- Override Spectre body bg aggressively ---- */
body#page-wrapper, #page-wrapper {
    background-color: #f0f4f8 !important;
}
