/* 02-chrome.css — Global page chrome: the "header_footer" file.
   - TANIA top utility bar (tier 1, tagline)
   - TANIA brand bar (tier 2, primary nav + theme/background pickers)
   - Page nav (per-page secondary header), page container, page bar, section labels
   - Site footer
   - Header bar-nav (Home/About pill links inside .tania-bar)
   Edit here when the header/footer/page-shell needs styling work.
   Was: app.css lines 212–426, 532–555, 1482–1507. */

/* ---------- TANIA top utility bar (tier 1) ----------
   Thin centered row that carries the org tagline. Gives the tagline
   its own line so it can grow without crowding the primary nav. */
.tania-topbar{
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 7px 24px;
  color: var(--text-muted);
}
.tania-topbar-inner{
  text-align: center;
  font-size: 16px;
  letter-spacing: .02em;
  line-height: 1.4;
}
.tania-topbar .brand-name{
  display: block;
  color: var(--text); font-weight: 600;
  line-height: 1.25;
}
.tania-topbar .accent-dot{ display: none; }
.tania-topbar .tania-tagline{
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.3;
  margin-top: 2px;
}

/* Visually hidden but accessible to screen readers. Used by the mobile
   chevron-toggle button below. */
.sr-only{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Mobile collapse trigger for theme + background pickers. Hidden on
   desktop; revealed at <=480px via the media block in mobile.css.
   CSS-only (checkbox-hack). */
.tania-bar-toggle-input{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.tania-bar-toggle{
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .2s;
}
.tania-bar-toggle:hover{ color: var(--text); border-color: var(--accent); }
.tania-bar-toggle .chev{ width: 16px; height: 16px; }
.tania-bar-toggle-input:focus-visible ~ .tania-bar-toggle{
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.tania-bar-toggle-input:checked ~ .tania-bar-toggle .chev{
  transform: rotate(180deg);
}
/* Per-theme gradients on the top utility bar. Three-stop linear blend
   (dark edge then darkened accent then dark edge) per scheme's palette.
   Mid-stop intentionally darker than the raw --accent so light --text
   stays legible across the bar. */
[data-scheme="1"] .tania-topbar{
  background: linear-gradient(90deg, rgba(20, 18, 16, 1) 0%, rgb(125 50 25) 35%, rgb(15 12 10) 100%);
}
[data-scheme="3"] .tania-topbar{
  background: linear-gradient(90deg, rgba(5, 8, 6, 1) 0%, rgb(0 100 55) 35%, rgb(0 20 15) 100%);
}
[data-scheme="5"] .tania-topbar{
  background: linear-gradient(90deg, rgba(2, 0, 36, 1) 0%, rgb(90 6 107) 35%, rgb(0 16 58) 100%);
}
[data-scheme="7"] .tania-topbar{
  background: linear-gradient(90deg, rgba(15, 12, 0, 1) 0%, rgb(125 80 0) 35%, rgb(20 15 0) 100%);
}
[data-scheme="17"] .tania-topbar{
  background: linear-gradient(90deg, rgba(8, 12, 18, 1) 0%, rgb(18 80 28) 35%, rgb(10 18 22) 100%);
}
[data-scheme="9"] .tania-topbar{
  background: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgb(110 90 0) 35%, rgba(0, 0, 0, 1) 100%);
}

/* ---------- TANIA brand bar (tier 2: primary nav) ----------
   Two-end flex layout: primary nav on the LEFT, theme + background pickers
   plus the collapse-chevron on the RIGHT. Mobile.css re-flows this onto
   multiple rows at <=880px. */
.tania-bar{
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}
.tania-bar-spacer{ display: none; }
.tania-bar-right{
  display: inline-flex; align-items: center; gap: 10px;
}
/* Theme + background pickers + (optional) logout button.
   Desktop default: OPEN. Mobile (<=480px in mobile.css) overrides to hidden.
   Checkbox :checked COLLAPSES on desktop (mobile overrides to expand). */
.tania-bar-utilities{
  display: inline-flex;
  align-items: center; gap: 12px;
}
.tania-bar-toggle-input:checked ~ .tania-bar-utilities{
  display: none;
}
.tania-bar-logout-form{ margin: 0; }
.tania-bar-logout{
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.tania-bar-logout:hover{
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface-2);
}
.tania-bar-logout:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.scheme-picker{
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.scheme-picker .gear{ width: 14px; height: 14px; color: var(--text-muted); }
.scheme-picker select{
  appearance: none; -webkit-appearance: none;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 28px 5px 10px;
  font: inherit; font-size: 12px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.scheme-picker select:hover{ border-color: var(--accent); }
.scheme-picker select:focus{ outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Header bar-nav (Home / About pill links inside .tania-bar) ----
   Distinct from the per-page .tania-nav below (which is a secondary header). */
.tania-bar-nav{
  display: inline-flex; align-items: center; gap: 4px;
}
.tania-navlink{
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.tania-navlink:hover{
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.tania-navlink:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* ---------- Top-right user pills (SETTINGS / RESULTS) ------------------
   Live inside .tania-bar-right, before the picker utilities. Mirror the
   .tania-navlink pill shape but use an accent-tinted border to read as
   "your account" actions rather than primary nav. */
.tania-bar-userpills{
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 6px;
}
.tania-userpill{
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  transition: color .15s, background .15s, border-color .15s;
}
.tania-userpill:hover{
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--accent);
}
.tania-userpill:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* ---------- Page nav (per-page secondary header) ---------- */
.tania-nav{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 16px;
}
.brand{ font-weight:500; letter-spacing:-.01em; font-size:18px; }
.brand .sep{ color: var(--text-muted); margin: 0 10px; font-weight:300; }
.brand .sub{ color: var(--text-muted); font-weight:300; font-size:14px; }
.nav-right{
  display:flex; align-items:center; gap:14px;
  color: var(--text-muted); font-size:14px;
}
.nav-right .who{ color: var(--text); font-weight:400; }
.nav-right a{ color: var(--link); text-decoration:none; }
.nav-right a:hover{ text-decoration: underline; }

/* ---------- Page container ---------- */
.tania-container{
  max-width: min(900px, 65vw); margin: 0 auto;
  padding: 28px 24px 64px;
}
@media (max-width: 768px){
  .tania-container{
    max-width: 100%;
    padding: 20px 16px 48px;
  }
}

/* ---------- Page bar (back/print row) ---------- */
.page-bar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 24px;
}
.back-link{ color: var(--link); text-decoration:none; font-size: 14px; }
.back-link:hover{ text-decoration: underline; }

/* ---------- Section labels ---------- */
.section-head{
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.tania-footer{
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--text-muted); font-size: 12px;
  background: var(--bg);
  gap: 12px;
}
.tania-footer .left{ justify-self: start; }
.tania-footer .center{ justify-self: center; text-align: center; }
.tania-footer .center a{
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.tania-footer .center a:hover{ text-decoration: underline; }
.tania-footer .right{ justify-self: end; }
.tania-footer a.policy{ color: var(--text-muted); text-decoration:none; margin-left:16px; }
.tania-footer a.policy:hover{ color: var(--accent); }
