/* ============================================================
   G20X site chrome — ONE header + footer for every page type
   ============================================================
   Loaded by both page systems:
     · marketing pages   (scripts/build_www_v2_2026_08_23.py)
     · attraction pages  (scripts/unify_chrome_2026_08_23.py)
   The nav items come from a single definition (site_content.NAV), so the two
   generators cannot drift apart. Selectors are namespaced (.g20xbar/.g20xfoot)
   so this file is safe to drop onto the attraction pages, which carry their own
   inline stylesheet and do NOT load tiko.css.
   ============================================================ */

.g20xbar{
  /* The attraction pages constrain <body> to 820px, so this bar is sometimes handed
     780px and sometimes the full window. A container query lets the same header
     adapt to the width it actually gets instead of guessing from the viewport. */
  container-type:inline-size;
  container-name:g20xbar;
  position:sticky;top:0;z-index:9000;
  background:rgba(251,251,253,.82);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid rgba(0,0,0,.06);
  font:16px/1.4 -apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',Roboto,
       'PingFang TC','Noto Sans TC','Microsoft JhengHei',sans-serif;
  color:#1D1D1F;
}
.g20xbar-in{
  max-width:1080px;margin:0 auto;padding:0 28px;height:60px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.g20xbar a{text-decoration:none}
.g20xbar-logo{display:flex;align-items:center;gap:10px;flex-shrink:0}
.g20xbar-logo img{height:36px;width:auto;object-fit:contain;display:block}
.g20xbar nav{display:flex;align-items:center;gap:2px;flex-wrap:wrap;justify-content:flex-end}
.g20xbar nav a{
  margin-left:4px;color:#86868B;font-size:14.5px;font-weight:500;
  padding:7px 14px;border-radius:999px;transition:color .2s,background .2s;
}
.g20xbar nav a:hover{color:#1D1D1F;background:rgba(0,0,0,.05)}
.g20xbar nav a.active{color:#1D1D1F;background:rgba(0,0,0,.06)}
.g20xbar .g20xbar-lang{
  font-size:13px;margin-left:10px;border:1.5px solid #E5E5EA;border-radius:999px;
  padding:5px 14px;color:#86868B;font-weight:600;transition:border-color .2s,color .2s;
}
.g20xbar .g20xbar-lang:hover{border-color:#FF5A1F;color:#FF5A1F}

/* ---- unified footer (compact variant, used by the attraction pages) ---- */
.g20xfoot{
  border-top:1px solid #E5E5EA;background:#fff;margin-top:40px;padding:32px 20px;
  font:13.5px/1.7 -apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',Roboto,
       'PingFang TC','Noto Sans TC',sans-serif;
  color:#86868B;text-align:center;
}
.g20xfoot-in{max-width:1080px;margin:0 auto}
.g20xfoot img.flogo{height:44px;width:auto;opacity:.9;margin-bottom:12px}
.g20xfoot a{color:#86868B;text-decoration:none;font-weight:600;white-space:nowrap}
.g20xfoot a:hover{color:#FF5A1F}
/* flex-wrap rather than inline: the generator joins these anchors with no
   whitespace, and each one is nowrap, so an inline row of English labels has no
   break opportunity at all and blows out the page width on a phone. */
.g20xfoot .links{display:flex;flex-wrap:wrap;justify-content:center;
  gap:6px 18px;margin-bottom:16px}
.g20xfoot .fine{font-size:12.5px;max-width:860px;margin:0 auto}

/* The attraction pages' "Buy" control was a dead <button>; it is now a link to
   /pricing/. The original styling lived in an inline style attribute on the
   button, so the link needs the button look restated here. */
a.buy-btn{
  display:block;width:100%;box-sizing:border-box;text-align:center;text-decoration:none;
  background:#FF5A1F;color:#fff !important;font-weight:700;font-size:15px;
  padding:13px 20px;border-radius:999px;margin-top:12px;
  box-shadow:0 4px 16px rgba(255,90,31,.28);transition:background .2s,transform .2s;
}
a.buy-btn:hover{background:#E8481A;text-decoration:none;transform:translateY(-1px)}
a.buy-btn:active{transform:scale(.98)}

/* Ad slots ship in the attraction template but nothing serves them yet, so they
   render as empty dashed boxes — a 250px hole on every page reads as "unfinished".
   Markup stays for when the DAI ads go live; delete this rule to switch them on. */
.g20x-adslot{display:none !important}

/* ---- adapt to the container, not the viewport ---- */
@container g20xbar (max-width:1000px){
  .g20xbar-in{padding:0 18px}
  .g20xbar nav a{padding:6px 10px;font-size:13.5px;margin-left:0}
  .g20xbar .g20xbar-lang{margin-left:6px}
}
@container g20xbar (max-width:840px){
  .g20xbar-in{gap:8px}
  .g20xbar nav a{padding:5px 8px;font-size:12.5px}
  .g20xbar .g20xbar-lang{padding:4px 10px;font-size:11.5px;margin-left:4px}
  .g20xbar-logo img{height:30px}
}
@container g20xbar (max-width:620px){
  .g20xbar-in{height:auto;min-height:58px;flex-wrap:wrap;padding:8px 16px}
  .g20xbar nav{flex:1 1 100%;order:3;justify-content:center;margin-top:2px}
}

/* viewport fallback for engines without container queries */
@supports not (container-type:inline-size){
  @media(max-width:900px){
    .g20xbar-in{padding:0 18px}
    .g20xbar nav a{padding:5px 8px;font-size:12.5px;margin-left:0}
    .g20xbar-logo img{height:30px}
  }
}
@media(max-width:720px){
  .g20xbar-in{height:auto;min-height:60px;flex-wrap:wrap;padding:8px 18px;gap:6px}
  .g20xbar nav{flex:1 1 100%;order:3;justify-content:center;margin-top:2px}
  .g20xbar nav a{padding:5px 9px;font-size:12.5px}
  .g20xbar .g20xbar-lang{margin-left:0;padding:4px 11px;font-size:12px}
  .g20xbar-logo img{height:32px}
}

/* ---- pages whose own stylesheet constrains <body> ------------------------
   The attraction template sets `body{max-width:820px;margin:0 auto}`, which
   would squeeze the site header and footer into that column while every other
   page renders them across the window. unify_chrome tags those pages with
   .g20x-narrow, and the constraint moves from <body> onto the content, so the
   chrome lines up site-wide and the article keeps its comfortable measure. */
body.g20x-narrow{max-width:none;padding-left:0;padding-right:0}
body.g20x-narrow > *:not(.g20xbar):not(.g20xfoot):not(script):not(style):not(link){
  max-width:820px;margin-left:auto;margin-right:auto;
  padding-left:20px;padding-right:20px;box-sizing:border-box;
}
