/* ==========================================================================
   Fleurnettoyage — Modèle 8 (Architecture Extrême Classless)
   ========================================================================== */

:root {
  --bg: #f7f7f5;       /* crème ivoire — contreformes logo */
  --card-bg: #ffffff;
  --ink: #263057;      /* marine profond — couleur du texte logo */
  --muted: #616379;    /* marine grisé — texte secondaire */
  --rose: #ea7493;     /* rose clair — couleur principale logo */
  --red: #dd4574;      /* rose foncé — CTA, accents */
  --navy: #3c405c;     /* marine moyen */
  --border: #e8e3e8;   /* border rosée */
  --max: 1120px;
  --body: "Outfit", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 15.5px/1.6 var(--body);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease-out); }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--body);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 4vw, 3.6rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2.1rem); }

main {
  width: min(var(--max), calc(100% - 40px));
  margin: auto;
}

/* --- Header / Navtop --- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1.2fr auto 1.2fr;
  align-items: center;
  gap: 20px;
  padding: 4px max(20px, calc((100vw - var(--max)) / 2));
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.35s ease;

  &::after {
    content: ""; position: absolute; bottom: 0; inset-inline: 0; height: 2px; background: var(--red);
  }

  &.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  }

  > a:first-child {
    display: inline-flex; align-items: center; gap: 12px;
    justify-self: start; transition: opacity 0.3s var(--ease);
    img:first-child { width: 44px; height: 44px; object-fit: contain; transition: transform 0.3s ease; }
    img:last-child { height: 22px; width: auto; }
    &:hover img:first-child { transform: rotate(-10deg) scale(1.05); }
  }

  > nav {
    display: flex; align-items: center; gap: 8px; justify-self: center;
    a {
      padding: 6px 14px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
      &:hover { color: var(--red); background-color: rgba(195, 13, 31, 0.05); transform: translateY(-1px); }
      &:active { transform: translateY(0); }
    }
  }

  > div {
    display: flex; align-items: center; gap: 20px; justify-self: end;
    > a:first-child {
      display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 700;
      &:hover { color: var(--rose); }
      svg { position: relative; top: 1px; width: 14px; height: 14px; }
    }
    > a:last-child {
      background: var(--ink); color: #ffffff; padding: 8px 26px; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
      clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
      transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
      &:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(38, 48, 87, 0.2); }
    }
  }
}

/* --- Sections Sémantiques --- */
main > section {
  padding: 40px 0;
  border-bottom: 0.5px solid var(--border);
  text-align: center;
  scroll-margin-top: 140px;

  /* Sous-titre (Services, Régions, Contact) */
  &:not(#hero) > p:first-of-type,
  &#contact > div > p:first-of-type {
    display: inline-block; width: 100%; max-width: max-content;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: #ffffff; background-color: var(--ink); padding: 4px 18px; margin-bottom: 12px; line-height: 1.2;
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  }

  /* Description (Chaque espace mérite...) */
  > p:nth-of-type(2) {
    color: var(--muted); font-size: 1rem; max-width: 650px; margin: 12px auto 0;
  }

  /* Grilles d'articles */
  > div {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 28px;
    &[data-gap="sm"] { gap: 18px; }
  }

  /* Figures (Galerie) */
  figure {
    margin: 0; padding: 0; border-radius: 4px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
    &:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 15px 35px rgba(0,0,0,0.12); z-index: 2; position: relative; }
    img { display: block; width: 100%; height: auto; object-fit: cover; }
  }
}


/* --- Liste Légère (Régions & Services) --- */
#services ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 40px;
  li {
    background: #fff; padding: 30px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
    display: flex; flex-direction: column; gap: 10px;
    strong { font-size: 1.15rem; color: var(--ink); }
    span { font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
    &:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05); border-color: var(--red); }
  }
}

#zones ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 30px;
  li {
    background: #fff; padding: 14px 18px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02); transition: border-color 0.3s ease;
    display: flex; flex-direction: column; gap: 4px;
    strong { font-size: 0.95rem; color: var(--ink); }
    span { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
    &:hover { border-color: var(--red); }
  }
}

