/* Akademik Retina 5.7.8 — unified hero blue, topic/article IA audit, no-scroll topics mega menu */
:root{
  --ar578-footer-blue:#005EB8;
  --ar578-footer-blue-dark:#004B93;
  --ar578-footer-blue-deep:#003D7A;
  --ar578-hero-text:#FFFFFF;
  --ar578-hero-muted:#E5F1F8;
  --ar578-hero-soft:#C8E2F2;
}

/* 1. Every hero uses the exact same blue family as the footer. */
.kn-hero,
.ar5-home-hero,
.ar5-page-hero,
.ar5-blog-hero,
.ar5-search-page-hero,
.ar5-contact-hero,
.ar5-article-hero,
.ar5-academic-hero,
.ar5-dictionary-hero,
.ar5-terminology-hero,
.ar5-dictionary-group-hero{
  background:var(--ar578-footer-blue)!important;
  color:var(--ar578-hero-text)!important;
  border-bottom-color:rgba(255,255,255,.20)!important;
}

/* Image hero keeps the approved image, but the framing/overlay uses footer blue. */
.ar5-home-hero .kn-hero-photo:after{
  background:linear-gradient(90deg,
    rgba(0,94,184,.97) 0%,
    rgba(0,94,184,.91) 34%,
    rgba(0,94,184,.63) 56%,
    rgba(0,94,184,.22) 78%,
    rgba(0,94,184,.06) 100%)!important;
}

