/* =========================================================
   wg-brand.css — site-wide branded shell + light/dark themes

   Loaded AFTER all other stylesheets so it can re-skin nav,
   footer, buttons, and links to match the WG brand without
   rewriting page-specific layouts underneath.

   Architecture:
     - Constant brand colors (coral palette stays in both modes)
     - Semantic tokens (--wg-bg-page, --wg-text, etc.) flip
       between light and dark via [data-theme="..."]
     - Default = follows system preference; explicit
       data-theme overrides
     - All header/footer/component styles reference SEMANTIC
       tokens, never raw colors, so they auto-adapt

   Contrast targets (WCAG AA):
     - Body text on background: ≥ 7:1
     - Secondary text on background: ≥ 4.5:1
     - Nav links: ≥ 4.5:1 in both modes
     - Coral CTAs use a near-black foreground (#1A1102) that
       passes contrast against the gradient in both modes
   ========================================================= */

:root {
  /* ----- Constant brand palette (do NOT change between modes) ----- */
  --wg-coral-300: #FFB59A;
  --wg-coral-500: #FB8C6E;
  --wg-coral-600: #E76F51;
  --wg-coral-700: #C75A3F;
  --wg-cta-fg:    #1A1102;     /* foreground on coral buttons */
  --wg-grad-coral: linear-gradient(135deg, #FFB59A 0%, #FB8C6E 45%, #E76F51 100%);

  /* Navy palette (used for dark surfaces + brand strokes everywhere) */
  --wg-navy-950: #0A1322;
  --wg-navy-900: #0F1A2E;
  --wg-navy-800: #1A2238;
  --wg-navy-700: #243049;

  /* Cream palette (used for light surfaces) */
  --wg-cream-50:  #FFFFFF;
  --wg-cream-100: #FAF7F2;
  --wg-cream-200: #F5F2EE;
  --wg-cream-300: #ECE7DF;

  /* Status colors */
  --wg-good:  #20A39E;
  --wg-warn:  #C77700;
  --wg-bad:   #C13B3B;
  --wg-admin: #B58200;

  /* Type stack */
  --wg-font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wg-font-display: 'Sora', 'Inter', sans-serif;

  /* Shape */
  --wg-radius-sm: 10px;
  --wg-radius:    18px;
  --wg-radius-lg: 28px;
}

/* ============================================================
   THEME: LIGHT  (default for users with prefers-color-scheme: light)
   ============================================================ */
:root,
[data-theme="light"] {
  --wg-bg-page:        var(--wg-cream-200);
  --wg-bg-surface:     var(--wg-cream-50);
  --wg-bg-elevated:    var(--wg-cream-50);
  --wg-bg-subtle:      var(--wg-cream-100);
  --wg-bg-inverse:     var(--wg-navy-900);

  --wg-text:           #0F1A2E;            /* 15.8:1 on cream */
  --wg-text-strong:    #050B17;
  --wg-text-dim:       #4B5568;            /* ~7.0:1 on cream */
  --wg-text-muted:     #6B7280;            /* ~4.7:1 on cream */
  --wg-text-inverse:   #FFFFFF;
  --wg-text-on-coral:  var(--wg-cta-fg);
  --wg-text-link:      var(--wg-coral-700); /* darker coral reads on light bg */
  --wg-text-link-hov:  var(--wg-coral-600);

  --wg-line:           rgba(15, 26, 46, 0.10);
  --wg-line-strong:    rgba(15, 26, 46, 0.18);
  --wg-glass:          rgba(15, 26, 46, 0.04);
  --wg-glass-strong:   rgba(15, 26, 46, 0.07);

  --wg-shadow-sm:      0 1px 2px rgba(15, 26, 46, 0.06);
  --wg-shadow:         0 12px 30px -10px rgba(15, 26, 46, 0.18);
  --wg-shadow-lg:      0 25px 60px -20px rgba(15, 26, 46, 0.25);
  --wg-shadow-coral:   0 16px 40px -12px rgba(231, 111, 81, 0.45);

  --wg-nav-bg:         rgba(255, 255, 255, 0.92);
  --wg-nav-border:     rgba(15, 26, 46, 0.08);
  --wg-nav-link:       #2C3650;
  --wg-nav-link-hov:   #0F1A2E;
  --wg-nav-link-active:var(--wg-coral-700);
  --wg-nav-cta-fg:     var(--wg-cta-fg);
  --wg-userchip-bg:    var(--wg-cream-100);
  --wg-userchip-fg:    var(--wg-text);

  --wg-footer-bg:      var(--wg-cream-100);
  --wg-footer-border:  var(--wg-line);

  --wg-card-bg:        linear-gradient(160deg, rgba(255,255,255,1), rgba(250,247,242,1));
  --wg-card-border:    var(--wg-line);

  --wg-input-bg:       #FFFFFF;
  --wg-input-border:   var(--wg-line-strong);
  --wg-input-fg:       var(--wg-text);
  --wg-input-placeholder: var(--wg-text-muted);

  color-scheme: light;
}

/* ============================================================
   THEME: DARK
   ============================================================ */
[data-theme="dark"] {
  --wg-bg-page:        var(--wg-navy-900);
  --wg-bg-surface:     var(--wg-navy-800);
  --wg-bg-elevated:    var(--wg-navy-700);
  --wg-bg-subtle:      var(--wg-navy-950);
  --wg-bg-inverse:     var(--wg-cream-100);

  --wg-text:           #EAEFF7;            /* ~13:1 on navy-900 */
  --wg-text-strong:    #FFFFFF;
  --wg-text-dim:       #B5BECF;            /* ~7.5:1 on navy-900 */
  --wg-text-muted:     #8A93A6;            /* ~4.8:1 on navy-900 */
  --wg-text-inverse:   #0F1A2E;
  --wg-text-on-coral:  var(--wg-cta-fg);
  --wg-text-link:      var(--wg-coral-300); /* lighter coral reads on dark bg */
  --wg-text-link-hov:  #FFD0BB;

  --wg-line:           rgba(255, 255, 255, 0.10);
  --wg-line-strong:    rgba(255, 255, 255, 0.18);
  --wg-glass:          rgba(255, 255, 255, 0.04);
  --wg-glass-strong:   rgba(255, 255, 255, 0.07);

  --wg-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4);
  --wg-shadow:         0 12px 30px -10px rgba(0, 0, 0, 0.55);
  --wg-shadow-lg:      0 25px 60px -20px rgba(0, 0, 0, 0.7);
  --wg-shadow-coral:   0 20px 60px -15px rgba(231, 111, 81, 0.55);

  --wg-nav-bg:         rgba(10, 19, 34, 0.88);
  --wg-nav-border:     rgba(255, 255, 255, 0.10);
  --wg-nav-link:       #B5BECF;
  --wg-nav-link-hov:   #FFFFFF;
  --wg-nav-link-active:var(--wg-coral-300);
  --wg-userchip-bg:    rgba(255, 255, 255, 0.07);
  --wg-userchip-fg:    #FFFFFF;

  --wg-footer-bg:      var(--wg-navy-950);
  --wg-footer-border:  var(--wg-line);

  --wg-card-bg:        linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  --wg-card-border:    var(--wg-line);

  --wg-input-bg:       rgba(255, 255, 255, 0.05);
  --wg-input-border:   var(--wg-line-strong);
  --wg-input-fg:       #FFFFFF;
  --wg-input-placeholder: var(--wg-text-muted);

  color-scheme: dark;
}

