/* TEOS shared UI layer. Linked by every page the build generates (scripts/build-site.js) and by the home page.
   Source of truth for: sticky header, menu overlay, ticker, stat cards, page overflow.
   Colour fallbacks are the Elmahrosa palette (beige #FDF8EE, gold #8A6D2B); each page's own tokens win when defined.
   Other TEOS sites can link https://sentinel.teosegypt.com/shared/styles.css and /shared/rtl.css. */

/* 1. Page never scrolls sideways */
body{overflow-x:hidden}
/* clip = same visual result but does not turn body into a scroll container, which would break position:sticky */
@supports(overflow:clip){body{overflow-x:clip}}

/* 2. Header: sticky, opaque, above the hero (home nav). The shell pages' .sx-top header is fixed with body padding. */
body>nav{position:sticky;top:0;z-index:100;width:100%;background:var(--bg,#FDF8EE);-webkit-backdrop-filter:none;backdrop-filter:none}

/* 3. Menu overlay: full screen, scrollable, page behind is hidden and cannot scroll */
@media(max-width:1100px){
  body>nav.open .links{display:flex;position:fixed;inset:0;z-index:200;width:auto;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;background:var(--bg,#FDF8EE);padding:calc(var(--nav-h,110px) + 8px) var(--pad,20px) 32px}
  body>nav.open .burger,body>nav.open .langbar{position:relative;z-index:201}
  html.menu-open{overflow:hidden}
}
@media(max-width:1239px){
  .sx-chk:checked~.sx-nav{position:fixed;inset:0;z-index:200;max-height:none;align-content:start;grid-auto-rows:min-content;overflow-y:auto;padding-top:calc(var(--sx-h,72px) + 10px);background:var(--sx-panel,#07060f)}
  .sx-top:has(.sx-chk:checked) .sx-id,.sx-top:has(.sx-chk:checked) .sx-lang,.sx-chk:checked~.sx-burger{position:relative;z-index:201}
  body:has(.sx-chk:checked){overflow:hidden}
}

/* 4. Ticker: one line, never clipped, always scrolls left-to-right content in LTR flow (also in Arabic) */
.ticker{overflow:hidden;white-space:nowrap;width:100%;display:flex;direction:ltr;border-block:1px solid var(--line,#E5DCC8);background:var(--bg2,#F3ECDB)}
.ticker-inner{display:flex;flex:none;width:max-content;gap:2rem;animation:scroll 20s linear infinite}
.ticker-inner span{white-space:nowrap;padding:14px 0;font-size:14px;color:var(--muted,#6B6250)}
.ticker-inner span:before{content:"\25C6";color:var(--accent,#8A6D2B);margin-inline-end:14px}
@keyframes scroll{to{transform:translateX(calc(-50% - 1rem))}}
@media(prefers-reduced-motion:reduce){.ticker-inner{animation:none}.ticker{overflow-x:auto}}

/* 5. Stat cards: one column on phones, no overlap */
.stats-grid{display:grid;grid-template-columns:1fr;gap:0;margin-top:48px;border-top:1px solid var(--line,#E5DCC8)}
.stats-grid .stat-card{border-bottom:1px solid var(--line,#E5DCC8);padding:24px 20px;min-height:110px;display:flex;justify-content:space-between;align-items:center;gap:16px;overflow:hidden;min-width:0}
.stats-grid .stat-card span{font-size:15px;min-width:0;overflow-wrap:anywhere}
.stats-grid .stat-number{font-size:44px;line-height:1;font-weight:500;color:var(--accent,#8A6D2B);flex:none}
@media(min-width:641px){
  .stats-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));border-left:1px solid var(--line,#E5DCC8)}
  .stats-grid .stat-card{flex-direction:column;align-items:flex-start;justify-content:center;gap:10px;padding:28px 26px;border-right:1px solid var(--line,#E5DCC8)}
  .stats-grid .stat-number{font-size:54px}
}
