/* --------------------------------------------------------------------------
   Sidebar - Scrollbar conditionnelle selon la hauteur d'écran
   -------------------------------------------------------------------------- */

/* Par défaut (hauteur > 760px) : Scrollbar invisible */
.layout-home > .wp-block-column:first-child,
.layout-page > .wp-block-column:first-child {
  scrollbar-width: none; /* Firefox - pas de scrollbar */
}

.layout-home > .wp-block-column:first-child::-webkit-scrollbar,
.layout-page > .wp-block-column:first-child::-webkit-scrollbar {
  width: 0px; /* Chrome/Safari/Edge - pas de scrollbar */
  display: none;
}

/* Hauteur ≤ 760px : Scrollbar visible et stylisée */
@media (min-width: 1201px) and (max-height: 760px) {
  /* Firefox - Scrollbar fine visible */
  .layout-home > .wp-block-column:first-child,
  .layout-page > .wp-block-column:first-child {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
  }

  /* Webkit (Chrome, Safari, Edge) - Scrollbar visible */
  .layout-home > .wp-block-column:first-child::-webkit-scrollbar,
  .layout-page > .wp-block-column:first-child::-webkit-scrollbar {
    width: 8px;
    display: block;
    background: transparent;
  }

  .layout-home > .wp-block-column:first-child::-webkit-scrollbar-track,
  .layout-page > .wp-block-column:first-child::-webkit-scrollbar-track {
    background: transparent;
  }

  .layout-home > .wp-block-column:first-child::-webkit-scrollbar-thumb,
  .layout-page > .wp-block-column:first-child::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
  }

  .layout-home > .wp-block-column:first-child::-webkit-scrollbar-thumb:hover,
  .layout-page > .wp-block-column:first-child::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
  }
}

/* --------------------------------------------------------------------------
   Sidebar - Réduction de la typo sur petites hauteurs
   -------------------------------------------------------------------------- */

/* Hauteur très réduite (< 700px) - Réduction importante */
@media (min-width: 1201px) and (max-height: 700px) {
  .home nav .wp-block-navigation__container,
  .layout-page
    > .wp-block-column:first-child
    nav
    .wp-block-navigation__container {
    font-size: var(--wp--preset--font-size--3-xl) !important;
  }

  .home .layout-home > .wp-block-column:first-child nav,
  .layout-page > .wp-block-column:first-child nav {
    gap: 0.5rem !important;
  }
}

/* Hauteur moyenne (700px - 860px) - Réduction modérée */
@media (min-width: 1201px) and (min-height: 701px) and (max-height: 860px) {
  .home nav .wp-block-navigation__container,
  .layout-page
    > .wp-block-column:first-child
    nav
    .wp-block-navigation__container {
    font-size: var(--wp--preset--font-size--4-xl) !important;
  }

  .home .layout-home > .wp-block-column:first-child nav,
  .layout-page > .wp-block-column:first-child nav {
    gap: 0.75rem !important;
  }
}

/* Hauteur confortable (> 860px) - Taille normale */
@media (min-width: 1201px) and (min-height: 861px) {
  .home nav .wp-block-navigation__container,
  .layout-page
    > .wp-block-column:first-child
    nav
    .wp-block-navigation__container {
    font-size: var(--wp--preset--font-size--5-xl) !important;
  }
}

/* --------------------------------------------------------------------------
   Sidebar - Menu actif
   -------------------------------------------------------------------------- */

.home .layout-home .wp-block-navigation .current-menu-item > a,
.layout-page .wp-block-navigation .current-menu-item > a {
  color: var(--wp--preset--color--primary) !important;
}

/* --------------------------------------------------------------------------
   Sidebar - Liens au survol
   -------------------------------------------------------------------------- */

.home .layout-home > .wp-block-column:first-child nav a:hover,
.layout-page > .wp-block-column:first-child nav a:hover {
  color: var(--wp--preset--color--primary);
}

/* --------------------------------------------------------------------------
   Sidebar - Rendu visuellement plus fin (sans changer la fonte)
   -------------------------------------------------------------------------- */

.home .layout-home > .wp-block-column:first-child nav a,
.layout-page > .wp-block-column:first-child nav a {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (-webkit-text-stroke: 1px black) {
  .home .layout-home > .wp-block-column:first-child nav a,
  .layout-page > .wp-block-column:first-child nav a {
    -webkit-text-stroke: 0.8px var(--wp--preset--color--secondary);
    -webkit-text-fill-color: var(--wp--preset--color--base);
  }
  .home .layout-home > .wp-block-column:first-child nav .current-menu-item > a,
  .layout-page > .wp-block-column:first-child nav .current-menu-item > a {
    -webkit-text-stroke: 0.8px var(--wp--preset--color--secondary);
    -webkit-text-fill-color: var(--wp--preset--color--primary);
  }

  .home
    .layout-home
    > .wp-block-column:first-child
    nav .sidebar_underline a:before,
  .layout-page > .wp-block-column:first-child nav .sidebar_underline a:before {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--wp--preset--color--base);
    bottom: -3px;
  }

    .home
    .layout-home
    > .wp-block-column:first-child
    nav
    .current-menu-item.sidebar_underline
    a:before,
  .layout-page > .wp-block-column:first-child nav .current-menu-item.sidebar_underline a:before {
    background: var(--wp--preset--color--primary);
  }
}