/* If the user hasn't picked, follow the system preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --wg-bg-page:        var(--wg-navy-900);
    --wg-bg-surface:     var(--wg-navy-800);
    --wg-bg-elevated:    var(--wg-navy-700);
    --wg-bg-subtle:      var(--wg-navy-950);
    --wg-bg-inverse:     var(--wg-cream-100);
    --wg-text:           #EAEFF7;
    --wg-text-strong:    #FFFFFF;
    --wg-text-dim:       #B5BECF;
    --wg-text-muted:     #8A93A6;
    --wg-text-inverse:   #0F1A2E;
    --wg-text-link:      var(--wg-coral-300);
    --wg-text-link-hov:  #FFD0BB;
    --wg-line:           rgba(255, 255, 255, 0.10);
    --wg-line-strong:    rgba(255, 255, 255, 0.18);
    --wg-glass:          rgba(255, 255, 255, 0.04);
    --wg-glass-strong:   rgba(255, 255, 255, 0.07);
    --wg-shadow:         0 12px 30px -10px rgba(0, 0, 0, 0.55);
    --wg-shadow-coral:   0 20px 60px -15px rgba(231, 111, 81, 0.55);
    --wg-nav-bg:         rgba(10, 19, 34, 0.88);
    --wg-nav-border:     rgba(255, 255, 255, 0.10);
    --wg-nav-link:       #B5BECF;
    --wg-nav-link-hov:   #FFFFFF;
    --wg-nav-link-active:var(--wg-coral-300);
    --wg-userchip-bg:    rgba(255, 255, 255, 0.07);
    --wg-userchip-fg:    #FFFFFF;
    --wg-footer-bg:      var(--wg-navy-950);
    --wg-card-bg:        linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
    --wg-input-bg:       rgba(255, 255, 255, 0.05);
    --wg-input-fg:       #FFFFFF;
    color-scheme: dark;
  }
}

/* ============================================================
   BASE — applied when wg-themed body class is present
   ============================================================ */
