/* Navigation principale du site (site-tools/site-nav.ts), la même sur toutes les pages : accueil, blog,
   guide des outils, outils gratuits, communauté. Autonome (préfixe sx-, sélecteurs à deux classes) pour
   tenir quelles que soient les feuilles de style de la page. Menus en <details>, fermés par site-nav.js. */

/* L'en-tête s'élargit pour que les menus tiennent sur une ligne. */
.site-header .header-inner:has(> .sx-nav) { max-width: 1400px; }
.site-header.wrap:has(> .sx-nav) { width: min(1400px, 100% - 40px); max-width: none; }
.site-header .wrap:has(> .sx-nav) { max-width: 1440px; padding-inline: 32px; gap: 16px; }

.sx-nav.sx-nav {
  --sx-ink: #2a2326;
  --sx-ink-soft: #4a3f44;
  --sx-muted: #6a5e63;
  --sx-wine: #702f48;
  --sx-wine-dark: #542036;
  --sx-wine-soft: #f6ecf0;
  --sx-rose: #bc4365;
  --sx-sage-soft: #e8efe3;
  --sx-sage: #5f7553;
  --sx-sage-dark: #3f5238;
  --sx-line: #e9e1da;
  --sx-paper: #fcfaf7;
  --sx-linen: #f6f0e9;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: 20px;
  font-size: 15px;
  line-height: 1.3;
}
.sx-nav .sx-menus { display: flex; align-items: center; gap: 2px; min-width: 0; }
.sx-nav .sx-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.sx-nav .sx-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--sx-line); }
.sx-nav .sx-icon { flex-shrink: 0; }

/* Liens et boutons des menus */
.sx-nav .sx-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sx-ink-soft);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.sx-nav .sx-link::-webkit-details-marker { display: none; }
.sx-nav .sx-link:hover { background: var(--sx-wine-soft); color: var(--sx-wine); }
.sx-nav .sx-link.is-current { color: var(--sx-wine); font-weight: 600; }
.sx-nav .sx-link:focus-visible,
.sx-nav .sx-entry:focus-visible,
.sx-nav .sx-tool:focus-visible,
.sx-nav .sx-cta:focus-visible { outline: 3px solid #b8651b; outline-offset: 2px; }
.sx-nav .sx-chevron { flex-shrink: 0; transition: transform 0.2s ease; }
.sx-nav .sx-menu[open] > .sx-link { background: var(--sx-wine-soft); color: var(--sx-wine); }
.sx-nav .sx-menu[open] > .sx-link .sx-chevron { transform: rotate(180deg); }

/* Les outils gratuits sont mis en avant : le vert des outils gratuits du site. */
.sx-nav .sx-menu-outils-gratuits > .sx-link { background: var(--sx-sage-soft); color: var(--sx-sage-dark); font-weight: 600; }
.sx-nav .sx-menu-outils-gratuits > .sx-link:hover { background: #dce8d4; color: var(--sx-sage-dark); }
.sx-nav .sx-menu-outils-gratuits[open] > .sx-link { background: var(--sx-sage-soft); color: var(--sx-sage-dark); box-shadow: inset 0 0 0 1.5px var(--sx-sage); }

.sx-nav .sx-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--sx-wine);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 10px 20px -12px rgb(84 32 54 / 80%);
  transition: background-color 0.2s ease;
}
.sx-nav .sx-cta:hover { background: var(--sx-wine-dark); color: #fff; }
.sx-nav .sx-cta-small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* Panneaux */
.sx-nav .sx-menu { position: relative; }
.sx-nav .sx-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 0;
  width: 360px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid var(--sx-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 40px 80px -40px rgb(61 23 39 / 45%), 0 4px 14px rgb(42 35 38 / 6%);
  color: var(--sx-ink);
  white-space: normal;
  text-align: left;
}
.sx-nav .sx-panel-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.sx-nav .sx-panel-wide { width: min(980px, calc(100vw - 48px)); }
.sx-nav .sx-menu-atelier > .sx-panel { left: -12px; }
.sx-nav .sx-menu-outils-gratuits > .sx-panel { left: -200px; width: min(1100px, calc(100vw - 48px)); }
.sx-nav .sx-menu-ressources > .sx-panel { left: auto; right: -80px; }

.sx-nav .sx-heading {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sx-muted);
}
.sx-nav .sx-columns { display: grid; gap: 28px; padding: 24px 28px 20px; }
.sx-nav .sx-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-nav .sx-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 0; }
.sx-nav .sx-column { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.sx-nav .sx-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 12px;
  color: var(--sx-ink);
  text-decoration: none;
}
.sx-nav .sx-panel-list .sx-entry { margin: 0; }
.sx-nav .sx-entry:hover { background: var(--sx-paper); color: var(--sx-ink); }
.sx-nav .sx-entry-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--sx-wine-soft);
  color: var(--sx-wine);
}
.sx-nav .sx-menu-communaute .sx-entry-icon { background: #fbeef1; color: #a63a5a; }
.sx-nav .sx-menu-ressources .sx-entry-icon { background: var(--sx-linen); color: var(--sx-wine); }
.sx-nav .sx-entry-text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; min-width: 0; }
.sx-nav .sx-entry-name { font-size: 15px; font-weight: 600; }
.sx-nav .sx-entry-hint { font-size: 13px; line-height: 1.4; color: var(--sx-muted); }
.sx-nav .sx-entry-plain { align-items: center; font-weight: 600; margin: 0; }