/* --- Hero Section Spécifique --- */
#hero {
  display: grid;
  grid-template-columns: 55fr 45fr;
  column-gap: 40px; row-gap: 16px;
  padding: 60px 0 40px;
  text-align: left;
  animation: heroLoad 1s var(--ease) forwards;
  border-bottom: 0.5px solid var(--border);

  /* Bloc texte + CTA */
  > div:first-of-type {
    display: flex; flex-direction: column; justify-content: center; gap: 28px;
    margin-top: 0; /* reset generic rule */
    h1 { line-height: 1.15; }
    p { color: var(--muted); font-size: 1.1rem; }
    a {
      display: inline-block; width: max-content;
      background: var(--ink); color: #fff; padding: 13px 28px;
      font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
      clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
      transition: transform 0.3s var(--ease);
      &:hover { transform: translateY(-2px); }
    }
  }

  /* Photo principale */
  > figure {
    margin: 0; border-radius: 6px; overflow: hidden; align-self: stretch;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 380px; }
  }

  /* Bande de 3 photos */
  > div:last-of-type {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-top: 0; /* reset generic rule */
    figure {
      margin: 0; border-radius: 4px; overflow: hidden;
      box-shadow: 0 4px 12px rgba(0,0,0,0.08);
      transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
      &:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }
      img { display: block; width: 100%; height: 180px; object-fit: cover; }
    }
  }
}

@keyframes heroLoad { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Autocomplete --- */
.suggestions-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  background: #ffffff; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 4px 4px; box-shadow: 0 4px 12px rgba(38,48,87,0.1);
  max-height: 200px; overflow-y: auto; list-style: none; padding: 0; margin: 0;
  display: none;
}
.suggestions-list.active { display: block; }
.suggestions-list li {
  padding: 10px 14px; font-size: 0.85rem; color: var(--ink);
  cursor: pointer; transition: background 0.2s var(--ease);
}
.suggestions-list li:hover { background: #f0f2f5; }
.suggestions-list li b { color: var(--rose); font-weight: 600; }

/* --- Boutons globaux --- */
button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; padding: 14px 28px;
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: #ffffff; background-color: var(--ink); border: none;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  cursor: pointer; transition: transform 0.3s var(--ease);
  &:hover { transform: translateY(-2px); }
  &:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }
}

/* --- Section Contact --- */
#contact {
  display: grid; grid-template-columns: 35fr 65fr; gap: 48px; text-align: left;
  > div { display: flex; flex-direction: column; height: 100%; }
  h2 { margin-bottom: 8px; }

  dl {
    display: flex; flex-direction: column; gap: 14px; margin: 30px 0 0;
    div { display: flex; flex-direction: column; gap: 4px; }
    dt { font-weight: 700; }
    dd { margin: 0; color: var(--muted); a:hover { color: var(--red); } }
  }
  
  > div:first-of-type > div:last-of-type { margin-top: auto; padding-top: 28px; width: 100%; iframe { display: block; width: 100%; min-height: 240px; } }
}

/* --- Formulaire --- */
form {
  display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; row-gap: 16px; padding-top: 4px;
  
  > div { position: relative; width: 100%; }
  
  button[type="submit"] { align-self: flex-start; }

  input, textarea, select {
    width: 100%; padding: 13px 12px 5px; border: 0.5px solid var(--border); color: var(--ink); background: var(--card-bg);
    font-family: var(--body); font-size: 0.92rem; border-radius: 4px; transition: all 0.25s var(--ease-out);
    &:focus { outline: 0; border-color: var(--red); background: rgba(195, 13, 31, 0.005); box-shadow: 0 0 0 4px rgba(195, 13, 31, 0.05); }
  }

  select {
    appearance: none; background: var(--card-bg) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233f3f3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
    padding-right: 40px; cursor: pointer;
  }
  textarea { min-height: 200px; resize: vertical; }

  label {
    position: absolute; left: 12px; top: 9px; font-weight: 500; font-size: 0.88rem; color: var(--muted);
    pointer-events: none; transition: all 0.2s var(--ease); transform-origin: left top;
  }
  input:focus ~ label, input:not(:placeholder-shown) ~ label,
  textarea:focus ~ label, textarea:not(:placeholder-shown) ~ label,
  select:focus ~ label, select:valid ~ label {
    transform: translateY(-6px) scale(0.74); color: var(--red); font-weight: 700;
  }
}

