/* ============================================================================
   Triumvirate Group — shared chrome (header + footer)
   Banner: [v-chrome-1]
   Path: public/lib/chrome.css

   One source of truth for the site header and footer across the Group. The
   chrome is TIER-AWARE: the same markup re-themes for each pillar of the
   Triumvirate Group —
       Books   (gold)   — Bookstore Direct + Studio   (live today)
       Care    (sage)   — Emergency · Providers · Resources
       Connect (clay)   — Community · Marketplace · Justice
   The active tier is set via [data-tier] on the .tgc-root wrapper; every accent
   below reads from --tgc-accent, so a single attribute restyles the whole bar.

   Self-contained: all tokens are declared on .tgc-root so the chrome renders
   identically on any page regardless of that page's own :root variables.
   Everything is namespaced .tgc-* to avoid colliding with legacy page styles
   during rollout.
   ========================================================================== */

.tgc-root,
.tgc-root *,
.tgc-root *::before,
.tgc-root *::after { box-sizing: border-box; }

.tgc-root {
  /* Group palette (matches the established Books identity) */
  --tgc-bg:       #0d0b08;
  --tgc-surface:  #141210;
  --tgc-surface2: #1a1813;
  --tgc-border:   #2e2b22;
  --tgc-border2:  #3a362c;
  --tgc-text:     #ede8dc;
  --tgc-text2:    #a89e88;
  --tgc-text3:    #6b6556;

  /* Per-tier accent — overridden by [data-tier] below. Default = Books gold. */
  --tgc-accent:     #c9a84c;
  --tgc-accent-dim: rgba(201,168,76,0.10);
  --tgc-accent-rim: rgba(201,168,76,0.28);

  --tgc-serif: 'Cormorant Garamond', Georgia, serif;
  --tgc-sans:  'DM Sans', system-ui, -apple-system, sans-serif;
  --tgc-mono:  'Courier New', monospace;

  font-family: var(--tgc-sans);
  color: var(--tgc-text);
}

/* ── Tier themes ──────────────────────────────────────────────────────────── */
.tgc-root[data-tier="books"] {
  --tgc-accent:#c9a84c; --tgc-accent-dim:rgba(201,168,76,0.10); --tgc-accent-rim:rgba(201,168,76,0.28);
}
.tgc-root[data-tier="care"] {
  --tgc-accent:#7fb0a6; --tgc-accent-dim:rgba(127,176,166,0.10); --tgc-accent-rim:rgba(127,176,166,0.30);
}
.tgc-root[data-tier="connect"] {
  --tgc-accent:#cf8a63; --tgc-accent-dim:rgba(207,138,99,0.10); --tgc-accent-rim:rgba(207,138,99,0.30);
}

/* ============================================================================
   HEADER
   ========================================================================== */
.tgc-header {
  /* Defensive resets: legacy pages style the bare <header> element (flex,
     padding, sticky). Since the chrome is also a <header>, force the layout we
     need so leftover page CSS can't leak in during rollout. */
  display: block; padding: 0; margin: 0; width: auto; max-width: none; min-width: 0;
  position: sticky; top: 0; z-index: 60;
  background: rgba(20,18,16,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tgc-border);
  border-top: 2px solid var(--tgc-accent);            /* the tier "tells you where you are" line */
}

/* Row 0 — Group switcher (BOOKS ◆ CARE ◆ CONNECT) */
.tgc-grouptabs {
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 7px 24px; border-bottom: 1px solid var(--tgc-border);
}
.tgc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--tgc-mono); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--tgc-text3); text-decoration: none;
  padding: 2px 16px; transition: color .15s;
}
.tgc-tab:hover { color: var(--tgc-text2); }
.tgc-tab[aria-current="true"] { color: var(--tgc-accent); }
.tgc-tab-sep { color: var(--tgc-border2); font-size: 8px; }
.tgc-tab .tgc-soon {
  font-size: 8px; letter-spacing: .12em; color: var(--tgc-text3);
  border: 1px solid var(--tgc-border2); border-radius: 2px; padding: 1px 4px;
}

