/*
Theme Name: Terra Habitat
Theme URI: https://example.com
Author: Patrimoine Digital
Author URI: https://example.com
Description: Thème de terra-habitat.fr, basé sur Minimal Theme (charte Terra Habitat, home orientée guide).
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minimal-theme
*/

/* ==========================================================================
   TABLE DES MATIÈRES
   ==========================================================================
   1. VARIABLES CSS
   2. RESET & BASE
   3. LAYOUT GÉNÉRAL
   4. HEADER & NAVIGATION
   5. HERO / ENTÊTE MODULAIRE
   6. FRONTPAGE
   7. ARCHIVES & CATÉGORIES
   8. SINGLE & PAGES
   9. SIDEBAR & SOMMAIRE
   10. BREADCRUMB
   11. PAGINATION
   12. FOOTER
   13. UTILITAIRES
   14. RESPONSIVE
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES CSS
   ========================================================================== */

:root {
    /* Couleurs principales - surchargeables via WordPress Customizer */
    --color-primary: #5C3D1E;
    --color-secondary: #C0703A;
    --color-text: #1E1A16;
    --color-text-light: #4d443b;
    --color-link: #4A7C59;
    --color-link-hover: #C0703A;
    --color-background: #F5EFE6;
    --color-background-alt: #fffaf3;
    --color-border: #e3d8c6;
    
    /* Typographie */
    --font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --th-terre: #5C3D1E;
    --th-cuivre: #C0703A;
    --th-cuivre-clair: #e9a173;
    --th-mousse: #7A9E7E;
    --th-foret: #4A7C59;
    --th-charbon: #1E1A16;
    --th-sable: #F5EFE6;
    --th-creme: #fffaf3;
    --th-beige: #d9c9b0;
    --font-size-base: 1rem;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --line-height: 1.6;
    
    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Largeurs */
    --max-width: 1200px;
    --max-width-content: 800px;
    
    /* Bordures & Ombres */
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: 0.3s ease;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition);
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

p {
    margin-bottom: var(--spacing-sm);
}

ul, ol {
    padding-left: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

/* ==========================================================================
   3. LAYOUT GÉNÉRAL
   ========================================================================== */

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container--narrow {
    max-width: var(--max-width-content);
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl) 0;
    padding-top: 0;
}

/* Header V3 (fixe) : compensation sur les pages sans hero */
.header-v3:not(.home):not(.front-page) .main-content {
    padding-top: 80px;
}

/* Header V3 : le hero doit compenser le header fixe */
.header-v3 .hero {
    padding-top: 80px;
}

/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */

.site-header {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    gap: var(--spacing-lg);
    position: relative;
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    order: 1;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

/* Navigation principale */
.main-nav {
    display: flex;
    align-items: center;
    order: 3;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: var(--color-text);
    font-weight: 500;
    padding: var(--spacing-xs) 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition);
}

.main-nav a:hover::after,
.main-nav .current-menu-item a::after {
    width: 100%;
}

.main-nav a:hover {
    color: var(--color-primary);
}

/* Menu mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative;
    z-index: 1002;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    order: 2;
    margin-left: auto;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    margin: 5px 0;
    transition: var(--transition);
    pointer-events: none;
}

/* ==========================================================================
   5. HERO / ENTÊTE MODULAIRE
   ========================================================================== */

.hero {
    position: relative;
    background-color: var(--color-background-alt);
    overflow: hidden;
}

.hero--image {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero--image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.6));
    z-index: 1;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: var(--spacing-xl) var(--spacing-md);
}

.hero__title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-sm);
    color: inherit;
}

.hero__subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.hero__cta {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color var(--transition), transform var(--transition);
}

.hero__cta:hover {
    background-color: var(--color-secondary);
    color: #fff;
    transform: translateY(-2px);
}

