/* Eygtag editorial navigation across site page types. Standalone tools are excluded at injection. */
@view-transition { navigation: auto; }
@media(prefers-reduced-motion:no-preference){
  @keyframes eg-global-curtain{from{clip-path:circle(0% at 50% 50%);opacity:.88}to{clip-path:circle(75% at 50% 50%);opacity:1}}
  @keyframes eg-global-title{from{opacity:.55;translate:0 12px}to{opacity:1;translate:0 0}}
  ::view-transition-old(root){animation:180ms ease-in both eg-global-out}
  ::view-transition-new(root){animation:620ms cubic-bezier(.2,.78,.16,1) both eg-global-curtain}
  @keyframes eg-global-out{to{opacity:.55}}
  body:not(.homepage-layout):not(.article-page) :is(main h1,main h2):first-child{animation:eg-global-title 500ms cubic-bezier(.2,.7,.2,1) both}
  body:not(.homepage-layout):not(.article-page) :is(article,.story-card,.news-card,.section-card):hover{translate:0 -2px;transition:translate 220ms ease}
}
@media(prefers-reduced-motion:reduce){::view-transition-new(root),::view-transition-old(root){animation-duration:.01ms!important}}

/* Living Interface V5: restrained discoverable motion across editorial surfaces. */
@media(prefers-reduced-motion:no-preference){
  @keyframes eg-stagger-in{from{opacity:.2;translate:0 17px}to{opacity:1;translate:0 0}}
  .eg-motion-reveal.eg-motion-visible{animation:eg-stagger-in 530ms cubic-bezier(.2,.75,.25,1) both;animation-delay:var(--eg-stagger-delay,0ms)}
  :is(.editorial-header,.site-header,header.site-header).eg-header-compact{transition:padding .28s ease,background-color .28s ease,box-shadow .28s ease;box-shadow:0 1px 0 #454c49}
  :is(.editorial-header,.site-header,header.site-header) :is(.header-search,form[role="search"],.search-field, input[type="search"]){transition:border-color .22s ease,background-color .22s ease}
  :is(.editorial-header,.site-header,header.site-header) :is(.header-search,form[role="search"],.search-field):focus-within{border-color:#8ba6a9;background-color:#282f31}
  .eg-motion-counter{font-variant-numeric:tabular-nums}
  :root[dir="ltr"] ::view-transition-new(root){animation-direction:normal}
}
.eg-reading-active{scroll-margin-top:110px}
@media(prefers-reduced-motion:reduce){.eg-motion-reveal{opacity:1!important;animation:none!important}.eg-header-compact{transition:none!important}}

/* Fixed reading controls must remain viewport-anchored above editorial layers. */
body:not(.tools-workspace) eg-back-to-top{position:static!important;display:contents}
body:not(.tools-workspace) .back-to-top{position:fixed!important;z-index:2147480000!important;inset-block-end:max(20px,env(safe-area-inset-bottom))!important;inset-inline-end:max(20px,env(safe-area-inset-right))!important;inset-block-start:auto!important;inline-size:50px!important;block-size:50px!important;background:#343a3b!important;border:1px solid #65716d!important;color:#e7ede8!important;box-shadow:none!important;backdrop-filter:none!important}
body:not(.tools-workspace) .back-to-top.is-visible{opacity:1!important;visibility:visible!important;pointer-events:auto!important}
body:not(.tools-workspace) .back-to-top:hover{background:#465251!important;border-color:#a0b3aa!important}

/* Living Experience V6: portal, depth, story reading, spotlight and precise tactile response. */
@media(prefers-reduced-motion:no-preference){
 @keyframes eg-depth-exit{to{opacity:.4;transform:scale(.975)}}
 @keyframes eg-portal-arrive{from{clip-path:circle(0% at var(--eg-portal-x,50%) var(--eg-portal-y,50%));opacity:.95}to{clip-path:circle(150% at var(--eg-portal-x,50%) var(--eg-portal-y,50%));opacity:1}}
 ::view-transition-old(root){animation:eg-depth-exit 330ms ease-in both!important}
 ::view-transition-new(root){animation:eg-portal-arrive 700ms cubic-bezier(.16,.78,.18,1) both!important}
 .eg-interactive-press{transition:scale .18s ease,background-color .18s ease}
 .eg-interactive-press:active{scale:.97}
 :is(main h2,main h3).eg-magnetic-heading{transition:translate .22s ease}
 :is(main h2,main h3).eg-magnetic-heading:hover{translate:0 -2px}
 .eg-scroll-story img{transition:scale .5s cubic-bezier(.18,.72,.2,1)}
 .eg-scroll-story.eg-motion-visible img{scale:1.018}
 dialog.eg-spotlight-search[open]{animation:eg-spotlight-enter .3s cubic-bezier(.2,.75,.2,1) both}
 @keyframes eg-spotlight-enter{from{opacity:0;transform:translateY(-16px) scale(.98)}to{opacity:1;transform:none}}
}
.eg-spotlight-search{width:min(720px,calc(100vw - 32px));max-width:720px;border:1px solid #59625f;border-radius:16px;padding:22px;background:#222829;color:#f0f0eb;box-shadow:0 20px 70px #0008}
.eg-spotlight-search::backdrop{background:#080c0cd9}
.eg-spotlight-search form{display:flex;gap:10px;align-items:center}
.eg-spotlight-search input{flex:1;min-width:0;padding:13px;background:#161b1c;border:1px solid #68726f;border-radius:9px;color:#f0f0eb}
.eg-spotlight-search button{padding:12px;border:1px solid #68726f;border-radius:9px;background:#36413f;color:#f0f0eb;cursor:pointer}
.eg-reading-journey{position:fixed;bottom:16px;inset-inline-start:18px;z-index:85;padding:7px 12px;border:1px solid #4c5854;background:#262c2cee;color:#dae5dc;border-radius:999px;font-size:12px;pointer-events:none}
@media(max-width:720px){.eg-reading-journey{bottom:12px;inset-inline-start:10px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.eg-spotlight-search[open],.eg-interactive-press{animation:none!important;transition:none!important}}

/* Editorial consistency V7: preserve native search sizing and fixed controls. */
:is(.editorial-header,.site-header,header.site-header) :is(.header-search,form[role="search"],.search-field,input[type="search"]){transition:border-color .2s ease,background-color .2s ease!important}
:is(.editorial-header,.site-header,header.site-header) :is(.header-search,form[role="search"],.search-field):focus-within{border-color:#8ba6a9!important}
body:not(.tools-workspace) .back-to-top{width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;max-width:50px!important;max-height:50px!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:50%!important;aspect-ratio:1!important;line-height:1!important;transform:translateY(10px) scale(.95)!important}
body:not(.tools-workspace) .back-to-top.is-visible{transform:translateY(0) scale(1)!important}
body:not(.tools-workspace) .back-to-top .ui-icon{width:23px!important;height:23px!important;stroke:currentColor!important;fill:none!important}
@media(prefers-reduced-motion:no-preference){
  @keyframes eg-first-arrival{from{opacity:.4;filter:brightness(.78);translate:0 10px}to{opacity:1;filter:brightness(1);translate:0 0}}
  body.eg-first-arrival :is(main,#main-content):first-of-type{animation:eg-first-arrival 570ms cubic-bezier(.18,.78,.22,1) both}
}
@media(prefers-reduced-motion:reduce){body.eg-first-arrival :is(main,#main-content):first-of-type{animation:none!important}}


/* First Impression V8: reveal from visible outer edges toward the center. */
@property --eg-inner-gap { syntax:"<percentage>"; initial-value:0%; inherits:false; }
@media(prefers-reduced-motion:no-preference){
 @keyframes eg-build-inward{from{--eg-inner-gap:68%;opacity:.88}to{--eg-inner-gap:0%;opacity:1}}
 body.eg-first-arrival :is(main,#main-content):first-of-type{
   animation:eg-build-inward 780ms cubic-bezier(.18,.76,.2,1) both!important;
   mask-image:radial-gradient(ellipse farthest-corner at center,transparent 0%,transparent calc(var(--eg-inner-gap) - 1%),#000 var(--eg-inner-gap));
   translate:none!important;transform:none!important;
 }
}
@media(prefers-reduced-motion:reduce){body.eg-first-arrival :is(main,#main-content):first-of-type{mask-image:none!important;animation:none!important}}

/* V9 homepage: single synchronized entrance, no delayed sidebar/cards/headline replay. */
@media(prefers-reduced-motion:no-preference){
 body.homepage-layout main,body.homepage-layout #main-content{animation:none!important;translate:none!important;mask-image:none!important}
 body.homepage-layout.eg-first-arrival :is(main,#main-content):first-of-type{animation:none!important;mask-image:none!important;translate:none!important}
 body.homepage-layout .eg-motion-reveal.eg-motion-visible{animation:none!important;animation-delay:0ms!important;opacity:1!important;translate:none!important}
 body.homepage-layout :is(.home-news-section__head h2,.section-heading h2,.home-news-lead__body h1){animation:none!important;opacity:1!important;transform:none!important}
 body.homepage-layout :is(.home-sidebar,.home-reference-sidebar,.home-sidebar-story){animation:none!important;animation-delay:0ms!important;opacity:1!important;transform:none!important;translate:none!important}
}

/* Floating-controls V10: explicit physical sides avoid RTL logical/physical collisions. */
body:not(.tools-workspace) .back-to-top{right:max(20px,env(safe-area-inset-right))!important;left:auto!important;inset-inline-start:auto!important;inset-inline-end:auto!important}
body:not(.tools-workspace) .eg-reading-journey{left:max(16px,env(safe-area-inset-left))!important;right:auto!important;inset-inline-start:auto!important;inset-inline-end:auto!important;bottom:max(24px,env(safe-area-inset-bottom))!important;max-width:calc(100vw - 110px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:480px){body:not(.tools-workspace) .back-to-top{right:max(12px,env(safe-area-inset-right))!important}body:not(.tools-workspace) .eg-reading-journey{left:max(10px,env(safe-area-inset-left))!important;max-width:calc(100vw - 90px)}}

/* V11: reserve an independent vertical lane for the reading counter above Up. */
body:not(.tools-workspace) .eg-reading-journey{
 position:fixed!important;left:auto!important;right:max(16px,env(safe-area-inset-right))!important;
 inset-inline-start:auto!important;inset-inline-end:auto!important;
 top:auto!important;bottom:max(88px,calc(env(safe-area-inset-bottom) + 88px))!important;
 max-width:min(180px,calc(100vw - 32px))!important;z-index:89!important;
 box-sizing:border-box;pointer-events:none;
}
@media(max-width:480px){body:not(.tools-workspace) .eg-reading-journey{right:max(12px,env(safe-area-inset-right))!important;bottom:max(78px,calc(env(safe-area-inset-bottom) + 78px))!important}}
