/*
Theme Name: MeilleurSite.net
Description: Theme custom MeilleurSite.net - design inspiré Clubic
Version: 2.3
Text Domain: meilleursite-net
*/

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

:root {
    --rouge: #c0392b;
    --rouge-dark: #a93226;
    --rouge-light: rgba(192, 57, 43, 0.08);
    --bg: #f4f4f4;
    --card-bg: #fff;
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #e0e0e0;
    --header-h: 60px;
    --radius: 6px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --max-w: 1160px;
    --article-w: 760px;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   Header
   ============================================ */
.site-header {
    background: #fff;
    border-bottom: 2px solid var(--rouge);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    overflow: visible;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 40px;
}

.site-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rouge);
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.site-logo span { color: var(--text); }

.main-nav { flex: 1; }

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
}

.main-nav ul li a {
    display: block;
    padding: 6px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a {
    color: var(--rouge);
    background: var(--rouge-light);
}

/* ============================================
   Wrapper global
   ============================================ */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* Pages simples (mentions legales, etc.) : colonne de lecture centree */
.page-wrapper {
    max-width: var(--article-w);
    margin: 0 auto;
}
.page-wrapper .entry-title { margin-top: 8px; }

/* ============================================
   Cards articles (homepage)
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }

.card-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e8e8e8;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card:hover .card-thumb img { transform: scale(1.03); }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.card-cat {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rouge);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    flex: 1;
}

.card-title a:hover { color: var(--rouge); }

.card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Homepage - hero + grilles
   ============================================ */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.hero-card .card-thumb { aspect-ratio: 16/9; }
.hero-card .card-title { font-size: 1.35rem; line-height: 1.25; }

.hero-aside { display: flex; flex-direction: column; gap: 12px; }
.hero-aside .card { flex-direction: row; }
.hero-aside .card-thumb { width: 110px; flex-shrink: 0; aspect-ratio: unset; min-height: 80px; }
.hero-aside .card-body { padding: 10px 12px; }
.hero-aside .card-title { font-size: 0.88rem; }

.section-block { margin-bottom: 40px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text);
}

.section-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--rouge);
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: middle;
}

.section-header a.voir-plus {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rouge);
}

.section-header a.voir-plus:hover { text-decoration: underline; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ============================================
   Article - page single
   ============================================ */
.article-wrapper {
    max-width: var(--article-w);
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 36px 44px 48px;
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--rouge); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

.article-cat-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rouge);
    background: var(--rouge-light);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.entry-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.article-meta .author-name { font-weight: 600; color: var(--text); }
.article-meta .sep { color: var(--border); }

.article-meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    order: -1;
}

.author-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-thumbnail {
    margin: 0 auto 28px;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 480px;
}

.post-thumbnail img { width: 100%; border-radius: var(--radius); }

/* ============================================
   Contenu article
   ============================================ */
.entry-content { font-size: 1rem; line-height: 1.7; }

.entry-content h2 {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    margin: 40px 0 14px;
    padding-top: 8px;
}

.entry-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 10px;
}

.entry-content p { margin-bottom: 18px; }
.entry-content strong { color: var(--text); font-weight: 700; }

.entry-content ul,
.entry-content ol { margin: 0 0 18px 24px; }
.entry-content p + ul,
.entry-content p + ol { margin-top: -10px; }
.entry-content li { margin-bottom: 6px; }

.entry-content a { color: var(--rouge); text-decoration: underline; }

/* ============================================
   Composants editoriaux
   ============================================ */
.intro-box {
    margin-bottom: 24px;
    font-weight: 700;
    line-height: 1.65;
    background: none;
    border: none;
    padding: 0;
}

.top5-box {
    background: #fff7f7;
    border: 1px solid rgba(192,57,43,0.2);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 28px 0;
}

.top5-box h2 { margin-top: 0; padding-top: 0; }
.top5-box ol { margin-left: 20px; margin-bottom: 0; }
.top5-box li { padding: 3px 0; font-weight: 400; }

/* Avantages / Inconvénients */
.site-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin: 14px 0 22px;
}

.pros-list, .cons-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pros-list li, .cons-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 0.85rem;
    padding: 3px 0;
    line-height: 1.4;
    color: var(--text);
}

.pros-list li svg, .cons-list li svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.pros-list li svg,
.pros-list li svg path { fill: #27ae60 !important; }
.cons-list li svg,
.cons-list li svg path { fill: #c0392b !important; }

/* FAQ */
.faq-block { margin: 36px 0; }
.faq-block > h2 { margin-top: 0; }

.faq-item { border-bottom: 1px solid var(--border); }

.faq-q {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 15px 36px 15px 0;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    position: relative;
    line-height: 1.4;
    font-family: var(--font);
}

.faq-q::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--rouge);
}

.faq-q[aria-expanded="true"]::after { content: '-'; }

.faq-a { display: none; padding: 0 0 15px; color: var(--text-secondary); font-size: 0.95rem; }
.faq-a.open { display: block; }
.faq-a p { margin-bottom: 8px; }
.faq-a p:last-child { margin-bottom: 0; }

/* CTA bouton */
.cta-btn, button.cta-btn {
    display: block;
    width: fit-content;
    margin: 10px auto;
    background: var(--rouge);
    color: #fff !important;
    padding: 11px 26px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none !important;
    font-family: var(--font);
}

