/* ============================================================
   crickleaze — document portal
   palette: warm off-white · near-black · deep forest green
   ============================================================ */

:root {
  --bg:            #f6f3ed;
  --bg-card:       #efebe3;
  --bg-rule:       #e2ddd4;
  --text-head:     #1b271a;   /* green-black for headings */
  --text-body:     #383838;
  --text-muted:    #7a8a72;
  --accent:        #265c1e;   /* deep forest green */
  --accent-hover:  #1a4015;
  --accent-faint:  #e6ede4;   /* very light green tint for category headers */
  --border:        #cdd5c4;
  --max-width:     780px;
  --font-serif:    'Spectral', Georgia, 'Times New Roman', serif;
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

main.container {
  flex: 1;
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

/* ---- Header ---- */
.site-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-head);
  line-height: 1;
}

.strapline {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.55rem;
}

/* ---- Category sections ---- */
.category {
  margin-bottom: 3.5rem;
}

.category-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--text-head);
  letter-spacing: -0.01em;
}

.category-count {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}

.category-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.55;
  max-width: 58ch;
}

/* ---- Document list ---- */
.doc-list {
  list-style: none;
  border-top: 1px solid var(--border);
}

.doc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--bg-rule);
  transition: background 0.12s;
}

.doc-item:last-child {
  border-bottom: 1px solid var(--border);
}

.doc-title-link {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.45;
  flex: 1;
  transition: color 0.12s;
}

.doc-title-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.doc-date {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---- List separator (between main docs and pinned items) ---- */
.doc-separator {
  height: 0;
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0.4rem 0;
  list-style: none;
}

/* ---- Empty / loading states ---- */
.loading,
.empty-category {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 1.5rem 0;
  font-style: italic;
}

.no-categories {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.site-footer .container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-sep {
  opacity: 0.5;
}

.footer-generated {
  font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  html { font-size: 16px; }

  .wordmark { font-size: 2.2rem; }

  .doc-item {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 0;
  }

  .doc-date {
    font-size: 0.72rem;
  }
}
