/* 
 * Style principal pour le blog Markdown
 */

/* Variables et reset */
:root {
    --primary-color: #6366f1;
    --secondary-color: #1e293b;
    --accent-color: #f43f5e;
    --text-color: #334155;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #64748b;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --container-width: 1200px;
    --border-radius: 8px;
    --box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--light-gray);
    font-size: 1.05rem;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin-bottom: 1.2rem;
    color: var(--secondary-color);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2.75rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1.2rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--accent-color);
}

a:not(nav a, .article-card a)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

a:not(nav a, .article-card a):hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1.2rem;
}

/* Styles pour les tableaux */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.content-table thead {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
    font-weight: bold;
}

.content-table th,
.content-table td {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--medium-gray);
}

.content-table tbody tr {
    border-bottom: 1px solid var(--medium-gray);
    transition: background-color 0.3s ease;
}

.content-table tbody tr:nth-of-type(even) {
    background-color: rgba(99, 102, 241, 0.05);
}

.content-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary-color);
}

.content-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.1);
    cursor: default;
}

/* Version responsive pour les petits écrans */
@media screen and (max-width: 600px) {
    .content-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    .content-table thead,
    .content-table tbody,
    .content-table th,
    .content-table td,
    .content-table tr {
        display: block;
    }
    
    .content-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .content-table tr {
        border: 1px solid var(--medium-gray);
        margin-bottom: 1rem;
        border-radius: var(--border-radius);
        overflow: hidden;
    }
    
    .content-table td {
        border: none;
        border-bottom: 1px solid var(--medium-gray);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    .content-table td:before {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
        content: attr(data-column);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: white;
    color: var(--secondary-color);
    padding: 1.5rem 1rem;
    margin-bottom: 3rem;
    box-shadow: var(--box-shadow);
    border-bottom: 1px solid var(--medium-gray);
   
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-weight: 800;
}

nav {
    margin-top: 1.25rem;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

nav ul li {
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

nav a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

main {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    animation: fadeIn 0.6s ease-out;
}

section {
    margin-bottom: 2rem;
}

aside {
    margin-bottom: 2rem;
}

footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
    border-top: 4px solid var(--primary-color);
}

footer p {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

footer a {
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: rgba(244, 63, 94, 0.1);
    transition: all 0.3s ease;
}

footer a:hover {
    background-color: rgba(244, 63, 94, 0.2);
    color: white;
}

footer a::before {
    content: "🗺";
    margin-right: 0.5rem;
}

/* Supprime l'effet de soulignement par défaut pour les liens du footer */
footer a::after {
    display: none;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
    border: 1px solid var(--medium-gray);
    position: relative;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.article-meta span {
    margin-right: 1rem;
}

.category {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.date {
    white-space: nowrap;
}

.read-more {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.read-more::after {
    content: "→";
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(4px);
}

/* Article page */
.single-article {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 3rem;
    border: 1px solid var(--medium-gray);
}

.article-header {
    padding: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--medium-gray);
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.article-content h1, .article-content h2, .article-content h3 {
    margin-top: 2rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

/* Styles pour les images d'article */
.image-container {
    text-align: center;
    margin: 2rem auto;
}

.article-image {
    max-width: 90%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: inline-block;
}

.article-content blockquote {
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-left: 4px solid var(--primary-color);
    background-color: var(--light-gray);
    font-style: italic;
    color: var(--secondary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.article-content pre {
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content code {
    background-color: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--medium-gray);
}

/* Sidebar */
.widget {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--medium-gray);
    margin-bottom: 2rem;
}

.widget h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--medium-gray);
}

.widget ul {
    list-style: none;
    margin-left: 0;
}

.widget li {
    margin-bottom: 0.5rem;
}

.widget a.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
    
    aside {
        order: -1;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .single-article {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin-right: 0;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-card {
        padding: 1.5rem;
    }
    
    .single-article {
        padding: 1rem;
    }
}

/* Ajout d'animations de chargement de page */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Amélioration des liens */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--accent-color);
}

a:not(nav a, .article-card a)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

a:not(nav a, .article-card a):hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Styles pour le Sitemap */
.sitemap-content {
    padding: 2rem 0;
}

.sitemap-section {
    margin-bottom: 3rem;
}

.sitemap-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--medium-gray);
}

.sitemap-section h3 {
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.3rem;
}

.sitemap-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sitemap-section li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.sitemap-section li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
} 