/*
Theme Name: Aurouze Seine-et-Marne
Theme URI: https://www.aurouze-seine-et-marne.fr
Author: IKONU
Author URI: https://ikonu.fr
Description: Thème sur mesure d’Aurouze Seine-et-Marne (77) : site vitrine orienté conversion — services 3D (dératisation, désinsectisation, désinfection, dépigeonnage), demande de devis en ligne centralisée, paramètres du thème et champs ACF.
Version: 0.5.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: Proprietary
Text Domain: aurouze-sem
*/

/* ==========================================================================
   0. Design tokens
   ========================================================================== */

:root {
  --asm-primary: #1e6a29;
  --asm-primary-dark: #133c19;
  --asm-primary-light: #eaf4ec;
  /* Appel à l'action : le vert de la marque, plus de jaune. Sur fond sombre, un vert clair. */
  --asm-accent: #1e6a29;
  --asm-accent-dark: #133c19;
  --asm-accent-on-dark: #a6d9ae;
  --asm-cream: #f7f5ef;
  --asm-ink: #1f2a22;
  --asm-muted: #5c6b60;
  --asm-line: #d9e5dc;
  --asm-bg: #ffffff;
  --asm-bg-soft: #f4f8f5;
  --asm-white: #ffffff;
  --asm-danger: #b42318;
  --asm-success: #1e6a29;

  --asm-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --asm-sans: "Poppins", Arial, sans-serif;

  --asm-container: 1200px;
  --asm-radius: 16px;
  --asm-radius-sm: 10px;
  --asm-shadow: 0 14px 34px rgba(19, 60, 25, 0.12);
  --asm-shadow-sm: 0 6px 16px rgba(19, 60, 25, 0.08);
  --asm-header-h: 76px;
  --asm-adminbar: 0px;
}

body.admin-bar { --asm-adminbar: 32px; }
@media (max-width: 782px) { body.admin-bar { --asm-adminbar: 46px; } }

/* ==========================================================================
   1. Base
   ========================================================================== */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--asm-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--asm-ink);
  background: var(--asm-bg);
}

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

a { color: var(--asm-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--asm-primary-dark); }

h1, h2, h3, h4 {
  font-family: var(--asm-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--asm-primary-dark);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 100000;
  width: auto; height: auto; clip: auto; margin: 0;
  padding: 0.6rem 1rem; background: var(--asm-primary-dark); color: #fff; border-radius: 8px;
}

/* ==========================================================================
   2. Layout helpers
   ========================================================================== */

.asm-wrap {
  width: min(100% - 2rem, var(--asm-container));
  margin-inline: auto;
}

.asm-wrap--narrow { max-width: 820px; }

.asm-section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.asm-section--soft { background: var(--asm-bg-soft); }
.asm-section--dark { background: var(--asm-primary-dark); color: #fff; }
.asm-section--dark h2, .asm-section--dark h3 { color: #fff; }
.asm-section--tight { padding: clamp(2rem, 4vw, 3rem) 0; }

.asm-section__head { max-width: 760px; margin: 0 auto 2.25rem; text-align: center; }
.asm-section__head--left { margin-left: 0; text-align: left; }
.asm-section__text { color: var(--asm-muted); font-size: 1.05rem; }
.asm-section--dark .asm-section__text { color: rgba(255,255,255,0.8); }

.asm-eyebrow {
  display: inline-block;
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--asm-primary);
}
.asm-eyebrow--light { color: var(--asm-primary); }

.asm-grid { display: grid; gap: 1.5rem; }
.asm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.asm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.asm-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .asm-grid--3, .asm-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .asm-grid--2, .asm-grid--3, .asm-grid--4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   3. Buttons & forms
   ========================================================================== */

.asm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--asm-primary);
  background: var(--asm-primary);
  color: #fff;
  font-family: var(--asm-sans);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.asm-btn:hover { background: var(--asm-primary-dark); border-color: var(--asm-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--asm-shadow-sm); }