body.wg-themed {
  background: var(--wg-bg-page) !important;
  color: var(--wg-text);
  font-family: var(--wg-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.wg-themed h1,
body.wg-themed h2,
body.wg-themed h3,
body.wg-themed h4 {
  font-family: var(--wg-font-display);
  letter-spacing: -0.02em;
  color: var(--wg-text-strong);
}
body.wg-themed a            { color: var(--wg-text-link); }
body.wg-themed a:hover      { color: var(--wg-text-link-hov); }

/* Cards and surfaces in legacy pages — gentle re-skin to the active theme */
body.wg-themed .card,
body.wg-themed .panel,
body.wg-themed .hero-card,
body.wg-themed .link-card,
body.wg-themed .quick-links-grid > *,
body.wg-themed .stat-card,
body.wg-themed .feature-card {
  background: var(--wg-card-bg) !important;
  border: 1px solid var(--wg-card-border) !important;
  color: var(--wg-text) !important;
  border-radius: var(--wg-radius);
}

/* Inputs */
body.wg-themed input[type="text"],
body.wg-themed input[type="email"],
body.wg-themed input[type="password"],
body.wg-themed input[type="number"],
body.wg-themed input[type="search"],
body.wg-themed select,
body.wg-themed textarea {
  background: var(--wg-input-bg);
  border: 1px solid var(--wg-input-border);
  color: var(--wg-input-fg);
}
body.wg-themed input::placeholder,
body.wg-themed textarea::placeholder { color: var(--wg-input-placeholder); }

/* Buttons — re-skin common variants on legacy pages */
body.wg-themed .btn-primary,
body.wg-themed .start-workout-massive,
body.wg-themed .login-btn,
body.wg-themed .cta-button {
  background: var(--wg-grad-coral) !important;
  color: var(--wg-cta-fg) !important;
  border: 0 !important;
  box-shadow: var(--wg-shadow-coral);
}
body.wg-themed .btn-primary:hover,
body.wg-themed .start-workout-massive:hover,
body.wg-themed .login-btn:hover,
body.wg-themed .cta-button:hover { filter: brightness(1.05); transform: translateY(-1px); }

body.wg-themed .btn-secondary,
body.wg-themed .btn-outline {
  background: var(--wg-glass-strong) !important;
  color: var(--wg-text) !important;
  border: 1px solid var(--wg-line-strong) !important;
}

/* ============================================================
   HEADER (wg-shell-nav)
   ============================================================ */
.wg-shell-nav {
  position: sticky; top: 0; z-index: 900; /* Sit above page content (cards, buttons) but below toasts/modals */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--wg-nav-bg);
  border-bottom: 1px solid var(--wg-nav-border);
  font-family: var(--wg-font-sans);
  transition: background-color .25s ease, border-color .25s ease;
}
.wg-shell-nav-inner {
  max-width: 1180px;
  width: 94%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.wg-shell-brand,
body.wg-themed a.wg-shell-brand,
body.wg-themed .wg-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  /* Hardcoded so it reads on both the cream + navy footer/header
     surfaces, regardless of which token the surrounding theme uses.
     !important is required because `body.wg-themed a` (a higher-
     specificity rule earlier in this file) otherwise sets the color
     to the coral text-link, which renders nearly invisible against
     the cream surface in light mode. */
  color: #0F1A2E !important;
  font-family: var(--wg-font-display); font-weight: 800; font-size: 1.06rem;
  line-height: 1;
  flex-shrink: 1;
  min-width: 0;
}
[data-theme="dark"] .wg-shell-brand,
[data-theme="dark"] body.wg-themed a.wg-shell-brand,
[data-theme="dark"] body.wg-themed .wg-shell-brand { color: #FFFFFF !important; }
/* The footer follows the same theme tokens as the rest of the page —
   cream surface in light mode (dark text), navy in dark mode (white text).
   Inherit from the brand selector above; no override needed. */
.wg-shell-brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center;
  display: block;
  padding: 0;
  border: 1px solid var(--wg-line);
  box-shadow: 0 8px 22px rgba(15, 26, 46, 0.22);
  background: var(--wg-bg-surface);
  transition: transform .25s ease, box-shadow .25s ease;
}
.wg-shell-brand:hover img {
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--wg-shadow-coral);
}
.wg-shell-brand span {
  display: inline-flex;
  align-items: center;
}
[data-theme="dark"] .wg-shell-brand img {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
}
@media (max-width: 560px) {
  .wg-shell-brand img { width: 40px; height: 40px; border-radius: 11px; }
  .wg-shell-brand     { font-size: 0.92rem; gap: 8px; }
  /* Keep the "WorkoutGenerator" wordmark visible on phones so the app
     header matches the landing-page (index.html) header. The brand can
     shrink/ellipsis on a constrained row rather than disappearing. */
  .wg-shell-nav .wg-shell-brand > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* On very narrow phones, drop the wordmark rather than overflow the row. */
@media (max-width: 360px) {
  .wg-shell-nav .wg-shell-brand > span { display: none; }
}
.wg-shell-brand .accent { color: var(--wg-coral-600); }
[data-theme="dark"] .wg-shell-brand .accent { color: var(--wg-coral-500); }

/* Some pages ship a global, unscoped `p, span { color: rgba(255,255,255,.8) }`
   (meant for dark cards but never scoped to dark). It whitens the brand
   wordmark and the signed-in name, making them invisible in light mode.
   Re-assert legible colors for the shell's own text with higher specificity. */
.wg-shell-nav .wg-shell-brand > span { color: inherit; }
.wg-shell-nav .wg-shell-brand .accent { color: var(--wg-coral-600); }
[data-theme="dark"] .wg-shell-nav .wg-shell-brand .accent { color: var(--wg-coral-500); }
/* The same unscoped `p, span` whitening also hits the FOOTER brand wordmark
   ("Workout"), its coral accent, and the tagline paragraph — leaving them
   near-white and unreadable on the cream footer in light mode. Re-assert
   theme-correct, legible colors with matching specificity. */
.wg-shell-footer .wg-shell-brand > span { color: inherit; }
.wg-shell-footer .wg-shell-brand .accent { color: var(--wg-coral-600); }
[data-theme="dark"] .wg-shell-footer .wg-shell-brand .accent { color: var(--wg-coral-500); }
.wg-shell-footer p { color: var(--wg-text-dim); }
.wg-shell-userchip > span,
.wg-shell-userchip > .name { color: var(--wg-userchip-fg); }
.wg-shell-nav.is-open .wg-shell-links .wg-shell-menu-user span { color: inherit; }

.wg-shell-links {
  display: flex; align-items: center; gap: 22px;
  list-style: none; margin: 0; padding: 0;
}
.wg-shell-links a {
  color: var(--wg-nav-link);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.wg-shell-links a:hover { color: var(--wg-nav-link-hov); }
.wg-shell-links a.is-active {
  color: var(--wg-nav-link-active);
  border-bottom-color: var(--wg-nav-link-active);
}

/* CTA button (Log in / Sign up) */
.wg-shell-cta {
  background: var(--wg-grad-coral);
  color: var(--wg-cta-fg) !important;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--wg-shadow-coral);
  transition: transform .2s ease, filter .2s ease;
}
.wg-shell-cta:hover { transform: translateY(-1px); filter: brightness(1.05); color: var(--wg-cta-fg) !important; }

/* Admin link — gold ribbon, contrast-tuned per theme */
.wg-shell-links a.wg-shell-admin {
  color: var(--wg-admin);
  padding: 4px 10px;
  margin-left: 4px;
  border-radius: 8px;
  background: rgba(181, 130, 0, 0.10);
  border: 1px solid rgba(181, 130, 0, 0.40);
}
.wg-shell-links a.wg-shell-admin:hover {
  color: #8A6300;
  background: rgba(181, 130, 0, 0.18);
  border-color: rgba(181, 130, 0, 0.6);
}
.wg-shell-links a.wg-shell-admin.is-active { border-color: var(--wg-admin); color: var(--wg-admin); }
[data-theme="dark"] .wg-shell-links a.wg-shell-admin {
  color: #FFD66E;
  background: rgba(255, 214, 110, 0.08);
  border-color: rgba(255, 214, 110, 0.35);
}
[data-theme="dark"] .wg-shell-links a.wg-shell-admin:hover {
  color: #FFE9A8;
  background: rgba(255, 214, 110, 0.15);
  border-color: rgba(255, 214, 110, 0.6);
}

/* User chip */
.wg-shell-userchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--wg-userchip-bg);
  border: 1px solid var(--wg-line);
  color: var(--wg-userchip-fg);
  font-size: 0.88rem; font-weight: 600;
  text-decoration: none;
  /* Stop the name from breaking onto multiple lines next to the avatar */
  max-width: 180px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.wg-shell-userchip > span,