/* --- Upload --- */
form > div:nth-last-child(2) > span:first-child { font-weight: 500; font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; display: block; }
#file-upload-zone {
  display: flex; align-items: center; gap: 8px; width: max-content;
  button:first-of-type {
    display: inline-flex; align-items: center; gap: 4px; background: var(--card-bg); border: 0.5px solid var(--border); color: var(--muted);
    padding: 4px 10px; font-size: 0.75rem; font-weight: 500; border-radius: 4px; cursor: pointer; transition: all 0.2s var(--ease);
    &:hover { background: var(--border); color: var(--ink); border-color: var(--muted); }
  }
  span { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  &.has-file span { color: var(--red); font-weight: 600; opacity: 1; }
  button:last-of-type {
    background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 0 4px; transition: all 0.2s ease;
    &:hover { color: var(--red); transform: scale(1.15); }
  }
}

/* --- Footer --- */
footer {
  width: 100%; background: #f0edf3; padding-top: 40px;
  > div {
    display: flex; gap: 4px;
    div:first-child { width: max(40px, 10vw); background: var(--red); clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%); }
    div:last-child { 
      flex: 1; background: var(--ink); clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%);
      display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 12px;
      padding: 16px 20px 16px 30px;
      img { filter: brightness(0) invert(1); opacity: 0.9; flex-shrink: 0; }
      .footer-logo { width: 30px; height: 30px; }
    }
  }
  p { margin: 0; text-align: center; font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); font-weight: 500; }
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: -80px; right: 24px; background: var(--ink); color: #fff; padding: 16px 24px; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); display: flex; align-items: center; gap: 12px; z-index: 1000;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-left: 4px solid var(--red);
  &.show { bottom: 24px; }
  div:first-child { font-size: 20px; font-weight: 700; }
  div:last-child { font-size: 0.92rem; font-weight: 500; }
}

/* --- Responsive --- */
@media (max-width: 760px) {
  header {
    display: grid; grid-template-columns: auto auto; row-gap: 10px; column-gap: 5px; justify-content: space-between; padding: 10px 15px;
    > a:first-child { 
      grid-row: 1; grid-column: 1; gap: 6px;
      img:first-child { width: 34px; height: 34px; } 
      img:last-child { height: 18px; max-width: 140px; object-fit: contain; } 
    }
    > nav { 
      grid-row: 2; grid-column: 1 / 3; width: 100%; justify-content: center; gap: 12px; margin-top: 0; border-top: 0.5px solid rgba(0, 0, 0, 0.05); padding-top: 8px; 
    }
    > div { 
      grid-row: 1; grid-column: 2; justify-self: end; gap: 5px; 
      > a:first-child { font-size: 0.65rem; white-space: nowrap; gap: 2px; letter-spacing: -0.02em; }
      > a:first-child span { display: inline; } /* Force display just in case */
      > a:first-child svg { width: 13px; height: 13px; }
      > a:last-child { padding: 4px 8px; font-size: 0.6rem; letter-spacing: 0; white-space: nowrap; }
    }
  }
  #hero { grid-template-columns: 1fr; padding: 32px 0 24px;
    > figure { min-height: 260px; img { min-height: 260px; } }
    > div:last-of-type { grid-template-columns: repeat(3, 1fr); }
  }
  #contact { grid-template-columns: 1fr; }
  main > section { padding: 42px 0; }
  button[type="submit"] { width: 100%; }
  .toast { left: 20px; right: 20px; bottom: -100px; &.show { bottom: 20px; } }
}
