/* Entête et méga-menu (inc/header-nav.php, js/header-nav.js) */

#cxh {
  --cxh-bar: #121212;
  --cxh-gold: #b0976d;
  --cxh-gold-text: #866a40;
  --cxh-wine: #7b1e2b;
  --cxh-paper: #fbf9f5;
  --cxh-cream: #f3ede3;
  --cxh-line: #e8e0d3;
  --cxh-ink: #2a2522;
  --cxh-muted: #6b635b;
  --cxh-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --cxh-sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  position: relative;
  z-index: 10000;
  background: var(--cxh-bar);
  border-bottom: 1px solid rgba(176, 151, 109, .35);
  font-family: var(--cxh-sans);
}
#cxh ul { list-style: none; margin: 0; padding: 0; }
#cxh li { margin: 0 !important; padding: 0; line-height: inherit; }
#cxh p { margin: 0; }
#cxh .linkobs, #cxh a { cursor: pointer; text-decoration: none; }
#cxh :focus-visible { outline: 2px solid var(--cxh-gold); outline-offset: 2px; }

.cxh-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cxh-logo { display: block; flex: 0 0 auto; line-height: 0; }
.cxh-logo img { width: 168px; height: auto; }

/* ─── Barre : déclencheurs ─────────────────────────────────────────── */
.cxh-menu { display: flex; align-items: stretch; height: 78px; }
.cxh-item { display: flex; position: static; }
.cxh-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .86);
  font: 600 15px/1.2 var(--cxh-serif);
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s;
}
.cxh-trigger::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--cxh-gold);
  transform: scaleX(0);
  transition: transform .2s;
}
.cxh-chev { color: var(--cxh-gold); transition: transform .2s; }
.cxh-trigger:hover, .cxh-item.is-open > .cxh-trigger { color: #fff; }
.cxh-item.is-open > .cxh-trigger::after, .cxh-item.is-active > .cxh-trigger::after { transform: scaleX(1); }
.cxh-item.is-open .cxh-chev { transform: rotate(180deg); }
.cxh-item.is-active > .cxh-trigger { color: var(--cxh-gold); }
/* Rubrique qui contient une nouveauté */
.cxh-item.is-fresh > .cxh-trigger { padding-right: 20px; }
.cxh-item.is-fresh > .cxh-trigger .cxh-chev { margin-right: -2px; }
.cxh-item.is-fresh > .cxh-trigger::before {
  content: "";
  position: absolute;
  top: 26px; right: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cxh-gold);
  box-shadow: 0 0 0 3px rgba(176, 151, 109, .25);
}

/* ─── Panneaux ─────────────────────────────────────────────────────── */
.cxh-panel {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--cxh-paper);
  border-top: 3px solid var(--cxh-gold);
  box-shadow: 0 24px 40px rgba(18, 12, 8, .18);
}
.cxh-item.is-open > .cxh-panel { display: block; animation: cxh-in .18s ease-out; }
html:not(.cxh-js) .cxh-item:hover > .cxh-panel,
html:not(.cxh-js) .cxh-item:focus-within > .cxh-panel { display: block; }
@keyframes cxh-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.cxh-panel-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 30px;
  display: flex;
  gap: 0;
}
.cxh-intro { flex: 0 0 260px; padding-right: 32px; }
.cxh-eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cxh-gold-text);
}
.cxh-title {
  margin: 10px 0 10px !important;
  font: 600 23px/1.2 var(--cxh-serif);
  color: var(--cxh-bar);
}
.cxh-text { font-size: 13.5px; line-height: 1.6; color: var(--cxh-muted); margin-bottom: 18px !important; }
.cxh-hub {
  display: inline-block;
  font: 600 14px/1.3 var(--cxh-serif);
  color: var(--cxh-wine);
  border-bottom: 1px solid var(--cxh-gold);
  padding-bottom: 3px;
}
.cxh-hub:hover { color: var(--cxh-bar); }

.cxh-col { flex: 1 1 0; min-width: 0; padding: 2px 24px; border-left: 1px solid var(--cxh-line); }
.cxh-col--grid { flex-grow: 2.4; }
.cxh-col--grid ul { columns: 3; column-gap: 24px; }
.cxh-col--grid li { break-inside: avoid; }
.cxh-col-title {
  margin-bottom: 10px !important;
  font: 600 16px/1.3 var(--cxh-serif);
  color: var(--cxh-wine);
}
.cxh-link {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--cxh-ink);
  transition: color .15s, transform .15s;
}
.cxh-link:hover { color: var(--cxh-wine); transform: translateX(3px); }
.cxh-link.is-current { color: var(--cxh-gold-text); font-weight: 600; }
.cxh-link.is-new::after {
  content: "Nouveau";
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--cxh-wine);
  color: #fff;
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: 2px;
}

