/* =========================================================
   UNIFIED PREMIUM NAVBAR
   Shared desktop navbar layer. Mobile menu styling remains owned by mobile-nav.css.
   This file intentionally contains final desktop overrides that beat runtime styles.
   ========================================================= */

@media (min-width:761px){
  body.navbar-unified .site-header .header-inner{
    min-height:var(--nav-h);
    align-items:center;
    gap:clamp(12px,1.2vw,22px);
  }

  body.navbar-unified .site-header .brand{
    flex:0 1 min(350px, 30vw) !important;
    min-width:min(190px, 24vw);
    max-width:min(350px, 30vw);
    overflow:hidden;
  }

  body.navbar-unified .site-header .brand-name{
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  body.navbar-unified .desktop-nav.desktop-nav-compact,
  body.navbar-unified .site-header .desktop-nav-compact.site-nav-hub{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    justify-content:flex-end;
    gap:clamp(1px,.22vw,5px);
    margin-left:auto;
    min-width:0;
  }

  body.navbar-unified .desktop-nav-compact .nav-button,
  body.navbar-unified .desktop-nav-compact .lang-switch a,
  body.navbar-unified .desktop-nav-compact .desktop-menu-toggle{
    position:relative;
    isolation:isolate;
    overflow:visible;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    border-radius:999px;
    border:1px solid transparent;
    background:transparent;
    color:var(--muted);
    font-size:clamp(.55rem,.57vw,.68rem);
    line-height:1;
    letter-spacing:.064em;
    text-transform:uppercase;
    white-space:nowrap;
    box-shadow:none;
    transform:translateZ(0);
    transform-origin:center;
    transition:color .28s var(--ease), transform .32s var(--ease), letter-spacing .32s var(--ease), border-color .32s var(--ease), background .32s var(--ease), box-shadow .32s var(--ease);
  }

  body.navbar-unified .desktop-nav-compact .nav-button{
    min-width:auto;
    padding:0 clamp(5px,.54vw,9px);
  }

  body.navbar-unified .desktop-nav-compact .nav-button[data-nav-key="between"],
  body.navbar-unified .desktop-nav-compact .nav-button[data-nav-key="institutions"]{
    padding-inline:clamp(6px,.62vw,10px);
  }

  body.navbar-unified .desktop-nav-compact .nav-button::after,
  body.navbar-unified .desktop-nav-compact .lang-switch a::after{
    content:"";
    position:absolute;
    left:50%;
    bottom:4px;
    width:0;
    height:2px;
    border-radius:999px;
    opacity:0;
    transform:translateX(-50%);
    background:linear-gradient(90deg, rgba(201,178,143,0), rgba(201,178,143,.74) 18%, rgba(242,236,227,.92) 50%, rgba(201,178,143,.74) 82%, rgba(201,178,143,0));
    filter:drop-shadow(0 0 8px rgba(201,178,143,.18));
    transition:opacity .32s var(--ease), width .32s var(--ease);
  }

  body.navbar-unified .desktop-nav-compact .nav-button:hover,
  body.navbar-unified .desktop-nav-compact .nav-button:focus-visible,
  body.navbar-unified .desktop-nav-compact .lang-switch a:hover,
  body.navbar-unified .desktop-nav-compact .lang-switch a:focus-visible{
    color:var(--text);
    transform:translateY(-1px) scale(1.045);
    letter-spacing:.078em;
    outline:none;
  }

  body.navbar-unified .desktop-nav-compact .nav-button:hover::after,
  body.navbar-unified .desktop-nav-compact .nav-button:focus-visible::after,
  body.navbar-unified .desktop-nav-compact .nav-button.is-active::after,
  body.navbar-unified .desktop-nav-compact .lang-switch a:hover::after,
  body.navbar-unified .desktop-nav-compact .lang-switch a:focus-visible::after,
  body.navbar-unified .desktop-nav-compact .lang-switch a.active::after{
    opacity:.86;
    width:calc(100% - 16px);
  }

  body.navbar-unified .desktop-nav-compact .nav-button.is-active,
  body.navbar-unified .desktop-nav-compact .lang-switch a.active{
    color:var(--text);
    opacity:1;
  }

  body.navbar-unified .desktop-nav-compact .desktop-menu-toggle{
    width:42px;
    min-width:42px;
    height:36px;
    min-height:36px;
    padding:0;
    gap:5px;
    flex:0 0 auto;
  }

  body.navbar-unified .desktop-nav-compact .desktop-menu-toggle span{
    width:17px;
    height:1.5px;
    border-radius:999px;
    background:currentColor;
  }

  body.navbar-unified .desktop-nav-compact .lang-switch{
    position:relative;
    display:flex;
    align-items:center;
    gap:1px;
    margin-left:3px;
    padding-left:8px;
  }

  body.navbar-unified .desktop-nav-compact .lang-switch::before{
    content:"";
    position:absolute;
    left:0;
    top:50%;
    width:1px;
    height:18px;
    transform:translateY(-50%);
    background:linear-gradient(180deg, transparent, rgba(201,178,143,.30), transparent);
  }

  body.navbar-unified .desktop-nav-compact .lang-switch a{
    min-width:32px;
    padding:0 6px;
  }

  body.navbar-unified.page-home .desktop-nav-compact .nav-button[href="/"],
  body.navbar-unified.page-home .desktop-nav-compact .nav-button[href="/pl/"]{
    display:none !important;
  }
}

/* Critical fix after PR #22:
   veritas.js has runtime breakpoint rules that may hide nav items from the 6th item onward.
   These higher-specificity rules keep Institutions/Instytucje and Press/Media visible on desktop. */
@media (min-width:761px){
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="institutions"],
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="press"]{
    display:inline-flex !important;
  }
}

