/* Agent B (SPEC3): header, mega-menus, live search suggestions, language flag.
   Loaded after local.css/extra.css; theme.css (H) is loaded last from the footer. */

/* ---------- top bar ---------- */
.header .nav-menu > li > a { display: flex; align-items: center; letter-spacing: .3px; }
.header .nav-menu > li > a .fa { margin-right: 7px; color: #f48625; transition: transform .2s, color .2s; }
.header .nav-menu > li > a:hover .fa,
.header .nav-menu > li > a.active .fa { color: #fff; transform: scale(1.12); }
.header .nav-menu > li > a.nav-fav .fa-heart { color: #f48625; }
.mflag { display: inline-block; width: 18px; margin-right: 8px; text-align: center; font-size: 15px; line-height: 1; vertical-align: -1px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* ---------- mega menu (desktop) ---------- */
.nav-menu > li > .hidden-menu.hm-mega {
  width: 960px; padding: 6px; top: 100%; left: 0;
  background: #1b1b1b; border: 1px solid rgba(244, 134, 37, .25); border-top: 3px solid #f48625;
  border-radius: 0 0 8px 8px; box-shadow: 0 14px 30px rgba(0, 0, 0, .7); z-index: 600;
}
.nav-menu > li > .hidden-menu.hm-series { width: 940px; }
.hm-mega .menu-container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hm-mega .menu-section {
  background: #242424; border: 1px solid rgba(255, 255, 255, .07); border-radius: 6px; padding: 12px 10px;
  max-height: 440px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #f48625 rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(8px); animation: hmFadeIn .28s ease forwards;
}
.hm-mega .menu-section:nth-child(1) { animation-delay: .04s; }
.hm-mega .menu-section:nth-child(2) { animation-delay: .1s; }
.hm-mega .menu-section:nth-child(3) { animation-delay: .16s; }
.hm-mega .menu-section:nth-child(4) { animation-delay: .22s; }
@keyframes hmFadeIn { to { opacity: 1; transform: translateY(0); } }
.hm-mega .menu-section::-webkit-scrollbar { width: 3px; }
.hm-mega .menu-section::-webkit-scrollbar-track { background: rgba(0, 0, 0, .3); }
.hm-mega .menu-section::-webkit-scrollbar-thumb { background: #f48625; border-radius: 3px; }
.hm-mega .menu-section-title, .hm-mega .menu-subsection-title { display: flex; align-items: center; white-space: nowrap; }
.hm-mega .menu-section-title {
  color: #f48625; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  margin: 0 0 8px; padding: 0 4px 7px; border-bottom: 1px solid rgba(244, 134, 37, .35);
}
.hm-mega .menu-section-title .fa { margin-right: 7px; font-size: 14px; }
.hm-mega .menu-subsection { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.hm-mega .menu-subsection-title { color: #9a9a9a; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 5px; padding: 0 4px; }
.hm-mega .menu-subsection-title .fa { margin-right: 6px; font-size: 11px; color: #f48625; }
.hm-mega .menu-section a {
  display: flex; align-items: center; padding: 5px 8px; margin-bottom: 1px; border-radius: 4px;
  color: #cfcfcf; font-size: 13px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, color .15s, transform .15s;
}
.hm-mega .menu-section a .fa { width: 16px; margin-right: 8px; text-align: center; font-size: 12px; color: #f48625; opacity: .8; flex: none; }
.hm-mega .menu-section a:hover { background: #f48625; color: #fff; transform: translateX(3px); }
.hm-mega .menu-section a:hover .fa { color: #fff; opacity: 1; }
.hm-mega .menu-subsection a { font-size: 12.5px; }
.hm-mega .menu-badge {
  margin-left: auto; padding: 1px 6px; border-radius: 9px; background: #f48625; color: #fff;
  font-size: 9px; line-height: 13px; font-weight: 700; letter-spacing: .3px; animation: hmPulse 2s infinite;
}
.hm-mega .menu-section a:hover .menu-badge { background: #fff; color: #f48625; }
@keyframes hmPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 134, 37, .6); } 60% { box-shadow: 0 0 0 5px rgba(244, 134, 37, 0); } }

/* "Tapez une Année" */
.year-custom-selector { margin-top: 6px; padding: 0 4px; }
.year-input-group { display: flex; gap: 6px; align-items: stretch; }
.year-input {
  flex: 1; min-width: 0; width: 100%; height: 32px; padding: 0 8px; text-align: center;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(244, 134, 37, .35); border-radius: 5px;
  color: #fff; font-size: 13px; font-weight: 600; -moz-appearance: textfield; transition: border-color .2s, box-shadow .2s;
}
.year-input::-webkit-outer-spin-button, .year-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.year-input::placeholder { color: rgba(255, 255, 255, .45); font-weight: 400; font-style: italic; }
.year-input:focus { outline: none; border-color: #f48625; box-shadow: 0 0 8px rgba(244, 134, 37, .35); background: rgba(255, 255, 255, .12); }
.year-input.is-error { border-color: #ff4444; box-shadow: 0 0 10px rgba(255, 68, 68, .5); animation: hmShake .3s; }
@keyframes hmShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* selectors carry 3 classes to beat styles.css' global `button:not(.color-btn):not([class*=fr])` rule */
.hm-mega .menu-section .year-go-btn {
  flex: none; width: 40px; height: 32px; line-height: 32px; padding: 0; border: 0; border-radius: 5px; cursor: pointer;
  background: linear-gradient(45deg, #f48625, #ff8533); color: #fff; font-size: 13px; transition: transform .2s, box-shadow .2s;
}
.hm-mega .menu-section .year-go-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(244, 134, 37, .45); }
.hm-mega .menu-section .year-go-btn:active { transform: translateY(0) scale(.97); }

/* ---------- search box ---------- */
.hd-right { display: flex; align-items: flex-start; }
.hd-right .search-wrap { width: 250px; }
.search-box input, .search-box input:focus {
  padding: 0 34px 0 12px; border-radius: 4px; background-color: #2b2b2b; border: 1px solid #444;
  box-shadow: none; font-size: 13px; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: #f48625; box-shadow: 0 0 0 3px rgba(244, 134, 37, .18); }
.search-box input::placeholder { color: #8a8a8a; }
.search-box button:hover { color: #fff !important; }
.search-box.is-loading button .fa:before { content: "\f110"; animation: fa-spin 1s infinite linear; display: inline-block; }

/* suggestions dropdown */
.sg-drop {
  position: absolute; top: calc(100% + 6px); right: 0; width: 460px; max-height: min(72vh, 640px); overflow-y: auto; overflow-x: hidden;
  background: #1c1c1c; border: 1px solid rgba(244, 134, 37, .4); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .75);
  z-index: 1000; text-align: left; white-space: normal; padding: 6px 0; scrollbar-width: thin; scrollbar-color: #f48625 #1c1c1c;
}
.sg-drop[hidden] { display: none; }
.sg-drop::-webkit-scrollbar { width: 4px; }
.sg-drop::-webkit-scrollbar-thumb { background: #f48625; border-radius: 2px; }
.sg-head {
  display: flex; align-items: center; padding: 8px 14px 4px;
  color: #f48625; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.sg-head .fa { margin-right: 6px; }
.sg-drop .sg-head .sg-clear { margin-left: auto; height: auto; line-height: 1; color: #888; font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: pointer; background: none; border: 0; padding: 0; }
.sg-drop .sg-head .sg-clear:hover { color: #fff; background: none; }
.sg-item {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px; color: #ddd; text-decoration: none;
  line-height: 1.3; cursor: pointer; border-left: 3px solid transparent; transition: background .12s;
}
.sg-item:hover, .sg-item.is-active { background: rgba(244, 134, 37, .16); border-left-color: #f48625; color: #fff; }
.sg-item img { flex: none; width: 40px; height: 58px; object-fit: cover; border-radius: 3px; background: #333; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.sg-item.sg-person img { width: 42px; height: 42px; border-radius: 50%; }
.sg-txt { min-width: 0; flex: 1; }
.sg-title { display: block; font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-title mark { background: none; color: #f48625; }
.sg-meta { display: block; margin-top: 2px; font-size: 12px; color: #9a9a9a; }
.sg-meta .sg-badge { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 2px; background: #f48625; color: #fff; font-size: 9px; line-height: 14px; font-weight: 700; vertical-align: 1px; }
.sg-meta .sg-kind { color: #777; }
.sg-item .sg-go { flex: none; color: #555; font-size: 12px; }
.sg-item.is-active .sg-go, .sg-item:hover .sg-go { color: #f48625; }
.sg-all {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 0; padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, .08); color: #f48625; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.sg-all:hover, .sg-all.is-active { background: rgba(244, 134, 37, .16); color: #fff; }
.sg-empty { padding: 18px 14px; color: #999; font-size: 13px; text-align: center; }
.sg-empty b { color: #fff; }
.sg-error { color: #ff6b6b; }

/* ---------- language flag ---------- */
.hd-lang { position: relative; margin-left: 10px; }
.hd-right .hd-lang .hd-lang-btn {
  display: flex; align-items: center; height: 34px; line-height: 32px; padding: 0 10px; border: 1px solid #444; border-radius: 4px;
  background: #2b2b2b; color: #ddd; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s;
}
.hd-lang-btn .mflag { margin-right: 6px; width: auto; }
.hd-lang-btn .fa { margin-left: 6px; font-size: 11px; color: #888; }
.hd-right .hd-lang .hd-lang-btn:hover, .hd-right .hd-lang.is-open .hd-lang-btn { border-color: #f48625; color: #fff; background: #2b2b2b; }
.hd-lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 190px; padding: 6px 0; z-index: 1000;
  background: #1c1c1c; border: 1px solid rgba(244, 134, 37, .4); border-radius: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .7);
}
.hd-lang-menu[hidden] { display: none; }
.hd-lang-menu a { display: flex; align-items: center; padding: 8px 14px; color: #ddd; font-size: 13px; white-space: nowrap; }
.hd-lang-menu a .fa { width: 18px; margin-right: 8px; text-align: center; color: #f48625; }
.hd-lang-menu a:hover { background: rgba(244, 134, 37, .16); color: #fff; }

/* ---------- responsive ---------- */
@media screen and (max-width: 1320px) {
  .nav-menu > li > .hidden-menu.hm-mega { width: 880px; }
  .nav-menu > li > .hidden-menu.hm-series { width: 780px; }
  .hm-series .menu-section a { font-size: 12.5px; padding-left: 6px; padding-right: 6px; }
  /* icon-only favourites button so the bar fits between 1220 and 1320px */
  .header .hd-right .bookmark-btn { font-size: 0; padding: 0 10px; }
  .header .hd-right .bookmark-btn .fa { font-size: 15px; margin: 0; line-height: 32px; }
  .hd-right .search-wrap { width: 220px; }
}
@media screen and (max-width: 760px) {
  .hd-right { display: block; }
}

/* mobile side panel (libs3 clones #nav-menu and moves #hd-right into #side-panel below 560px) */
.side-panel .hidden-menu.hm-mega { width: 100%; padding: 4px 0; border: 0; border-top: 2px solid #f48625; border-radius: 0; box-shadow: none; background: #2a2a2a; }
.side-panel .hm-mega .menu-container { display: block; }
.side-panel .hm-mega .menu-section { max-height: none; overflow: visible; margin-bottom: 6px; padding: 8px; opacity: 1; transform: none; animation: none; }
.side-panel .hm-mega .menu-section a { white-space: normal; }
.side-panel .hd-right { display: block; }
.side-panel .search-wrap { width: 100%; }
.side-panel .sg-drop { position: static; width: 100%; max-height: none; margin-top: 6px; box-shadow: none; }
.side-panel .hd-lang { margin: 8px 0 0; }
.side-panel .hd-lang-btn { width: 100%; justify-content: center; }
.side-panel .hd-lang-menu { position: static; margin-top: 4px; }