/* Hero simple (archives, etc.) */
.hero--simple {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.hero--simple .hero__title {
    color: var(--color-text);
}

.hero--simple .hero__subtitle {
    color: var(--color-text-light);
}

/* ==========================================================================
   6. FRONTPAGE
   ========================================================================== */

/* Section derniers articles */
.section {
    padding: var(--spacing-2xl) 0;
}

.section__header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section__title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-xs);
}

.section__subtitle {
    color: var(--color-text-light);
    font-size: var(--font-size-lg);
}

/* Grille d'articles */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.post-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-4px);
}

.post-card__image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background-color: var(--color-background-alt);
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

.post-card__content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card__category {
    display: inline-block;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.post-card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
}

.post-card__title a {
    color: var(--color-text);
}

.post-card__title a:hover {
    color: var(--color-primary);
}

.post-card__excerpt {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.post-card__date {
    display: block;
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    margin-top: auto;
}

/* Section catégories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.category-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: flex-end;
}

.category-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 30%, rgba(0,0,0,0.8));
    z-index: 1;
}

.category-card:hover .category-card__image {
    transform: scale(1.05);
}

.category-card__content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-md);
    color: #fff;
    width: 100%;
}

.category-card__title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-xs);
    color: inherit;
}

.category-card__description {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: 0;
}

.category-card__link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* ==========================================================================
   7. ARCHIVES & CATÉGORIES
   ========================================================================== */

.archive-header {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background-color: var(--color-background-alt);
    margin-bottom: var(--spacing-xl);
}

.archive-header__title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-sm);
}

.archive-header__description {
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Archive header avec image de fond (hero) */
.archive-header--hero {
    position: relative;
    padding: var(--spacing-2xl) 0;
    background-color: transparent;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-header__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.archive-header__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

.archive-header--hero .container {
    position: relative;
    z-index: 3;
}

.archive-header__content {
    max-width: 700px;
    margin: 0 auto;
}

.archive-header--hero .archive-header__title {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.archive-header--hero .archive-header__description {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    font-size: var(--font-size-lg);
}

/* Liste d'articles archives */
.archive-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

/* ==========================================================================
   8. SINGLE & PAGES
   ========================================================================== */

/* Page simple / orpheline (mentions légales, contact, etc.) */
.page-simple {
    padding: var(--spacing-lg) 0 var(--spacing-2xl);
}

.page-simple__header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.page-simple__title {
    font-size: var(--font-size-4xl);
    margin-bottom: 0;
}

.page-simple__content {
    font-size: var(--font-size-lg);
    line-height: 1.8;
}

.page-simple__content h2 {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.page-simple__content h3 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.page-simple__content p {
    margin-bottom: var(--spacing-md);
}

.page-simple__content ul,
.page-simple__content ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.page-simple__content li {
    margin-bottom: var(--spacing-xs);
}

.page-simple__content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-simple__content a:hover {
    text-decoration-color: var(--color-primary);
}

/* Layout article/page avec sommaire */
.single-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-xl);
    max-width: calc(var(--max-width-content) + 300px);
    margin: 0 auto;
}

.article-content {
    max-width: var(--max-width-content);
}

/* Image d'entête article */
.article-header-image {
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.article-header-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Contenu article */
.article-body {
    font-size: var(--font-size-lg);
    line-height: 1.8;
}

.article-body h2 {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.article-body h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.article-body h3 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.article-body p {
    margin-bottom: var(--spacing-md);
}

.article-body img {
    border-radius: var(--border-radius);
    margin: var(--spacing-lg) 0;
}

.article-body blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    font-style: italic;
    color: var(--color-text-light);
}

.article-body ul,
.article-body ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.article-body li {
    margin-bottom: var(--spacing-xs);
}

/* ==========================================================================
   9. SIDEBAR & SOMMAIRE
   ========================================================================== */

.sidebar {
    position: sticky;
    top: calc(70px + var(--spacing-lg));
    height: fit-content;
}

.toc {
    padding: var(--spacing-md) 0;
    border-left: 2px solid var(--color-border);
}

.toc__title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
    font-weight: 700;
}

.toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc__item {
    margin-bottom: 0;
}

.toc__link {
    display: block;
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: all var(--transition);
    line-height: 1.4;
}

.toc__link:hover {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    background-color: transparent;
}

.toc__link.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

/* Sommaire mobile */
.toc-mobile {
    display: none;
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-md);
    z-index: 1100;
}

.toc-mobile__toggle {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    transition: transform var(--transition), box-shadow var(--transition);
}

.toc-mobile__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.toc-mobile__toggle::before {
    content: '☰';
    font-size: 1.1em;
}

.toc-mobile__content {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md) 0;
    min-width: 280px;
    max-height: 60vh;
    overflow-y: auto;
}

