/* Entete publique unifiee : seul le degrade change selon la classe de page. */
.mto-page-subheader {
  position: relative;
  z-index: 1200;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
}

body.mto-page-avec-sous-entete .mto-conteneur-sans-entete-principale {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.mto-page-avec-sous-entete {
  --mto-espace-apres-subheader: 0.5rem;
}

body:not(.page-administration) wa-page::part(main-content) {
  padding-block-start: 0 !important;
  gap: 0 !important;
}

body:not(.page-administration):not(.mto-page-avec-sous-entete) #main-content {
  padding-block-start: 0 !important;
  margin-block-start: 0 !important;
}

body.mto-page-avec-sous-entete:not(.page-administration) #main-content {
  padding-block-start: 0 !important;
  margin-block-start: var(--mto-espace-apres-subheader) !important;
}

body:not(.page-administration) #main-content > :first-child {
  margin-block-start: 0 !important;
}

body:not(.page-administration) #main-content > :has(> .mto-entete-public:first-child) {
  padding-block-start: 0 !important;
  margin-block-start: 0 !important;
}

/* Fallback explicite: la page blog applique un padding top sur son conteneur. */
body.page-articles .mto-articles {
  padding-top: 0 !important;
}

body:not(.page-administration) #main-content:has(> .mto-entete-public:first-child) {
  padding-block-start: 0 !important;
  margin-block-start: 0 !important;
}

@media (max-width: 920px) {
  body:not(.page-administration) {
    --mto-gouttiere-mobile-site: 15px;
  }

  body:not(.page-administration) wa-page::part(main-content) {
    padding-inline: 0 !important;
  }

  body:not(.page-administration) #main-content {
    width: 100% !important;
    max-width: none !important;
    padding-inline: var(--mto-gouttiere-mobile-site) !important;
  }

  body:not(.page-administration) #main-content > :is(
    .mto-articles,
    .mto-article-page,
    .mto-information-page,
    .mto-annuaire-page,
    .mto-cal-page,
    .mto-env-page,
    .mto-bus,
    .mto-contact-page,
    .mto-confidentialite,
    .mto-page-auteur
  ) {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 0 !important;
  }

  body:not(.page-administration) .mto-contact-page {
    width: 100% !important;
  }
}

.mto-entete-public {
  --mto-entete-degrade-1: #0f4f47;
  --mto-entete-degrade-2: #1f756a;
  --mto-entete-degrade-3: #2aa68a;
  --mto-entete-accent-1: rgb(255 205 120 / 34%);
  --mto-entete-accent-2: rgb(116 224 193 / 32%);
  --mto-entete-texte-secondaire: rgb(255 255 255 / 97%);
  --mto-entete-surtitre: rgb(255 255 255 / 96%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 20%);
  --mto-entete-chip-fond: rgb(255 255 255 / 18%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 42%);
  --mto-entete-ombre: rgb(18 63 57 / 20%);
  position: relative;
  overflow: hidden;
  display: flex;
  width: auto;
  min-width: 0;
  box-sizing: border-box;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: flex-end;
  justify-content: space-between;
  padding: clamp(1.2rem, 2.2vw, 1.7rem) clamp(1.25rem, 3.3vw, 2.4rem);
  margin: 0 calc(50% - 50vw) clamp(1.35rem, 3vw, 2rem);
  border-radius: 0;
  color: var(--mto-color-blanc);
  box-shadow: 0 0.85rem 2rem var(--mto-entete-ombre);
  background:
    radial-gradient(circle at 78% 15%, var(--mto-entete-accent-1), transparent 30%),
    radial-gradient(circle at 42% 80%, var(--mto-entete-accent-2), transparent 34%),
    linear-gradient(135deg, var(--mto-entete-degrade-1), var(--mto-entete-degrade-2) 62%, var(--mto-entete-degrade-3));
}

.mto-entete-public > div:first-child {
  max-width: 66rem;
}

body.page-article .mto-entete-public > div:first-child {
  width: 100%;
  max-width: none;
}

body.page-article .mto-entete-public h1 {
  width: 100%;
  max-width: none;
  text-wrap: unset;
  overflow-wrap: anywhere;
}

body.page-agenda-evenement .mto-entete-public > div:first-child {
  width: 100%;
  max-width: none;
}

