/* ==========================================================================
   Module main headers — SEO-friendly site chrome for verticals
   (mobiles / autos / recipes / entertainment / movies / series / anime)
   ========================================================================== */

:root {
  --fe-mod-header-h: 56px;
}

/* —— Site logo (mirrors fe885 brand treatment) —— */
.fe-mod-header__site {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  margin-right: 0.5rem;
  padding-right: 0.85rem;
  border-right: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  min-height: 40px;
}

.fe-mod-header__brand-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.fe-mod-header__logo {
  display: block;
  object-fit: contain;
  object-position: left center;
}

.fe-mod-header__logo--desktop {
  height: 36px;
  width: auto;
  max-width: 160px;
}

.fe-mod-header__logo--compact {
  display: none;
  height: 36px;
  width: 36px;
}

.fe-mod-header__site-name {
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.fe-mod-header__site--wordmark {
  gap: 0.5rem;
}

.fe-mod-header__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #0052cc 0%, #2563eb 100%);
  box-shadow: 0 1px 2px rgba(0, 82, 204, 0.35);
}

.fe-mod-header__site--has-logo .fe-mod-header__mark--hide-if-logo {
  display: none;
}

.fe-mod-header__logo.is-failed,
.fe-mod-header__logo[hidden] {
  display: none !important;
}

.fe-mod-header__brand-icon:not(:has(.fe-mod-header__logo:not(.is-failed):not([hidden]))) .fe-mod-header__mark--hide-if-logo {
  display: inline-flex;
}

/* —— Auth —— */
.fe-mod-header__auth {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
}

.fe-mod-header__login,
.fe-mod-header__signup {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.fe-mod-header__login {
  color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  background: transparent;
}

.fe-mod-header__login:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.fe-mod-header__signup {
  color: #fff;
  background: linear-gradient(135deg, #0052cc 0%, #2563eb 100%);
  border: 1px solid transparent;
}

.fe-mod-header__signup:hover {
  filter: brightness(1.06);
}

.fe-mod-header__user {
  position: relative;
}

.fe-mod-header__user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.fe-mod-header__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0052cc 0%, #2563eb 100%);
}

.fe-mod-header__chev {
  font-size: 0.65rem;
  opacity: 0.7;
}

.fe-mod-header__user-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 12rem;
  padding: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 80;
}

.fe-mod-header__user-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.fe-mod-header__user-link:hover {
  background: #f1f5f9;
}

.fe-mod-header__user-link--danger {
  color: #b91c1c;
}

.fe-mod-header__user-sep {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: #e2e8f0;
}

/* Dark surfaces */
.fe-mod-header--on-dark.fe-mod-header__site,
.fe-mod-header--on-dark .fe-mod-header__site {
  border-right-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.fe-mod-header--on-dark.fe-mod-header__auth .fe-mod-header__login,
.fe-mod-header--on-dark .fe-mod-header__login {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.18);
}

