/* =======================
   VARIABLES AMÉLIORÉES
======================= */
:root {
    --gris-fonce: #000000;
    --gris-clair: #F5C400;
    --bleu-hover: #4418c9;
    --blanc: #f0f8ff;
    --black: #F5C400;
    --transition: 0.3s ease;
    --shadow-menu: 0 2px 8px rgba(0,0,0,0.1);
}

body {
  background-image: url("https://emcmds26.sciencesconf.org/data/css/background_microelectronics_v2.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* pour effet parallax */
}

/* =======================
   CONTAINER MENU - AUTOMATIQUE
======================= */
#mainmenu {
    width: 100%;
    background: #4418c9;
    position: relative;
    z-index: 1000;
    box-shadow: var(--shadow-menu);
    padding: 0 clamp(12px, 3vw, 24px);
}

/* =======================
   STRUCTURE FLEXBOX ADAPTATIVE
======================= */
#mainmenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#mainmenu > ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: clamp(4px, 1.5vw, 16px);
    overflow-x: auto;
    overflow-y: visible;
    
    /* Cache la scrollbar mais garde la fonctionnalité */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#mainmenu > ul::-webkit-scrollbar {
    display: none;
}

/* Annule les anciens floats */
#mainmenu .fll,
#mainmenu .flr {
    float: none !important;
}

/* =======================
   ITEMS MENU - FLUIDE
======================= */
#mainmenu ul li {
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

/* =======================
   LIENS - TAILLE ADAPTATIVE
======================= */
#mainmenu ul li a {
    display: block;
    padding: clamp(10px, 2vw, 14px) clamp(8px, 1.5vw, 16px);
    font-weight: 600;
    font-size: clamp(11px, 1.8vw, 14px);
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: all var(--transition);
   
}

/* =======================
   ÉTATS HOVER & ACTIF
======================= */
#mainmenu ul li a:hover,
#mainmenu ul li:hover > a {
    background-color: var(--bleu-hover) !important;
    color: var(--blanc) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 24, 201, 0.3);
}

#mainmenu ul li.menu_h_on > a {
    background-color: var(--bleu-hover) !important;
    color: var(--blanc) !important;
    box-shadow: inset 0 -3px 0 ;
}

/* =======================
   MY SPACE - TOUJOURS VISIBLE
======================= */
#mainmenu ul.admin {
    margin-left: auto;
    flex-shrink: 0;
}

/* =======================
   MOBILE AUTOMATIQUE (< 768px)
======================= */
@media (max-width: 768px) {
    
    #mainmenu {
        flex-wrap: wrap;
        padding: 8px 12px;
    }
    
    /* Menu principal scroll horizontal */
    #mainmenu > ul:not(.admin) {
        width: 100%;
        order: 2;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
    }
    
    #mainmenu ul li {
        scroll-snap-align: start;
    }
    
    #mainmenu ul li a {
        font-size: 13px;
        padding: 10px 14px;
        white-space: nowrap;
    }
    
    /* MY SPACE en haut */
    #mainmenu ul.admin {
        order: 1;
        margin-left: auto;
        margin-bottom: 0;
    }
    
    #mainmenu ul.admin li a {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    /* Indicateur de scroll visuel */
    #mainmenu > ul:not(.admin)::after {
        content: "→";
        position: sticky;
        right: 0;
        padding: 0 8px;
        background: linear-gradient(to right, transparent, var(--blanc) 30%);
        color: var(--gris-fonce);
        font-size: 16px;
        pointer-events: none;
        opacity: 0.5;
    }
}

/* =======================
   TRÈS PETITS ÉCRANS (< 480px)
======================= */
@media (max-width: 480px) {
    
    #mainmenu {
        padding: 6px 8px;
    }
    
    #mainmenu ul li a {
        font-size: 12px;
        padding: 8px 10px;
        letter-spacing: 0.2px;
    }
    
    #mainmenu ul.admin li a {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* =====================================================
   SLIDER D'IMAGES - RESPONSIVE AUTOMATIQUE
===================================================== */



#template_main {
    position: relative;
    overflow: hidden;
}

/* Barre d'images - hauteur fluide */
#template_main::before {
    content: "";
    display: block;
    width: 100%;
    height: clamp(200px, 35vw, 380px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: sliderMasterpiece 36s infinite;
    will-change: background-image, transform;
}