body.page-agenda-evenement .mto-entete-public h1 {
  width: 100%;
  max-width: none;
  text-wrap: unset;
  overflow-wrap: anywhere;
}

body.page-information .mto-entete-public > div:first-child {
  width: 100%;
  max-width: none;
}

body.page-information .mto-entete-public h1 {
  width: 100%;
  max-width: none;
  text-wrap: unset;
  overflow-wrap: anywhere;
}

.mto-entete-public h1 {
  margin: 0.22rem 0 0.45rem;
  color: var(--mto-color-blanc);
  font-size: clamp(1.95rem, 4.1vw, 3.25rem);
  line-height: 1.06;
  text-wrap: balance;
  text-shadow: 0 0.14rem 0.5rem var(--mto-entete-texte-ombre);
}

.mto-entete-public p:last-child {
  margin: 0;
  color: var(--mto-entete-texte-secondaire);
  line-height: 1.52;
  text-wrap: pretty;
  text-shadow: 0 0.08rem 0.45rem var(--mto-entete-texte-ombre);
}

.mto-entete-public .mto-entete-page-standard-surtitre,
.mto-entete-public .mto-accueil-sur-titre,
.mto-entete-public .mto-surtitre {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
  color: var(--mto-entete-surtitre);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0.08rem 0.35rem var(--mto-entete-texte-ombre);
}

.mto-entete-public .mto-entete-page-standard-actions {
  display: grid;
  flex: 0 0 auto;
  gap: 0.55rem;
  justify-items: end;
}

.mto-entete-public .mto-entete-page-standard-actions > span {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.52rem 0.75rem;
  border: 1px solid var(--mto-entete-chip-bordure);
  border-radius: 0.7rem;
  background: var(--mto-entete-chip-fond);
  color: var(--mto-color-blanc);
  font-size: 0.78rem;
  font-weight: 750;
  text-shadow: 0 0.08rem 0.3rem var(--mto-entete-texte-ombre);
}

.mto-entete-public .mto-entete-page-standard-actions strong {
  font-size: 1rem;
}

.mto-entete-public wa-badge::part(base),
.mto-entete-public wa-badge::part(badge) {
  border-color: var(--mto-entete-chip-bordure);
  background: var(--mto-entete-chip-fond);
  color: var(--mto-color-blanc);
  font-weight: 800;
}





body.page-defibrillateurs .mto-entete-public
 {
  --mto-entete-degrade-1: rgb(var(--rose-fonce-rgb));
  --mto-entete-degrade-2: oklch(from var(--mto-entete-degrade-1)calc(l * 1.25) c h);
  --mto-entete-degrade-3: oklch(from var(--mto-entete-degrade-1)calc(l * 1.55) c h);
  --mto-entete-accent-1: oklch(from var(--mto-entete-degrade-1)calc(l * 0.7) c h);
  --mto-entete-accent-2: oklch(from var(--mto-entete-degrade-1)calc(l * 0.6) c h);
  --mto-entete-ombre: oklch(from var(--mto-entete-degrade-1)calc(l * 0.4) c h);
  --mto-entete-chip-fond: rgb(0 0 0 / 15%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 55%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 32%);
}

body.page-confidentialite .mto-entete-public,
body.page-suivi-demande .mto-entete-public,
body.page-espace-adherent .mto-entete-public,
body.page-compte .mto-entete-public {
  --mto-entete-degrade-1: rgb(var(--violet-fonce-rgb));
  --mto-entete-degrade-2: oklch(from var(--mto-entete-degrade-1)calc(l * 1.25) c h);
  --mto-entete-degrade-3: oklch(from var(--mto-entete-degrade-1)calc(l * 1.55) c h);
  --mto-entete-accent-1: oklch(from var(--mto-entete-degrade-1)calc(l * 0.7) c h);
  --mto-entete-accent-2: oklch(from var(--mto-entete-degrade-1)calc(l * 0.6) c h);
  --mto-entete-ombre: oklch(from var(--mto-entete-degrade-1)calc(l * 0.4) c h);
  --mto-entete-chip-fond: rgb(0 0 0 / 15%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 55%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 32%);
}