.wg-shell-userchip > .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.wg-shell-userchip:hover { background: var(--wg-glass-strong); }
.wg-shell-userchip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--wg-grad-coral);
  display: grid; place-items: center;
  color: var(--wg-cta-fg); font-weight: 800; font-size: 0.78rem;
  overflow: hidden;
  flex-shrink: 0;
}
.wg-shell-userchip .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

@media (max-width: 880px) {
  /* Once the hamburger appears, the header chip collapses to just the avatar
     so brand + avatar + toggle sit cleanly in one row. The full name is shown
     at the top of the opened menu instead (see .wg-shell-menu-user). */
  .wg-shell-userchip { max-width: none; padding: 3px; gap: 0; }
  .wg-shell-userchip > span,
  .wg-shell-userchip > .name { display: none; }
  .wg-shell-userchip .avatar { width: 30px; height: 30px; font-size: 0.78rem; }
}

/* Theme toggle button — DEPRECATED.
   We now use only the bottom-left dark-mode FAB created by js/dark-mode.js,
   so explicitly hide any in-nav .wg-theme-toggle that older HTML still
   ships with (e.g. inline buttons in index.html / login.html). */
.wg-theme-toggle { display: none !important; }

/* Mobile menu toggle — plain 3 bars (no box/border) to match index.html.
   Scoped with `.wg-shell-nav` so it beats the global dark-mode rule
   ([data-theme="dark"] button { background: coral }). */