/* Animation cinématique */
@keyframes sliderMasterpiece {
    0%, 100% {
        background-image: url("https://emcmds26.sciencesconf.org/data/css/Golf_port_El_Kantaoui4_1.jpg");
        transform: scale(1.08);
        filter: brightness(1.1) contrast(1.1) saturate(1.15);
    }
    23% {
        transform: scale(1);
        filter: brightness(1) contrast(1) saturate(1);
    }
    25% {
        background-image: url("https://emcmds26.sciencesconf.org/data/css/jem_p.png");
        transform: scale(1.08);
        filter: brightness(1.1) contrast(1.1) saturate(1.15);
    }
    48% {
        transform: scale(1);
        filter: brightness(1) contrast(1) saturate(1);
    }
    50% {
        background-image: url("https://emcmds26.sciencesconf.org/data/css/djerba.png");
        transform: scale(1.08);
        filter: brightness(1.1) contrast(1.1) saturate(1.15);
    }
    73% {
        transform: scale(1);
        filter: brightness(1) contrast(1) saturate(1);
    }
    75% {
        background-image: url("https://emcmds26.sciencesconf.org/data/css/sbos.png");
        transform: scale(1.08);
        filter: brightness(1.1) contrast(1.1) saturate(1.15);
    }
    98% {
        transform: scale(1);
        filter: brightness(1) contrast(1) saturate(1);
    }
}

/* Overlay élégant - hauteur synchronisée */
#template_main::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(200px, 35vw, 380px);
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3),
        rgba(0,0,0,0.05),
        rgba(0,0,0,0.3)
    );
    pointer-events: none;
    z-index: 1;
}

#template_main > * {
    position: relative;
    z-index: 2;
}

/* =======================
   LARGEUR GLOBALE - FLUIDE
======================= */
#wrapper,
#template_wrapper {
    max-width: 1180px !important;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 24px);
    box-sizing: border-box;
}

/* =======================
   AMÉLIORATIONS VISUELLES
======================= */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus accessibilité */
#mainmenu ul li a:focus {
    outline: 2px solid var(--gris-clair);
    outline-offset: 2px;
}

#mainmenu ul li a:focus:not(:focus-visible) {
    outline: none;
}

/* Touch optimization mobile */
@media (hover: none) and (pointer: coarse) {
    #mainmenu ul li a {
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Performance animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =======================
   COMPATIBILITÉ ANCIENNES VERSIONS
======================= */

/* Support navigateurs anciens */
#mainmenu > ul {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

/* Fallback si clamp non supporté */
@supports not (font-size: clamp(11px, 1.8vw, 14px)) {
    #mainmenu ul li a {
        font-size: 13px;
    }
    
    @media (max-width: 480px) {
        #mainmenu ul li a {
            font-size: 11px;
        }
    }
}




















#template_content {
    overflow: visible !important;
    position: relative;
    z-index: 1;
}












#mainmenu > ul:not(.admin) {
    flex: 1;
    width: 100%;
}
#mainmenu > ul:not(.admin) > li {
    flex: 1 1 0;
    text-align: center;
}
#mainmenu > ul:not(.admin) > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
#mainmenu > ul {
    gap: 0;
}
@media (max-width: 768px) {
    #mainmenu > ul:not(.admin) > li {
        flex: 0 0 auto;
    }
}




















/* =====================================================
   MENU GLOBAL – RÉPARTITION SUR TOUTES LES PAGES
===================================================== */

/* Le menu prend toute la largeur */
#mainmenu {
    display: flex;
    align-items: stretch;
}

/* UL principal étendu */
#mainmenu > ul:not(.admin) {
    flex: 1;
    width: 100%;
}

/* Chaque item prend la même largeur */
#mainmenu > ul:not(.admin) > li {
    flex: 1 1 0;
    text-align: center;
}

/* Lien centré verticalement et horizontalement */
#mainmenu > ul:not(.admin) > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* MY SPACE reste à droite */
#mainmenu > ul.admin {
    margin-left: auto;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    #mainmenu > ul:not(.admin) > li {
        flex: 0 0 auto;
    }
}
.tpl_nav_h #mainmenu > ul:not(.admin) > li {
    flex: 1 1 0;
}


















































/* Place le menu juste après le header */
#mainmenu {
    position: relative;
    top: 0;
    margin-top: 0;
    z-index: 9999;
}

/* Assure que le header ne chevauche pas le menu */
#template_header {
    z-index: 1;
    position: relative;
}

/* Décale le slider pour qu’il commence après le menu */
#template_main {
    margin-top: 0; /* annule tout décalage inutile */
}

















.tpl_nav_h {
    position: sticky;
    top: var(--header-height, -437px);
    z-index: 99999;
}


