:root {
  --anthracite: #2b2d31;
  --anthracite-dark: #1e2024;
  --anthracite-light: #f4f4f5;
  --gray-accent: #b7bac0;
  --yellow: #F1CC13;
  --yellow-dark: #D4B010;
  --white: #ffffff;
  --text: #3a3d42;
  --muted: #6b6f76;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--anthracite-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-logo {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--gray-accent);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--yellow);
}

.nav-cta {
  padding: 10px 18px;
  background: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 6px;
  color: var(--anthracite-dark);
}

.nav-cta:hover {
  background: transparent;
  color: var(--yellow);
}

/* Hero */
.hero {
  background: var(--anthracite);
  color: var(--white);
  padding: 96px 0 90px;
  border-bottom: 6px solid var(--yellow);
  position: relative;
}

.hero-eyebrow {
  color: var(--yellow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 16px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 760px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--gray-accent);
  max-width: 620px;
  margin-bottom: 32px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-yellow {
  background: var(--yellow);
  color: var(--anthracite-dark);
}

.btn-yellow:hover {
  background: var(--yellow-dark);
}

.btn-outline {
  border: 2px solid var(--anthracite);
  color: var(--anthracite);
}

.btn-outline:hover {
  background: var(--anthracite);
  color: var(--white);
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--anthracite-light);
}

.section-pb-sm {
  padding-bottom: 40px;
}

.section-title {
  font-size: 1.9rem;
  color: var(--anthracite);
  margin-bottom: 36px;
  position: relative;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  background: var(--yellow);
}

.section-text {
  font-size: 1.15rem;
  max-width: 720px;
  color: var(--text);
}

/* Grid & cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.card {
  background: var(--white);
  border: 1px solid #e4e4e7;
  border-top: 4px solid var(--yellow);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

a.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(30, 32, 36, 0.12);
}

.card-title {
  color: var(--anthracite);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.card-year {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 8px;
}

.project-meta {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.card-text {
  color: var(--muted);
  font-size: 0.98rem;
  flex-grow: 1;
}

.card-link {
  color: var(--yellow-dark);
  font-weight: 600;
  margin-top: 16px;
}

.see-all-wrap {
  margin-top: 40px;
  text-align: center;
}

/* Secteurs (page Services) : carrousel horizontal */
.sector-carousel-wrap {
  position: relative;
}

.carousel-btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--yellow);
  color: var(--anthracite-dark);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 32, 36, 0.22);
  transition: background 0.2s ease, transform 0.15s ease;
}

.carousel-btn:hover {
  background: var(--yellow-dark);
}

.carousel-btn[hidden] {
  display: none;
}

.carousel-btn-prev {
  left: -14px;
}

.carousel-btn-next {
  right: -14px;
}

.sector-carousel {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 16px;
  -webkit-overflow-scrolling: touch;
}

.sector-carousel .card {
  flex: 0 0 calc((100% - 56px) / 3);
  scroll-snap-align: start;
}

.sector-carousel::-webkit-scrollbar {
  height: 8px;
}

.sector-carousel::-webkit-scrollbar-thumb {
  background: var(--gray-accent);
  border-radius: 999px;
}

/* Page header */
.page-header {
  background: var(--anthracite);
  color: var(--white);
  padding: 40px 0;
  border-bottom: 6px solid var(--yellow);
  position: relative;
}

.page-title {
  font-size: 2.4rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--gray-accent);
  margin-top: 8px;
  font-size: 1.1rem;
}

/* Hero / page header with background photo */
.hero-bg,
.page-header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-overlay,
.page-header-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 32, 36, 0.62);
}

.hero-with-bg .hero-content,
.page-header-with-bg .page-header-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-with-bg {
  padding-top: 120px;
  padding-bottom: 110px;
}

.page-header-with-bg {
  padding-top: 48px;
  padding-bottom: 44px;
}

/* Sector detail */
.sector-lead {
  font-size: 1.2rem;
  color: var(--anthracite);
  font-weight: 500;
}

/* Ne pas ajouter de marge aux <p> générés par CKEditor dans les blocs courts */
.sector-lead p,
.card-text p,
.section-text p,
.team-bio p,
.cta-text p {
  margin: 0;
}

/* Laisser un léger espace sous le dernier paragraphe des blocs de texte */
.card-text p + p,
.section-text p + p {
  margin-top: 12px;
}

.section-text p {
  margin-bottom: 12px;
}
.section-text p:last-child {
  margin-bottom: 0;
}

