/*
Theme Name: Rénov Maison Theme
Description: Thème custom léger — Magazine Maison & Travaux
Version: 1.0
Text Domain: renov-maison-theme
*/

/* ============================
   VARIABLES & RESET
   ============================ */
:root {
    --primary: #1B5E3B;
    --primary-light: #2E8B57;
    --accent: #E8A317;
    --dark: #1A1A2E;
    --gray-dark: #4A4A5A;
    --gray-mid: #8E8E9E;
    --gray-light: #F4F4F8;
    --white: #FFFFFF;
    --border: #E0E0E8;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --max-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 340px;
    --gap: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }

/* ============================
   HEADER & NAVIGATION
   ============================ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.site-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.site-logo span { color: var(--accent); }

.main-nav ul { display: flex; list-style: none; gap: 28px; }
.main-nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-dark);
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current_page_parent > a {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Hamburger mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.menu-toggle svg { width: 28px; height: 28px; fill: var(--dark); }

/* ============================
   HERO SECTION (Accueil)
   ============================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0D3B22 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 24px;
}
.hero h1 { font-size: 36px; margin-bottom: 16px; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }
.hero .search-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}
.hero .search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    color: var(--dark);
    outline: none;
    font-family: var(--font);
}
.hero .search-form button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 14px 24px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    font-size: 15px;
    transition: background 0.2s;
}
.hero .search-form button:hover {
    background: #d4940f;
}

/* ============================
   CONTENEUR PRINCIPAL
   ============================ */
.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* Layout article avec sidebar */
.content-area {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 48px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* ============================
   CARDS ARTICLES
   ============================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.articles-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.article-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.article-card a { color: inherit; display: block; }
.article-card img { width: 100%; height: 180px; object-fit: cover; }
.article-card-body { padding: 20px; }
.article-card .category-badge {
    display: inline-block;
    background: var(--gray-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.article-card h3 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--dark);
}
.article-card p {
    font-size: 14px;
    color: var(--gray-dark);
    line-height: 1.5;
}
.article-card .read-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.article-card .read-more:hover { color: var(--primary-light); }

/* Placeholder image when no thumbnail */
.article-card-placeholder {
    width: 100%;
    height: 180px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.article-card-placeholder svg {
    width: 48px;
    height: 48px;
    fill: var(--border);
}

/* ============================
   SECTION SILO (Accueil)
   ============================ */
.silo-section { margin-bottom: 60px; }
.silo-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}
.silo-section-header h2 { font-size: 24px; }
.silo-section-header .see-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.silo-section-header .see-all:hover { color: var(--primary-light); }

/* Featured articles (3 colonnes) */
.featured-articles { margin-bottom: 60px; }
.featured-articles h2 {
    font-size: 24px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

/* ============================
   ARTICLE SINGLE
   ============================ */
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: 32px; line-height: 1.3; margin-bottom: 12px; }
.article-meta {
    font-size: 14px;
    color: var(--gray-mid);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.article-meta span { display: flex; align-items: center; gap: 4px; }
.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

/* Contenu article */
.article-content h2 {
    font-size: 26px;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.article-content h3 { font-size: 22px; margin-top: 32px; margin-bottom: 12px; }
.article-content h4 { font-size: 18px; margin-top: 24px; margin-bottom: 10px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--gray-light);
    padding: 16px 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--gray-dark);
}
.article-content strong { font-weight: 600; }

/* Tableaux dans articles */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}
.article-content th {
    background: var(--primary);
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}
.article-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}
.article-content tr:nth-child(even) { background: var(--gray-light); }

/* ============================
   BREADCRUMB
   ============================ */
.breadcrumb {
    font-size: 13px;
    color: var(--gray-mid);
    margin-bottom: 24px;
    padding: 12px 0;
}
.breadcrumb a { color: var(--gray-mid); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; }

/* ============================
   FAQ SECTION
   ============================ */
.faq-section { margin-top: 48px; }
.faq-section h2 { margin-bottom: 20px; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    transition: background 0.2s;
}
.faq-question:hover { background: var(--gray-light); }
.faq-question::after {
    content: '+';
    font-size: 20px;
    color: var(--primary);
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 12px;
}
.faq-item.active .faq-question::after { content: '\2212'; }
.faq-answer {
    padding: 0 20px 16px;
    display: none;
    line-height: 1.7;
    color: var(--gray-dark);
}
.faq-item.active .faq-answer { display: block; }

/* ============================
   SIDEBAR
   ============================ */