#mainmenu {
    height: 56px;
    background: #a8c9e8;
    display: flex;
    align-items: center;
}
#template_main {
    padding-top: 56px;
}
@media (max-width: 768px) {
    .tpl_nav_h {
        top: 95px;
        max-width: 100%;
    }

    #mainmenu {
        height: 64px;
    }

    #template_main {
        padding-top: 64px;
    }
}








@media (max-width: 768px) {
    .tpl_nav_h {
        top: 115px; /* descend un peu plus bas sur mobile */
        max-width: 100%;
    }
}


#template_main::after {
    background: none !important;
}












/* Supprimer le pleanary talks & programs */
#mainmenu > ul.fll > li:last-child > a[href="/"] {
    display: none !important;
}














/* =======================
   FINAL FIX – MOBILE ONLY
   NO STICKY, NO OVERLAP
======================= */
@media (max-width: 768px) {

    /* Disable sticky behavior */
    .tpl_nav_h {
        position: relative !important;
        top: auto !important;
    }

    /* Menu takes its natural place */
    #mainmenu {
        position: relative !important;
        height: auto !important;
        margin-top: 16px;
    }

    /* Slider starts AFTER menu */
    #template_main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

/* STYLE TITRE PRINCIPAL – VERSION AFRICACRYPT */
#template_content > h1.titre {
    display: block !important;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    color: teal; /* bleu foncé académique */
    letter-spacing: 1px;
    margin: 40px 0 15px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #cfcfcf;
}























/* Supprime complètement l'ancien slider sur template_main et template_wrapper */
#template_main::before,
#template_main::after,
#template_wrapper::before,
#template_wrapper::after {
    content: none !important;
    display: none !important;
}

/* Remet le slider APRÈS le menu, sur template_content::before */
#template_content::before {
    content: "";
    display: block;
    width: 100%;
    height: clamp(200px, 35vw, 380px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: sliderMasterpiece 36s infinite;
    will-change: background-image, transform;
}

/* Menu violet visible, au-dessus du slider */
#mainmenu {
    position: relative;
    z-index: 100;
    height: auto;
}

/* tpl_nav_h normal, pas sticky */
.tpl_nav_h {
    position: relative !important;
    top: auto !important;
    z-index: 100;
    overflow: hidden !important;
}

/* template_main sans padding/margin */
#template_main {
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow: visible;
}
#template_content {
    overflow: hidden !important;
    position: relative;
}





/* Supprime l'espace orange entre menu et slider */

.tpl_nav_h {
    margin-bottom: 0 !important;
}








p.titre:empty,
p.titre {
    display: none !important;
}




.menu_niveau_1_on{
    background-color: var(--bleu-hover)
}


























#template_content::before {
    transform-origin: center center;
}

#template_content {
    position: relative;
    overflow: hidden; /* important */
}


/* Supprimer complètement la zone template_link */
#template_link {
    display: none !important;
}




#header_wheredate {
  //  font-size: 19px !important;
}
/* Modifier le texte de la date et du lieu */

#header_wheredate {
    position: relative;
    color: transparent; /* cache le texte original */
    font-size: 62px;
    font-weight: 600;
}

#header_wheredate::after {
    content: "28–30 October 2026 | El Kantaoui, Sousse, Tunisia";
    color: #ffffff;
    position: absolute;
    left: 0;
    top: 0;
font-size: 16px;
}














<!-- KEEP YOUR ORIGINAL HEADER HTML EXACTLY UNCHANGED -->
<!-- ONLY ADD THIS CSS -->

<style>
/* Keep original logo untouched */
#template_header td.tac.vam #header_logo {
  margin-right:30px !important;
  max-height:none !important;
  width:auto !important;
  content:none !important;
}

/* Add NEW IJNT logo on top-right without affecting layout */
#template_header {
  position: relative;
}

#template_header::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 1px;
  width: 180px;   /* adjust size here */
  height: 150px;  /* adjust size here */
  background: url('https://emcmds26.sciencesconf.org/data/css/logo_ijnt.png') no-repeat center center;
  background-size: contain;
}
/* Make title block stop before logo */
#template_header td.tal.vam {
  display: block !important;
  width: calc(140% - 290px) !important; /* reserve logo space */
  max-width: calc(140% - 290px) !important;
  padding-right: 220px !important;
  box-sizing: border-box;
}

/* Force long title to wrap correctly */
#header_title,
#header_subtitle,
#header_wheredate {
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}
</style>