.asm-btn--accent { background: var(--asm-accent); border-color: var(--asm-accent); color: #fff; }
.asm-btn--accent:hover { background: var(--asm-accent-dark); border-color: var(--asm-accent-dark); color: #fff; }
.asm-section--dark .asm-btn--accent, .asm-cta .asm-btn--accent, .asm-footer .asm-btn--accent { background: #fff; border-color: #fff; color: var(--asm-primary-dark); }
.asm-section--dark .asm-btn--accent:hover, .asm-cta .asm-btn--accent:hover, .asm-footer .asm-btn--accent:hover { background: var(--asm-primary-light); border-color: var(--asm-primary-light); color: var(--asm-primary-dark); }
.asm-btn--ghost { background: transparent; color: var(--asm-primary); }
.asm-btn--ghost:hover { background: var(--asm-primary-light); color: var(--asm-primary-dark); border-color: var(--asm-primary); }
.asm-btn--white { background: #fff; border-color: #fff; color: var(--asm-primary-dark); }
.asm-btn--white:hover { background: var(--asm-primary-light); border-color: var(--asm-primary-light); color: var(--asm-primary-dark); }
.asm-btn--outline-white { background: transparent; border-color: rgba(255,255,255,0.7); color: #fff; }
.asm-btn--outline-white:hover { background: #fff; border-color: #fff; color: var(--asm-primary-dark); }
.asm-btn--lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.asm-btn--sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.asm-btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }

.asm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.asm-actions--center { justify-content: center; }

.asm-form { display: grid; gap: 1rem; }
.asm-form__row { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 600px) { .asm-form__row { grid-template-columns: 1fr; } }
.asm-form__field { display: grid; gap: 0.35rem; }
.asm-form__field label { font-size: 0.85rem; font-weight: 600; color: var(--asm-primary-dark); }
.asm-form__field label .req { color: var(--asm-danger); }
.asm-form input[type=text], .asm-form input[type=email], .asm-form input[type=tel],
.asm-form select, .asm-form textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--asm-line);
  border-radius: var(--asm-radius-sm);
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
  color: var(--asm-ink);
}
.asm-form input:focus, .asm-form select:focus, .asm-form textarea:focus {
  outline: 2px solid var(--asm-primary);
  outline-offset: 1px;
  border-color: var(--asm-primary);
}
.asm-form textarea { min-height: 120px; resize: vertical; }
.asm-form__choice { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.asm-form__choice label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.95rem; border: 1px solid var(--asm-line); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 500; font-size: 0.9rem; color: var(--asm-ink);
}
.asm-form__choice input { accent-color: var(--asm-primary); }
.asm-form__choice label:has(input:checked) { border-color: var(--asm-primary); background: var(--asm-primary-light); color: var(--asm-primary-dark); }
.asm-form__consent { font-size: 0.82rem; color: var(--asm-muted); display: flex; gap: 0.5rem; align-items: flex-start; }
.asm-form__consent input { margin-top: 0.25rem; accent-color: var(--asm-primary); }
.asm-form__hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.asm-form__note { font-size: 0.8rem; color: var(--asm-muted); margin: 0; }

.asm-notice { padding: 0.9rem 1.1rem; border-radius: var(--asm-radius-sm); margin: 0 0 1.25rem; font-size: 0.95rem; }
.asm-notice--error { background: #fdecea; color: var(--asm-danger); border: 1px solid #f5c2bd; }
.asm-notice--success { background: var(--asm-primary-light); color: var(--asm-primary-dark); border: 1px solid #bcd8c2; }

/* ==========================================================================
   4. Header
   ========================================================================== */

.asm-header {
  position: sticky;
  top: var(--asm-adminbar);
  z-index: 900;
  background: #fff;
  border-bottom: 1px solid var(--asm-line);
}

.asm-header__topbar {
  background: var(--asm-primary-dark);
  color: #fff;
  font-size: 0.82rem;
}
.asm-header__topbar .asm-wrap {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 34px;
}
.asm-header__topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.asm-header__topbar a:hover { color: var(--asm-accent-on-dark); }
.asm-header__topbar svg { width: 14px; height: 14px; fill: currentColor; }
.asm-header__topbar-left, .asm-header__topbar-right { display: flex; gap: 1.25rem; align-items: center; }

.asm-header__main .asm-wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: var(--asm-header-h);
}

.asm-header__logo a { display: block; }
.asm-header__logo img { max-height: 56px; width: auto; }
.asm-header__logo-text { font-family: var(--asm-serif); font-size: 1.5rem; font-weight: 700; color: var(--asm-primary-dark); text-decoration: none; }

.asm-nav { display: flex; align-items: center; }
.asm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.asm-nav li { position: relative; }
.asm-nav > ul > li > a {
  display: block; padding: 0.6rem 0.85rem; border-radius: 8px;
  color: var(--asm-ink); font-weight: 500; font-size: 0.95rem; text-decoration: none;
}
.asm-nav > ul > li > a:hover, .asm-nav > ul > li.current-menu-item > a, .asm-nav > ul > li.current-menu-ancestor > a {
  background: var(--asm-primary-light); color: var(--asm-primary-dark);
}
.asm-nav .sub-menu {
  position: absolute; left: 0; top: 100%; min-width: 240px;
  display: none; flex-direction: column; gap: 0;
  padding: 0.5rem; margin: 0;
  background: #fff; border: 1px solid var(--asm-line); border-radius: 12px; box-shadow: var(--asm-shadow);
}
.asm-nav li:hover > .sub-menu, .asm-nav li:focus-within > .sub-menu { display: flex; }
.asm-nav .sub-menu a { display: block; padding: 0.55rem 0.8rem; border-radius: 8px; color: var(--asm-ink); text-decoration: none; font-size: 0.92rem; }
.asm-nav .sub-menu a:hover { background: var(--asm-primary-light); color: var(--asm-primary-dark); }

.asm-header__cta { display: flex; align-items: center; gap: 0.6rem; }
.asm-header__phone { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; color: var(--asm-primary-dark); text-decoration: none; white-space: nowrap; }
.asm-header__phone svg { width: 18px; height: 18px; fill: currentColor; }

.asm-header__burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--asm-line); border-radius: 10px; background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
}
.asm-header__burger span { display: block; width: 20px; height: 2px; background: var(--asm-primary-dark); position: relative; }
.asm-header__burger span::before, .asm-header__burger span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--asm-primary-dark); transition: transform 0.2s; }
.asm-header__burger span::before { top: -6px; }
.asm-header__burger span::after { top: 6px; }
.asm-header__burger[aria-expanded="true"] span { background: transparent; }
.asm-header__burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.asm-header__burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.asm-mobile-panel { display: none; background: #fff; border-top: 1px solid var(--asm-line); }
.asm-mobile-panel[data-open="true"] { display: block; }
.asm-mobile-panel ul { list-style: none; margin: 0; padding: 0.5rem 0; }
.asm-mobile-panel li a { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--asm-line); color: var(--asm-ink); text-decoration: none; font-weight: 500; }
.asm-mobile-panel .sub-menu { padding-left: 1rem; }
.asm-mobile-panel .sub-menu a { font-weight: 400; font-size: 0.92rem; }
.asm-mobile-panel__cta { display: grid; gap: 0.6rem; padding: 1rem 0 1.25rem; }

