/* ========================================================================== 
 * Pépites Découvertes — layout dédié « À faire autour d’ici » — V10-C3
 * Header propre à la rubrique : solide, lisible, sans volets translucides.
 * Wrapper de référence : 1350 px.
 * ========================================================================== */
body.a-faire-layout {
  --af-site-shell: min(1350px, calc(100% - 48px));
  margin: 0;
  background: #fbfaf7;
}

body.a-faire-layout .a-faire-main {
  margin: 0;
  padding-top: 0;
}

/* --------------------------------------------------------------------------
 * HEADER DÉDIÉ
 * -------------------------------------------------------------------------- */
.afh,
.afh * {
  box-sizing: border-box;
}

.afh {
  position: relative;
  z-index: 120;
  width: 100%;
  color: #171717;
  background: #fffdf9;
  border-bottom: 1px solid #e7e2da;
}

.afh__inner {
  width: var(--af-site-shell);
  min-height: 66px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.afh__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.afh__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: #171717;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.035em;
  line-height: 1;
}

.afh__brand strong {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.afh__brand > span {
  color: #ef5a38;
  font-size: .92rem;
  font-weight: 900;
}

.afh__brand em {
  color: #55534f;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: .82rem;
  font-style: normal;
  font-weight: 520;
  text-transform: uppercase;
}

.afh__rule {
  width: 1px;
  height: 26px;
  background: #ddd8cf;
}

.afh__section {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5a5a55;
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
}

.afh__section:hover,
.afh__section:focus-visible {
  color: #171717;
}

.afh__section-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef5a38;
  box-shadow: 0 0 0 4px #fde9e2;
}

.afh__nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.afh__link {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 8px;
  color: #242421;
  background: transparent;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
}

.afh__link:hover,
.afh__link:focus-visible,
.afh__menu[open] > .afh__link {
  color: #171717;
  background: #f3f0ea;
  outline: none;
}

.afh__link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.afh__menu {
  position: relative;
}

.afh__menu > summary {
  list-style: none;
}

.afh__menu > summary::-webkit-details-marker {
  display: none;
}

.afh__menu[open] > summary svg {
  transform: rotate(180deg);
}

.afh__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(420px, 82vw);
  overflow: hidden;
  border: 1px solid #ded8ce;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(29, 27, 22, .15);
}

.afh__dropdown-head {
  padding: 17px 19px 15px;
  color: #fff;
  background: #1f2f29;
}

.afh__dropdown-head span {
  display: block;
  margin-bottom: 4px;
  color: #c7d8cf;
  font-size: .57rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.afh__dropdown-head strong {
  font-family: "Lora", Georgia, serif;
  font-size: 1.18rem;
}

.afh__dropdown-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px;
  background: #fff;
}

.afh__dropdown-links a {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 11px;
  border-radius: 8px;
  color: #222;
  font-size: .72rem;
  font-weight: 690;
  line-height: 1.35;
  text-decoration: none;
}

.afh__dropdown-links a:hover,
.afh__dropdown-links a:focus-visible {
  color: #c9472c;
  background: #fbf2ee;
  outline: none;
}

.afh__dropdown-links svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.afh__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.afh__theme,
.afh__burger {
  border: 1px solid #ded8ce;
  color: #20201d;
  background: #fff;
}

.afh__theme {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.afh__theme:hover,
.afh__theme:focus-visible {
  border-color: #bfb8ad;
  background: #f5f2ec;
  outline: none;
}

.afh__theme svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.afh__burger {
  display: none;
  width: 40px;
  height: 38px;
  padding: 8px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.afh__burger span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 99px;
  background: currentColor;
}

/* --------------------------------------------------------------------------
 * RESPONSIVE
 * -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .afh__inner {
    gap: 18px;
  }

  .afh__section {
    display: none;
  }

  .afh__rule {
    display: none;
  }
}

@media (max-width: 900px) {
  body.a-faire-layout {
    --af-site-shell: min(100% - 28px, 1350px);
  }

  .afh__inner {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .afh__brand strong {
    font-size: .94rem;
  }

  .afh__brand em {
    font-size: .74rem;
  }

  .afh__burger {
    display: block;
    grid-column: 2;
  }

  .afh__actions {
    grid-column: 3;
  }

  .afh__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 10px 14px 14px;
    border-top: 1px solid #e7e2da;
    border-bottom: 1px solid #ded8ce;
    background: #fffdf9;
    box-shadow: 0 18px 36px rgba(29, 27, 22, .1);
  }

  .afh.is-open .afh__nav {
    display: grid;
    gap: 4px;
  }

  .afh__link {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
    padding-inline: 12px;
  }

  .afh__dropdown {
    position: static;
    width: 100%;
    margin: 4px 0 8px;
    border-radius: 10px;
    box-shadow: none;
  }

  .afh__dropdown-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body.a-faire-layout {
    --af-site-shell: min(100% - 20px, 1350px);
  }

  .afh__brand {
    gap: 5px;
  }

  .afh__brand strong {
    font-size: .86rem;
  }

  .afh__brand em {
    font-size: .68rem;
  }
}

/* --------------------------------------------------------------------------
 * DARK MODE — toujours opaque et lisible
 * -------------------------------------------------------------------------- */
html[data-theme="dark"] body.a-faire-layout,
html.theme-dark body.a-faire-layout {
  background: #111210;
}

html[data-theme="dark"] .afh,
html.theme-dark .afh,
html[data-theme="dark"] .afh__nav,
html.theme-dark .afh__nav {
  color: #f5f2eb;
  background: #151714;
  border-color: #30322e;
}

html[data-theme="dark"] .afh__brand,
html.theme-dark .afh__brand,
html[data-theme="dark"] .afh__link,
html.theme-dark .afh__link,
html[data-theme="dark"] .afh__theme,
html.theme-dark .afh__theme,
html[data-theme="dark"] .afh__burger,
html.theme-dark .afh__burger {
  color: #f5f2eb;
}

html[data-theme="dark"] .afh__brand em,
html.theme-dark .afh__brand em,
html[data-theme="dark"] .afh__section,
html.theme-dark .afh__section {
  color: #bbb8b1;
}

html[data-theme="dark"] .afh__theme,
html.theme-dark .afh__theme,
html[data-theme="dark"] .afh__burger,
html.theme-dark .afh__burger {
  background: #1c1e1a;
  border-color: #383a35;
}

html[data-theme="dark"] .afh__link:hover,
html.theme-dark .afh__link:hover,
html[data-theme="dark"] .afh__menu[open] > .afh__link,
html.theme-dark .afh__menu[open] > .afh__link {
  background: #232620;
}

html[data-theme="dark"] .afh__dropdown,
html.theme-dark .afh__dropdown,
html[data-theme="dark"] .afh__dropdown-links,
html.theme-dark .afh__dropdown-links {
  background: #191b18;
  border-color: #383a35;
}

html[data-theme="dark"] .afh__dropdown-links a,
html.theme-dark .afh__dropdown-links a {
  color: #f1eee7;
}

html[data-theme="dark"] .afh__dropdown-links a:hover,
html.theme-dark .afh__dropdown-links a:hover {
  background: #26241f;
}
