/* ==========================================================================
   Des idées pour la cuisine - Stylesheet
   ========================================================================== */

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

:root {
    --primary-color: #80b784;
    --primary-rgb: 128, 183, 132;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fff;
    --bg-light: #f9f9f9;
    --border-color: #e8e8e8;
    --title-red: #d8343a;
    --font-primary: 'Bitter', Georgia, serif;
    --font-secondary: 'Playfair Display', Georgia, serif;
    --font-logo: 'Belleza', sans-serif;
    --max-width: 1170px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--bg-color);
}

a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--title-red); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    line-height: 1.3;
    margin-bottom: 0.6em;
    color: var(--text-color);
}
h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.25em; } h4 { font-size: 1.1em; }
p { margin-bottom: 1em; }
ul, ol { margin: 0 0 1em 1.5em; }
li { margin-bottom: 0.3em; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--primary-color); color: #fff; padding: 8px 16px; }
.skip-link:focus { left: 0; }

/* --- Header --- */
.site-header { background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.header-mid { padding: 15px 0; }
.header-mid .container { display: flex; align-items: center; }
.site-branding { display: flex; align-items: center; gap: 15px; }
.site-logo img { width: 65px; height: auto; }
.site-title { font-family: var(--font-logo); font-size: 21px; font-weight: 400; margin: 0; }
.site-title a { color: var(--title-red); }
.site-title a:hover { color: var(--primary-color); }
.site-description { font-size: 14px; color: var(--text-light); margin: 0; }

.header-bottom { background: var(--primary-color); }
.header-bottom .container { display: flex; align-items: center; justify-content: space-between; }
.main-nav { display: flex; list-style: none; margin: 0; padding: 0; }
.main-nav li a { display: block; padding: 12px 18px; color: #fff; font-size: 15px; font-weight: 500; transition: background 0.2s; }
.main-nav li a:hover, .main-nav li.active a { background: rgba(0,0,0,0.15); color: #fff; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; }
.menu-toggle span { display: block; width: 24px; height: 3px; background: #fff; margin: 4px 0; transition: 0.3s; }

/* --- Breadcrumb --- */
.breadcrumb { background: var(--bg-light); padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--border-color); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary-color); }
.breadcrumb .separator { margin: 0 8px; color: #ccc; }
.breadcrumb .current { color: var(--text-color); }

/* --- Main Layout --- */
.site-content { padding: 30px 0; }
.site-content > .container { display: flex; gap: 40px; align-items: flex-start; }
.content-area { flex: 1; min-width: 0; }

/* --- Article --- */
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: 2em; margin-bottom: 10px; }
.entry-meta { font-size: 14px; color: var(--text-light); margin-bottom: 15px; }
.post-thumbnail { margin-bottom: 25px; border-radius: 4px; overflow: hidden; }
.post-thumbnail img { width: 100%; }
.entry-content h2 { margin-top: 1.5em; padding-bottom: 8px; border-bottom: 2px solid var(--primary-color); }
.entry-content h3 { margin-top: 1.2em; }
.entry-content ul, .entry-content ol { margin: 1em 0 1em 2em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content strong { color: var(--text-color); }

/* --- Table of Contents --- */
.toc-container { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 4px; padding: 20px; margin: 20px 0; }
.toc-title { font-size: 1.1em; font-weight: 600; margin-bottom: 10px; text-align: center; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; margin-bottom: 6px; }
.toc-list li a::before { content: counters(toc, '.') '. '; color: var(--primary-color); font-weight: 600; }
.toc-list li a { color: var(--text-color); font-size: 0.95em; }
.toc-list li a:hover { color: var(--primary-color); }

/* --- Article Cards --- */
.post-list { display: grid; gap: 30px; }
.post-card { display: flex; gap: 20px; padding-bottom: 30px; border-bottom: 1px solid var(--border-color); }
.post-card:last-child { border-bottom: none; }
.post-card .card-thumbnail { flex-shrink: 0; width: 300px; border-radius: 4px; overflow: hidden; }
.post-card .card-thumbnail img { width: 100%; height: 200px; object-fit: cover; }
.post-card .card-content { flex: 1; }
.post-card .card-title { font-size: 1.25em; margin-bottom: 8px; }
.post-card .card-title a { color: var(--text-color); }
.post-card .card-title a:hover { color: var(--primary-color); }
.post-card .card-category { font-size: 13px; color: var(--primary-color); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.post-card .card-excerpt { font-size: 0.95em; color: var(--text-light); line-height: 1.6; }
.read-more { display: inline-block; margin-top: 8px; color: var(--primary-color); font-weight: 500; font-size: 0.9em; }
.read-more:hover { color: var(--title-red); }

/* --- Post Navigation --- */
.post-navigation { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.post-navigation a { display: flex; align-items: center; gap: 10px; color: var(--text-color); font-size: 0.95em; }
.post-navigation a:hover { color: var(--primary-color); }
.post-navigation .nav-label { font-size: 0.8em; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.post-navigation .nav-title { font-weight: 500; }

/* --- Related Posts --- */
.related-posts { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.related-posts h3 { margin-bottom: 15px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-item { text-align: center; }
.related-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; }
.related-item a { font-size: 0.9em; color: var(--text-color); }
.related-item a:hover { color: var(--primary-color); }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; padding-top: 20px; }
.pagination a, .pagination .current-page { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 14px; color: var(--text-color); }
.pagination a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.pagination .current-page { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* --- Sidebar --- */
.sidebar { width: 300px; flex-shrink: 0; }
.widget { margin-bottom: 30px; padding: 20px; background: var(--bg-light); border-radius: 4px; }
.widget-title { font-size: 1.1em; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-color); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-color); font-size: 0.95em; }
.widget ul li a:hover { color: var(--primary-color); }

/* --- Category Header --- */
.category-header { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid var(--primary-color); }
.category-header h1 { font-size: 1.8em; }

/* --- Footer --- */
.site-footer { background: #2c2c2c; color: #aaa; padding: 25px 0; margin-top: 40px; font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--primary-color); }
.site-footer a:hover { color: #fff; }

.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 44px; height: 44px; background: var(--primary-color); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: background 0.2s; z-index: 100; }
.back-to-top:hover { background: #6a9e6e; }
.back-to-top.visible { display: flex; }

/* --- Banner --- */
.site-banner { position: relative; overflow: hidden; background: #222; }
.banner-slides { display: flex; transition: transform 0.5s ease; }
.banner-slide { min-width: 100%; position: relative; }
.banner-slide img { width: 100%; height: 400px; object-fit: cover; }
.banner-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff; }
.banner-caption h2 { font-size: 1.6em; margin-bottom: 8px; }
.banner-caption h2 a { color: #fff; }
.banner-caption h2 a:hover { color: var(--primary-color); }
.banner-caption p { font-size: 0.95em; opacity: 0.9; }
.banner-nav { position: absolute; bottom: 15px; right: 30px; display: flex; gap: 8px; }
.banner-nav button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; padding: 0; }
.banner-nav button.active { background: #fff; }

/* --- Page --- */
.page-header { margin-bottom: 20px; }
.page-title { font-size: 2em; }
.page-content img { margin: 15px 0; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .site-content > .container { flex-direction: column; }
    .sidebar { width: 100%; }
    .post-card { flex-direction: column; }
    .post-card .card-thumbnail { width: 100%; }
    .post-card .card-thumbnail img { height: 220px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary-color); z-index: 1000; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
    .main-nav.open { display: flex; }
    .main-nav li a { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .header-bottom .container { position: relative; }
    .banner-slide img { height: 280px; }
    .banner-caption h2 { font-size: 1.2em; }
    .entry-title { font-size: 1.5em; }
    .post-navigation { flex-direction: column; }
    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .container { padding: 0 15px; }
    .banner-slide img { height: 200px; }
}
