/* ═══════════════════════════════════════════════════════════════════════════
   The public bars — the top bar and the footer of the public pages, ONE file for both
   sites: the game's (landing, sign-up, login, legal: `PublicShell`/`PublicFooter`) and the
   studio's (`public/studio/index.html`, static HTML outside the SPA).

   Why a shared stylesheet and not a shared component (decision of 03/10/2026): the
   studio page is a static file on purpose — it moves to the studio's own domain by being
   copied — so the two markups stay separate. What must NOT stay separate is the drawing:
   until this file the two footers were "the same footer" written twice, and they had
   drifted (one boxed at 76rem, the other full width; links in mono on one and in the body
   face on the other; icons of 26px against 1.625rem). Now the geometry lives here, the two
   pages only choose a THEME, and `e2e/public-bars.spec.ts` measures both and fails when
   they part ways. Edit here, and both pages change together.

   ⚠️ Lengths in `px`, not `rem`, on purpose: the game's `rem` is fluid (16→21px with the
   window and the interface scale, Design do Jogo §13.8) and the studio's is not, so the
   same `2rem` drew 33px on one page and 32px on the other.

   Served from `public/` and linked by both pages' HTML (`index.html` of the SPA and the
   studio's), so it is NOT bundled or hashed: a change here reaches both at once.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── The themes: the "if/else" between the two sites ─────────────────────────
   Everything below reads only these tokens. The game's points at the kit's own tokens,
   so it follows them if they ever change; the studio's are the warm graphite of the studio
   page's bars (dark because the Southern Cross is light and vanishes on paper — the same
   rule as the studio's e-mails — but warm, of the paper's family). */
.pb--game {
  --pb-bg: var(--sd-chrome); --pb-face: var(--sd-face); --pb-frame: var(--sd-frame);
  --pb-text: var(--sd-text); --pb-dim: var(--sd-dim); --pb-faint: var(--sd-faint);
  --pb-accent: var(--sd-accent);
}
.pb--studio {
  --pb-bg: #36322c; --pb-face: #403b34; --pb-frame: #524c43;
  --pb-text: #f1ece3; --pb-dim: #c4bcae; --pb-faint: #a39a8c;
  --pb-accent: #e0a526;
}
.pb--game, .pb--studio {
  --pb-font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --pb-font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

/* ── The two bars share one grammar ──────────────────────────────────────────
   Same background, same side padding, same middle line; the top one draws its rule below
   and the footer above. Two bars that are similar but not the same just look careless. */
.pb-bar, .pb-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 28px;
  background: var(--pb-bg);
  color: var(--pb-text);
}
.pb-bar { border-bottom: 1px solid var(--pb-frame); }

/* ── The footer: links · channels · seal ─────────────────────────────────────
   Three columns with equal outer ones (`1fr`), so the channels sit on the page's true axis
   — with `space-between` a middle item lands halfway between two blocks of different
   widths and drifts. FULL WIDTH, like the top bar: a footer boxed narrower than the bar
   above it reads as a different page. */
.pb-foot {
  display: grid; grid-template-columns: 1fr auto 1fr;
  border-top: 1px solid var(--pb-frame);
}
.pb-foot__links {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 22px;
  font-family: var(--pb-font-body);
}
.pb-foot__links a { color: var(--pb-dim); text-decoration: none; font-size: 15px; }
.pb-foot__links a:hover, .pb-foot__links a:focus-visible { color: var(--pb-accent); }
/* The page you are on (the game's footer marks it with NavLink; the studio page has none). */
.pb-foot__links a[aria-current="page"] {
  color: var(--pb-text);
  text-decoration: underline; text-decoration-color: var(--pb-accent); text-underline-offset: 5px;
}
.pb-foot__place {
  font-family: var(--pb-font-mono); font-size: 13px; letter-spacing: .04em; color: var(--pb-faint);
}
.pb-foot__social { display: flex; align-items: center; gap: 6px; }
.pb-foot__social a {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  color: var(--pb-dim); border: 1px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.pb-foot__social a:hover, .pb-foot__social a:focus-visible {
  color: var(--pb-accent); border-color: var(--pb-frame); background: var(--pb-face);
}
/* The glyph: an inline <svg> on the studio page, the kit's `Icon` (`.sd-ico`, a sized
   span) on the game's. Both drawn at 32px — the user asked for them larger (03/10/2026). */
.pb-foot__social svg, .pb-foot__social .sd-ico { width: 32px !important; height: 32px !important; display: block; }

/* The studio's seal, last column. On the game's pages it is a link to the studio page and
   gets the same hover as the channels; on the studio page it is just the signature. */
.pb-foot > .pb-seal { justify-self: end; }
.pb-seal {
  display: inline-flex; align-items: center; text-decoration: none;
  padding: 5px 9px; border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
a.pb-seal:hover, a.pb-seal:focus-visible { border-color: var(--pb-frame); background: var(--pb-face); }

/* On a phone the top bar keeps to a 16px gutter (10/10/2026, mockup `Aterragem - versao
   celular.html`): 28px a side ate the room the wordmark, the beta plate and the language
   need to share ONE row on a 360px screen. Both sites follow it — the studio page too. */
@media (max-width: 480px) {
  .pb-bar { padding: 10px 16px; }
}

/* On a phone the three columns do not fit side by side. They used to stack, each centred on
   a row of its own — ~200px of footer, mostly air, with "Brasil" dropping alone onto a
   fourth row at 360px. Since 10/10/2026 it is two rows: the seal and the channels share the
   first (seal left, channels right), the links run below a hairline with the country at the
   far end. Both sites follow it. */
@media (max-width: 640px) {
  .pb-foot {
    grid-template-columns: 1fr auto;
    grid-template-areas: "seal social" "links links";
    align-items: center; row-gap: 10px;
  }
  .pb-foot > .pb-seal { grid-area: seal; justify-self: start; margin-left: -9px; }
  .pb-foot__social { grid-area: social; justify-self: end; margin-right: -8px; }
  .pb-foot__links {
    grid-area: links; justify-content: flex-start; gap: 4px 18px;
    padding-top: 12px; border-top: 1px solid var(--pb-frame);
  }
  .pb-foot__links a { font-size: 14px; }
  .pb-foot__place { margin-left: auto; }
}
@media (max-width: 480px) {
  .pb-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
}
