/* v:\assets\css\frontend.css */

:root {
    /* Variables - Mode Clair (Défaut) */
    --bg-body: #ffffff;
    --bg-card: #f9f9f9;
    --text-main: #1a1a1a;
    --text-sec: #666666;
    --accent: #000000;
    --border: #eeeeee;
    --nav-height: 70px;
    --gap: 20px;
}

[data-theme="dark"] {
    /* Variables - Mode Sombre */
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-sec: #a0a0a0;
    --accent: #ffffff;
    --border: #333333;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Police neutre et moderne */
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }
img { max-width: 100%; height: auto; display: block; }

/* --- HEADER --- */
header {
    position: sticky; top: 0; z-index: 1000;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px var(--gap);
}
.header-left, .header-right {
    flex: 1;
}
.header-right {
    display: flex;
    justify-content: flex-end;
}
.nav-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrer les lignes de nav */
}
.nav-top, .nav-bottom {
    display: flex;
    gap: 25px;
    justify-content: center; /* Centrer les liens dans chaque ligne */
    align-items: center;
    padding: 5px 0;
    flex-wrap: wrap;
}
.mobile-nav-toggle {
    display: none;
    background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-main);
}

/* Navigation */
.nav-item { font-size: 0.9rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-item.active { border-bottom: 2px solid var(--accent); }

/* --- LAYOUT CONTENT --- */
main {
    max-width: 1600px; margin: 0 auto;
    padding: 40px var(--gap);
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Breadcrumb & Titres */
.page-header { margin-bottom: 40px; text-align: center; }
.breadcrumb { font-size: 0.85rem; color: var(--text-sec); margin-bottom: 10px; }
.page-title { font-size: 2rem; font-weight: 300; margin-bottom: 10px; }
.page-desc { max-width: 800px; margin: 0 auto; color: var(--text-sec); font-size: 1rem; }

/* --- GRILLES (Rubriques / Albums) --- */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}
.card {
    background: var(--bg-card);
    border-radius: 4px; overflow: hidden;
    transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); }
.card-img { height: 200px; overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-info { padding: 15px; text-align: center; }
.card-title { font-weight: 600; font-size: 1.1rem; margin-bottom: 5px; }
.card-meta { font-size: 0.8rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; }

/* --- MASONRY (Oeuvres) --- */
/* Utilisation de colonnes CSS pour un vrai effet maçonnerie vertical */
.masonry-grid {
    column-count: 4;
    column-gap: 20px;
}
.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
}
.masonry-item img {
    width: 100%;
    border-radius: 2px;
}
/* Overlay info au survol */
.overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0; transition: opacity 0.3s;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: #fff; text-align: center; padding: 10px;
}
.masonry-item:hover .overlay { opacity: 1; }
.overlay-title { font-weight: bold; font-size: 1.1rem; }

/* --- ARTICLES (Info / Blog) --- */
.hero-container {
    position: relative;
    width: 100%;
    flex-grow: 1; /* Le conteneur s'étire pour remplir l'espace disponible */
    min-height: 300px; /* On garde une hauteur minimale de sécurité */
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-container #particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.article-container { max-width: 800px; margin: 0 auto 50px auto; }
.article-meta { font-size: 0.8rem; color: var(--text-sec); margin-bottom: 20px; }
.article-content { font-size: 1.1rem; line-height: 1.8; }
.article-content img { margin: 20px 0; border-radius: 4px; }

/* --- FOOTER & UTILS --- */
footer {
    border-top: 1px solid var(--border);
    padding: 30px var(--gap);
    text-align: center; font-size: 0.8rem; color: var(--text-sec);
    margin-top: auto;
}
.theme-toggle { cursor: pointer; background: none; border: none; font-size: 1.2rem; color: var(--text-main); margin-left: 20px; }
.auth-link { position: fixed; bottom: 10px; right: 10px; opacity: 0.3; font-size: 0.8rem; }
.auth-link:hover { opacity: 1; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) { .masonry-grid { column-count: 3; } }
@media (max-width: 768px) {
    .masonry-grid { column-count: 2; }
    .page-title { font-size: 1.5rem; }

    .mobile-nav-toggle { display: block; }
    .nav-container {
        display: none; /* Caché par défaut */
        position: absolute;
        top: 100%; /* Juste en dessous du header */
        left: 0; right: 0;
        background: var(--bg-body);
        border-bottom: 1px solid var(--border);
        padding: var(--gap);
        flex-direction: column;
        align-items: center;
    }
    .nav-container.open { display: flex; } /* Affiché au clic */
    .nav-top, .nav-bottom { flex-direction: column; gap: 15px; }
}
@media (max-width: 480px) { .masonry-grid { column-count: 1; } }