/*
Theme Name: Guerra Habitat
Theme URI: https://guerrahabitat.fr/
Author: Guerra Habitat
Description: Thème sur mesure pour Guerra Habitat – maçonnerie, rénovation, isolation, aménagements extérieurs à Pruniers-en-Sologne. Thème « bloc » 100 % gratuit, éditable dans l'éditeur de site WordPress, sans constructeur de page payant.
Version: 1.4.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: guerra-habitat
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: 3px; }

/* ---------- Barre supérieure ---------- */
.gh-topbar { font-size: .9rem; }
.gh-topbar a { color: inherit; text-decoration: none; }
.gh-topbar a:hover { text-decoration: underline; }

/* ---------- En-tête ---------- */
.gh-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 14px rgba(0,0,0,.06); }
.admin-bar .gh-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .gh-header { top: 46px; } }
.gh-header .wp-block-site-title a { text-decoration: none; letter-spacing: .04em; }
.gh-header .wp-block-navigation a { text-decoration: none; }
.gh-header .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }
.gh-header .current-menu-item > a { color: var(--wp--preset--color--accent); }

/* ---------- Hero ---------- */
.gh-hero {
  position: relative;
  background-color: var(--wp--preset--color--anthracite);
  background-image: url("../couverture-bandes-rge.svg");
  background-size: cover;
  background-position: center right;
  color: #fff;
}
.gh-hero h1 { color: #fff; }
.gh-hero .gh-kicker { color: var(--wp--preset--color--accent-clair); }

.gh-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .82rem; font-weight: 700; color: var(--wp--preset--color--accent); margin-bottom: .4rem; }

/* ---------- Bouton secondaire ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { border-width: 2px; }
.gh-hero .is-style-outline > .wp-block-button__link { color: #fff; border-color: #fff; }

/* ---------- Cartes ---------- */
.gh-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--wp--preset--color--bordure);
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
}
.gh-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.gh-card h3 { margin-top: 0; }
.gh-card .gh-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--wp--preset--color--accent); color: #fff; font-weight: 700;
  margin-bottom: .6rem;
}
.wp-block-columns.gh-grid { gap: 1.5rem; }
.wp-block-column > .gh-card { height: 100%; }

/* ---------- Valeurs ---------- */
.gh-valeurs { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; list-style: none; padding: 0; }
.gh-valeurs li {
  background: #fff; border: 2px solid var(--wp--preset--color--accent);
  color: var(--wp--preset--color--anthracite); border-radius: 999px;
  padding: .45rem 1.2rem; font-weight: 600;
}

/* ---------- Listes à coches ---------- */
.gh-checks { list-style: none; padding-left: 0; }
.gh-checks li { position: relative; padding-left: 1.8rem; margin-bottom: .55rem; }
.gh-checks li::before {
  content: "✔"; position: absolute; left: 0; top: 0;
  color: var(--wp--preset--color--accent); font-weight: 700;
}

/* ---------- Images arrondies ---------- */
.gh-rounded img { border-radius: 10px; }