.cta-btn:hover, button.cta-btn:hover { background: var(--rouge-dark); }


/* ============================================
   Articles liés
   ============================================ */
.related-articles {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 2px solid var(--border);
}

.related-articles h3 {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    margin-top: 0;
}

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

/* ============================================
   Formulaire contact
   ============================================ */
.contact-apparaitre-form { max-width: 520px; }
.contact-apparaitre-form label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
.contact-apparaitre-form input,
.contact-apparaitre-form textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-family: var(--font);
    background: #fafafa;
}
.contact-apparaitre-form input:focus,
.contact-apparaitre-form textarea:focus { outline: 2px solid var(--rouge); border-color: transparent; background: #fff; }
.contact-apparaitre-form textarea { min-height: 110px; resize: vertical; }

/* ============================================
   Share buttons (dans article-meta)
   ============================================ */
.meta-share {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover { background: var(--rouge-light); border-color: var(--rouge); }
.share-btn svg { width: 13px; height: 13px; fill: var(--text-muted); transition: fill 0.15s; }
.share-btn:hover svg { fill: var(--rouge); }
.share-copy-ok svg { fill: #27ae60 !important; }

/* ============================================
   Bloc auteur (single.php)
   ============================================ */
.author-cta-box {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 40px 0;
}
.author-box-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--rouge);
}
.author-box-content { flex: 1; min-width: 0; }
.author-box-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}
.author-box-name a { color: var(--text); text-decoration: none; }
.author-box-name a:hover { color: var(--rouge); }
.author-box-bio { font-size: 0.88rem; color: var(--text-secondary); margin: 0 0 10px; line-height: 1.55; }
.author-box-link { font-size: 0.82rem; color: var(--rouge); font-weight: 600; text-decoration: none; }
.author-box-link:hover { text-decoration: underline; }

/* ============================================
   Page auteur (author.php)
   ============================================ */
.author-page { max-width: var(--article-w); margin: 0 auto; padding: 36px 20px; }
.author-page-header {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 40px;
}
.author-page-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--rouge);
}
.author-page-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}
.author-page-bio { font-size: 1rem; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.author-page-articles h2 { font-size: 1.2rem; margin-bottom: 20px; color: var(--text); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--text);
    color: #888;
    padding: 30px 20px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 60px;
}

.site-footer a { color: #aaa; }
.site-footer a:hover { color: #fff; }

/* ============================================
   Responsive
   ============================================ */
/* ============================================
   Burger button
   ============================================ */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}
.burger-btn span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================
   Responsive
   ============================================ */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.entry-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

.entry-content pre,
.entry-content code {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   Archive - Header catégorie
   ============================================ */
.cat-page-header {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 0 28px;
}

.cat-header-text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px 32px;
    border-right: 1px solid var(--border);
}

.cat-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 10px;
    line-height: 1.2;
}

.cat-page-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.65;
    margin: 0;
}

.cat-header-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    flex-shrink: 0;
    width: 200px;
    padding: 24px 20px;
    background: var(--light);
}

.cat-author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--rouge);
}

.cat-author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.cat-author-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
}

.cat-author-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    line-height: 1.2;
}
.cat-author-name:hover { color: var(--rouge); }

.cat-author-bio {
    font-size: 0.76rem;
    color: #777;
    line-height: 1.45;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .hero-section { grid-template-columns: 1fr; }
    .hero-aside { display: none; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .article-wrapper { padding: 24px 20px 36px; }
    .entry-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
    /* Burger visible, nav cachée par défaut */
    .burger-btn { display: flex; }
    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 2px solid var(--rouge);
        box-shadow: 0 4px 12px rgba(0,0,0,.12);
        z-index: 200;
    }
    .main-nav.open { display: block; }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 6px 0;
    }
    .main-nav ul li a {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }
    .main-nav ul li:last-child a { border-bottom: none; }
    .header-inner { gap: 0; }

    /* Site main sans padding horizontal - pleine largeur */
    .site-main { padding: 12px 0 32px; }

    /* Article pleine largeur, sans cadre sur mobile */
    .article-wrapper {
        background: transparent;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 16px 16px 32px;
        max-width: 100%;
    }

    /* Contenu listes */
    .cards-grid { grid-template-columns: 1fr; padding: 0 12px; }
    .related-grid { grid-template-columns: 1fr; }
    .entry-title { font-size: 1.3rem; }
    .top5-box { padding: 14px 16px; }
    .post-thumbnail { max-width: 100%; }
    .verdict-box { padding: 14px 16px; }
    .faq-q { font-size: 0.92rem; }
    .cta-btn, button.cta-btn { font-size: 0.88rem; padding: 10px 20px; }
    .site-screenshot { margin: 10px 0 16px; }

    /* Pros/cons colonnes → 1 seule colonne */
    .site-pros-cons { grid-template-columns: 1fr; gap: 6px; }

    /* Header catégorie en mobile */
    .cat-page-header {
        flex-direction: column;
        margin: 0 12px 20px;
    }
    .cat-header-text {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px 18px;
    }
    .cat-header-author {
        width: 100%;
        flex-direction: row;
        text-align: left;
        padding: 16px 18px;
        box-sizing: border-box;
    }
    .cat-author-info { align-items: flex-start; }
}
