/*
Theme Name: Éco Vert
Theme URI: https://example.com/eco-vert
Author: WP sans WP
Author URI: https://example.com
Description: Thème écologique léger basé sur Bootstrap 5, mobile-first, palette verte.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eco-vert
Tags: bootstrap, green, ecology, acf, mobile-first, responsive
*/

/* =========================================================
   VARIABLES & PALETTE VERTE ÉCOLOGIQUE
   ========================================================= */
:root {
  --eco-primary:        #2E7D32;   /* vert foncé dominant */
  --eco-primary-dark:   #1B5E20;   /* vert très foncé */
  --eco-primary-light:  #4CAF50;   /* vert moyen */
  --eco-secondary:      #66BB6A;   /* vert clair accent */
  --eco-accent:         #A5D6A7;   /* vert pâle */
  --eco-tint:           #E8F5E9;   /* fond vert très léger */
  --eco-bg:             #F7FBF7;   /* fond page */
  --eco-white:          #FFFFFF;
  --eco-text:           #1C2B1E;   /* texte principal */
  --eco-text-muted:     #5A6B5B;   /* texte secondaire */
  --eco-border:         #C8E6C9;   /* bordures */
  --eco-card-shadow:    0 2px 12px rgba(46, 125, 50, 0.10);
  --eco-radius:         0.5rem;
  --eco-radius-lg:      0.875rem;
  --container-max:      1000px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--eco-text);
  background-color: var(--eco-bg);
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   TYPOGRAPHIE — Montserrat pour titres, Roboto pour texte
   ========================================================= */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--eco-primary-dark);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

h1, .h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2, .h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3, .h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4, .h4 { font-size: clamp(1.05rem, 2vw, 1.3rem); }
h5, .h5 { font-size: 1.1rem; }
h6, .h6 { font-size: 1rem; }

p {
  font-family: 'Roboto', sans-serif;
  margin-bottom: 1.25rem;
}

/* Listes, tableaux, formulaires : même police que <p> */
ul, ol, dl, li, dt, dd,
table, th, td,
input, select, textarea, button,
figcaption, blockquote, cite {
  font-family: 'Roboto', sans-serif;
}

