/* Tourey Legal — formal document styles */

:root {
  --text: #1a1a1a;
  --muted: #555555;
  --line: #d6d6d6;
  --accent: #1f3350;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.tabs a {
  padding: 20px 0 18px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover { color: var(--text); }

.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.toc-title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
}

.toc li a:hover { color: var(--text); text-decoration: underline; }

.toc li a.current {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Document ---------- */
.doc {
  min-width: 0;
  max-width: 740px;
}

.doc-panel[hidden] { display: none; }

.doc h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--text);
}

.doc .updated {
  color: var(--muted);
  margin: 0 0 28px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.doc h3 {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 36px 0 10px;
  color: var(--text);
  scroll-margin-top: 90px;
}

.doc p {
  margin: 0 0 14px;
  text-align: left;
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 26px;
}

.doc li { margin-bottom: 6px; }

.doc strong { font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 24px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
}

.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .toc ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
}

@media (max-width: 480px) {
  .doc h1 { font-size: 1.5rem; }
  .toc ul { grid-template-columns: 1fr; }
  .tabs { gap: 18px; }
  .tabs a { font-size: 0.85rem; }
}

@media print {
  .site-header, .toc, .site-footer { display: none; }
  .layout { display: block; padding: 0; }
  .doc { max-width: none; }
}