@media (min-width:1061px){
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="author"],
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="contact"]{
    display:inline-flex !important;
  }
}

@media (max-width:1120px) and (min-width:761px){
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="author"]{
    display:none !important;
  }
}

@media (max-width:980px) and (min-width:761px){
  html body.veritas-universe.navbar-unified .site-header nav.desktop-nav.desktop-nav-compact.site-nav-hub a.nav-button[data-nav-key="between"]{
    display:none !important;
  }
}

@media (max-width:760px){
  body.navbar-unified{overflow-x:clip;}
  body.navbar-unified .site-header{max-width:100vw;overflow-x:hidden;}
  body.navbar-unified .site-header .header-inner{width:100%;max-width:100%;min-width:0;}
  body.navbar-unified .site-header .brand{min-width:0;}
  body.navbar-unified .desktop-nav.desktop-nav-compact{min-width:0;flex:0 0 auto;}
  body.navbar-unified .desktop-nav-compact .desktop-menu-toggle{width:50px;min-width:50px;height:50px;min-height:50px;}
  body.navbar-unified .mobile-menu-overlay{width:100vw;max-width:100vw;overflow-x:hidden;}
  body.navbar-unified .mobile-menu-panel{width:calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));max-width:min(420px, calc(100vw - 24px));margin-left:auto;margin-right:auto;box-sizing:border-box;}
  body.navbar-unified .mobile-menu-link,
  body.navbar-unified .mobile-menu-button{box-sizing:border-box;}
  body.navbar-unified .brand-name.unified-world-label{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
}

body.reduced-motion.navbar-unified .desktop-nav-compact .nav-button,
body.reduced-motion.navbar-unified .desktop-nav-compact .nav-button::after,
body.reduced-motion.navbar-unified .desktop-nav-compact .lang-switch a,
body.reduced-motion.navbar-unified .desktop-nav-compact .lang-switch a::after,
body.reduced-motion.navbar-unified .desktop-nav-compact .desktop-menu-toggle{
  transition:none !important;
}

body.reduced-motion.navbar-unified .desktop-nav-compact .nav-button:hover,
body.reduced-motion.navbar-unified .desktop-nav-compact .nav-button:focus-visible,
body.reduced-motion.navbar-unified .desktop-nav-compact .lang-switch a:hover,
body.reduced-motion.navbar-unified .desktop-nav-compact .lang-switch a:focus-visible,
body.reduced-motion.navbar-unified .desktop-nav-compact .desktop-menu-toggle:hover,
body.reduced-motion.navbar-unified .desktop-nav-compact .desktop-menu-toggle:focus-visible{
  transform:none;
}
