/* ============================================
   THEME NAV - Menu sticky des thèmes
   ============================================ */

.theme-nav {
    position: relative;
    width: 100%;
    background-color: var(--color-blanc);
    border-bottom: 1px solid #E0E0E0;
    z-index: 100;
    margin-bottom: 40px; /* Marge en dessous avant le premier theme-block */
}

.theme-nav--sticky {
    position: fixed;
    top: 75px; /* Hauteur du header */
    left: 0;
    right: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

/* Spacer pour éviter le saut au passage sticky */
.theme-nav-spacer {
    width: 100%;
    height: 0;
    overflow: hidden;
}

.theme-nav__container {
    max-width: 1600px; /* Même max-width que le contenu */
    margin: 0 auto;
    padding: 0 var(--marge-laterale); /* Même padding que theme-block */
}

.theme-nav__list {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Espacer sur toute la largeur */
    list-style: none;
    margin: 0;
    padding: 0;
    height: 85px;
}

.theme-nav__item {
    margin: 0;
    padding: 0;
}

.theme-nav__link {
    font-family: 'tt-commons-pro', 'TT Commons Pro', sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.2;
    color: var(--color-noir);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    padding-bottom: 4px;
}

/* Filet rollover — base (invisible) */
.theme-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-noir);
    transition: width 0.3s ease;
}

/* Filet au hover */
.theme-nav__link:hover::after {
    width: 100%;
}

/* Filet permanent sur l'item actif */
.theme-nav__link--active::after {
    width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px), (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1032px) {
    .theme-nav__list {
        gap: 24px;
    }

    .theme-nav__link {
        font-size: 16px;
    }
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1032px) {
    .theme-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Masquer la scrollbar */
        -ms-overflow-style: none;
    }

    .theme-nav::-webkit-scrollbar {
        display: none;
    }

    .theme-nav__container {
        padding: 0; /* Container sans padding, le padding est sur la liste */
    }

    .theme-nav__list {
        gap: 30px;
        height: 70px;
        padding: 0 var(--marge-laterale); /* Aligné avec les marges du site */
        justify-content: flex-start; /* Pas d'espacement forcé — scroll horizontal */
    }

    .theme-nav__link {
        font-size: 14px;
    }

    .theme-nav--sticky {
        top: 70px; /* Hauteur header mobile (70px) */
    }
}

/* ============================================
   PAYSAGE TACTILE - Tablette et téléphone en paysage
   Sous-menu sans débordement, entrées espacées
   ============================================ */

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 769px) and (max-width: 1376px) {
    .theme-nav__container {
        padding: 0 max(var(--marge-laterale), env(safe-area-inset-right)) 0 max(var(--marge-laterale), env(safe-area-inset-left));
    }

    .theme-nav__list {
        gap: 24px;
    }

    .theme-nav__link {
        font-size: min(16px, calc((100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) * 0.015625));
    }
}
