/*
Theme Name: Astuces Maison
Theme URI: https://example.com
Author: Kousseila
Description: Thème custom léger pour blog d'astuces maison. Optimisé SEO (Rank Math), Pinterest, et zones publicitaires MGID/Ezoic intégrées.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: astuces-maison
*/

/* ==========================================================================
   1. VARIABLES — change ici pour recolorer tout le site
   ========================================================================== */
:root {
  --color-primary: #6B8F71;      /* Sauge - header, liens, boutons */
  --color-primary-dark: #52725A;
  --color-accent: #D97B4F;       /* Terracotta - CTA, highlights */
  --color-bg: #FBF7F0;           /* Crème - fond général */
  --color-card: #FFFFFF;
  --color-text: #2E2A24;         /* Charbon chaud */
  --color-text-light: #6B6459;
  --color-border: #E7E0D3;

  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, Helvetica, Arial, sans-serif;

  --radius: 12px;
  --shadow: 0 2px 12px rgba(46, 42, 36, 0.08);
  --max-width: 1120px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
/* Garde-fou : tout élément qui déborderait (table, iframe, embed collé dans le contenu) est contraint */
.post-content table,
.post-content iframe,
.post-content embed,
.post-content video,
.post-content pre {
  max-width: 100%;
}
.post-content table { display: block; overflow-x: auto; }
.post-content pre { overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { color: var(--color-accent); }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 .5em;
}
p { margin: 0 0 1.2em; }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.screen-reader-text { position: absolute; left: -9999px; }

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.site-logo img { max-height: 48px; border-radius: 0; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--color-text);
  cursor: pointer;
}

@media (max-width: 780px) {
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 10px 0; }
  .main-nav li { border-top: 1px solid var(--color-border); }
  .main-nav a { display: block; padding: 12px 0; }
  .site-header-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; }
}

/* ==========================================================================
   4. AD ZONES (MGID / Ezoic / Facebook pixel friendly)
   ========================================================================== */
.ad-zone {
  max-width: var(--max-width);
  width: 100%;
  margin: 24px auto;
  padding: 0 20px;
  text-align: center;
  min-height: 90px;
  overflow-x: hidden;
}
.ad-zone > * { max-width: 100%; }
.ad-zone span.ad-label {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 6px;
}

/* ==========================================================================
   5. LAYOUT
   ========================================================================== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   6. ARTICLE CARDS (index / archive)
   ========================================================================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.post-card:hover { transform: translateY(-3px); }
.post-card img { border-radius: 0; aspect-ratio: 4/5; object-fit: cover; }
.post-card-body { padding: 16px; }
.post-card .cat-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.post-card h2 { font-size: 19px; margin-bottom: 6px; }
.post-card p { font-size: 14px; color: var(--color-text-light); margin: 0; }

/* ==========================================================================
   7. SINGLE POST
   ========================================================================== */