@media (max-width: 1024px) {
  .asm-nav, .asm-header__cta .asm-btn { display: none; }
  .asm-header__burger { display: inline-flex; }
  .asm-header__topbar-left span.asm-hide-mobile { display: none; }
}

/* ==========================================================================
   5. Footer
   ========================================================================== */

.asm-footer { background: var(--asm-primary-dark); color: rgba(255,255,255,0.85); margin-top: 0; }
.asm-footer a { color: #fff; text-decoration: none; }
.asm-footer a:hover { color: var(--asm-accent-on-dark); }

.asm-footer__cta { background: var(--asm-primary); color: #fff; padding: 2.5rem 0; }
.asm-footer__cta .asm-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.asm-footer__cta h2 { color: #fff; margin: 0 0 0.25rem; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.asm-footer__cta p { margin: 0; color: rgba(255,255,255,0.85); }

.asm-footer__main { padding: 3rem 0 2rem; }
.asm-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 960px) { .asm-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .asm-footer__grid { grid-template-columns: 1fr; } }

.asm-footer__logo img { max-height: 60px; width: auto; margin-bottom: 1rem; }
.asm-footer__title { font-family: var(--asm-serif); color: #fff; font-size: 1.3rem; margin: 0 0 0.9rem; }
.asm-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.asm-footer__info li { display: flex; gap: 0.6rem; align-items: flex-start; }
.asm-footer__info svg { width: 16px; height: 16px; fill: var(--asm-accent-on-dark); flex: none; margin-top: 0.3rem; }
.asm-footer__social { display: flex; gap: 0.6rem; margin-top: 1rem; }
.asm-footer__social a { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.08); }
.asm-footer__social svg { width: 18px; height: 18px; fill: currentColor; }

.asm-footer__certs { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.1rem 0; }
.asm-footer__certs .asm-wrap { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; }
.asm-footer__certs-label { margin: 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }

.asm-footer__bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 0.9rem 0; font-size: 0.82rem; }
.asm-footer__bottom .asm-wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.asm-footer__bottom nav { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ==========================================================================
   6. Sticky conversion bar (mobile) + floating phone
   ========================================================================== */

.asm-sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  display: none; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--asm-line); box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
}
.asm-sticky-bar .asm-btn { width: 100%; padding: 0.8rem 0.5rem; font-size: 0.9rem; }
@media (max-width: 1024px) {
  .asm-sticky-bar { display: grid; }
  body { padding-bottom: 72px; }
}

