/* ===== Core sizing ===== */
/* :root{ --msithd-container:min(1200px,92vw); } */
.msithd *{ box-sizing:border-box; }
.msithd .msithd-container{ width: 100%; margin:0; display:flex; align-items:center; justify-content: center;}

/* ===== Top & bottom bars (same height) ===== */
/* .msithd-topbar,.msithd-mainbar{ --bar-h:38px; --bar-fs:14px; border:0!important; box-shadow:none!important; } */
.msithd-topbar{ background:var(--msithd-topbar-bg,#9E363A); color:#fff; padding: 0 2rem; height: 1.85rem; align-content: center;}
.msithd-mainbar{ background:var(--msithd-mainbar-bg,#9E363A); color:#fff; padding: 0 1rem; height: 2.3rem; align-content: center;}
.msithd-topbar {font-size: 0.8rem; font-weight: 400;}
.msithd-mainbar{font-size: 0.9rem; font-weight: 400;}
/* .msithd-topbar,.msithd-middle,.msithd-mainbar{ position:relative; left:50%; right:50%; margin-left:-50vw; margin-right:-50vw; width:100vw; } */

/* .msithd-topbar__row,.msithd-mainbar__row{ min-height:100%; align-items:center; justify-content:space-between; padding:0; } */
.msithd-topbar a{ color:#fff; text-decoration:none; padding:0 0.25rem; transition: color 0.5s ease;}
.msithd-topbar a:hover{ color:#FFD600; }
.msithd-topmenu{ list-style:none; display:flex; padding:0; margin:0; }
.msithd-contacts{ display:flex;  align-items:center; } .msithd-contacts i{ margin-right:2px; }

/* Main nav */
.msithd-mainmenu{ list-style:none; display:flex; margin:0; padding:0; }
.msithd-mainmenu>li{ position:relative;}
.msithd-mainmenu a{ color:#fff; text-decoration:none; padding:0 0.5rem; display:block;  transition: color 0.5s ease;}
.msithd-mainmenu li:hover>a{ color: #FFD600;}
.msithd-mainmenu .sub-menu{ position:absolute; left:0; top:100%; background:#9E363A; color:#fff; min-width:220px;  display:none; z-index:20; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.msithd-mainmenu .sub-menu a{ color:#333;  }
.msithd-mainmenu li:hover>.sub-menu{ display:block; }



.msithd-mainmenu > li {
  position: relative;
  padding-bottom: 0.45rem;
  padding-top: 0.4rem;
}

.msithd-mainmenu > li::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0%;
  width: 100%;
  height: 2px;
  background: #FFD600;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease-in-out;
}

.msithd-mainmenu > li:hover::after {
  transform: scaleX(1);
}

/* Submenu Styling */
.msithd-mainmenu,
.msithd-mainmenu .sub-menu {
  list-style: none;   /* remove bullets */
  margin: 0;
  padding: 0;
}

/* First-level submenu (below parent) */
.msithd-mainmenu .sub-menu {
  margin-top: 1px;
  position: absolute;
  top: 100%;   /* directly below parent */
  left: 0;     /* aligned to left of parent */
  background: #9E363A;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-radius: 4px;
  z-index: 1000;
}

/* Show submenu on hover */
.msithd-mainmenu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Submenu items */
.msithd-mainmenu .sub-menu > li {
  position: relative;
}

.msithd-mainmenu .sub-menu > li a {
  display: block;
  color: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.msithd-mainmenu .sub-menu > li:hover > a {
  color: #FFD600;
}

/* Deeper-level submenu (flyout Right side) */
.msithd-mainmenu .sub-menu .sub-menu {
  top: 0;
  left: 100%; 
  border-radius: 4px;
  margin-left: 1px;
}
.msithd-mainmenu .sub-menu:hover {
  border-radius: 0px;
}
.msithd-mainmenu .sub-menu .sub-menu:hover {
  border-radius: 0px;
}

/* Remove bullets everywhere */
.msithd-mainmenu,
.msithd-mainmenu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}


/* Common underline effect for all menu levels */
.msithd-mainmenu > li::after,
.msithd-mainmenu .sub-menu > li::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #FFD600;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease-in-out;
}

/* Show underline on hover */
.msithd-mainmenu > li:hover::after,
.msithd-mainmenu .sub-menu > li:hover::after {
  transform: scaleX(1);
}


/* ===== Middle band ===== */
.msithd-middle{ padding:0; background:#fff; color:#333; }
.msithd-middle__grid{ display:flex;  align-items:center; width:100%; margin:0; }

.msithd-col-left {
  width: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msithd-col-center {
  width: 60%;
}

.msithd-col-right {
  width: 27%;
}

/* Left */
.msithd-logo-img{ height:5rem; width:auto; }
.msithd-logo__placeholder{ display:inline-block; padding:.35rem .55rem; border:2px solid #333; border-radius:8px; font-weight:700; }

/* Center */
.msithd-title-text{ margin:0; font-size: clamp(1.5rem, 2vw + 1rem, 2.3rem); line-height:1.1; font-weight:700; color:var(--msithd-title-color,#9E363A); display:inline-block; padding-bottom: clamp(4px, 0.5vw, 6px); border-bottom:2px solid var(--msithd-title-color,#9E363A); }

.lower-middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Rotator (slides from top down) */
.msithd-rotator{ position:relative; height:22px; width: 70%; overflow:hidden; color:#9E363A;  }
 .msithd-rotator a{     font-size: clamp(0.85rem, 0.4vw + 0.85rem, 1rem) }
.msithd-marquee--affiliation {
  width: 30% !important;
}
.msithd-rotator__item{ position:absolute; left:0; right:0; top:0; opacity:0; transform:translateY(-100%); transition:transform .45s ease, opacity .45s ease; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.msithd-rotator__item.is-active{ opacity:1; transform:translateY(0%); }
.msithd-rotator__item.is-active:hover{ color: rgb(0, 63, 156); cursor: pointer;}
.msithd-rotator__item.is-leaving{ opacity:0; transform:translateY(100%); }

/* ===== Marquees (BOTH moving) ===== */
.msithd-marquee{ overflow:hidden; width:auto; }
.msithd-marquee__track{ display:flex; align-items:center; gap:0.8rem; will-change:transform; animation:msithd-scroll 5s linear infinite; }
@keyframes msithd-scroll{ 0%{transform:translateX(0);} 100%{transform:translateX(-50%);} }

/* Sizes per row */
.msithd-marquee--affiliation .msithd-marquee__track img{ height:2.5rem; width:auto; filter:saturate(.95); border: 2px solid rgb(245, 245, 245); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); border-radius: 3px;}
.msithd-marquee--partners    .msithd-marquee__track img{ height:2.5rem; width:auto; border: 2px solid rgb(245, 245, 245); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); border-radius: 3px;}

/* Right column: partner marquee (top) + Techno & Admission (bottom) */
.msithd-col-right{ display:flex; justify-content: center; align-items: center;}
.msithd-right-bottom{ display:flex; flex-direction: column; align-items:end; justify-content: center;}
.msithd-techno{ height: 5rem; width:auto; margin-left: 5%; margin-right: 5%;}
.msithd-admission img{ display:block; height:3.5rem; width:auto; }

/* ===== Mobile drawer — REVERT to previous (red header) ===== */
.msithd-burger{ display:none; background:none; border:0; color:#fff; font-size:22px; }
.msithd-mobile-logo{ display:none; } .msithd-mobile-logo img{ height:40px; width:auto; }

.msithd-drawer{ position:fixed; inset:0; pointer-events:none; z-index:9999; }
.msithd-drawer__overlay{  inset:0; background:rgba(0,0,0,.45); opacity:0; transition:opacity .25s ease; }
.msithd-drawer__panel{ position:absolute; inset:0 auto 0 0; width:min(88vw,380px); background:#9E363A; color:#fff; transform:translateX(-100%); transition:transform .3s ease; display:flex; flex-direction:column; gap:12px; }
/* red header, white text (the version you liked) */
.msithd-drawer__header{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px; background:#9E363A; color:#fff; border-bottom:1px solid rgba(255,255,255,.2); }
.msithd-drawer__header img{ height:44px; width:auto; }
.msithd-close{ background:none; border:0; color:#fff; font-size:24px; }
.msithd-drawer__nav{ padding:10px 12px 16px; overflow:auto; }
.msithd-mobilemenu{ list-style:none; margin:0; padding:0; }
.msithd-mobilemenu li a{ color:#fff; text-decoration:none; display:block; padding:12px 10px; border-bottom:1px solid rgba(255,255,255,.2); }
.msithd-mobilemenu .sub-menu{ padding-left:10px; background:rgba(0,0,0,.08); }

/* Mobile submenu toggles */
.msithd-sub-toggle{ background:none; border:0; color:#fff; font-size:16px; margin-left:8px; }
.msithd-mobilemenu li.menu-item-has-children{ display:flex; align-items:center; justify-content:space-between; }
.msithd-mobilemenu li.menu-item-has-children > a{ display:inline-block; width:auto; }
.msithd-mobilemenu li.menu-item-has-children > .sub-menu a{ border-bottom:0; }

/* Open state */
.msithd--open .msithd-drawer{ pointer-events:auto; }
.msithd--open .msithd-drawer__panel{ transform:none; }
.msithd--open .msithd-drawer__overlay{ opacity:1; }

/* ===== Responsive ===== */
@media (max-width:1200px){
  /* .msithd-middle__grid{ grid-template-columns:110px 1fr 380px; }
  .msithd-techno{ height:52px; } .msithd-admission img{ height:38px; } */
  .msithd-topbar {font-size: 0.65rem; }
.msithd-mainbar{font-size: clamp(0.6rem, 0.4vw + 0.45rem, 0.8rem);}
/* .msithd-title-text{ font-size:2rem;} */
}
@media (max-width:991px){
  /* .msithd-topbar,.msithd-middle{ display:none; }
  .msithd-mainmenu{ display:none; }
  .msithd-burger{ display:inline-flex; }
  .msithd-mobile-logo{ display:inline-flex; align-items:center; } */
  .msithd-marquee, .msithd-topbar, .msithd-col-right{display: none;}
  .msithd-col-center {width: 90%;}
  .msithd-mainmenu a {padding: 0 0.4rem;}
  .msithd-mainbar{font-size: clamp(0.55rem, 0.35vw + 0.4rem, 0.75rem);}

}
@media (max-width:782px){  
  .msithd-topbar,.msithd-middle{ display:none; }
  .msithd-mainmenu{ display:none; }
  .msithd-burger{ display:inline-flex; }
  .msithd-mobile-logo{ display:inline-flex; align-items:center; }
  .msithd-mainbar{background: #fff; height: 5rem;}
  .msithd-burger {color: #9E363A;}
  .msithd .msithd-container{justify-content: space-between;}
  .msithd-mainbar.msithd-sticky-active{display: none;}
}

/* ===== Admin repeater UI (unchanged) ===== */
.wp-admin .msithd-rp-list{ margin:12px 0; padding:0; }
.wp-admin .msithd-rp-item{ list-style:none; display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #ccd0d4; padding:8px; margin:8px 0; }
.wp-admin .msithd-rp-handle{ cursor:move; font-size:18px; color:#777; user-select:none; padding:0 6px; line-height:1; }
.wp-admin .msithd-rp-thumb img{ height:48px; width:auto; border:1px solid #ddd; background:#fff; padding:2px; }
.wp-admin .msithd-rp-placeholder{ border:2px dashed #bbb; height:60px; margin:8px 0; }

/* ===== JavaScript Sticky Navigation CSS ===== */

/* Remove the old sticky CSS and replace with this: */



/* Sticky state applied by JavaScript */
.msithd-mainbar.msithd-sticky-active {
  position: fixed !important;
  font-size: clamp(0.45rem, 1.5vw, 0.85rem);
  padding-top: 0.3rem;
  padding-bottom: 5rem;
  top: 0rem !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  background: var(--msithd-mainbar-bg, #9E363A) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}
/* Show logo only when sticky is active */
.msithd-mainbar.msithd-sticky-active .msithd-mobile-logo {
  display: flex;
  margin-top: 2rem;
}

.msithd-mainbar.msithd-sticky-active .msithd-mobile-logo img{
  
    border-radius: 100%;
    height: clamp(3.5rem, 8vw, 5.5rem);
  width: auto;
}

/* Define the spin animation */
@keyframes spin-once {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Apply it to the logo image when sticky is active */
.msithd-mainbar.msithd-sticky-active .msithd-mobile-logo img {
  animation: spin-once 0.8s ease-in-out; /* spins once in 0.8s */
}


/* Placeholder to prevent content jump */
.msithd-sticky-placeholder {
  width: 100%;
  background: transparent;
}

/* Ensure container works with fixed positioning */
.msithd-mainbar.msithd-sticky-active .msithd-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Smooth transition animation */
.msithd-mainbar {
  transition: all 0.3s ease;
}

/* Keep all your existing responsive CSS exactly as is */
@media (max-width:1200px) {
  .msithd-mainbar {
    font-size: clamp(0.6rem, 0.4vw + 0.45rem, 0.8rem);
  }
  .msithd-mainbar.msithd-sticky-active {
    font-size: clamp(0.45rem, 1.5vw, 0.6rem);
  }
  .msithd-mainbar.msithd-sticky-active .msithd-mobile-logo img {
    height: clamp(3rem, 8vw, 4.5rem);
  }
}

@media (max-width:991px) {
  .msithd-mainbar {
    font-size: clamp(0.55rem, 0.35vw + 0.4rem, 0.75rem);
  }
  .msithd-mainbar.msithd-sticky-active .msithd-mobile-logo img {
    height: clamp(1rem, 8vw, 3rem);
    flex-wrap: wrap;
  }

.msithd-mainbar.msithd-sticky-active .msithd-container {
  padding: 0;
}
}

@media (max-width:782px) {
  .msithd-mainbar {
    background: #fff;
    height: 5rem;
  }
  
  .msithd-mainbar.msithd-sticky-active {
    background: #fff !important;
  }
}