/*
  Personnalisation rapide du site
  À modifier en priorité via Admin > Design.
  Le CSS principal reste dans assets/css/styles.css.
*/

:root {
  /* Couleurs globales */
  --white: #ffffff;
  --grey: #f9f9f9;
  --page: #f8faf9;
  --sand: #f6f1e8;

  /* Bleu du site */
  --blue-950: #143c42;
  --blue-900: #1d4a51;
  --blue-700: #2d6870;
  --blue-100: #e7f1f2;
  --blue-50: #f3f8f9;

  /* Ocre du logo */
  --ochre-700: #8f7134;
  --ochre-600: #a98943;
  --ochre-100: #f2ead7;

  /* Textes */
  --ink: #17393e;
  --muted: #60777b;
  --line: #dfe9e9;
  --line-strong: #c6d6d7;

  /* Fond du site */
  --page-bg-image: none;
  --page-bg-size: cover;
  --page-bg-position: center center;
  --page-bg-attachment: scroll;
  --page-bg-overlay: rgba(255, 255, 255, 0.90);

  /* Transparences */
  --surface-alpha: 0.96;
  --card-alpha: 0.96;
  --header-alpha: 0.96;
  --hero-image-opacity: 1;

  /* Header, logo et menu */
  --header-height: 88px;
  --logo-width: 160px;
  --logo-radius: 16px;
  --header-layout: logo-left;
  --header-grid-columns: auto 1fr auto;
  --header-grid-areas: "brand nav tools";
  --brand-justify: start;
  --tools-justify: end;
  --mobile-header-layout: logo-left;
  --mobile-header-grid-columns: auto 1fr auto;
  --mobile-header-grid-areas: "brand . tools";
  --mobile-brand-justify: start;
  --mobile-tools-justify: end;
  --nav-position: center;
  --nav-font-size: 1rem;
  --nav-gap: 0.22rem;
  --nav-item-padding-y: 0.58rem;
  --nav-item-padding-x: 0.78rem;
  --menu-panel-width: min(92vw, 420px);

  /* Cartes */
  --card-radius: 28px;
}

/* Fond image optionnel */
body {
  background:
    linear-gradient(var(--page-bg-overlay), var(--page-bg-overlay)),
    var(--page-bg-image),
    var(--white);
  background-size: auto, var(--page-bg-size), auto;
  background-position: center, var(--page-bg-position), center;
  background-attachment: scroll, var(--page-bg-attachment), scroll;
}

/* Surfaces avec transparence réglable */
.site-header {
  min-height: var(--header-height);
  background: rgba(255, 255, 255, var(--header-alpha));
}

.header-shell {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: var(--header-grid-columns);
  grid-template-areas: var(--header-grid-areas);
  align-items: center;
  gap: clamp(1rem, 2vw, 1.6rem);
}

.brand {
  grid-area: brand;
  justify-self: var(--brand-justify);
}

.header-tools {
  grid-area: tools;
  justify-self: var(--tools-justify);
}

.brand-logo {
  width: min(var(--logo-width), 42vw);
  border-radius: var(--logo-radius);
}

.nav {
  grid-area: nav;
  grid-column: auto;
  gap: var(--nav-gap);
  justify-self: var(--nav-position);
}

.nav a {
  font-size: var(--nav-font-size);
  padding: var(--nav-item-padding-y) var(--nav-item-padding-x);
}

.feature,
.cards article,
.contact-card,
.contact-form,
.hero-card,
.logo-grid img,
.page-row,
.panel-like {
  background: rgba(255, 255, 255, var(--card-alpha));
  border-radius: var(--card-radius);
}

.hero-card img,
.split > img,
.cards img {
  opacity: var(--hero-image-opacity);
}

/* Menu mobile */
@media (max-width: 1160px) {
  .header-shell {
    grid-template-columns: var(--mobile-header-grid-columns);
    grid-template-areas: var(--mobile-header-grid-areas);
  }

  .brand {
    justify-self: var(--mobile-brand-justify);
  }

  .header-tools {
    justify-self: var(--mobile-tools-justify);
  }

  .nav {
    grid-area: auto;
  }
}

@media (max-width: 940px) {
  .nav {
    width: var(--menu-panel-width);
    max-width: calc(100vw - 2rem);
    justify-self: center;
  }

  .menu-toggle {
    min-width: 58px;
    min-height: 58px;
  }
}

/* Classes utiles pour colorer ponctuellement un texte */
.text-blue {
  color: var(--blue-950) !important;
}

.text-ochre {
  color: var(--ochre-700) !important;
}

.text-muted {
  color: var(--muted) !important;
}

.text-white {
  color: var(--white) !important;
}

.bg-blue {
  background: var(--blue-950) !important;
  color: var(--white) !important;
}

.bg-ochre {
  background: var(--ochre-700) !important;
  color: var(--white) !important;
}

.bg-soft {
  background: var(--page) !important;
}

/* Correction mobile : cards en colonne */
@media (max-width: 900px) {
  .feature-grid,
  .cards,
  .cards-section .cards {
    gap: 1.25rem !important;
  }

  .feature,
  .cards article {
    width: min(100%, 520px);
    margin-inline: auto;
    padding: 1.5rem;
  }

  .feature h2,
  .cards h2,
  .cards h3,
  .feature p,
  .cards p,
  .feature a,
  .cards a {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
}

@media (max-width: 680px) {
  .feature-grid,
  .cards {
    grid-auto-flow: row !important;
    grid-template-columns: 1fr !important;
  }
}

/* --------------------------------------------------------------------------
   Patch accueil : carrousel photo hero
   -------------------------------------------------------------------------- */
.hero-carousel {
  overflow: hidden;
  isolation: isolate;
}

.hero-carousel .carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 10px);
  background: #fff;
}

.hero-carousel .carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 420ms ease, transform 720ms ease;
  pointer-events: none;
}

.hero-carousel .carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

.hero-carousel .carousel-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(31, 64, 68, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--blue-950, #143f43);
  box-shadow: 0 12px 34px rgba(20, 63, 67, 0.16);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  translate: 0 -50%;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hero-carousel .carousel-btn:hover,
.hero-carousel .carousel-btn:focus-visible {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 16px 42px rgba(20, 63, 67, 0.22);
}

.hero-carousel .carousel-prev {
  left: 1.05rem;
}

.hero-carousel .carousel-next {
  right: 1.05rem;
}

.hero-carousel .carousel-dots {
  position: absolute;
  z-index: 5;
  right: 1.25rem;
  bottom: 4.95rem;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.38rem 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(20, 63, 67, 0.12);
}

.hero-carousel .carousel-dots button {
  width: 0.58rem;
  height: 0.58rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 64, 68, 0.28);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.hero-carousel .carousel-dots button.is-active {
  width: 1.45rem;
  background: var(--blue-950, #143f43);
}

@media (max-width: 760px) {
  .hero-carousel .carousel-btn {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 1.7rem;
  }

  .hero-carousel .carousel-prev {
    left: 0.75rem;
  }

  .hero-carousel .carousel-next {
    right: 0.75rem;
  }

  .hero-carousel .carousel-dots {
    right: 50%;
    bottom: 4.6rem;
    transform: translateX(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel .carousel-slide {
    transition: none;
    transform: none;
  }
}