/* ---------- Galerie réalisations ---------- */
.gh-galerie.wp-block-gallery figure.wp-block-image img { border-radius: 8px; }
.gh-galerie.wp-block-gallery.has-nested-images figure.wp-block-image { flex-grow: 0; }
.gh-galerie.wp-block-gallery.has-nested-images { --wp--style--unstable-gallery-gap: 1.2rem; gap: 1.2rem; }
/* légende sous la photo (et non plus par-dessus, pour ne pas masquer les visuels) */
.gh-galerie.wp-block-gallery figure.wp-block-image figcaption {
  position: static; background: none; color: var(--wp--preset--color--contrast, #222); text-shadow: none;
  overflow: visible; max-height: none; text-align: center;
  font-size: .85rem; line-height: 1.3; padding: .6rem .25rem 0;
}

/* ---------- Bandeau appel ---------- */
.gh-cta { border-radius: 12px; }
.gh-cta h2, .gh-cta p { color: #fff; }
.gh-cta .wp-block-button__link { background: #fff; color: var(--wp--preset--color--accent-fonce); }

/* ---------- Formulaire de contact ---------- */
.gh-form { display: grid; gap: 1rem; max-width: 760px; }
.gh-form .gh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .gh-form .gh-row { grid-template-columns: 1fr; } }
.gh-form label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.gh-form input[type=text], .gh-form input[type=email], .gh-form input[type=tel],
.gh-form select, .gh-form textarea {
  width: 100%; box-sizing: border-box; padding: .75rem .9rem; font: inherit;
  border: 1px solid var(--wp--preset--color--bordure); border-radius: 6px; background: #fff;
}
.gh-form input:focus, .gh-form select:focus, .gh-form textarea:focus {
  outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; border-color: transparent;
}
.gh-form textarea { min-height: 160px; resize: vertical; }
.gh-form .gh-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.gh-form .gh-consent input { margin-top: .25rem; }
.gh-form .gh-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.gh-form button {
  justify-self: start; cursor: pointer; border: 0; border-radius: 999px;
  background: var(--wp--preset--color--accent); color: #fff; font: inherit; font-weight: 700;
  padding: .9rem 1.8rem;
}
.gh-form button:hover { background: var(--wp--preset--color--accent-fonce); }
.gh-alert { padding: 1rem 1.2rem; border-radius: 6px; margin-bottom: 1rem; }
.gh-alert.ok { background: #e7f6ec; border: 1px solid #9bd3ad; color: #1d5b31; }
.gh-alert.err { background: #fdecea; border: 1px solid #f1a9a0; color: #8a1f11; }

/* ---------- Livre d'or (commentaires) ---------- */
.gh-livre .wp-block-comment-template { list-style: none; padding: 0; }
.gh-livre .wp-block-comment-template > li {
  background: #fff; border: 1px solid var(--wp--preset--color--bordure);
  border-radius: 10px; padding: 1.2rem 1.4rem; margin-bottom: 1rem;
}
.gh-livre .comment-form input[type=text], .gh-livre .comment-form input[type=email],
.gh-livre .comment-form input[type=url], .gh-livre .comment-form textarea {
  width: 100%; box-sizing: border-box; padding: .7rem; border: 1px solid var(--wp--preset--color--bordure); border-radius: 6px;
}

/* ---------- Pages légales ---------- */
.gh-legal h2 { font-size: 1.25rem; margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--wp--preset--color--bordure); }

/* ---------- Pied de page ---------- */
.gh-footer a { color: #fff; text-decoration: none; }
.gh-footer a:hover { color: var(--wp--preset--color--accent-clair); }
.gh-footer .wp-block-heading { color: #fff; }
.gh-footer ul { list-style: none; padding-left: 0; }
.gh-footer li { margin-bottom: .35rem; }
.gh-footer-bottom { border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; opacity: .8; }

/* ---------- Bouton appel mobile ---------- */
.gh-callfab {
  display: none; position: fixed; right: 16px; bottom: 16px; z-index: 60;
  background: var(--wp--preset--color--accent); color: #fff !important; text-decoration: none;
  border-radius: 999px; padding: .8rem 1.2rem; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
@media (max-width: 782px) { .gh-callfab { display: inline-block; } }

/* Titres dans les cartes */
.gh-card h3 { font-size: 1.15rem; hyphens: manual; overflow-wrap: normal; }
@media (max-width: 1000px) and (min-width: 782px) { .gh-grid { flex-wrap: wrap !important; } .gh-grid > .wp-block-column { flex-basis: calc(50% - 1rem) !important; } }
.gh-card h3 { font-size: 1.2rem; }
.gh-footer h3.wp-block-heading { font-size: 1.15rem; letter-spacing: .03em; }

/* =====================================================
   Charte graphique Guerra Habitat
   Magenta #D80C75 · Noir #222 · Blanc · Rose #F888C0
   Typographie : Quicksand (proche du logo)
   ===================================================== */

/* Logo : si un logo est défini, on masque le titre texte */
.gh-header .wp-block-site-logo img { height: 72px; width: auto; }
.gh-header .wp-block-site-logo + .wp-block-site-title { display: none; }
@media (max-width: 600px) { .gh-header .wp-block-site-logo img { height: 48px; } }

/* Filet magenta sous l'en-tête, rappel du toit du logo */
.gh-header { border-bottom: 3px solid var(--wp--preset--color--accent); }

/* Motif « toit » du logo au-dessus des sur-titres */
.gh-kicker::before {
  content: ""; display: inline-block; width: 26px; height: 12px; margin-right: .55rem; vertical-align: -1px;
  background: linear-gradient(to bottom right, transparent calc(50% - 1.5px), currentColor calc(50% - 1.5px), currentColor calc(50% + 1.5px), transparent calc(50% + 1.5px)) left / 50% 100% no-repeat,
              linear-gradient(to top right, transparent calc(50% - 1.5px), currentColor calc(50% - 1.5px), currentColor calc(50% + 1.5px), transparent calc(50% + 1.5px)) right / 50% 100% no-repeat;
}
.has-text-align-center.gh-kicker::before { display: none; }

/* Bandes diagonales roses, comme sur le visuel RGE / Qualibat */
.gh-cta, .gh-hero { position: relative; overflow: hidden; }
.gh-cta::after {
  content: ""; position: absolute; right: -60px; bottom: -40px; width: 320px; height: 220px; pointer-events: none;
  background: repeating-linear-gradient(-40deg, rgba(255,255,255,.18) 0 18px, transparent 18px 46px);
  border-radius: 40px;
}
.gh-cta > *, .gh-hero > * { position: relative; z-index: 1; }

/* Numéros / pastilles */
.gh-card .gh-num { font-size: .95rem; }
.gh-card:hover { border-color: var(--wp--preset--color--accent-clair); }

/* Valeurs en pastilles magenta */
.gh-valeurs li { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent-fonce); }

/* Badge qualifications */
.gh-badge img { filter: drop-shadow(0 12px 24px rgba(216,12,117,.25)); }
.gh-qualif { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.gh-qualif li { background: var(--wp--preset--color--accent); color: #fff; border-radius: 999px; padding: .35rem 1rem; font-weight: 700; font-size: .9rem; }

/* Pied de page : logo blanc */
.gh-footer .gh-footer-logo img { max-width: 260px; height: auto; }
.gh-footer-bottom { border-top-color: rgba(248,136,192,.35); }

/* Barre du haut magenta */
.gh-topbar { background: var(--wp--preset--color--accent) !important; }

@media (max-width: 782px) {
  .gh-topbar .wp-block-group > p:first-child { display: none; }
  .gh-topbar .wp-block-group { justify-content: center !important; }
  .gh-hero { background-image: linear-gradient(rgba(120,0,60,.45), rgba(120,0,60,.45)), url("../couverture-bandes-rge.svg"); }
}
.gh-form .gh-rgpd-info { font-size: .82rem; line-height: 1.5; color: #555; margin: 0; }

/* Couverture rose : bouton principal blanc pour rester visible */
.gh-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link { background: #fff; color: var(--wp--preset--color--accent-fonce); }
.gh-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover { background: var(--wp--preset--color--anthracite); color: #fff; }
.gh-hero .gh-kicker { color: #FFE3F1; }

/* ---------- Étoiles & livre d'or ---------- */
.gh-stars { letter-spacing: 2px; font-size: 1.15rem; line-height: 1; white-space: nowrap; }
.gh-stars .on { color: var(--wp--preset--color--accent); }
.gh-stars .off { color: var(--wp--preset--color--bordure); }
.gh-note-globale { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; background: var(--wp--preset--color--sable); border: 1px solid var(--wp--preset--color--bordure); border-radius: 12px; padding: 1rem 1.3rem; margin-bottom: 1.5rem; }
.gh-note-globale .gh-stars { font-size: 1.8rem; }
.gh-note-chiffre { font-size: 1.6rem; font-weight: 700; color: var(--wp--preset--color--anthracite); }
.gh-note-nb { color: #666; }
.gh-avis-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.gh-avis-titre { color: var(--wp--preset--color--anthracite); }
.gh-livre .wp-block-comment-template > li { border-left: 4px solid var(--wp--preset--color--accent); }
.gh-livre .wp-block-comment-template { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.gh-livre .wp-block-comment-template > li { margin-bottom: 0; }
.gh-rating-input { border: 0; padding: 0; margin: 0 0 1rem; }
.gh-rating-input legend { font-weight: 600; margin-bottom: .3rem; }
.gh-rating-stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.gh-rating-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gh-rating-stars label { font-size: 2rem; cursor: pointer; color: var(--wp--preset--color--bordure); line-height: 1; }
.gh-rating-stars input:checked ~ label, .gh-rating-stars label:hover, .gh-rating-stars label:hover ~ label { color: var(--wp--preset--color--accent); }
.gh-rating-stars input:focus-visible + label { outline: 2px solid var(--wp--preset--color--accent); border-radius: 4px; }