.wg-shell-nav .wg-shell-toggle,
[data-theme="dark"] .wg-shell-nav .wg-shell-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--wg-nav-link-hov);
  font-size: 1.5rem;
  line-height: 1;
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: none;
  transform: none;
}
.wg-shell-nav .wg-shell-toggle:hover,
[data-theme="dark"] .wg-shell-nav .wg-shell-toggle:hover {
  color: var(--wg-coral-600);
  background: transparent;
  transform: none;
}

@media (max-width: 880px) {
  .wg-shell-links { display: none; }
  .wg-shell-nav .wg-shell-toggle,
  [data-theme="dark"] .wg-shell-nav .wg-shell-toggle { display: inline-flex; }
  .wg-shell-nav.is-open .wg-shell-links {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    /* Clean, centered, spacious stack to match index.html's mobile menu. */
    flex-direction: column; align-items: center; gap: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) 22px;
    background: var(--wg-bg-surface);
    border-bottom: 1px solid var(--wg-nav-border);
    box-shadow: 0 24px 40px -24px rgba(0,0,0,0.45);
    max-height: calc(100vh - 100%);
    overflow-y: auto;
  }
  .wg-shell-nav.is-open .wg-shell-links a {
    width: 100%;
    /* display:flex without justify-content was left-aligning the icon+label;
       center the whole group so it reads like the landing menu. */
    justify-content: center;
    text-align: center;
    font-family: var(--wg-font-display, 'Sora', 'Inter', sans-serif);
    font-size: 1.12rem;
    font-weight: 600;
    padding: 17px 4px;
    border-bottom: 1px solid var(--wg-line);
    border-radius: 0;
  }
  /* Text-only items — the landing menu carries no per-row icons. */
  .wg-shell-nav.is-open .wg-shell-links a > i { display: none; }
  /* The admin "ribbon" reads as a plain centered row inside the dropdown. */
  .wg-shell-nav.is-open .wg-shell-links a.wg-shell-admin {
    margin-left: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--wg-line);
  }
  .wg-shell-nav.is-open .wg-shell-links a.is-active { border-bottom-color: var(--wg-line); color: var(--wg-coral-600); }
  [data-theme="dark"] .wg-shell-nav.is-open .wg-shell-links a.is-active { color: var(--wg-coral-300); }
}

