/* ==========================================================================
   TTR Multiservices — Styles de base communs à toutes les pages
   Variables de thème : redéfinies par page dans home.css / espaces-verts.css /
   batiment.css / devis.css / contact.css via [data-theme="..."] sur <body>.
   ========================================================================== */

:root {
  /* Couleur d'accent commune à tout le site (cohérence de marque) */
  --accent: #e8871e;
  --accent-dark: #c96f0f;
  --accent-light: #f6b25f;

  /* Thème neutre par défaut (Accueil / Devis / Contact) */
  --primary: #1e293b;
  --primary-dark: #10161f;
  --primary-light: #3c4a63;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1a1c1f;
  --text-muted: #5b6270;
  --border: #e4e1da;

  --font-heading: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 20, 0.10);
  --shadow-lg: 0 18px 48px rgba(20, 20, 20, 0.16);
  --container: 1160px;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 0.5em; line-height: 1.2; color: var(--primary); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-accent {
  background: var(--accent);
  color: #201404;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); color: #ffffff; }
.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-ghost-light {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
  backdrop-filter: blur(4px);
}
.btn-ghost-light:hover { background: #fff; color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }

/* --------------------------------------------------------------------------
   En-tête / navigation (commun)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
}
.brand .brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: grid; place-items: center;
  color: var(--accent-light);
  flex-shrink: 0;
}
.brand .brand-mark svg { width: 24px; height: 24px; }
.brand .brand-logo { width: 54px; height: 48px; object-fit: contain; flex-shrink: 0; }
.footer-logo {
  display: inline-block;
  background: #fff;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.footer-logo img { width: 170px; height: auto; }
.brand .brand-name span { display: block; white-space: nowrap; }
.brand .brand-name .sub { font-family: var(--font-body); font-weight: 500; font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 2.2rem; }
.nav-links { display: flex; gap: 1.9rem; }
.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  position: relative;
  padding: 0.4rem 0.1rem;
  transition: color 0.15s ease;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--accent-dark); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--accent-dark); }

.nav-cta { display: flex; align-items: center; gap: 0.9rem; }
@media (min-width: 1181px) and (max-width: 1320px) {
  .main-nav { gap: 1.4rem; }
  .nav-links { gap: 1.2rem; }
  .nav-cta .btn { padding: 0.75rem 1.2rem; }
}
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: none; background: var(--bg);
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1.5rem;
    /* Masqué par découpe plutôt que par décalage hors écran : évite que la page déborde en largeur sur mobile */
    clip-path: inset(0 0 0 100%);
    visibility: hidden;
    transition: clip-path 0.28s ease, visibility 0s linear 0.28s;
    overflow-y: auto;
  }
  .main-nav.is-open { clip-path: inset(0); visibility: visible; transition: clip-path 0.28s ease; }
  .nav-links { flex-direction: column; gap: 1.1rem; font-size: 1.1rem; }
  .nav-cta { flex-direction: column; align-items: stretch; }
  .nav-cta .btn { justify-content: center; }
}

/* Fil d'Ariane */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.9rem 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb .sep { margin: 0 0.4rem; opacity: 0.6; }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* --------------------------------------------------------------------------
   Sections génériques
   -------------------------------------------------------------------------- */
.section { padding: 5.5rem 0; }
.section-tight { padding: 3.5rem 0; }
.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* Grilles */
.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Cartes de service (communes, thémées via variables) */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.9rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.service-card .icon-wrap {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
}
.service-card .icon-wrap svg { width: 28px; height: 28px; }
.service-card h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0; }

/* Placeholder visuel (à remplacer par une vraie photo) */
.media-placeholder {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)) 0 14px, color-mix(in srgb, var(--primary) 6%, var(--surface)) 14px 28px);
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent);
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--primary);
  text-align: center;
}
.media-placeholder .ph-icon {
  width: 56px; height: 56px; margin: 0 auto 0.6rem;
  opacity: 0.55;
}
.media-placeholder .ph-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.75);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 2.4rem;
}
.form-row { display: grid; gap: 1.3rem; margin-bottom: 1.3rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}
.field .req { color: var(--accent-dark); }
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field textarea { resize: vertical; min-height: 130px; }
.field-error { color: #c0392b; font-size: 0.82rem; margin-top: 0.35rem; display: none; }
.field.has-error input,
.field.has-error textarea,
.field.has-error select { border-color: #c0392b; }
.field.has-error .field-error { display: block; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.checkbox-pill {
  display: flex; align-items: center; gap: 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg);
}
.checkbox-pill:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.checkbox-pill input { accent-color: var(--accent); }

.form-success {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
}
.form-success.is-visible { display: block; }
/* Agrandissement des photos de réalisations (pages Bâtiment et Espaces verts) */
.ba-lightbox {
  padding: 0; border: 0;
  background: transparent;
  max-width: min(1200px, 94vw);
  max-height: 92vh;
}
.ba-lightbox::backdrop { background: rgba(10, 12, 14, 0.88); }
.ba-lightbox img { display: block; max-width: 100%; max-height: 92vh; width: auto; height: auto; }
.ba-lightbox-close {
  position: absolute; right: 0.6rem; top: 0.6rem;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(20, 23, 26, 0.8); color: #fff;
  cursor: pointer;
}

.privacy-note {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  max-width: 520px;
  margin: 0.4rem auto 0;
}
.privacy-note a { color: inherit; text-decoration: underline; }
.form-send-error {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid #c92a2a;
  background: color-mix(in srgb, #c92a2a 8%, transparent);
  color: #8a1c1c;
  font-size: 0.9rem;
}
.form-send-error a { color: inherit; font-weight: 600; }
.form-success .success-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: color-mix(in srgb, #2f9e44 15%, transparent);
  color: #2f9e44;
  display: grid; place-items: center;
  margin: 0 auto 1.2rem;
}
.form-success .success-icon svg { width: 34px; height: 34px; }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--primary-dark, var(--primary));
  color: rgba(255,255,255,0.82);
  padding: 4rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { color: #fff; margin-bottom: 0.9rem; }
.footer-brand p { color: rgba(255,255,255,0.65); font-size: 0.92rem; max-width: 280px; }
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; }
.site-footer ul li { margin-bottom: 0.7rem; font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent-light); }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; }
.footer-contact svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--accent-light); }
.footer-legal a { color: inherit; text-decoration: underline; }
.footer-legal a:hover { color: #fff; }
.footer-bottom {
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}

/* --------------------------------------------------------------------------
   Divers
   -------------------------------------------------------------------------- */
.badge-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}
.badge svg { width: 16px; height: 16px; }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: 0.8rem 1.2rem;
  z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