/* All hero copy is contrast-safe on footer blue. */
.ar5-page-hero h1,
.ar5-blog-hero h1,
.ar5-search-page-hero h1,
.ar5-contact-hero h1,
.ar5-article-hero h1,
.ar5-academic-hero h1,
.ar5-dictionary-hero h1,
.ar5-terminology-hero h1,
.ar5-dictionary-group-hero h1,
.ar5-home-hero h1,
.ar5-home-hero .kn-label,
.ar5-home-hero .kn-hero-main>p{
  color:#FFFFFF!important;
}
.ar5-page-hero p,
.ar5-blog-hero p,
.ar5-search-page-hero p,
.ar5-contact-hero p,
.ar5-article-hero p,
.ar5-academic-hero p,
.ar5-dictionary-hero p,
.ar5-terminology-hero p,
.ar5-dictionary-group-hero p,
.ar5-academic-hero .ar5-breadcrumbs,
.ar5-academic-hero .ar5-breadcrumbs a,
.ar5-dictionary-hero .ar5-breadcrumbs,
.ar5-dictionary-hero .ar5-breadcrumbs a,
.ar5-terminology-hero .ar5-breadcrumbs,
.ar5-terminology-hero .ar5-breadcrumbs a,
.ar5-dictionary-group-hero .ar5-breadcrumbs,
.ar5-dictionary-group-hero .ar5-breadcrumbs a,
.ar5-page-hero .ar5-breadcrumbs,
.ar5-page-hero .ar5-breadcrumbs a,
.ar5-blog-hero .ar5-breadcrumbs,
.ar5-blog-hero .ar5-breadcrumbs a,
.ar5-search-page-hero .ar5-breadcrumbs,
.ar5-search-page-hero .ar5-breadcrumbs a,
.ar5-contact-hero .ar5-breadcrumbs,
.ar5-contact-hero .ar5-breadcrumbs a,
.ar5-article-hero .ar5-breadcrumbs,
.ar5-article-hero .ar5-breadcrumbs a{
  color:var(--ar578-hero-muted)!important;
}
.ar5-page-hero .ar5-eyebrow,
.ar5-blog-hero .ar5-eyebrow,
.ar5-search-page-hero .ar5-eyebrow,
.ar5-contact-hero .ar5-eyebrow,
.ar5-article-hero .ar5-eyebrow,
.ar5-academic-hero .ar5-eyebrow,
.ar5-dictionary-hero .ar5-eyebrow,
.ar5-terminology-hero .ar5-eyebrow,
.ar5-dictionary-group-hero .ar5-eyebrow{
  color:#FFFFFF!important;
}
.ar5-terminology-hero .ar5-terminology-meta span,
.ar5-dictionary-group-hero .ar5-terminology-meta span{
  background:rgba(255,255,255,.13)!important;
  border-color:rgba(255,255,255,.42)!important;
  color:#FFFFFF!important;
}
.ar5-dictionary-hero-stats{border-color:rgba(255,255,255,.30)!important}
.ar5-dictionary-hero-stats>div{border-color:rgba(255,255,255,.24)!important}
.ar5-dictionary-hero-stats strong{color:#FFFFFF!important}
.ar5-dictionary-hero-stats span{color:var(--ar578-hero-muted)!important}

/* Dictionary hero buttons are deliberately inverted against footer blue. */
.ar5-dictionary-hero .ar5-button-primary{
  background:#FFFFFF!important;
  border-color:#FFFFFF!important;
  color:var(--ar578-footer-blue-deep)!important;
}
.ar5-dictionary-hero .ar5-button-primary:hover,
.ar5-dictionary-hero .ar5-button-primary:focus-visible{
  background:#EAF3FA!important;
  border-color:#EAF3FA!important;
  color:var(--ar578-footer-blue-deep)!important;
}
.ar5-dictionary-hero .ar5-button-ghost{
  background:transparent!important;
  border-color:#FFFFFF!important;
  color:#FFFFFF!important;
}
.ar5-dictionary-hero .ar5-button-ghost:hover,
.ar5-dictionary-hero .ar5-button-ghost:focus-visible{
  background:#FFFFFF!important;
  color:var(--ar578-footer-blue-deep)!important;
}

/* 2. Topics mega menu: never scroll internally; all topic links visible at once. */
.ar55-mega-panel,
.ar5-mega-panel{
  max-height:none!important;
  overflow:visible!important;
}
.ar55-mega-topics .ar55-mega-panel{
  width:min(1280px,calc(100vw - 28px))!important;
  max-width:calc(100vw - 28px)!important;
}
.ar55-mega-topics .ar55-mega-head{
  grid-template-columns:260px minmax(0,1fr)!important;
}
.ar55-mega-topics .ar55-mega-head .ar5-mega-intro{
  padding:20px 22px!important;
}
.ar55-mega-topics .ar55-mega-featured a{
  min-height:90px!important;
  padding:16px 18px!important;
}
.ar55-mega-topics .ar55-mega-featured strong{font-size:15px!important}
.ar55-mega-topics .ar55-mega-links{
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:0 10px!important;
  padding:10px 16px 12px!important;
}
.ar55-mega-topics .ar55-mega-links a{
  min-height:52px!important;
  padding:8px 10px!important;
}
.ar55-mega-topics .ar55-mega-links a span{
  font-size:12px!important;
  line-height:1.25!important;
}
.ar55-mega-topics .ar55-mega-links a small{
  font-size:9px!important;
  margin-top:2px!important;
}
.ar55-mega-topics .ar55-mega-foot{
  padding:10px 18px 12px!important;
}

/* Academic menu also does not need an internal scrollbar. */
.ar55-mega-academic .ar55-mega-panel{max-height:none!important;overflow:visible!important}

/* 3. Home hero search: clearer, calmer, premium pill action. */
.ar5-home-hero .kn-search{
  display:grid!important;
  grid-template-columns:52px minmax(0,1fr) 138px!important;
  align-items:center!important;
  min-height:68px!important;
  height:68px!important;
  padding:6px!important;
  border:1px solid rgba(255,255,255,.72)!important;
  border-radius:999px!important;
  background:#FFFFFF!important;
  box-shadow:0 14px 34px rgba(0,48,94,.24)!important;
  overflow:hidden!important;
}
.ar5-home-hero .kn-search:focus-within{
  border-color:#FFFFFF!important;
  box-shadow:0 0 0 4px rgba(255,255,255,.22),0 16px 40px rgba(0,48,94,.28)!important;
  transform:none!important;
}
.ar5-home-hero .kn-search>span{
  color:var(--ar578-footer-blue)!important;
  font-size:27px!important;
}
.ar5-home-hero .kn-search input{
  height:100%!important;
  padding:0 10px 0 2px!important;
  color:#102A43!important;
  background:#FFFFFF!important;
  font-size:15px!important;
}
.ar5-home-hero .kn-search input::placeholder{color:#5E7180!important}
.ar5-home-hero .kn-search button{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  min-width:126px!important;
  height:54px!important;
  margin:0!important;
  padding:0 22px!important;
  border:0!important;
  border-radius:999px!important;
  background:var(--ar578-footer-blue-deep)!important;
  color:#FFFFFF!important;
  font-size:13px!important;
  font-weight:800!important;
  letter-spacing:.01em!important;
  text-transform:none!important;
  box-shadow:0 6px 16px rgba(0,61,122,.24)!important;
  transition:background .2s ease,box-shadow .2s ease,transform .2s ease!important;
}
.ar5-home-hero .kn-search button::after{
  content:"→";
  display:inline-block;
  font-size:17px;
  line-height:1;
  transition:transform .2s ease;
}
.ar5-home-hero .kn-search button:hover,
.ar5-home-hero .kn-search button:focus-visible{
  background:#102A43!important;
  box-shadow:0 8px 20px rgba(16,42,67,.28)!important;
  transform:translateY(-1px)!important;
  outline:0!important;
}
.ar5-home-hero .kn-search button:hover::after,
.ar5-home-hero .kn-search button:focus-visible::after{transform:translateX(3px)}

/* 4. Topic/article count labels: secondary labels remain clearly readable. */
.ar5-home-dictionary-grid a span,
.ar55-mega-links a small,
.ar5-dictionary-mini-groups a small,
.ar-topic span{
  color:#526A7A!important;
  font-weight:700!important;
}

@media(max-width:1240px) and (min-width:1021px){
  .ar55-mega-topics .ar55-mega-links{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .ar55-mega-topics .ar55-mega-head{grid-template-columns:220px minmax(0,1fr)!important}
}

@media(max-width:760px){
  .ar5-home-hero .kn-search{
    grid-template-columns:42px minmax(0,1fr)!important;
    height:auto!important;
    min-height:64px!important;
    padding:7px!important;
    border-radius:16px!important;
  }
  .ar5-home-hero .kn-search button{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    height:48px!important;
    margin-top:5px!important;
    border-radius:12px!important;
  }
}

/* Full-bleed section pseudo-backgrounds from v5.7.3 must match the hero itself. */
.kn-hero,
.ar5-home-hero,
.ar5-page-hero,
.ar5-blog-hero,
.ar5-search-page-hero,
.ar5-contact-hero,
.ar5-article-hero,
.ar5-academic-hero,
.ar5-dictionary-hero,
.ar5-terminology-hero,
.ar5-dictionary-group-hero{
  --ar573-band:var(--ar578-footer-blue)!important;
}
.kn-hero::before,
.ar5-home-hero::before,
.ar5-page-hero::before,
.ar5-blog-hero::before,
.ar5-search-page-hero::before,
.ar5-contact-hero::before,
.ar5-article-hero::before,
.ar5-academic-hero::before,
.ar5-dictionary-hero::before,
.ar5-terminology-hero::before,
.ar5-dictionary-group-hero::before{
  background:var(--ar578-footer-blue)!important;
}
