/*
Theme Name: Maisons DZ Blog
Theme URI: https://www.maisonsdz.fr
Author: Thème sur mesure
Description: Thème WordPress sur mesure pour le blog des Maisons DZ (constructeur de maison, Andrézieux-Bouthéon). Charte reprise du site : rouge de marque, accent orange, police Poppins. Page blog = header + menu (liens vers le site principal, sur une seule ligne, CTA épinglé) + liste des articles + footer.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: maisonsdz-blog
*/

/* =========================================================
   1. VARIABLES — charte Les Maisons DZ
   ========================================================= */
:root {
  --dz-red:     #ac1a0f;   /* rouge de marque (CTA, éléments forts) */
  --dz-red-dk:  #8f150c;   /* survol */
  --dz-orange:  #ffa500;   /* accent orange */
  --dz-green:   #019746;   /* touche verte */
  --dz-ink:     #1d1b1c;   /* footer / éléments sombres */

  --dz-text:    #282828;   /* texte courant */
  --dz-muted:   #6a6a6a;   /* texte secondaire */
  --dz-bg:      #ffffff;   /* fond */
  --dz-alt:     #f8f9fa;   /* fond alternatif */
  --dz-border:  #ececec;   /* bordures */

  --dz-font: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --dz-max-width: 1220px;
  --dz-radius: 10px;
  --dz-radius-pill: 30px;   /* boutons pilule, comme le site */
  --dz-shadow: 0 12px 32px rgba(40,40,40,.10);
}

/* =========================================================
   2. BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--dz-font);
  color: var(--dz-text);
  background: var(--dz-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--dz-red); text-decoration: none; }
a:hover { color: var(--dz-red-dk); }
h1, h2, h3, h4 {
  font-family: var(--dz-font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dz-text);
  margin: 0 0 .5em;
}
.dz-container {
  width: 100%;
  max-width: var(--dz-max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* Bouton pilule (style du site) */
