/* =============================================
   Favor Legal Center — Stylesheet
   Brand: #0099E5 (Cerulean), #77CEF9 (Malibu)
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #0099E5;
  --blue-light:  #77CEF9;
  --blue-dark:   #0077B3;
  --blue-faint:  #EAF6FD;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --border:      #e5e7eb;
  --bg:          #ffffff;
  --bg-subtle:   #f9fafb;
  --sidebar-w:   240px;
  --header-h:    56px;
  --font-body:   'Georgia', 'Times New Roman', serif;
  --font-ui:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius:      6px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-subtle);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue);
  height: var(--header-h);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo img {
  /* Invert the blue parts to white for the header */
  filter: brightness(0) invert(1);
  height: 30px;
  width: auto;
}

.header-divider {
  color: rgba(255,255,255,0.45);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}

.header-section {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.header-nav-link:hover,
.header-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

/* ---- Page layout ---- */

.page-layout {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
  gap: 0;
}

/* ---- Sidebar ---- */

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-section {
  padding: 0 0 1.25rem;
  margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
}

.sidebar-link {
  display: block;
  padding: 6px 1.25rem;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.sidebar-link.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: var(--blue-faint);
  font-weight: 500;
}

/* Sidebar meta (version, date) */

.sidebar-meta {
  font-size: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 1.25rem;
  color: var(--text-muted);
  font-size: 12px;
}

.meta-row span:first-child { color: var(--text-light); }

.download-link {
  display: block;
  margin: 0.75rem 1.25rem 0;
  padding: 6px 10px;
  background: var(--blue-faint);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid rgba(0,153,229,0.2);
  text-align: center;
  transition: background 0.15s;
}

.download-link:hover {
  background: #d6eefa;
}

/* TOC nav */

.toc { font-size: 12.5px; }

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

.toc a:hover { color: var(--blue); }

/* ---- Main content ---- */

.main-content {
  background: var(--bg);
  border-left: 1px solid var(--border);
  min-height: calc(100vh - var(--header-h));
  padding: 0;
}

.doc-header {
  background: var(--blue-faint);
  border-left: 4px solid var(--blue);
  padding: 1.75rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.doc-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 6px;
}

.doc-title {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
}

.doc-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Document body (article) ---- */

.doc-body {
  padding: 2rem 2.5rem 3rem;
  max-width: 760px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: #2d2d2d;
}

.doc-body h1 {
  /* Hide the H1 from markdown — already shown in doc-header */
  display: none;
}

.doc-body h2 {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 0.6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  line-height: 1.3;
}

.doc-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-body h3 {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-body p {
  margin-bottom: 1rem;
}

.doc-body p:last-child { margin-bottom: 0; }

.doc-body ul, .doc-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.doc-body li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.doc-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-body a:hover { color: var(--blue-dark); }

.doc-body strong { font-weight: 700; }

.doc-body em { font-style: italic; }

.doc-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Signature block styling */
.doc-body p:has(+ p > strong:first-child) { margin-top: 2rem; }

/* ---- Footer ---- */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--blue); }

/* ---- Index page ---- */

.index-hero {
  background: var(--blue);
  padding: 3rem 2.5rem;
  color: white;
}

.index-hero h1 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.index-hero p {
  font-size: 15px;
  opacity: 0.85;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.doc-card {
  background: var(--bg);
  padding: 1.75rem 2rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.15s;
}

.doc-card:hover { background: var(--blue-faint); }

.doc-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.doc-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.doc-card-arrow {
  font-size: 18px;
  color: var(--blue);
  margin-top: auto;
  padding-top: 0.75rem;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .header-nav { display: none; }

  .doc-body { padding: 1.5rem; }
  .doc-header { padding: 1.25rem 1.5rem; }
}

@media (max-width: 600px) {
  .doc-title { font-size: 22px; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