.prose p {
  margin-bottom: 16px;
  max-width: 760px;
}

.cta-strip {
  padding: 40px 24px 80px;
}

.cta-strip-top {
  padding: 28px 24px 0;
}

/* Clients */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  align-items: center;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.client-logo img {
  max-height: 64px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.client-logo:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* Footer */
.site-footer {
  background: var(--anthracite-dark);
  color: var(--gray-accent);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-weight: 600;
  color: var(--white);
}

.footer-links a {
  margin-left: 20px;
}

.footer-links a:hover {
  color: var(--yellow);
}

.footer-contact {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(183, 186, 192, 0.25);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-contact a {
  color: var(--gray-accent);
  font-weight: 500;
}

.footer-contact a:hover {
  color: var(--yellow);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .main-nav {
    gap: 16px;
  }
  .hero {
    padding: 64px 0;
  }
  .carousel-btn {
    display: none;
  }
  .sector-carousel {
    flex-direction: column;
    overflow-x: visible;
    scroll-snap-type: none;
    gap: 40px;
    padding: 8px 0 12px;
  }
  .sector-carousel .card {
    flex: 1 0 auto;
    width: 100%;
  }
}

/* Service detail */
.service-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 32px;
}

/* Rendu du contenu HTML riche */
.prose h2 {
  color: var(--anthracite);
  font-size: 1.5rem;
  margin: 32px 0 16px;
  position: relative;
  padding-bottom: 10px;
}

.prose h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 4px;
  background: var(--yellow);
}

.prose h3 {
  color: var(--anthracite);
  font-size: 1.2rem;
  margin: 24px 0 10px;
}

.prose p {
  margin-bottom: 18px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px 24px;
}

.prose li {
  margin-bottom: 6px;
}

.prose img {
  border-radius: 12px;
  margin: 20px 0;
}

.prose blockquote {
  border-left: 4px solid var(--yellow);
  padding: 4px 0 4px 20px;
  margin: 20px 0;
  color: var(--muted);
  font-style: italic;
}

.service-sectors {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e4e4e7;
}

.meta-label {
  color: var(--muted);
  font-weight: 500;
  margin-right: 12px;
}

.tag {
  display: inline-block;
  background: var(--anthracite-light);
  color: var(--anthracite);
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  padding: 6px 14px;
  margin: 4px 6px 4px 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.tag:hover {
  border-color: var(--yellow);
  color: var(--yellow-dark);
}

/* Équipe */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}

.team-card {
  background: var(--white);
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.team-card:hover {
  box-shadow: 0 12px 28px rgba(30, 32, 36, 0.1);
}

.team-photo {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 4px solid var(--yellow);
}

.team-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--anthracite);
  color: var(--yellow);
  font-size: 2.5rem;
  font-weight: 700;
}

.team-name {
  color: var(--anthracite);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.team-role {
  color: var(--yellow-dark);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.team-bio {
  color: var(--muted);
  font-size: 0.95rem;
}

/* CTA band (pages de services) */
.section-cta {
  background: var(--anthracite);
  color: var(--white);
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cta-title {
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 8px;
}

.cta-text {
  color: var(--gray-accent);
}

/* Messages flash (toast, coin bas-droit) */
.messages {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.message {
  border-radius: 10px;
  padding: 16px 20px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(30, 32, 36, 0.2);
  animation: message-in 0.3s ease, message-out 0.3s ease 4.7s forwards;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes message-out {
  to { opacity: 0; transform: translateY(12px); }
}

.message-success {
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  color: #1b5e20;
}

.message-error {
  background: #fdecea;
  border-left: 4px solid #c62828;
  color: #b71c1c;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

.contact-details {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e4e4e7;
}

.contact-detail {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--anthracite);
  margin-bottom: 10px;
}

.contact-detail a {
  color: var(--anthracite);
}

.contact-detail a:hover {
  color: var(--yellow-dark);
}

.contact-form-wrap {
  background: var(--anthracite-light);
  border-radius: 12px;
  padding: 32px;
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-weight: 600;
  color: var(--anthracite);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(244, 192, 31, 0.25);
}

.form-field .captcha {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 8px;
}

.captcha-refresh {
  display: inline-block;
  margin-top: 8px;
  color: var(--yellow-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-field .errorlist {
  list-style: none;
  margin-top: 6px;
  font-size: 0.88rem;
}

.form-field .errorlist li {
  color: #c62828;
}

.form-errors {
  background: #fdecea;
  border-left: 4px solid #c62828;
  color: #b71c1c;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
}