.dz-btn {
  display: inline-block;
  background: var(--dz-red);
  color: #fff !important;
  padding: 11px 24px;
  border-radius: var(--dz-radius-pill);
  font-weight: 600;
  transition: background .2s ease;
}
.dz-btn:hover { background: var(--dz-red-dk); color: #fff; }

/* =========================================================
   3. HEADER + NAVIGATION (menu sur UNE seule ligne)
   ========================================================= */
.site-header {
  background: var(--dz-bg);
  border-bottom: 1px solid var(--dz-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  flex-wrap: nowrap;
}

/* Marque / logo */
.site-branding { flex: 0 0 auto; display: flex; align-items: center; }
.site-branding .custom-logo { max-height: 58px; width: auto; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo-img { height: 56px; width: auto; display: block; }
.brand-word { font-weight: 700; font-size: 1.5rem; white-space: nowrap; color: var(--dz-text); letter-spacing: -.01em; }
.brand-word .brand-dz { color: var(--dz-red); }

/* Zone droite : menu + CTA */
.header-actions { display: flex; align-items: center; gap: 20px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }

/* Navigation : tous les éléments sur UNE SEULE LIGNE */
.main-navigation { min-width: 0; }
.main-navigation ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: nowrap;          /* ← une seule ligne, jamais de retour */
  align-items: center;
  gap: 20px;
  overflow-x: auto;           /* sécurité : le menu défile si trop long */
  scrollbar-width: none;
}
.main-navigation ul::-webkit-scrollbar { display: none; }
.main-navigation li { flex: 0 0 auto; white-space: nowrap; }
.main-navigation a {
  display: inline-block;
  padding: 6px 0;
  color: var(--dz-text);
  font-weight: 500;
  font-size: .92rem;
  position: relative;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { color: var(--dz-red); }
.main-navigation a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--dz-orange);
  transition: width .25s ease;
}
.main-navigation a:hover::after { width: 100%; }

/* CTA "Contactez-nous" épinglé à droite, toujours visible (hors zone défilante) */
.header-cta { flex: 0 0 auto; }
.header-cta a {
  display: inline-block;
  background: var(--dz-red);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--dz-radius-pill);
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s ease;
}
.header-cta a:hover { background: var(--dz-red-dk); color: #fff; }

/* =========================================================
   4. LISTE DES ARTICLES (page blog)
   ========================================================= */
.blog-main { padding: 54px 0 70px; }
.blog-header { margin-bottom: 38px; }
.blog-header .overline { color: var(--dz-orange); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin-bottom: 10px; }
.blog-header h1 { font-size: 2.6rem; }
.blog-header .blog-sub { color: var(--dz-muted); margin-top: 8px; font-size: 1.05rem; }

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.post-card {
  background: var(--dz-bg);
  border: 1px solid var(--dz-border);
  border-radius: var(--dz-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--dz-shadow); }
.post-card__thumb { display: block; aspect-ratio: 16/10; background: var(--dz-alt); overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { font-size: .78rem; color: var(--dz-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.post-card__meta .cat { color: var(--dz-red); font-weight: 700; }
.post-card__title { font-size: 1.3rem; margin: 0 0 12px; line-height: 1.25; }
.post-card__title a { color: var(--dz-text); }
.post-card__title a:hover { color: var(--dz-red); }
.post-card__excerpt { color: var(--dz-muted); font-size: .96rem; margin: 0 0 18px; flex: 1; }
.post-card__more { align-self: flex-start; font-weight: 600; color: var(--dz-red); }
.post-card__more::after { content: " →"; }

/* Pagination */
.dz-pagination { margin-top: 52px; text-align: center; }
.dz-pagination .page-numbers {
  display: inline-block; padding: 9px 15px; margin: 0 4px;
  border: 1px solid var(--dz-border); border-radius: var(--dz-radius-pill); color: var(--dz-text); background: #fff;
}
.dz-pagination .page-numbers.current,
.dz-pagination .page-numbers:hover {
  background: var(--dz-red); color: #fff; border-color: var(--dz-red);
}
.no-posts { padding: 60px 0; text-align: center; color: var(--dz-muted); }

/* =========================================================
   5. ARTICLE SEUL
   ========================================================= */
.single-article { padding: 54px 0 70px; max-width: 760px; }
.single-article__header h1 { font-size: 2.7rem; }
.single-article__meta { color: var(--dz-muted); font-size: .9rem; margin-bottom: 24px; }
.single-article__thumb { margin: 0 0 32px; border-radius: var(--dz-radius); overflow: hidden; }
.single-article__content { font-size: 1.08rem; }
.single-article__content p { margin: 0 0 1.3em; }
.single-article__content img { border-radius: var(--dz-radius); margin: 1.5em 0; }
.back-to-blog { display: inline-block; margin-top: 40px; font-weight: 600; }
.back-to-blog::before { content: "← "; }

/* =========================================================
   6. FOOTER
   ========================================================= */
.site-footer {
  background: var(--dz-ink);
  color: #b9b3b4;
  padding: 50px 0 28px;
  margin-top: 54px;
}
.site-footer a { color: #e2dddd; }
.site-footer a:hover { color: var(--dz-orange); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.site-footer__brand { font-weight: 700; font-size: 1.4rem; color: #fff; }
.site-footer__brand .brand-dz { color: var(--dz-orange); }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 20px; max-width: 640px; }
.footer-contact { font-size: .9rem; line-height: 1.5; }
.footer-contact strong { color: #fff; display: block; margin-bottom: 2px; }
.footer-contact .agency { margin-bottom: 12px; }
.site-footer__copy {
  width: 100%; text-align: center; opacity: .7; font-size: .84rem;
  margin-top: 26px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px;
}

/* =========================================================
   7. RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .site-header__inner { min-height: 64px; gap: 14px; }
  .brand-logo-img { height: 44px; }
  .blog-header h1 { font-size: 1.95rem; }
  .header-actions { gap: 14px; }
  /* Le menu reste sur une seule ligne et défile horizontalement */
  .main-navigation ul { gap: 16px; }
}