/* --------------------------------------------------------------------- */
body.page-agenda .mto-entete-public,
body.page-agenda-evenement .mto-entete-public,
body.page-articles .mto-entete-public,
body.page-article .mto-entete-public,
body.page-informations .mto-entete-public,
body.page-information .mto-entete-public,
body.page-auteur .mto-entete-public,
body.page-nos-auteurs .mto-entete-public
{
  --mto-entete-degrade-1: rgb(var(--mto-color-menu-actualite-base));
  --mto-entete-degrade-2: oklch(from var(--mto-entete-degrade-1)calc(l * 1.25) c h);
  --mto-entete-degrade-3: oklch(from var(--mto-entete-degrade-1)calc(l * 1.55) c h);
  --mto-entete-accent-1: oklch(from var(--mto-entete-degrade-1)calc(l * 0.7) c h);
  --mto-entete-accent-2: oklch(from var(--mto-entete-degrade-1)calc(l * 0.6) c h);
  --mto-entete-ombre: oklch(from var(--mto-entete-degrade-1)calc(l * 0.4) c h);
  --mto-entete-chip-fond: rgb(0 0 0 / 15%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 55%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 32%);
}

body.page-services .mto-entete-public,
body.page-service .mto-entete-public,
body.page-service-categorie .mto-entete-public,
body.page-annuaire .mto-entete-public,
body.page-annuaire-entree .mto-entete-public,
body.page-bus .mto-entete-public,
body.page-horaires-ter .mto-entete-public,
body.page-bornes-recharge .mto-entete-public,
body.page-prix-carburants .mto-entete-public {
  --mto-entete-degrade-1: rgb(var(--mto-color-menu-vie-pratique-base));
  --mto-entete-degrade-2: oklch(from var(--mto-entete-degrade-1)calc(l * 1.25) c h);
  --mto-entete-degrade-3: oklch(from var(--mto-entete-degrade-1)calc(l * 1.55) c h);
  --mto-entete-accent-1: oklch(from var(--mto-entete-degrade-1)calc(l * 0.7) c h);
  --mto-entete-accent-2: oklch(from var(--mto-entete-degrade-1)calc(l * 0.6) c h);
  --mto-entete-ombre: oklch(from var(--mto-entete-degrade-1)calc(l * 0.4) c h);
  --mto-entete-chip-fond: rgb(0 0 0 / 15%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 55%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 32%);
}

body.page-contact .mto-entete-public,
body.page-contact .mto-entete-public,
body.page-vacances-scolaires .mto-entete-public,
body.page-environnement .mto-entete-public,
body.page-faq .mto-entete-public,
body.page-faq-entree .mto-entete-public
{
  --mto-entete-degrade-1: rgb(var(--mto-color-menu-infos-utiles-base));
  --mto-entete-degrade-2: oklch(from var(--mto-entete-degrade-1)calc(l * 1.25) c h);
  --mto-entete-degrade-3: oklch(from var(--mto-entete-degrade-1)calc(l * 1.55) c h);
  --mto-entete-accent-1: oklch(from var(--mto-entete-degrade-1)calc(l * 0.7) c h);
  --mto-entete-accent-2: oklch(from var(--mto-entete-degrade-1)calc(l * 0.6) c h);
  --mto-entete-ombre: oklch(from var(--mto-entete-degrade-1)calc(l * 0.4) c h);
  --mto-entete-chip-fond: rgb(0 0 0 / 15%);
  --mto-entete-chip-bordure: rgb(255 255 255 / 55%);
  --mto-entete-texte-ombre: rgb(0 0 0 / 32%);
}

/* --------------------------------------------------------------------- */

@media (max-width: 800px) {
  .mto-entete-public {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem;
    margin-bottom: 1.1rem;
  }

  .mto-entete-public h1 {
    font-size: clamp(1.7rem, 8.1vw, 2.35rem);
    line-height: 1.1;
  }

  .mto-entete-public .mto-entete-page-standard-surtitre,
  .mto-entete-public .mto-accueil-sur-titre,
  .mto-entete-public .mto-surtitre {
    font-size: 0.73rem;
    letter-spacing: 0.055em;
  }

  .mto-entete-public p:last-child {
    font-size: 0.96rem;
  }

  .mto-entete-public .mto-entete-page-standard-actions {
    width: 100%;
    justify-items: stretch;
  }

  .mto-entete-public .mto-entete-page-standard-actions > span {
    justify-content: center;
  }
}