/* Row 1 — main bar */
.tgc-bar {
  display: flex; align-items: center; gap: 28px;
  padding: 13px 28px; max-width: 1240px; margin: 0 auto;
}
@media (max-width: 720px){ .tgc-bar{ padding: 11px 18px; gap: 16px; } }

/* Brand lockup: ◆ TRIUMVIRATE | <Tier>.  Two links: the wordmark goes to the
   Group home (the Books/Care/Connect picker); the tier name goes to that tier. */
.tgc-brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tgc-brand a { text-decoration: none; }
.tgc-brand-group { display: inline-flex; align-items: center; gap: 12px; }
.tgc-brand .tgc-diamond { width: 9px; height: 9px; background: var(--tgc-accent); transform: rotate(45deg); flex-shrink: 0; }
.tgc-brand .tgc-word {
  font-family: var(--tgc-serif); font-weight: 400; font-size: 21px; letter-spacing: .16em;
  color: var(--tgc-text); text-transform: uppercase; line-height: 1; transition: color .15s;
}
.tgc-brand-group:hover .tgc-word { color: var(--tgc-accent); }
.tgc-brand .tgc-divider { width: 1px; height: 20px; background: var(--tgc-border2); }
.tgc-brand .tgc-tier {
  font-family: var(--tgc-serif); font-style: italic; font-size: 19px; font-weight: 300;
  color: var(--tgc-accent); line-height: 1; opacity: .92; transition: opacity .15s;
}
.tgc-brand .tgc-tier:hover { opacity: 1; }
@media (max-width: 560px){ .tgc-brand .tgc-word{ font-size:18px; letter-spacing:.12em; } .tgc-brand .tgc-tier{ font-size:16px; } }

/* Tier section nav */
.tgc-nav { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.tgc-nav a {
  font-family: var(--tgc-sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tgc-text2); text-decoration: none; white-space: nowrap; transition: color .15s; position: relative;
}
.tgc-nav a:hover { color: var(--tgc-text); }
.tgc-nav a[aria-current="true"] { color: var(--tgc-accent); }
.tgc-nav a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -19px; height: 2px; background: var(--tgc-accent);
}
/* .tgc-nav lives inside .tgc-collapse, which folds into a dropdown on narrow
   screens — see the responsive block further down. */

.tgc-spacer { flex: 1; }

/* Collapsible wrapper around nav + spacer + account. On wide screens it is
   `display: contents`, so its children lay out as direct flex items of the bar
   exactly as before; on narrow screens it becomes the dropdown panel. */
.tgc-collapse { display: contents; }

/* Account area */
.tgc-account { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.tgc-user { font-size: 12px; color: var(--tgc-text2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px){ .tgc-user{ display:none; } }
.tgc-link {
  font-size: 12px; letter-spacing: .04em; color: var(--tgc-text2); text-decoration: none; transition: color .15s; white-space: nowrap;
}
.tgc-link:hover { color: var(--tgc-accent); }
.tgc-pill {
  display: inline-flex; align-items: center; border: 1px solid var(--tgc-border2);
  color: var(--tgc-text2); padding: 7px 14px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 2px; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.tgc-pill:hover { border-color: var(--tgc-accent-rim); color: var(--tgc-accent); }
.tgc-cta {
  display: inline-flex; align-items: center; background: var(--tgc-accent); color: #15120c;
  padding: 8px 18px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  border-radius: 2px; text-decoration: none; border: none; cursor: pointer; transition: opacity .15s; white-space: nowrap;
}
.tgc-cta:hover { opacity: .88; }

/* Mobile menu toggle (shown when the bar collapses) */
.tgc-menu-btn { display: none; background: none; border: 1px solid var(--tgc-border2); color: var(--tgc-text2);
  border-radius: 2px; padding: 7px 11px; cursor: pointer; font-size: 15px; line-height: 1; flex-shrink: 0; }
.tgc-menu-btn:hover { border-color: var(--tgc-accent-rim); color: var(--tgc-accent); }

/* ── Responsive header: collapse nav + account into a dropdown ─────────────── */
@media (max-width: 880px){
  .tgc-bar { position: relative; }
  .tgc-menu-btn { display: inline-flex; margin-left: auto; }

  /* The wrapper becomes an absolutely-positioned dropdown panel. */
  .tgc-collapse {
    display: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 1px);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--tgc-surface);
    border-top: 1px solid var(--tgc-border);
    border-bottom: 1px solid var(--tgc-border);
    padding: 6px 18px 14px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.5);
    max-height: calc(100vh - 100px); overflow-y: auto;
  }
  .tgc-bar.tgc-open .tgc-collapse { display: flex; }

  .tgc-spacer { display: none; }

  /* Section nav stacks vertically inside the panel. */
  .tgc-nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .tgc-nav a { padding: 12px 4px; font-size: 13px; border-bottom: 1px solid var(--tgc-border); }
  .tgc-nav a[aria-current="true"]::after { display: none; }   /* drop the inline underline in column layout */

  /* Account cluster stacks too; the name becomes a panel heading. */
  .tgc-account { flex-direction: column; align-items: stretch; gap: 0; }
  .tgc-user {
    display: block; max-width: none; white-space: normal; overflow: visible;
    padding: 12px 4px 10px; font-size: 13px; color: var(--tgc-text);
    border-bottom: 1px solid var(--tgc-border);
  }
  .tgc-link { padding: 12px 4px; font-size: 13px; border-bottom: 1px solid var(--tgc-border); }
  .tgc-pill, .tgc-cta { margin-top: 12px; justify-content: center; padding: 11px 14px; }
}