.toc-mobile__content .toc__title {
    padding: 0 var(--spacing-md) var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.toc-mobile__content .toc__link {
    padding: var(--spacing-xs) var(--spacing-md);
    margin-left: 0;
    border-left: none;
}

.toc-mobile__content .toc__link:hover {
    background-color: var(--color-background-alt);
    border-left: none;
}

.toc-mobile__content.active {
    display: block;
    animation: tocSlideUp 0.2s ease;
}

@keyframes tocSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   10. BREADCRUMB
   ========================================================================== */

.breadcrumb {
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-xs);
}

.breadcrumb__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.breadcrumb__item:not(:last-child)::after {
    content: '›';
    color: var(--color-text-light);
}

.breadcrumb__link {
    color: var(--color-text-light);
}

.breadcrumb__link:hover {
    color: var(--color-primary);
}

.breadcrumb__current {
    color: var(--color-text);
    font-weight: 500;
}

/* ==========================================================================
   11. PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-sm);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a {
    background-color: var(--color-background-alt);
    color: var(--color-text);
}

.pagination a:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.pagination .current {
    background-color: var(--color-primary);
    color: #fff;
}

.pagination .dots {
    background: none;
    color: var(--color-text-light);
}

/* ==========================================================================
   12. FOOTER
   ========================================================================== */

.site-footer {
    background-color: var(--color-background-alt);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-xl) 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: var(--spacing-md);
    padding: 0;
    margin: 0;
}