/* ==========================================================================
   7. Content (pages, articles)
   ========================================================================== */

.asm-prose { max-width: 820px; }
.asm-prose > * + * { margin-top: 1rem; }
.asm-prose h2 { margin-top: 2.2rem; }
.asm-prose h3 { margin-top: 1.6rem; }
.asm-prose ul, .asm-prose ol { padding-left: 1.3rem; }
.asm-prose img { border-radius: var(--asm-radius); }
.asm-prose .wp-block-table table, .asm-prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.asm-prose th, .asm-prose td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--asm-line); text-align: left; }
.asm-prose th { background: var(--asm-primary-light); color: var(--asm-primary-dark); }
.asm-prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--asm-primary); background: var(--asm-bg-soft); border-radius: 0 12px 12px 0; }

.asm-page-title { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }

/* Cards (generic) */
.asm-card {
  background: #fff; border: 1px solid var(--asm-line); border-radius: var(--asm-radius);
  padding: 1.5rem; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.asm-card:hover { transform: translateY(-3px); box-shadow: var(--asm-shadow); }
.asm-card__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--asm-primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.asm-card__icon img, .asm-card__icon svg { width: 32px; height: 32px; }
.asm-card h3 { margin-bottom: 0.4rem; }
.asm-card p { color: var(--asm-muted); margin: 0; }
.asm-card__link { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1rem; font-weight: 600; text-decoration: none; }

/* Elementor legacy compatibility (pages not yet migrated keep their own rendering) */
.elementor { font-family: var(--asm-sans); }

.asm-form .is-error input, .asm-form .is-error textarea, .asm-form .is-error select { border-color: var(--asm-danger); }

/* Garde-fou : si le kit Elementor est encore chargé, il ne doit pas recolorer les liens du thème. */
body.asm .asm-header__topbar a,
body.asm .asm-footer a,
body.asm a.asm-btn--outline-white { color: #fff; }
body.asm .asm-header__topbar a:hover,
body.asm .asm-footer a:hover { color: var(--asm-accent-on-dark); }
.asm-header__topbar-left > span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Widget d'avis : jamais plus large que l'écran (évitait un défilement horizontal sur mobile). */
.asm-reviews__widget { max-width: 100%; overflow: hidden; }

@media (max-width: 782px) {
  /* Barre du haut mobile : on garde le téléphone, l'adresse est dans le pied de page. */
  .asm-header__topbar-left { display: none; }
  .asm-header__topbar .asm-wrap { justify-content: center; }
  /* Le bouton de consentement Axeptio (en bas à gauche) ne doit pas masquer « Appeler ». */
  body:has(#axeptio_overlay) .asm-sticky-bar { padding-left: 72px; }
}