a {
  color: var(--eco-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

a:hover, a:focus {
  color: var(--eco-primary-dark);
}

strong, b { font-weight: 700; }
em, i     { font-style: italic; }

/* =========================================================
   CONTAINER LIMITÉ À 1000 PX
   ========================================================= */
.container,
.container-fluid {
  max-width: var(--container-max) !important;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 576px) {
  .container,
  .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* =========================================================
   HEADER / NAVBAR
   ========================================================= */
.site-header {
  background-color: var(--eco-white);
  border-bottom: 2px solid var(--eco-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(46, 125, 50, 0.08);
}

.site-header .navbar-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--eco-primary) !important;
  letter-spacing: -0.5px;
}

.site-header .navbar-brand span {
  color: var(--eco-secondary);
}

.site-header .nav-link {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--eco-text) !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: var(--eco-radius);
  transition: background 0.2s, color 0.2s;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus,
.site-header .nav-link.active {
  color: var(--eco-primary) !important;
  background-color: var(--eco-tint);
}

.navbar-toggler {
  border-color: var(--eco-border) !important;
}

.navbar-toggler-icon {
  filter: invert(30%) sepia(60%) saturate(400%) hue-rotate(90deg);
}

/* =========================================================
   HERO / BANNIÈRE
   ========================================================= */
.site-hero {
  background: linear-gradient(135deg, var(--eco-primary-dark) 0%, var(--eco-primary) 60%, var(--eco-primary-light) 100%);
  color: var(--eco-white);
  padding: 4rem 0 3rem;
  text-align: center;
}

.site-hero h1 {
  color: var(--eco-white);
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.site-hero p.lead {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.site-main {
  padding: 2.5rem 0 3rem;
}

/* =========================================================
   BLOCS ACF
   ========================================================= */

/* --- Introduction --- */
.acf-introduction {
  background-color: var(--eco-tint);
  border-left: 4px solid var(--eco-primary);
  border-radius: 0 var(--eco-radius) var(--eco-radius) 0;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.acf-introduction p:last-child { margin-bottom: 0; }

/* --- Ce qu'il faut retenir --- */
.acf-retenir {
  background-color: var(--eco-white);
  border: 1.5px solid var(--eco-accent);
  border-radius: var(--eco-radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--eco-card-shadow);
}

.acf-retenir__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eco-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.acf-retenir__title::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--eco-primary);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2a10 10 0 100 20A10 10 0 0012 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
  background-size: cover;
}

.acf-retenir ul,
.acf-retenir ol {
  padding-left: 1.5rem;
  margin-bottom: 0;
}

.acf-retenir li {
  margin-bottom: 0.4rem;
}

/* --- Contenu global --- */
.acf-contenu-global {
  margin-bottom: 2rem;
}

.acf-contenu-global img {
  max-width: 100%;
  height: auto;
  border-radius: var(--eco-radius);
}

/* =========================================================
   ARTICLES (CARDS)
   ========================================================= */
.post-card {
  background: var(--eco-white);
  border: 1px solid var(--eco-border);
  border-radius: var(--eco-radius-lg);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: var(--eco-card-shadow);
  transform: translateY(-2px);
}

.post-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.post-card__thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--eco-tint), var(--eco-accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card__thumb-placeholder svg {
  opacity: 0.3;
  width: 48px;
  height: 48px;
}

.post-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card__category {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eco-primary);
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.post-card__category:hover { color: var(--eco-primary-dark); }

.post-card__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--eco-text);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.post-card__title a {
  color: inherit;
  text-decoration: none;
}

.post-card__title a:hover { color: var(--eco-primary); }

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--eco-text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

.post-card__meta {
  font-size: 0.8rem;
  color: var(--eco-text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-card__read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--eco-primary);
  text-decoration: none;
  margin-top: auto;
  transition: gap 0.2s;
}

.post-card__read-more:hover {
  color: var(--eco-primary-dark);
  gap: 0.6rem;
}

/* =========================================================
   SECTION "DERNIERS ARTICLES" (pages catégories)
   ========================================================= */
.category-posts-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--eco-border);
}

.category-posts-section__title {
  color: var(--eco-primary);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.category-posts-section__title::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.6rem;
  background: var(--eco-primary);
  border-radius: 2px;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  gap: 0.25rem;
}

.page-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--eco-primary);
  border-color: var(--eco-border);
  border-radius: var(--eco-radius) !important;
  padding: 0.4rem 0.85rem;
}

.page-link:hover,
.page-link:focus {
  background-color: var(--eco-tint);
  border-color: var(--eco-secondary);
  color: var(--eco-primary-dark);
}

.page-item.active .page-link {
  background-color: var(--eco-primary);
  border-color: var(--eco-primary);
  color: var(--eco-white);
}

/* =========================================================
   TABLEAUX
   ========================================================= */
.wp-block-table,
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

table thead tr {
  background-color: var(--eco-primary);
  color: var(--eco-white);
}

table th,
table td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--eco-border);
  text-align: left;
  vertical-align: top;
}

table tbody tr:nth-child(even) {
  background-color: var(--eco-tint);
}

table tbody tr:hover {
  background-color: var(--eco-accent);
}

/* =========================================================
   LISTES
   ========================================================= */
.entry-content ul,
.acf-contenu-global ul,
.entry-content ol,
.acf-contenu-global ol {
  padding-left: 1.75rem;
  margin-bottom: 1.25rem;
}

.entry-content li,
.acf-contenu-global li {
  margin-bottom: 0.4rem;
}

.entry-content ul li::marker {
  color: var(--eco-primary);
}

