/* Menu du site, chargé par includes/header.php (version datée : pas de cache périmé).
   Classes yh-* : rien à voir avec l'ancien menu de stylesheet.css ni avec Bootstrap. */
.yh {
  --yh-ink: #1d2230;
  --yh-muted: #5d6475;
  --yh-line: #e6e4de;
  --yh-paper: rgba(250, 248, 244, .88);
  --yh-accent: #50599C;
  --yh-soft: #eef0f8;
  --yh-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html { scroll-padding-top: 76px; }

/* Barre (header.yh l'emporte sur header {…} de stylesheet.css) */
header.yh { position: sticky; top: 0; z-index: 1030; height: auto; min-height: 0; background: var(--yh-paper); border-bottom: 1px solid var(--yh-line); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); transition: box-shadow .2s; }
header.yh::after { content: none; }
header.yh.is-scrolled { box-shadow: 0 6px 24px rgba(29, 34, 48, .08); }
.yh a, .yh button, .yh span, .yh strong, .yh small, .yh p { font-family: var(--yh-font); }
.yh ul { list-style: none; margin: 0; padding: 0; }
.yh a, .yh a:hover, .yh a:focus { text-decoration: none; }
.yh-bar { display: flex; align-items: center; gap: 24px; max-width: 1240px; height: 64px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

.yh-brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--yh-ink); }
.yh-brand:hover { color: var(--yh-ink); }
.yh-brand img { width: 40px; height: 40px; border-radius: 10px; }
.yh-brand span { font-size: 19px; font-weight: 700; letter-spacing: .04em; }
.yh-brand em { margin-left: 2px; font-style: normal; font-weight: 500; letter-spacing: 0; color: var(--yh-accent); }

.yh-nav { display: flex; align-items: center; flex: 1; gap: 16px; }
.yh-links { display: flex; align-items: center; gap: 2px; }
.yh-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Liens et boutons du menu */
.yh-link { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--yh-muted); font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.yh-link > i:first-child { font-size: 14px; opacity: .75; }
.yh-link:hover, .yh-link:focus-visible, .yh-drop.is-open > .yh-link { background: var(--yh-soft); color: var(--yh-ink); }
.yh-link.is-active { color: var(--yh-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--yh-accent); border-radius: 10px 10px 2px 2px; }
.yh-link.is-active > i:first-child { color: var(--yh-accent); opacity: 1; }
.yh-link:focus { outline: none; }
.yh-link:focus-visible, .yh-cta:focus-visible, .yh-burger:focus-visible { outline: 2px solid var(--yh-accent); outline-offset: 2px; }
.yh-chev { font-size: 10px; opacity: .6; transition: transform .2s; }
.yh-drop.is-open .yh-chev { transform: rotate(180deg); }

.yh-cta { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--yh-ink); color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .15s, transform .15s; }
.yh-cta:hover, .yh-cta:focus { background: var(--yh-accent); color: #fff; }
.yh-cta i { font-size: 12px; transition: transform .2s; }
.yh-cta:hover i { transform: translateX(3px); }

/* Sous-menus */
.yh-drop { position: relative; }
.yh-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; padding: 8px; background: #fff; border: 1px solid var(--yh-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(29, 34, 48, .14); box-sizing: border-box; }
.yh-drop-right .yh-panel { left: auto; right: 0; }
.yh-panel-2 { min-width: 480px; grid-template-columns: 1fr 1fr; gap: 4px; }
.yh-drop.is-open .yh-panel { display: block; animation: yh-in .16s ease-out; }
.yh-drop.is-open .yh-panel-2 { display: grid; }
@keyframes yh-in { from { opacity: 0; transform: translateY(-4px); } }
.yh-panel a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--yh-ink); }
.yh-panel a:hover, .yh-panel a:focus { background: var(--yh-soft); color: var(--yh-ink); }
.yh-panel a > i { width: 18px; margin-top: 2px; text-align: center; color: var(--yh-accent); font-size: 15px; }
.yh-panel strong { display: block; font-size: 14px; font-weight: 600; }
.yh-panel small { display: block; margin-top: 2px; font-size: 13px; color: var(--yh-muted); }
.yh-panel hr { margin: 6px 8px; border: 0; border-top: 1px solid var(--yh-line); }
.yh-group { margin: 6px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--yh-muted); }

/* Bouton du menu mobile */
.yh-burger { display: none; position: relative; width: 42px; height: 42px; margin-left: auto; padding: 0; border: 1px solid var(--yh-line); border-radius: 12px; background: #fff; cursor: pointer; }
.yh-burger span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--yh-ink); transition: transform .2s, opacity .2s; }
.yh-burger span:nth-child(1) { top: 14px; }
.yh-burger span:nth-child(2) { top: 20px; }
.yh-burger span:nth-child(3) { top: 26px; }
.yh.is-open .yh-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.yh.is-open .yh-burger span:nth-child(2) { opacity: 0; }
.yh.is-open .yh-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile et tablette : panneau sous la barre */
@media (max-width: 960px) {
  .yh-bar { padding: 0 16px; }
  .yh-burger { display: block; }
  .yh-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 20px; background: #fbfaf7; border-bottom: 1px solid var(--yh-line); box-shadow: 0 16px 32px rgba(29, 34, 48, .12); box-sizing: border-box; }
  .yh.is-open .yh-nav { display: flex; animation: yh-in .16s ease-out; }
  .yh-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .yh-link { width: 100%; height: 48px; font-size: 16px; }
  .yh-link.is-active { box-shadow: inset 3px 0 0 var(--yh-accent); border-radius: 2px 10px 10px 2px; background: var(--yh-soft); }
  .yh-chev { margin-left: auto; }
  .yh-panel, .yh-panel-2 { position: static; min-width: 0; margin: 2px 0 6px; padding: 4px; border: 0; border-radius: 12px; box-shadow: none; background: #fff; }
  .yh-drop.is-open .yh-panel-2 { grid-template-columns: 1fr; }
  .yh-actions { flex-direction: column; align-items: stretch; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--yh-line); }
  .yh-cta { justify-content: center; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .yh *, .yh { animation: none !important; transition: none !important; }
}
.yh-bientot { margin-left: 2px; padding: 2px 7px; font-size: 11px; font-weight: 600; line-height: 1.4; color: #c2410c; background: #fff1e6; border-radius: 999px; }
/* Écrans moyens : « Créer un compte » et les onglets secondaires (APIs, outils, Poèmes) réduits
   à leur icône pour que le menu tienne sur une ligne */
@media (min-width: 961px) and (max-width: 1279px) {
  .yh-inscription .yh-txt, .yh-inscription .yh-bientot, .yh-compact .yh-txt { display: none; }
  .yh-links .yh-link, .yh-actions .yh-link { padding: 0 9px; }
}
.yh-pseudo { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