.footer-nav a {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

.footer-nav a:hover {
    color: var(--color-primary);
}

.footer-copyright {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   13. UTILITAIRES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.hidden { display: none !important; }

/* Boutons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn--primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--color-secondary);
    color: #fff;
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

/* Tablette */
@media (max-width: 1024px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
    }
    
    .single-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .toc-mobile {
        display: block;
    }
    
    /* Grilles tablette - 2 colonnes */
    .posts-grid,
    .categories-grid,
    .archive-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }
    
    /* Archive header hero mobile */
    .archive-header--hero {
        min-height: 200px;
        padding: var(--spacing-xl) 0;
    }
    
    .archive-header--hero .archive-header__title {
        font-size: var(--font-size-3xl);
    }
    
    .archive-header--hero .archive-header__description {
        font-size: var(--font-size-base);
    }
    
    /* Page simple mobile */
    .page-simple__title {
        font-size: var(--font-size-3xl);
    }
    
    .page-simple__content {
        font-size: var(--font-size-base);
    }
    
    /* Header mobile */
    .menu-toggle {
        display: flex !important;
    }
    
    .main-nav {
        display: none !important;
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -5px 0 20px rgba(0,0,0,0.15);
        padding: 80px 24px 24px 24px;
        z-index: 1001;
        flex-direction: column;
        overflow-y: auto;
    }
    
    #main-nav.active {
        display: flex !important;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid #eee;
    }
    
    .main-nav a {
        display: block;
        padding: 15px 0;
        font-size: 18px;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .main-nav a {
        display: block;
        padding: var(--spacing-sm) 0;
        font-size: var(--font-size-lg);
    }
    
    /* Hero mobile */
    .hero--image {
        min-height: 300px;
    }
    
    .hero__title {
        font-size: var(--font-size-3xl);
    }
    
    /* Grilles mobile - 1 colonne */
    .posts-grid,
    .categories-grid,
    .archive-posts {
        grid-template-columns: 1fr;
    }
    
    /* Footer mobile */
    .footer-nav ul {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* Très petit écran */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero__content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
}

/* ==========================================================================
   15. TERRA HABITAT : HEADER, HOME, FOOTER
   ========================================================================== */

.th-topbar{background:var(--th-charbon);color:var(--th-beige);font-size:.8125rem}
.th-topbar .container{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding-top:.5rem;padding-bottom:.5rem}
.th-topbar a{color:var(--th-cuivre-clair);font-weight:600}
.th-topbar a:hover{color:#fff}

.site-header{background:var(--th-terre);border-bottom:0;box-shadow:none}
.site-header .header-inner{gap:1.5rem}
.site-logo a,.site-logo .th-logo{display:flex;align-items:center;gap:.6rem;color:var(--th-sable);font-family:var(--font-heading);font-size:1.5rem;font-weight:700}
.site-logo a:hover{color:#fff}
.site-logo img{max-height:50px;width:auto}
.site-header .main-nav a{color:var(--th-sable);font-weight:600}
.site-header .main-nav a:hover{color:#fff}
.site-header .main-nav a::after{background-color:var(--th-cuivre)}
.site-header .menu-toggle span{background-color:var(--th-sable)}
.th-header-cta{background:var(--th-cuivre);color:#fff !important;font-weight:700;padding:.75rem 1.25rem;border-radius:6px;white-space:nowrap}
.th-header-cta:hover{background:#a95f2f;color:#fff}

.th-btn{display:inline-flex;align-items:center;justify-content:center;background:var(--th-cuivre);color:#fff;border:0;border-radius:6px;padding:0 1.6rem;min-height:52px;font:700 1.0625rem var(--font-family);cursor:pointer;transition:background var(--transition)}
.th-btn:hover{background:#a95f2f;color:#fff}
.screen-reader-text{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

/* Hero guide */
.th-hero{background:var(--th-terre);color:var(--th-sable);padding:4.5rem 0 5.5rem}
.th-hero__grid{display:grid;grid-template-columns:1.25fr 1fr;gap:4rem;align-items:center}
.th-hero__title{font-size:3rem;line-height:1.1;margin:0 0 1.1rem;color:var(--th-sable)}
.th-hero__text{margin:0 0 .75rem;font-size:1.1875rem;color:#e8dccb}
.th-benefits{list-style:none;margin:0 0 1.25rem;padding:0;font-size:1.0625rem;color:#e8dccb}
.th-benefits li{margin-bottom:.5rem}
.th-benefits strong{color:var(--th-sable)}
.th-benefits__check{color:var(--th-mousse);font-weight:700}
.th-hero__proof{margin:0 0 1.5rem;font-size:1rem;color:var(--th-beige)}
.th-optin{display:flex;gap:.6rem;flex-wrap:wrap;max-width:560px}
.th-optin input[type=email]{flex:1;min-width:240px;border:0;border-radius:6px;padding:.9rem 1rem;font:inherit;min-height:52px;color:var(--th-charbon)}
.th-optin__note{margin:.75rem 0 0;font-size:.8125rem;color:var(--th-beige)}
.th-optin__msg{margin:.75rem 0 0;font-weight:600;color:#fff}
.th-hero__cover{display:flex;justify-content:center}
.th-hero__cover img{width:320px;max-width:100%;height:auto;border-radius:6px;box-shadow:18px 18px 0 var(--th-cuivre);transform:rotate(-2deg)}

/* Sections */
.th-section{padding:5.5rem 0 2.5rem}
.th-section__head{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap;margin-bottom:2rem}
.th-section__title{font-size:2.375rem;color:var(--th-terre);margin:0}
.th-section__intro{margin:.5rem 0 1.75rem;color:var(--color-text-light)}

/* Cartes articles */
.th-grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem}
.th-card{background:var(--th-creme);border-radius:10px;overflow:hidden}
.th-card__media{position:relative;display:block;aspect-ratio:3/2;background:#e6d9c4}
.th-card__media img{width:100%;height:100%;object-fit:cover}
.th-card__cat{position:absolute;top:0;left:1.4rem;background:var(--th-cuivre);color:#fff;font-size:.75rem;font-weight:700;padding:.3rem .9rem;border-radius:0 0 6px 6px;text-transform:uppercase;letter-spacing:.06em}
.th-card__body{padding:1.1rem 1.4rem 1.5rem}
.th-card__title{font-size:1.25rem;line-height:1.3;margin:0 0 .5rem}
.th-card__title a{color:var(--th-terre)}
.th-card__title a:hover{color:var(--th-cuivre)}
.th-card__excerpt{margin:0;font-size:.9375rem;color:var(--color-text-light)}

/* Rubriques (bloc sombre) */
.th-rubriques{padding:3.5rem 0}
.th-rubriques__box{background:var(--th-charbon);color:var(--th-sable);border-radius:14px;padding:3.5rem}
.th-kicker{margin:0 0 .5rem;color:var(--th-cuivre-clair);font-weight:700;font-size:.875rem;letter-spacing:.08em;text-transform:uppercase}
.th-rubriques__title{font-size:2.25rem;line-height:1.15;margin:0 0 2rem;color:var(--th-sable)}
.th-grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}
.th-rubrique{display:block;background:var(--th-sable);color:var(--th-charbon);border-radius:10px;padding:1.5rem;border:2px solid var(--th-foret)}
.th-rubrique:hover{border-color:var(--th-cuivre);color:var(--th-charbon)}
.th-rubrique__name{display:block;font-family:var(--font-heading);font-size:1.375rem;font-weight:700;color:var(--th-terre);margin-bottom:.4rem}
.th-rubrique__desc{display:block;font-size:.9375rem;color:var(--color-text-light);margin-bottom:.9rem}
.th-rubrique__more{display:block;font-weight:700;color:var(--th-foret);font-size:.9375rem}

/* Récemment mis à jour */
.th-updated{padding:2.5rem 0 6rem}
.th-updated__list{display:grid;grid-template-columns:1fr 1fr;gap:1rem 2rem}
.th-updated__item{display:flex;gap:1.1rem;align-items:center;background:var(--th-creme);border-radius:10px;padding:.9rem;color:var(--th-charbon)}
.th-updated__item:hover{color:var(--th-charbon);box-shadow:0 0 0 2px var(--th-mousse)}
.th-updated__thumb{width:110px;height:80px;flex:none;border-radius:6px;overflow:hidden;background:#e6d9c4}
.th-updated__thumb img{width:100%;height:100%;object-fit:cover}
.th-updated__meta{display:block;font-size:.8125rem;font-weight:700;color:var(--th-foret)}
.th-updated__title{display:block;font-family:var(--font-heading);font-size:1.125rem;font-weight:700;line-height:1.3;color:var(--th-terre)}

/* Footer */
.site-footer{background:var(--th-charbon);color:var(--th-beige);padding:3.5rem 0 1.75rem;font-size:.9375rem}
.th-footer__grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:2.5rem}
.th-footer__brand{font-family:var(--font-heading);font-size:1.5rem;font-weight:700;color:var(--th-sable)}
.th-footer__title{margin:0 0 .6rem;color:var(--th-sable);font-weight:700}
.th-footer__grid ul{list-style:none;margin:0;padding:0;line-height:2}
.site-footer a{color:var(--th-beige)}
.site-footer a:hover{color:var(--th-cuivre-clair)}
.th-footer__bottom{margin-top:2.5rem;padding-top:1.25rem;border-top:1px solid #3a332c;font-size:.8125rem}

@media (max-width:960px){
.th-hero__grid,.th-grid3,.th-updated__list{grid-template-columns:1fr}
.th-grid4{grid-template-columns:1fr 1fr}
.th-footer__grid{grid-template-columns:1fr 1fr}
.th-hero__title{font-size:2.4rem}
.th-hero__cover{order:-1}
.th-hero__cover img{width:220px}
.th-rubriques__box{padding:2rem 1.25rem}
}
@media (max-width:768px){
.th-header-cta{display:none}
.site-header .main-nav{background-color:var(--th-terre)}
}
@media (max-width:560px){
.th-grid4,.th-footer__grid{grid-template-columns:1fr}
.th-section__title{font-size:1.875rem}
}

/* Logo image (custom logo) : pastille claire pour rester lisible sur le fond Terre */
.site-logo .custom-logo-link{display:inline-flex;align-items:center;background:var(--th-sable);padding:.4rem .9rem;border-radius:8px}
.site-logo .custom-logo-link img{max-height:46px;width:auto}

/* Date de publication dans les cartes */
.th-card__date{display:block;font-size:.8125rem;font-weight:600;color:var(--th-foret);margin-bottom:.35rem}

/* ==========================================================================
   16. HERO MODERNISÉ
   ========================================================================== */
.th-hero{position:relative;overflow:hidden;background:
  radial-gradient(900px 500px at 85% 40%,rgba(192,112,58,.28),transparent 60%),
  radial-gradient(700px 500px at 0% 100%,rgba(122,158,126,.22),transparent 60%),
  var(--th-terre);padding:5rem 0 6rem}
.th-hero::after{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(245,239,230,.07) 1px,transparent 1px);background-size:22px 22px;pointer-events:none}
.th-hero .container{position:relative;z-index:1}
.th-hero__badge{display:inline-flex;align-items:center;gap:.5rem;margin:0 0 1.25rem;padding:.4rem .9rem;border:1px solid rgba(245,239,230,.25);border-radius:999px;background:rgba(245,239,230,.08);font-size:.8125rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--th-sable)}
.th-hero__dot{width:8px;height:8px;border-radius:50%;background:var(--th-cuivre-clair);box-shadow:0 0 0 4px rgba(233,161,115,.25)}
.th-hero__title{font-size:3.25rem;line-height:1.08;letter-spacing:-.01em;margin:0 0 1rem}
.th-hero__text{font-size:1.125rem;margin:0 0 1.25rem;color:#e8dccb}
.th-benefits{display:grid;gap:.75rem;margin:0 0 1.75rem}
.th-benefits li{display:flex;gap:.85rem;align-items:flex-start;margin:0;padding:.85rem 1rem;border-radius:12px;background:rgba(245,239,230,.07);border:1px solid rgba(245,239,230,.12);font-size:.9875rem;line-height:1.45;color:#e8dccb}
.th-benefits strong{display:inline-block;font-size:1.0625rem;color:var(--th-sable);margin-bottom:.1rem}
.th-benefits__check{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--th-foret);color:#fff;margin-top:.1rem}
.th-optin-card{background:var(--th-sable);border-radius:14px;padding:.5rem .5rem .9rem;max-width:580px;box-shadow:0 18px 40px rgba(20,14,8,.35)}
.th-optin-card .th-optin{max-width:none;gap:.5rem}
.th-optin-card input[type=email]{background:#fff;border:1px solid #e3d8c6}
.th-optin-card .th-optin__note{color:#5c5249;margin:.6rem .6rem 0;font-size:.8125rem}
.th-optin-card .th-optin__msg{color:var(--th-foret);margin:.6rem}
.th-hero__proof{display:flex;gap:.6rem;align-items:flex-start;max-width:580px;margin:1.25rem 0 0;font-size:.875rem;line-height:1.5;color:var(--th-beige)}
.th-hero__proof svg{flex:none;margin-top:.15rem;color:var(--th-mousse)}
.th-hero__cover{position:relative}
.th-hero__cover::before{content:"";position:absolute;width:420px;height:420px;border-radius:50%;background:radial-gradient(circle,rgba(122,158,126,.35),transparent 70%);top:50%;left:50%;transform:translate(-50%,-50%)}
.th-hero__cover img{position:relative;width:340px}
.th-hero__free{position:absolute;z-index:2;top:-14px;right:calc(50% - 200px);width:92px;height:92px;border-radius:50%;background:var(--th-foret);color:#fff;display:flex;align-items:center;justify-content:center;font:700 1rem var(--font-family);text-transform:uppercase;letter-spacing:.06em;transform:rotate(12deg);box-shadow:0 8px 20px rgba(0,0,0,.25)}
@media (max-width:960px){.th-hero__title{font-size:2.3rem}.th-hero__free{width:70px;height:70px;font-size:.8rem;right:calc(50% - 140px)}.th-hero__cover::before{width:280px;height:280px}}

/* ==========================================================================
   17. HERO PLEIN ÉCRAN + CTA INTÉGRÉ
   ========================================================================== */
.th-hero{min-height:calc(100vh - var(--th-header-h,130px));min-height:calc(100svh - var(--th-header-h,130px));display:flex;align-items:center;padding:clamp(1.5rem,4vh,4rem) 0;box-sizing:border-box}
.th-hero .container{width:100%}
.th-hero__grid{gap:clamp(2rem,4vw,4rem)}
.th-hero__title{font-size:clamp(2rem,min(4.2vw,6.2vh),3.25rem);margin-bottom:clamp(.5rem,1.5vh,1rem)}
.th-hero__text{font-size:clamp(1rem,2vh,1.125rem);margin-bottom:clamp(.6rem,1.8vh,1.25rem)}
.th-benefits{gap:clamp(.4rem,1vh,.75rem);margin-bottom:clamp(1rem,2.5vh,1.75rem)}
.th-benefits li{padding:clamp(.5rem,1.3vh,.85rem) 1rem}
.th-hero__cover img{width:clamp(220px,min(26vw,42vh),340px)}
.th-hero__cover::before{width:clamp(260px,min(32vw,52vh),420px);height:clamp(260px,min(32vw,52vh),420px)}

/* CTA : même langage que les cartes bénéfices, sans bloc clair */
.th-optin-card{background:none;box-shadow:none;padding:0;border-radius:0;max-width:580px}
.th-optin-card .th-optin{display:flex;flex-wrap:nowrap;gap:0;padding:6px;border-radius:999px;background:rgba(245,239,230,.1);border:1px solid rgba(245,239,230,.22);transition:border-color var(--transition),background var(--transition)}
.th-optin-card .th-optin:focus-within{border-color:var(--th-cuivre-clair);background:rgba(245,239,230,.14)}
.th-optin-card input[type=email]{flex:1;min-width:0;background:transparent;border:0;color:var(--th-sable);padding:0 1.1rem;min-height:50px;font-size:1rem}
.th-optin-card input[type=email]::placeholder{color:rgba(245,239,230,.6)}
.th-optin-card input[type=email]:focus{outline:none}
.th-optin-card .th-btn{border-radius:999px;min-height:50px;padding:0 1.5rem;white-space:nowrap;box-shadow:0 6px 18px rgba(192,112,58,.35)}
.th-optin-card .th-optin__note{color:var(--th-beige);margin:.65rem 0 0 1.1rem}
.th-optin-card .th-optin__msg{color:#fff;margin:0}
.th-hero__proof{margin-top:clamp(.75rem,2vh,1.25rem)}
@media (max-height:760px) and (min-width:961px){.th-hero__proof{display:none}.th-benefits li{font-size:.9375rem}}
@media (max-width:960px){
.th-hero{min-height:0;padding:2.5rem 0 3rem}
.th-hero__cover{display:none}
}
@media (max-width:520px){
.th-optin-card .th-optin{flex-direction:column;border-radius:16px;gap:6px}
.th-optin-card .th-btn{width:100%}
}

/* ==========================================================================
   18. FOND DE PAGE : RELIEF DISCRET
   ========================================================================== */
/* Lignes de niveau (motif topographique) très légères, en ton sur ton */
body.home .main-content{position:relative;background-color:var(--th-sable);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%235C3D1E' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M-50 120c90-40 160 30 250 0s150-90 250-50 150 60 200 30'/%3E%3Cpath d='M-50 170c90-40 160 30 250 0s150-90 250-50 150 60 200 30'/%3E%3Cpath d='M-50 220c90-40 160 30 250 0s150-90 250-50 150 60 200 30'/%3E%3Cpath d='M-50 400c80 30 170-40 260-10s140 80 240 40 140-60 200-30'/%3E%3Cpath d='M-50 450c80 30 170-40 260-10s140 80 240 40 140-60 200-30'/%3E%3Cpath d='M-50 500c80 30 170-40 260-10s140 80 240 40 140-60 200-30'/%3E%3C/g%3E%3C/svg%3E");background-size:600px 600px}

/* Transition douce sous le hero */
.th-hero{border-radius:0 0 48px 48px}

/* Derniers articles : halo cuivre très léger en haut à droite */
.th-section{position:relative}
.th-section::before{content:"";position:absolute;top:0;right:0;width:520px;height:520px;background:radial-gradient(circle,rgba(192,112,58,.10),transparent 65%);pointer-events:none}
.th-section .container{position:relative}

/* Récemment mis à jour : bande crème légèrement plus claire */
.th-updated{background:linear-gradient(180deg,rgba(255,250,243,0) 0,rgba(255,250,243,.85) 120px);margin-top:2rem;padding-top:4rem}

/* Cartes : relief léger et survol */
.th-card,.th-updated__item{box-shadow:0 1px 2px rgba(30,26,22,.05),0 8px 24px rgba(92,61,30,.06);transition:transform var(--transition),box-shadow var(--transition)}
.th-card:hover{transform:translateY(-3px);box-shadow:0 2px 4px rgba(30,26,22,.06),0 16px 32px rgba(92,61,30,.12)}
.th-updated__item{background:#fff}
@media (max-width:960px){.th-hero{border-radius:0 0 28px 28px}}

/* ==========================================================================
   19. FOND DU HERO : DÉGRADÉ + LIGNES DE NIVEAU
   ========================================================================== */
.th-hero{background:
  radial-gradient(800px 520px at 82% 45%,rgba(192,112,58,.38),transparent 62%),
  radial-gradient(620px 460px at 4% 96%,rgba(122,158,126,.30),transparent 62%),
  radial-gradient(500px 360px at 40% 0%,rgba(233,161,115,.12),transparent 70%),
  linear-gradient(135deg,#6B4826 0%,#5C3D1E 45%,#3E2A16 100%)}
.th-hero::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720' viewBox='0 0 720 720'%3E%3Cg fill='none' stroke='%23F5EFE6' stroke-opacity='.07' stroke-width='1.3'%3E%3Cpath d='M-60 140c110-50 190 40 300 0s180-110 300-60 180 70 240 35'/%3E%3Cpath d='M-60 200c110-50 190 40 300 0s180-110 300-60 180 70 240 35'/%3E%3Cpath d='M-60 260c110-50 190 40 300 0s180-110 300-60 180 70 240 35'/%3E%3Cpath d='M-60 470c95 35 205-50 310-12s170 95 290 48 170-72 240-36'/%3E%3Cpath d='M-60 530c95 35 205-50 310-12s170 95 290 48 170-72 240-36'/%3E%3Cpath d='M-60 590c95 35 205-50 310-12s170 95 290 48 170-72 240-36'/%3E%3C/g%3E%3C/svg%3E");background-size:720px 720px;-webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 35%,#000 100%);mask-image:linear-gradient(90deg,transparent 0%,#000 35%,#000 100%)}

/* Lignes de niveau du hero retirées */
.th-hero::after{content:none}