/* Cartes « dernières pages » */
.cxh-aside { flex: 0 0 300px; padding: 2px 0 2px 24px; border-left: 1px solid var(--cxh-line); }
.cxh-aside li + li { border-top: 1px solid var(--cxh-line); }
.cxh-card { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--cxh-ink); }
.cxh-card-img { flex: 0 0 56px; width: 56px; height: 56px; overflow: hidden; background: var(--cxh-cream); }
.cxh-card-img img { width: 56px; height: 56px; object-fit: cover; display: block; }
.cxh-card-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--cxh-cream), #e4d8c4); }
.cxh-card-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cxh-card-title { font-size: 13.5px; line-height: 1.35; }
.cxh-card-date { font-size: 11.5px; color: var(--cxh-muted); }
.cxh-card:hover .cxh-card-title { color: var(--cxh-wine); }
/* Rubrique sans colonne de liens (Le blog) : les articles occupent toute la largeur */
.cxh-intro + .cxh-aside { flex: 1 1 auto; }
.cxh-intro + .cxh-aside ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.cxh-intro + .cxh-aside li + li { border-top: 0; }
.cxh-intro + .cxh-aside li:nth-child(n+4) { border-top: 1px solid var(--cxh-line); }

/* Pied de panneau : promo du moment */
.cxh-foot { background: var(--cxh-cream); border-top: 1px solid var(--cxh-line); }
.cxh-promo {
  display: block;
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  font-size: 14px;
  color: var(--cxh-wine);
  font-weight: 600;
}
.cxh-promo:hover { text-decoration: underline; }
.cxh-promo-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--cxh-wine);
  color: #fff;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 400;
  vertical-align: 1px;
}

/* Bouton mobile */
.cxh-burger {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(176, 151, 109, .5);
  border-radius: 2px;
  background: none;
  color: #fff;
  font: 600 14px/1 var(--cxh-serif);
  cursor: pointer;
}
.cxh-burger-icon { position: relative; width: 18px; height: 12px; }
.cxh-burger-icon span {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--cxh-gold);
  transition: transform .2s, opacity .2s, top .2s;
}
.cxh-burger-icon span:nth-child(1) { top: 0; }
.cxh-burger-icon span:nth-child(2) { top: 5px; }
.cxh-burger-icon span:nth-child(3) { top: 10px; }
#cxh.is-menu-open .cxh-burger-icon span:nth-child(1) { top: 5px; transform: rotate(45deg); }
#cxh.is-menu-open .cxh-burger-icon span:nth-child(2) { opacity: 0; }
#cxh.is-menu-open .cxh-burger-icon span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* ─── Écrans moyens ────────────────────────────────────────────────── */
@media (max-width: 1239.98px) and (min-width: 992px) {
  .cxh-bar { gap: 12px; padding: 0 16px; }
  .cxh-logo img { width: 140px; }
  .cxh-trigger { padding: 0 9px; font-size: 14px; }
  .cxh-trigger::after { left: 9px; right: 9px; }
  .cxh-item.is-fresh > .cxh-trigger { padding-right: 15px; }
  .cxh-item.is-fresh > .cxh-trigger::before { right: 5px; }
  .cxh-intro { flex-basis: 220px; padding-right: 24px; }
  .cxh-col { padding: 2px 16px; }
  .cxh-aside { flex-basis: 250px; padding-left: 16px; }
  .cxh-col--grid ul { columns: 2; }
}

/* ─── Mobile et tablette : accordéon sous la barre ─────────────────── */
@media (max-width: 991.98px) {
  .cxh-bar { height: 66px; padding: 0 16px; }
  .cxh-logo img { width: 140px; }
  .cxh-burger { display: inline-flex; }
  .cxh-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--cxh-bar); border-top: 1px solid rgba(176, 151, 109, .35); max-height: calc(100vh - 66px); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 24px 40px rgba(0, 0, 0, .35); }
  #cxh.is-menu-open .cxh-nav { display: block; }
  .cxh-menu { display: block; height: auto; padding: 4px 0 12px; }
  .cxh-item { display: block; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .cxh-trigger { width: 100%; justify-content: space-between; padding: 16px 20px; font-size: 17px; }
  .cxh-trigger::after { display: none; }
  .cxh-item.is-fresh > .cxh-trigger { padding-right: 20px; }
  .cxh-item.is-fresh > .cxh-trigger::before { top: 50%; right: auto; left: 8px; margin-top: -3px; }
  .cxh-panel { position: static; border-top: 0; box-shadow: none; animation: none !important; }
  html:not(.cxh-js) .cxh-item:hover > .cxh-panel { display: none; }
  .cxh-panel-inner { display: block; padding: 6px 20px 18px; }
  .cxh-intro { padding: 10px 0 6px; }
  .cxh-eyebrow, .cxh-title, .cxh-text { display: none; }
  .cxh-col, .cxh-aside { border-left: 0; padding: 14px 0 0; }
  .cxh-col--grid ul { columns: 2; }
  .cxh-link { padding: 9px 0; font-size: 15px; }
  .cxh-link:hover { transform: none; }
  .cxh-aside li + li, .cxh-intro + .cxh-aside li:nth-child(n+4) { border-top: 0; }
  .cxh-intro + .cxh-aside ul { display: block; }
  .cxh-promo { padding: 13px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  #cxh *, #cxh *::before, #cxh *::after { animation: none !important; transition: none !important; }
}