/* Outils gratuits : la photo en grille en vedette, puis les outils par famille. */
.sx-nav .sx-tools-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding: 24px 28px 20px; }
.sx-nav .sx-feature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  background-color: var(--sx-sage-soft);
  background-image: radial-gradient(circle, rgb(79 100 70 / 16%) 1.2px, transparent 1.7px);
  background-size: 14px 14px;
  color: var(--sx-ink);
  text-decoration: none;
}
.sx-nav .sx-feature .sx-heading { margin: 0; color: #4f6446; }
.sx-nav .sx-feature-title { font-family: 'Playfair Display', Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.15; }
.sx-nav .sx-feature-title em { color: var(--sx-wine); text-decoration: underline dashed #e8879b 2px; text-underline-offset: 6px; }
.sx-nav .sx-feature-text { font-size: 14px; line-height: 1.55; color: var(--sx-ink-soft); }
.sx-nav .sx-feature .sx-cta { align-self: flex-start; margin-top: 4px; }
.sx-nav .sx-feature:hover .sx-cta { background: var(--sx-wine-dark); }
.sx-nav .sx-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 3px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  color: var(--sx-ink);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}
.sx-nav .sx-tool:hover { background: var(--sx-paper); color: var(--sx-wine); }
.sx-nav .sx-tool-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--sx-sage-soft);
  color: #4f6446;
}
.sx-nav .sx-tool-icon svg { width: 16px; height: 16px; }

.sx-nav .sx-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 14px 28px;
  border-top: 1px solid var(--sx-line);
  border-radius: 0 0 20px 20px;
  background: var(--sx-linen);
}
.sx-nav .sx-strip p { margin: 0 auto 0 0; font-size: 14px; color: var(--sx-ink-soft); }
.sx-nav .sx-strip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--sx-wine);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.sx-nav .sx-strip-link:hover { text-decoration: underline; }

/* Fenêtres étroites : un seul menu */
.sx-nav .sx-compact { display: none; }
.sx-nav .sx-compact-title { margin: 18px 4px 8px; font-family: 'Playfair Display', Georgia, serif; font-size: 19px; font-weight: 600; color: var(--sx-ink); }
.sx-nav .sx-panel-compact { display: flex; flex-direction: column; padding: 14px; }
.sx-nav .sx-panel-compact .sx-panel { position: static; width: auto; max-height: none; overflow: visible; box-shadow: none; border-radius: 16px; }
.sx-nav .sx-panel-compact .sx-columns,
.sx-nav .sx-panel-compact .sx-tools-layout { grid-template-columns: 1fr 1fr; padding: 16px; gap: 18px; }
.sx-nav .sx-panel-compact .sx-feature { grid-column: 1 / -1; }
.sx-nav .sx-panel-compact .sx-columns-4 { grid-column: 1 / -1; padding: 0; }
.sx-nav .sx-panel-compact .sx-strip { padding: 12px 16px; border-radius: 0 0 16px 16px; }
.sx-nav .sx-panel-compact > .sx-cta { align-self: stretch; }
.sx-nav .sx-compact-login { display: none; }

@media (max-width: 1280px) {
  .sx-nav .sx-menu-atelier > .sx-link .sx-icon,
  .sx-nav .sx-menu-communaute > .sx-link .sx-icon { display: none; }
  .sx-nav .sx-link { padding: 0 10px; }
}
@media (max-width: 1220px) {
  .sx-nav .sx-pricing,
  .sx-nav .sx-menus .sx-sep { display: none; }
}
@media (max-width: 1150px) {
  .sx-nav .sx-menus { display: none; }
  .sx-nav .sx-compact { display: block; margin-left: auto; }
  .sx-nav .sx-actions { margin-left: 0; }
  .sx-nav .sx-compact > .sx-panel {
    position: fixed;
    top: 76px;
    left: auto;
    right: 12px;
    width: min(640px, calc(100vw - 24px));
    max-height: calc(100vh - 92px);
  }
}
@media (max-width: 720px) {
  .sx-nav.sx-nav { margin-left: 8px; gap: 4px; }
  .sx-nav .sx-actions .sx-cta { display: none; }
  .sx-nav .sx-panel-compact .sx-columns,
  .sx-nav .sx-panel-compact .sx-tools-layout { grid-template-columns: 1fr; }
  .sx-nav .sx-compact > .sx-panel { top: 68px; right: 8px; width: calc(100vw - 16px); }
}
@media (max-width: 480px) {
  .sx-nav .sx-login { display: none; }
  .sx-nav .sx-panel-compact .sx-compact-login { display: flex; justify-content: center; margin-top: 6px; }
}
@media print {
  .sx-nav { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-nav .sx-link,
  .sx-nav .sx-chevron,
  .sx-nav .sx-cta { transition: none; }
}