.fe-mod-header--on-dark.fe-mod-header__auth .fe-mod-header__user-trigger,
.fe-mod-header--on-dark .fe-mod-header__user-trigger {
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.fe-mod-header--on-dark.fe-mod-header__auth .fe-mod-header__user-panel,
.fe-mod-header--on-dark .fe-mod-header__user-panel {
  background: #111827;
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.fe-mod-header--on-dark.fe-mod-header__auth .fe-mod-header__user-link:hover,
.fe-mod-header--on-dark .fe-mod-header__user-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fe-mod-header--on-dark.fe-mod-header__auth .fe-mod-header__user-sep,
.fe-mod-header--on-dark .fe-mod-header__user-sep {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 720px) {
  .fe-mod-header__logo--desktop {
    display: none;
  }

  .fe-mod-header__logo--compact {
    display: block;
  }

  .fe-mod-header__site {
    padding-right: 0.55rem;
    margin-right: 0.25rem;
  }

  .fe-mod-header__login span {
    display: none;
  }
}

/* —— Sticky module banners (mobiles / autos / recipes) —— */
.fe-mod-main-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--fe-mod-header-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.fe-mod-main-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.fe-mod-main-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1;
}

.fe-mod-main-header__brand i {
  font-size: 0.95rem;
}

.fe-mod-main-header__nav {
  flex: 1 1 auto;
  min-width: 0;
}

/* Module primary nav — clean underline tabs (not pill clusters) */
.fe-mod-nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.fe-mod-nav__list::-webkit-scrollbar {
  display: none;
}

.fe-mod-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: inherit;
  opacity: 0.72;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.fe-mod-nav__link:hover {
  opacity: 1;
  background: color-mix(in srgb, currentColor 7%, transparent);
}

.fe-mod-nav__link.is-active,
.fe-mod-nav__link[aria-current="page"] {
  opacity: 1;
  background: color-mix(in srgb, currentColor 10%, transparent);
  box-shadow: inset 0 -2px 0 currentColor;
}

.fe-mod-main-header--mobiles {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.fe-mod-main-header--mobiles .fe-mod-main-header__brand {
  color: #0f172a;
}

.fe-mod-main-header--mobiles .fe-mod-main-header__brand i {
  color: #0891b2;
}

.fe-mod-main-header--mobiles .fe-mod-nav__link.is-active,
.fe-mod-main-header--mobiles .fe-mod-nav__link[aria-current="page"] {
  color: #0e7490;
  box-shadow: inset 0 -2px 0 #0891b2;
  background: rgba(8, 145, 178, 0.08);
}

.fe-mod-main-header--autos {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.fe-mod-main-header--autos .fe-mod-main-header__brand {
  color: #0f172a;
}

.fe-mod-main-header--autos .fe-mod-main-header__brand i {
  color: var(--au-primary, #16a34a);
}

.fe-mod-main-header--autos .fe-mod-nav__link.is-active,
.fe-mod-main-header--autos .fe-mod-nav__link[aria-current="page"] {
  color: var(--au-primary-dark, #15803d);
  box-shadow: inset 0 -2px 0 var(--au-primary, #16a34a);
  background: color-mix(in srgb, var(--au-primary, #16a34a) 10%, transparent);
}

.fe-mod-main-header--recipes {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.fe-mod-main-header--recipes .fe-mod-main-header__brand {
  color: #0f172a;
}

.fe-mod-main-header--recipes .fe-mod-main-header__brand i {
  color: var(--recipes-primary, #ea580c);
}

.fe-mod-main-header--recipes .fe-mod-nav__link.is-active,
.fe-mod-main-header--recipes .fe-mod-nav__link[aria-current="page"] {
  color: var(--recipes-primary, #ea580c);
  box-shadow: inset 0 -2px 0 var(--recipes-primary, #ea580c);
  background: color-mix(in srgb, var(--recipes-primary, #ea580c) 10%, transparent);
}

.fe-mod-main-header--work {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.fe-mod-main-header--work .fe-mod-main-header__brand {
  color: #0f172a;
}

.fe-mod-main-header--work .fe-mod-main-header__brand i {
  color: var(--jobs-primary, #2563eb);
}

.fe-mod-main-header--work .fe-mod-nav__link.is-active,
.fe-mod-main-header--work .fe-mod-nav__link[aria-current="page"] {
  color: var(--jobs-primary, #2563eb);
  box-shadow: inset 0 -2px 0 var(--jobs-primary, #2563eb);
  background: color-mix(in srgb, var(--jobs-primary, #2563eb) 10%, transparent);
}

.fe-mod-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--jobs-primary, #2563eb);
}

/* Legacy jobs sticky nav must never double up with module chrome */
.fe-module-shell .j45-nav {
  display: none !important;
}

@media (max-width: 900px) {
  .fe-mod-main-header__inner {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 0.35rem 0.5rem;
  }

  .fe-mod-main-header__nav {
    grid-column: 1 / -1;
    order: unset;
    flex: none;
    width: 100%;
  }

  .fe-mod-header__auth {
    margin-left: 0;
    justify-self: end;
  }

  .fe-mod-nav__link {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .fe-mod-main-header__brand span {
    max-width: 5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Integrate logo into entertainment module navs */
.mfc-nav-inner .fe-mod-header__site,
.sfx-nav-inner .fe-mod-header__site,
.anx-nav__inner .fe-mod-header__site,
.ent-xp-nav__inner .fe-mod-header__site {
  align-self: center;
}

.mfc-nav__actions .fe-mod-header__auth,
.sfx-nav__actions .fe-mod-header__auth,
.anx-nav__actions .fe-mod-header__auth,
.ent-xp-nav__actions .fe-mod-header__auth {
  margin-left: 0.15rem;
}

/* Detail page section chrome sits under the module banner */
.fe-module-shell--catalog .md-section-nav,
.fe-module-shell--catalog .au-page-chrome,
.fe-module-shell--catalog .au-page-chrome.is-sticky,
.fe-module-shell--catalog .rp-page-chrome {
  top: var(--fe-mod-header-h, 56px) !important;
}

.fe-module-shell .mfc-section-nav {
  top: var(--mfc-nav-h, 56px);
}

.fe-module-shell .md-section-nav a,
.fe-module-shell .au-section-nav a,
.fe-module-shell .rp-section-nav a,
.fe-module-shell .mfc-section-nav a,
.fe-module-shell .sfx-section-nav a,
.fe-module-shell .anx-section-nav a {
  border-radius: 0 !important;
  background: transparent !important;
  border-bottom: 2px solid transparent;
  font-weight: 550;
}

.fe-module-shell .md-section-nav a:hover,
.fe-module-shell .md-section-nav a.active,
.fe-module-shell .md-section-nav a[aria-current="location"],
.fe-module-shell .au-section-nav a:hover,
.fe-module-shell .au-section-nav a.active,
.fe-module-shell .au-section-nav a[aria-current="location"],
.fe-module-shell .rp-section-nav a:hover,
.fe-module-shell .rp-section-nav a.active,
.fe-module-shell .rp-section-nav a[aria-current="location"],
.fe-module-shell .mfc-section-nav a:hover,
.fe-module-shell .mfc-section-nav a.is-active,
.fe-module-shell .sfx-section-nav a:hover,
.fe-module-shell .sfx-section-nav a.is-active,
.fe-module-shell .anx-section-nav a:hover,
.fe-module-shell .anx-section-nav a.is-active {
  background: transparent !important;
  border-bottom-color: currentColor;
}

/* Real site logo on dark entertainment headers — tight plate, no oversized blank box */
.fe-mod-header--on-dark.fe-mod-header__site--has-logo {
  gap: 0;
}

.fe-mod-header__site--logo-plate .fe-mod-header__brand-icon {
  line-height: 0;
  padding: 0.2rem 0.4rem;
  border-radius: 0.35rem;
  background: #fff;
}

.fe-mod-header--on-dark .fe-mod-header__logo--desktop {
  display: block;
  height: 26px;
  width: auto;
  max-width: 118px;
  object-fit: contain;
  object-position: left center;
}

.fe-mod-header--on-dark .fe-mod-header__logo--compact {
  display: none !important;
}

@media (max-width: 720px) {
  .fe-mod-header--on-dark .fe-mod-header__logo--desktop {
    display: none !important;
  }

  .fe-mod-header--on-dark .fe-mod-header__logo--compact {
    display: block !important;
    height: 28px !important;
    width: auto !important;
    max-width: 28px !important;
  }
}

/* Hide global header whenever a module header is on the page */
body.fe-module-shell .fe885-header,
body.fe-module-shell .fe885-announce,
body.fe-module-shell .fe885-mega-portal,
body.fe-module-shell .fe885-mega-pointer,
body.fe-module-shell [data-fe885-mobile-drawer],
body:has(.fe-mod-main-header) .fe885-header,
body:has(.fe-mod-main-header) .fe885-announce,
body:has(.fe-mod-main-header) .fe885-mega-portal,
body:has(.fe-mod-main-header) [data-fe885-mobile-drawer] {
  display: none !important;
}