.sidebar { position: sticky; top: 100px; }
.sidebar-widget {
    background: var(--gray-light);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.sidebar-widget h4 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

/* Table of Contents */
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 8px; }
.toc-list a {
    font-size: 14px;
    color: var(--gray-dark);
    padding: 4px 0 4px 12px;
    border-left: 2px solid transparent;
    display: block;
    transition: all 0.2s;
}
.toc-list a:hover,
.toc-list a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}
.toc-list .toc-h3 { padding-left: 24px; font-size: 13px; }

/* Related articles sidebar */
.sidebar-related .related-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.sidebar-related .related-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-related .related-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-related .related-item h5 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.sidebar-related .related-item h5 a { color: var(--dark); }
.sidebar-related .related-item h5 a:hover { color: var(--primary); }

/* CTA Widget */
.sidebar-cta {
    background: linear-gradient(135deg, var(--primary) 0%, #0D3B22 100%);
    color: var(--white);
    text-align: center;
}
.sidebar-cta h4 { color: var(--white); border-bottom-color: var(--accent); }
.sidebar-cta p { font-size: 14px; margin-bottom: 16px; opacity: 0.9; }
.sidebar-cta .cta-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.sidebar-cta .cta-btn:hover { background: #d4940f; color: var(--white); }

/* ============================
   ARCHIVE / CATEGORY PAGE
   ============================ */
.archive-header {
    margin-bottom: 40px;
}
.archive-header h1 {
    font-size: 32px;
    margin-bottom: 12px;
}
.archive-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-dark);
    max-width: var(--content-width);
}
.archive-seo-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.pagination .current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ============================
   PAGE TEMPLATE
   ============================ */
.page-content {
    max-width: var(--content-width);
    margin: 0 auto;
}
.page-content h1 {
    font-size: 32px;
    margin-bottom: 24px;
}
.page-content h2 { font-size: 26px; margin-top: 32px; margin-bottom: 12px; }
.page-content h3 { font-size: 22px; margin-top: 24px; margin-bottom: 10px; }
.page-content p { margin-bottom: 16px; }
.page-content ul, .page-content ol { margin-bottom: 16px; padding-left: 24px; }
.page-content li { margin-bottom: 8px; }

/* ============================
   SEARCH PAGE
   ============================ */
.search-header { margin-bottom: 40px; }
.search-header h1 { font-size: 28px; margin-bottom: 16px; }
.search-header .search-form {
    max-width: 500px;
    display: flex;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.search-header .search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    font-family: var(--font);
    outline: none;
}
.search-header .search-form button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

/* ============================
   404 PAGE
   ============================ */
.error-404 {
    text-align: center;
    padding: 80px 24px;
}
.error-404 h1 {
    font-size: 80px;
    color: var(--primary);
    margin-bottom: 16px;
}
.error-404 h2 {
    font-size: 28px;
    margin-bottom: 16px;
}
.error-404 p {
    font-size: 16px;
    color: var(--gray-dark);
    margin-bottom: 32px;
}
.error-404 .btn-home {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}
.error-404 .btn-home:hover { background: var(--primary-light); color: var(--white); }

/* Related articles section (bottom of single) */
.related-articles {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.related-articles h2 {
    font-size: 24px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
    background: var(--dark);
    color: var(--gray-mid);
    padding: 40px 24px;
    margin-top: 60px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-copy { font-size: 14px; }
.footer-nav ul { display: flex; list-style: none; gap: 24px; }
.footer-nav a { color: var(--gray-mid); font-size: 14px; }
.footer-nav a:hover { color: var(--white); }

/* ============================
   COOKIE BANNER
   ============================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    color: var(--white);
    padding: 20px 24px;
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.cookie-inner p { font-size: 14px; flex: 1; margin: 0; }
.cookie-inner p a { color: var(--accent); }
.cookie-buttons { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: var(--font);
    transition: background 0.2s;
}
.cookie-btn-accept { background: var(--accent); color: var(--white); }
.cookie-btn-accept:hover { background: #d4940f; }
.cookie-btn-refuse { background: transparent; color: var(--gray-mid); border: 1px solid var(--gray-mid); }
.cookie-btn-refuse:hover { color: var(--white); border-color: var(--white); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .sidebar { position: static; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 12px; }
    .menu-toggle { display: block; }
    .articles-grid, .articles-grid-2 { grid-template-columns: 1fr; }
    .hero { padding: 48px 24px; }
    .hero h1 { font-size: 28px; }
    .hero .search-form { flex-direction: column; }
    .hero .search-form button { padding: 12px; }
    .article-header h1 { font-size: 26px; }
    .featured-image { height: 250px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-nav ul { flex-wrap: wrap; justify-content: center; }
    .cookie-inner { flex-direction: column; text-align: center; }
    .cookie-buttons { width: 100%; justify-content: center; }
}