/* =========================================================
   BLOCKQUOTE
   ========================================================= */
blockquote,
.wp-block-quote {
  border-left: 4px solid var(--eco-secondary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background-color: var(--eco-tint);
  border-radius: 0 var(--eco-radius) var(--eco-radius) 0;
  font-style: italic;
  color: var(--eco-text-muted);
}

blockquote p:last-child { margin-bottom: 0; }

cite {
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
}

/* =========================================================
   BOUTONS
   ========================================================= */
.btn {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  border-radius: var(--eco-radius);
  letter-spacing: 0.02em;
  transition: all 0.2s;
}

.btn-eco,
.btn-primary {
  background-color: var(--eco-primary) !important;
  border-color: var(--eco-primary) !important;
  color: var(--eco-white) !important;
}

.btn-eco:hover,
.btn-primary:hover {
  background-color: var(--eco-primary-dark) !important;
  border-color: var(--eco-primary-dark) !important;
}

.btn-eco-outline,
.btn-outline-primary {
  border-color: var(--eco-primary) !important;
  color: var(--eco-primary) !important;
  background: transparent !important;
}

.btn-eco-outline:hover,
.btn-outline-primary:hover {
  background-color: var(--eco-tint) !important;
  border-color: var(--eco-primary-dark) !important;
  color: var(--eco-primary-dark) !important;
}

/* =========================================================
   FORMULAIRES
   ========================================================= */
.form-control,
.form-select {
  border-color: var(--eco-border);
  border-radius: var(--eco-radius);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--eco-secondary);
  box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.25);
}

/* =========================================================
   BADGES / TAGS
   ========================================================= */
.badge-eco {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  background-color: var(--eco-tint);
  color: var(--eco-primary);
  border: 1px solid var(--eco-accent);
  border-radius: 999px;
  padding: 0.25em 0.75em;
  text-decoration: none;
  transition: background 0.2s;
}

.badge-eco:hover {
  background-color: var(--eco-accent);
  color: var(--eco-primary-dark);
}

/* =========================================================
   SIDEBAR (si utilisée)
   ========================================================= */
.site-sidebar .widget {
  background: var(--eco-white);
  border: 1px solid var(--eco-border);
  border-radius: var(--eco-radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.site-sidebar .widget-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eco-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--eco-tint);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background-color: var(--eco-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer a {
  color: var(--eco-accent);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--eco-white);
}

.site-footer__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eco-white);
  margin-bottom: 1rem;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.eco-breadcrumb {
  font-size: 0.85rem;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.eco-breadcrumb a {
  color: var(--eco-primary);
  text-decoration: none;
}

.eco-breadcrumb a:hover { text-decoration: underline; }

.eco-breadcrumb .breadcrumb-item.active { color: var(--eco-text-muted); }

.breadcrumb-item + .breadcrumb-item::before {
  content: '›';
  color: var(--eco-text-muted);
}

/* =========================================================
   PAGE 404
   ========================================================= */
.page-404 {
  text-align: center;
  padding: 5rem 0;
}

.page-404__number {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 900;
  color: var(--eco-accent);
  line-height: 1;
}

/* =========================================================
   UTILITAIRES
   ========================================================= */
.text-eco       { color: var(--eco-primary) !important; }
.text-eco-dark  { color: var(--eco-primary-dark) !important; }
.text-eco-muted { color: var(--eco-text-muted) !important; }
.bg-eco-tint    { background-color: var(--eco-tint) !important; }
.bg-eco         { background-color: var(--eco-primary) !important; }

.section-divider {
  border: none;
  border-top: 2px solid var(--eco-border);
  margin: 2.5rem 0;
}

/* =========================================================
   RESPONSIVE HELPERS
   ========================================================= */
@media (max-width: 575.98px) {
  .acf-introduction,
  .acf-retenir {
    padding: 1.25rem;
  }

  table {
    font-size: 0.85rem;
  }
}