/* ============================================================================
   FOOTER
   ========================================================================== */
.tgc-footer {
  /* Defensive resets — see .tgc-header (legacy pages style bare <footer>). */
  display: block; margin: 0; width: auto; max-width: none; font-size: 13px;
  background: var(--tgc-surface); border-top: 1px solid var(--tgc-border);
  color: var(--tgc-text2); padding: 52px 28px 30px;
}
.tgc-footer-inner { max-width: 1240px; margin: 0 auto; }

.tgc-foot-pillars {
  display: flex; align-items: center; justify-content: center; gap: 0;
  font-family: var(--tgc-mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  margin-bottom: 34px;
}
.tgc-foot-pillars a { color: var(--tgc-text3); text-decoration: none; padding: 0 18px; transition: color .15s; }
.tgc-foot-pillars a:hover { color: var(--tgc-text2); }
.tgc-foot-pillars a[aria-current="true"] { color: var(--tgc-accent); }
.tgc-foot-pillars .tgc-tab-sep { color: var(--tgc-border2); }

.tgc-foot-cols {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px;
  padding-bottom: 34px; border-bottom: 1px solid var(--tgc-border);
}
@media (max-width: 760px){ .tgc-foot-cols{ grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 440px){ .tgc-foot-cols{ grid-template-columns: 1fr; } }

.tgc-foot-brand .tgc-word {
  font-family: var(--tgc-serif); font-size: 22px; letter-spacing: .14em; text-transform: uppercase; color: var(--tgc-text);
}
.tgc-foot-brand .tgc-promise {
  font-family: var(--tgc-serif); font-style: italic; font-size: 15px; color: var(--tgc-text2);
  line-height: 1.6; margin-top: 12px; max-width: 320px;
}
.tgc-foot-col h4 {
  font-family: var(--tgc-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--tgc-accent); margin: 0 0 14px; font-weight: 400;
}
.tgc-foot-col a {
  display: block; font-size: 13px; color: var(--tgc-text2); text-decoration: none; margin-bottom: 9px; transition: color .15s;
}
.tgc-foot-col a:hover { color: var(--tgc-accent); }
.tgc-foot-col .tgc-soon { font-size: 9px; letter-spacing: .1em; color: var(--tgc-text3); margin-left: 6px;
  border: 1px solid var(--tgc-border2); border-radius: 2px; padding: 0 4px; }

.tgc-foot-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px;
  font-family: var(--tgc-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--tgc-text3);
}
.tgc-foot-bottom a { color: var(--tgc-text3); text-decoration: none; transition: color .15s; }
.tgc-foot-bottom a:hover { color: var(--tgc-text2); }
.tgc-foot-bottom .tgc-dot { color: var(--tgc-border2); margin: 0 8px; }
