/*
 * By Night V220 — alignement desktop du menu supérieur et des filtres d'accueil.
 * Feuille volontairement séparée afin de contourner tout ancien cache CSS.
 */

@media (min-width:1024px) {
  :root {
    --home-filter-outer-space:clamp(10px,1vw,18px);
    --home-filter-center-space:clamp(170px,15vw,250px);
  }

  /* Espace réellement visible entre Agenda/Guide et Reportages/Actualités. */
  body > [data-primary-actions].is-group-transition .primary-actions-dock-group {
    gap:clamp(26px,2.35vw,38px)!important;
  }

  /* Les filtres reprennent les trois zones du bandeau supérieur : gauche, logo, droite. */
  body:has(.home-screen-events) .home-events-filter-row,
  body:has(.home-screen-guide) .home-guide-filter-shell,
  body:has(.home-screen-editorial) .home-report-filter-shell,
  .home-news-filter-shell {
    left:0!important;
    width:100%!important;
    max-width:100%!important;
    margin-left:0!important;
    padding-left:var(--home-filter-outer-space)!important;
    padding-right:var(--home-filter-outer-space)!important;
    transform:none!important;
    grid-template-columns:minmax(0,1fr) var(--home-filter-center-space) minmax(0,1fr)!important;
    column-gap:0!important;
  }

  body:has(.home-screen-events) .home-events-filter-row > :first-child,
  body:has(.home-screen-guide) .home-guide-filter-shell > :first-child,
  body:has(.home-screen-editorial) .home-report-filter-shell > :first-child,
  .home-news-filter-shell > :first-child {
    grid-column:1!important;
    justify-self:center!important;
  }

  body:has(.home-screen-events) .home-events-filter-row > :last-child,
  body:has(.home-screen-guide) .home-guide-filter-shell > :last-child,
  body:has(.home-screen-editorial) .home-report-filter-shell > :last-child,
  .home-news-filter-shell > :last-child {
    grid-column:3!important;
    justify-self:center!important;
  }

  body:has(.home-screen-events) .home-events-filter-group,
  body:has(.home-screen-editorial) .home-report-filter-group,
  .home-news-filter-group,
  body:has(.home-screen-guide) .home-guide-filter-areas {
    width:max-content!important;
    max-width:100%!important;
    justify-content:center!important;
    text-align:center!important;
  }

  /* Le séparateur suit précisément l'axe du logo et non le bord d'un filtre. */
  body:has(.home-screen-events) .home-events-filter-row::after,
  body:has(.home-screen-guide) .home-guide-filter-shell::after,
  body:has(.home-screen-editorial) .home-report-filter-shell::after,
  .home-news-filter-shell::after {
    left:50%!important;
  }

  /* Deux lignes strictement identiques en largeur dans le filtre Guide. */
  body:has(.home-screen-guide) .home-guide-filter-types {
    width:100%!important;
    max-width:100%!important;
    justify-self:stretch!important;
  }

  body:has(.home-screen-guide) .home-guide-type-row {
    display:flex!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:clamp(3px,.45vw,7px)!important;
  }

  body:has(.home-screen-guide) .home-guide-type-row button {
    flex:0 0 auto!important;
  }

  body:has(.home-screen-guide) .home-guide-type-row .home-guide-option-switch {
    width:76px!important;
    min-width:76px!important;
    max-width:76px!important;
    flex:0 0 76px!important;
    justify-content:flex-end!important;
  }
}

/* Keep both guide switches at the right edge, even when categories are hidden. */
body:has(.home-screen-guide) .home-guide-type-row,
body:has(.home-screen-guide) .home-guide-type-row-alcohol.is-types-hidden {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) max-content!important;
  box-sizing:border-box!important;
  padding-right:10px!important;
  overflow:visible!important;
}
body:has(.home-screen-guide) .home-guide-type-options {
  display:flex;
  min-width:0;
  align-items:center;
  gap:inherit;
  overflow-x:auto;
  scrollbar-width:none;
}
body:has(.home-screen-guide) .home-guide-type-options::-webkit-scrollbar { display:none; }
body:has(.home-screen-guide) .home-guide-type-options button { flex:0 0 auto!important; }
body:has(.home-screen-guide) .home-guide-type-row .home-guide-option-switch {
  grid-column:2!important;
  justify-self:end!important;
}

/* On phones, show sectors before establishment types. */
@media (max-width:600px) {
  body:has(.home-screen-guide) .home-guide-filter-shell {
    grid-template-rows:31px 62px!important;
  }
  body:has(.home-screen-guide) .home-guide-filter-areas {
    grid-row:1!important;
    padding:0 2px 4px!important;
    border-top:0!important;
    border-bottom:1px solid rgba(255,255,255,.1)!important;
  }
  body:has(.home-screen-guide) .home-guide-filter-types {
    grid-row:2!important;
    padding-top:3px!important;
    padding-bottom:0!important;
  }
}

/* Fit the mobile feature and its date inside the visible opening screen. */
@media (max-width:600px) {
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-content.hero-content-premium {
    display:grid!important;
    grid-template-rows:minmax(0,1fr) 60px auto!important;
    gap:8px!important;
    padding-top:8px!important;
    padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-copy {
    min-height:0!important;
    height:100%!important;
    overflow:hidden;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-main-title,
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-graffiti-mobile {
    height:100%!important;
    min-height:0!important;
    margin:0!important;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-graffiti-mobile {
    max-height:240px!important;
    transform:none!important;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-graffiti-mobile img {
    height:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-daily-feature {
    width:min(92%,calc(100svh - 260px))!important;
    margin-top:0!important;
    margin-bottom:0!important;
    gap:6px!important;
  }
  body:has(.home-screen-hero) [data-home-section="hero"] .hero-daily-feature > h2 {
    font-size:clamp(12px,3.5vw,15px)!important;
    letter-spacing:.015em!important;
    line-height:1.2!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  [data-home-section="hero"] [data-primary-actions]:not(.is-group-transition):not(.is-mobile-side-logo-transition):not(.is-mobile-refined-transition):not(.is-mobile-logo-dock) .button .home-action-icon {
    width:34px!important;
    height:34px!important;
  }
  body > [data-primary-actions].is-mobile-side-logo-transition .home-action-icon img,
  body > [data-primary-actions].is-mobile-logo-dock .home-action-icon img {
    scale:1.15;
  }
  html[lang="en"] body:has(.home-screen-hero) [data-home-section="hero"] .hero-daily-feature > h2 {
    font-size:clamp(10px,2.9vw,13px)!important;
  }

}

/* Phone navigation uses icons in both the hero and the top dock. */
@media (max-width:600px) {
  html body [data-primary-actions] .button .home-action-label {
    display:none!important;
  }
}
