/*
 * Shared site shell: one header + one footer across every theme route.
 * Route bundles should contain only page-specific layout from v6.8.0 onward.
 */
:root {
  --g2048-shell-width: 1120px;
  --g2048-shell-page: #faf8ef;
  --g2048-shell-surface: #fffdf8;
  --g2048-shell-soft: #f1ede3;
  --g2048-shell-line: rgba(119, 110, 101, .16);
  --g2048-shell-text: #655b52;
  --g2048-shell-muted: #807469;
  --g2048-shell-primary: #8f7f70;
  --g2048-shell-primary-hover: #7d6f62;
}

/* ===== Header ===== */
.g2048-site-header {
  position: relative;
  font-family: var(--g2048-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Tahoma, sans-serif);
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid var(--g2048-shell-line);
  background: rgba(250, 248, 239, .97);
}

.g2048-site-header__inner {
  width: min(var(--g2048-shell-width), calc(100% - 36px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.g2048-site-logo {
  flex: 0 0 auto;
  color: #77695c;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.2px;
  text-decoration: none;
}

.g2048-site-logo:hover,
.g2048-site-logo:focus-visible {
  color: #5f564e;
}

.g2048-site-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.g2048-site-nav__link {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--g2048-shell-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.g2048-site-nav__link:hover,
.g2048-site-nav__link:focus-visible {
  background: rgba(119, 110, 101, .08);
  color: #514940;
}

.g2048-site-nav__link[aria-current="page"] {
  background: var(--g2048-shell-primary);
  color: #fff;
}

.g2048-site-logo:focus-visible,
.g2048-site-nav__link:focus-visible,
.g2048-site-menu summary:focus-visible,
.g2048-site-menu__panel a:focus-visible {
  outline: 3px solid rgba(119, 110, 101, .24);
  outline-offset: 2px;
}

.g2048-site-menu {
  position: relative;
  display: none;
}

.g2048-site-menu summary {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(119, 110, 101, .18);
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fffaf2;
  cursor: pointer;
  list-style: none;
}

.g2048-site-menu summary::-webkit-details-marker { display: none; }

.g2048-site-menu__icon {
  width: 19px;
  display: grid;
  gap: 4px;
}

.g2048-site-menu__icon i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #655b52;
}

.g2048-site-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(270px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--g2048-shell-line);
  border-radius: 12px;
  display: grid;
  gap: 3px;
  background: #fffdf8;
  box-shadow: 0 16px 36px rgba(73, 60, 49, .15);
}

.g2048-site-menu__panel a {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  color: var(--g2048-shell-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.g2048-site-menu__panel a:hover,
.g2048-site-menu__panel a:focus-visible { background: #f3eee5; }
.g2048-site-menu__panel a[aria-current="page"] { background: #eee6dc; color: #514940; }

/* ===== Footer ===== */
.g2048-site-footer {
  font-family: var(--g2048-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Tahoma, sans-serif);
  border-top: 1px solid var(--g2048-shell-line);
  background: var(--g2048-shell-soft);
  color: var(--g2048-shell-muted);
}

.g2048-footer-inner {
  width: min(var(--g2048-shell-width), calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 22px;
}

.g2048-footer-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) minmax(125px, .72fr) minmax(170px, .88fr) minmax(260px, 1.25fr);
  gap: 28px 36px;
  align-items: start;
}

.g2048-footer-logo {
  display: inline-block;
  color: #77695c;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.2px;
  text-decoration: none;
}

.g2048-footer-logo:hover,
.g2048-footer-logo:focus-visible { color: #5f564e; }

.g2048-footer-tagline {
  max-width: 260px;
  margin: 10px 0 0;
  color: var(--g2048-shell-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}


.g2048-footer-intro {
  max-width: 300px;
  margin: 7px 0 0;
  color: var(--g2048-shell-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.62;
}

.g2048-footer-nav h2,
.g2048-footer-languages h2 {
  margin: 2px 0 12px;
  color: var(--g2048-shell-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.g2048-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.g2048-footer-nav a,
.g2048-footer-language-list a,
.g2048-footer-bottom a {
  color: var(--g2048-shell-muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
  text-underline-offset: 3px;
}

.g2048-footer-nav a:hover,
.g2048-footer-nav a:focus-visible,
.g2048-footer-language-list a:hover,
.g2048-footer-language-list a:focus-visible,
.g2048-footer-bottom a:hover,
.g2048-footer-bottom a:focus-visible {
  color: #5f564e;
  text-decoration: underline;
}

.g2048-footer-language-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.g2048-footer-language-list a[aria-current="page"],
.g2048-site-footer .g2048-footer-nav a[aria-current="page"] {
  color: #5f564e;
  font-weight: 700;
}

.g2048-footer-bottom {
  margin-top: 28px;
  padding-top: 17px;
  border-top: 1px solid rgba(119, 110, 101, .12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #8c8177;
  font-size: 12px;
  line-height: 1.5;
}

.g2048-footer-trust-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

@media (max-width: 900px) {
  .g2048-site-nav__link { padding-inline: 9px; font-size: 13px; }
  .g2048-footer-grid { grid-template-columns: 1.2fr .8fr .9fr; }
  .g2048-footer-languages { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .g2048-site-header__inner { width: min(100% - 28px, 620px); min-height: 58px; }
  .g2048-site-logo { font-size: 29px; }
  .g2048-site-nav { display: none; }
  .g2048-site-menu { display: block; }
  .g2048-footer-inner { width: min(100% - 30px, 620px); padding-top: 32px; }
  .g2048-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 22px; }
  .g2048-footer-brand,
  .g2048-footer-languages { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .g2048-site-header__inner { width: calc(100% - 24px); }
  .g2048-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .g2048-footer-brand,
  .g2048-footer-languages { grid-column: auto; }
  .g2048-footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
  .g2048-footer-nav h2 { grid-column: 1 / -1; }
  .g2048-footer-bottom { align-items: flex-start; flex-direction: column; }
  .g2048-footer-trust-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .g2048-site-header *, .g2048-site-footer * { scroll-behavior: auto !important; }
}