.single-post .post-header { margin-bottom: 20px; }
.single-post h1 { font-size: 32px; }
.post-meta {
  font-size: 13px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: .04em;
  overflow-wrap: break-word;
}
@media (max-width: 480px) {
  .post-meta { font-size: 12px; letter-spacing: .02em; }
}
.post-featured-image { margin: 20px 0; }
.post-content { font-size: 18px; }
.post-content h2 { font-size: 24px; margin-top: 1.6em; }
.post-content h3 { font-size: 20px; margin-top: 1.4em; }
.post-content ul, .post-content ol { padding-left: 1.3em; }
.post-content blockquote {
  border-left: 4px solid var(--color-accent);
  margin: 1.5em 0;
  padding: .5em 1.2em;
  background: var(--color-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

/* tip/callout box — utile pour "astuces" */
.tip-box {
  background: #EEF3EA;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 1.6em 0;
}
.tip-box strong { color: var(--color-primary-dark); }

.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}
.share-bar a {
  background: var(--color-primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.share-bar a:hover { background: var(--color-accent); color: #fff; }
@media (max-width: 420px) {
  .share-bar a { flex: 1 1 100%; text-align: center; }
}

/* Related posts */
.related-posts { margin: 48px 0 20px; }
.related-posts h3 { font-size: 22px; margin-bottom: 16px; }

/* ==========================================================================
   8. SIDEBAR
   ========================================================================== */
.widget {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}
.widget h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-light);
  margin-bottom: 14px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-top: 1px solid var(--color-border); }
.widget li:first-child { border-top: none; }

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.site-footer {
  background: var(--color-primary-dark);
  color: #fff;
  margin-top: 50px;
}
.site-footer .container {
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
@media (max-width: 700px) { .site-footer .container { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 15px; text-transform: uppercase; }
.site-footer a { color: #E7E0D3; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  text-align: center;
  font-size: 13px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.15);
  color: #D8D2C4;
}

/* ==========================================================================
   10. MISC
   ========================================================================== */
/* ==========================================================================
   11. HOMEPAGE — HERO
   ========================================================================== */
.hero {
  background: linear-gradient(180deg, #F1EBDD 0%, var(--color-bg) 100%);
  padding: 50px 0 70px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 50px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .hero-cta { justify-content: center; }
}
.hero-kicker {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.hero-text h1 {
  font-size: 42px;
  margin-bottom: 18px;
}
@media (max-width: 480px) { .hero-text h1 { font-size: 32px; } }
.hero-lead {
  font-size: 18px;
  color: var(--color-text-light);
  max-width: 480px;
}
@media (max-width: 860px) { .hero-lead { max-width: none; } }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary-dark); border: 2px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }

.hero-photo img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero-photo-placeholder {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 20px;
  border: 2px dashed var(--color-primary);
  background: rgba(107,143,113,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-light);
  padding: 20px;
}

/* ==========================================================================
   12. HOMEPAGE — CATEGORIES
   ========================================================================== */
.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 30px;
}
.categories-section { padding: 60px 20px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .category-grid { grid-template-columns: 1fr; } }

.category-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  transition: transform .15s ease;
}
.category-card:hover { transform: translateY(-4px); }
.category-icon { font-size: 34px; display: block; margin-bottom: 10px; }
.category-card h3 { font-size: 17px; margin-bottom: 6px; color: var(--color-text); }
.category-count { font-size: 13px; color: var(--color-text-light); }

/* ==========================================================================
   13. HOMEPAGE — LATEST POSTS
   ========================================================================== */
.latest-section { padding: 20px 20px 70px; }
.latest-more { text-align: center; margin-top: 34px; }

/* ==========================================================================
   14. HOMEPAGE — NEWSLETTER
   ========================================================================== */
.newsletter-section {
  background: var(--color-primary-dark);
  padding: 60px 20px;
}
.newsletter-box {
  max-width: 560px;
  text-align: center;
  color: #fff;
}
.newsletter-icon { font-size: 38px; display: block; margin-bottom: 10px; }
.newsletter-box h2 { color: #fff; font-size: 26px; }
.newsletter-box p { color: #E7E0D3; }
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 24px 0 12px;
}
.newsletter-form input[type="email"] {
  flex: 1 1 260px;
  max-width: 320px;
  padding: 13px 18px;
  border: none;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 15px;
}
.newsletter-form button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 13px 26px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.newsletter-form button:hover { background: #c46a3d; }
.newsletter-note { font-size: 13px; color: #C9C2B3; margin: 0; }
.breadcrumbs a { color: var(--color-text-light); }
.search-form { display: flex; }
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: var(--font-body);
}
.search-form button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}
.pagination { display: flex; gap: 8px; margin: 30px 0; justify-content: center; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--color-card);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
}
.pagination .current { background: var(--color-primary); color: #fff; }

/* ==========================================================================
   15. PAGE À PROPOS
   ========================================================================== */
.about-hero {
  background: linear-gradient(180deg, #F1EBDD 0%, var(--color-bg) 100%);
  padding: 60px 0;
}
.about-hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 700px) {
  .about-hero-inner { grid-template-columns: 1fr; text-align: center; }
}
.about-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.about-content {
  max-width: 720px;
  padding-top: 40px;
  padding-bottom: 60px;
  font-size: 18px;
}
.about-content h2 { font-size: 24px; margin-top: 1.8em; }
.pull-quote {
  border-left: 4px solid var(--color-accent);
  margin: 1.8em 0;
  padding: .6em 1.4em;
  background: var(--color-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-heading);
  font-size: 22px;
  font-style: italic;
  color: var(--color-primary-dark);
}
.about-content ul { padding-left: 1.3em; }
.about-signature {
  font-family: var(--font-heading);
  font-size: 22px;
  margin-top: 2em;
  color: var(--color-primary-dark);
}
