/* =========================
   Trust-State Unified CSS
   Final Institutional Version
   ========================= */

/* ---------- Root Variables ---------- */

:root {
  --ts-navy: #0A1F33;
  --ts-accent: #1E90FF;
  --ts-light: #F5F7FA;
  --ts-border: #E5E7EB;
  --ts-text: #1F2937;
  --ts-muted: #6B7280;
  --max-width: 960px;
  --doc-width: 760px;
  --radius: 6px;
}

/* ---------- Base Reset ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--ts-light);
  color: var(--ts-text);
  line-height: 1.6;
}

/* ---------- Layout Containers ---------- */

.ts-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  color: var(--ts-navy);
  font-weight: 600;
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--ts-border);
  padding-bottom: 0.5rem;
}

p { margin-bottom: 0.75rem; }

ul, ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
}

li { margin-bottom: 0.4rem; }

a {
  color: var(--ts-accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ---------- Hidden Field ---------- */

.ts-hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---------- Topbar ---------- */

.ts-topbar {
  background: #F4F7FA;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.4rem 0;
  color: var(--ts-muted);
  border-bottom: 1px solid var(--ts-border);
}

/* ---------- Header ---------- */

.ts-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--ts-border);
  z-index: 1000;
}

.ts-header .ts-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  position: relative; /* needed for mobile panel */
}

.ts-logo a {
  text-decoration: none;
  color: var(--ts-navy);
  font-weight: 600;
  font-size: 1.1rem;
}

/* ---------- Navigation ---------- */

.ts-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.ts-nav a {
  color: var(--ts-text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.ts-nav a:hover {
  color: var(--ts-navy);
}

/* ---------- Active Nav ---------- */

body.page-standard .ts-nav a[href="/standard/"],
body.page-releases .ts-nav a[href="/releases/"],
body.page-conformance .ts-nav a[href="/conformance/"],
body.page-governance .ts-nav a[href="/governance/"],
body.page-about .ts-nav a[href="/about/"],
body.page-contact .ts-nav a[href="/contact/"] {
  font-weight: 600;
  color: var(--ts-navy);
}

/* ---------- Hamburger ---------- */

.ts-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ts-text);
}

/* ---------- Standard Page Layout ---------- */

.ts-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2.5rem;
}

/* ---------- Sidebar ---------- */

.ts-sidebar { font-size: 0.9rem; }

.ts-sidenav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.ts-sidenav li { margin-bottom: 0.4rem; }

.ts-sidenav a {
  color: var(--ts-text);
  display: block;
  padding: 0.25rem 0;
}

.ts-sidenav a:hover {
  color: var(--ts-accent);
}

/* ---------- Divider ---------- */

.ts-divider {
  border: none;
  border-top: 1px solid var(--ts-border);
  margin: 2rem 0;
}

/* ---------- Contact Form ---------- */

.ts-form-clean {
  max-width: 820px;
  margin-top: 2rem;
}

.ts-form-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.ts-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ts-field label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.ts-field input,
.ts-field select,
.ts-field textarea {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ts-border);
  border-radius: 4px;
  font-size: 0.95rem;
  background: #ffffff;
}

.ts-field input:focus,
.ts-field select:focus,
.ts-field textarea:focus {
  outline: none;
  border-color: var(--ts-accent);
}

.ts-form-actions { margin-top: 2rem; }

.ts-button-wide { min-width: 220px; }

/* ---------- Hash ---------- */

.ts-hash { margin-top: 1rem; font-size: 0.85rem; }

.ts-hash-value {
  font-family: monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
  display: block;
}

/* ---------- Footer ---------- */

.ts-footer {
  background: var(--ts-navy);
  color: #ffffff;
  padding: 3rem 0;
  margin-top: 4rem;
}

.ts-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  align-items: start;
}

.ts-footer-bottom {
  margin-top: 2rem;
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 900px) {
  .ts-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  .ts-hamburger {
    display: block;
  }

  /* Panel-style dropdown */
  .ts-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--ts-border);
    padding: 1.5rem 2.5rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
  }

  .ts-nav.active {
    display: flex;
  }

  .ts-form-row {
    flex-direction: column;
    gap: 1.25rem;
  }

  .ts-footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

}