/* Signed-in name shown at the top of the open mobile menu. Hidden on desktop
   (where the header chip carries the name) and only revealed in the dropdown. */
/* Hidden on desktop (the header userchip carries the name). Specificity must
   beat `.wg-shell-links a { display: inline-flex }`, or the name leaks into
   the desktop header and collides with the brand wordmark. */
.wg-shell-nav .wg-shell-links .wg-shell-menu-user { display: none; }
@media (max-width: 880px) {
  .wg-shell-nav.is-open .wg-shell-links .wg-shell-menu-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 4px;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--wg-text);
    text-decoration: none;
    border-bottom: 1px solid var(--wg-line);
  }
  .wg-shell-nav.is-open .wg-shell-links .wg-shell-menu-user .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--wg-grad-coral);
    display: grid; place-items: center;
    color: var(--wg-cta-fg); font-weight: 800; font-size: 0.82rem;
    overflow: hidden; flex-shrink: 0;
  }
  .wg-shell-nav.is-open .wg-shell-links .wg-shell-menu-user .avatar img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  }
}

/* Hide legacy headers/footers when our shell has mounted */
body.wg-shell-mounted > header.site-header,
body.wg-shell-mounted > header:not(.wg-shell-nav),
body.wg-shell-mounted > .header,
body.wg-shell-mounted > .navigation,
body.wg-shell-mounted > .mobile-menu,
body.wg-shell-mounted > footer:not(.wg-shell-footer) {
  display: none !important;
}

/* ============================================================
   FOOTER (wg-shell-footer)
   ============================================================ */
.wg-shell-footer {
  margin-top: 60px;
  padding: 56px 0 26px;
  background: var(--wg-footer-bg);
  border-top: 1px solid var(--wg-footer-border);
  color: var(--wg-text-dim);
  font-family: var(--wg-font-sans);
  transition: background-color .25s ease, border-color .25s ease;
}
.wg-shell-footer-inner { max-width: 1180px; width: 94%; margin: 0 auto; }
.wg-shell-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.wg-shell-footer h4 {
  font-family: var(--wg-font-display);
  color: var(--wg-text-strong);
  margin: 0 0 14px; font-size: 0.96rem;
  letter-spacing: 0.04em;
}
.wg-shell-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.wg-shell-footer ul a { color: var(--wg-text-dim); text-decoration: none; font-size: 0.92rem; }
.wg-shell-footer ul a:hover { color: var(--wg-text-link); }
.wg-shell-footer .socials { display: flex; gap: 10px; margin-top: 14px; }
.wg-shell-footer .socials a {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--wg-glass-strong); border: 1px solid var(--wg-line);
  color: var(--wg-text-dim);
}
.wg-shell-footer .socials a:hover { color: var(--wg-text-link); border-color: var(--wg-text-link); }
.wg-shell-footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px solid var(--wg-line);
  font-size: 0.85rem;
}

@media (max-width: 760px) { .wg-shell-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .wg-shell-footer-grid { grid-template-columns: 1fr; } }

/* Make sure links inside the legacy footer (if it ever shows again on a non-mounted page) still respect tokens. */
body.wg-themed footer a { color: var(--wg-text-link); }
body.wg-themed footer a:hover { color: var(--wg-text-link-hov); }
