/* Tiny Congress - Minimal prose-focused theme */

/* CSS Variables - Light/Dark mode support */
:root {
  --primary-color: #222;
  --accent-color: #e23c29;
  --text-color: #383838;
  --text-color-light: #666;
  --bg-color: #fff;
  --bg-color-secondary: #f8f8f8;
  --border-color: #e0e0e0;
  --link-color: #0c6fb5;
  --link-color-hover: #094b79;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #fff;
    --text-color: #e0e0e0;
    --text-color-light: #999;
    --bg-color: #1a1a1a;
    --bg-color-secondary: #222;
    --border-color: #333;
    --link-color: #6ab0e4;
    --link-color-hover: #8cc4ed;
  }
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 1.125em;
  line-height: 1.7;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5em;
  margin-bottom: 0.25em;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5em;
  margin-bottom: 0.75em;
}

h3 {
  font-size: 1.2em;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--link-color-hover);
}

/* Layout */
.container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Top Bar - minimal with GitHub icon */
.top-bar {
  padding: 1rem 0;
}

.top-bar .container {
  display: flex;
  justify-content: flex-end;
}

.github-link {
  color: var(--text-color-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

.github-link:hover {
  color: var(--primary-color);
}

.github-link svg {
  display: block;
}

/* Page Article */
.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Hero */
.hero {
  padding: 2rem 0 2rem;
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 3rem;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.hero h1 .logo {
  height: 1em;
  width: auto;
}

.headline {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.25em;
}

.subheadline {
  font-size: 1.1rem;
  color: var(--text-color-light);
  margin-bottom: 1.5em;
}

.intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
}

/* Table of Contents */
.toc {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.toc-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-color-light);
  margin-bottom: 0.75rem;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  padding-left: 0;
  margin: 0;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 0.5em;
}

.toc li::before {
  content: counter(toc) ".";
  display: inline-block;
  width: 1.5em;
  color: var(--text-color-light);
  font-size: 0.9rem;
}

.toc a {
  font-size: 0.95rem;
  color: var(--text-color);
  text-decoration: none;
}

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

/* Sections */
section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
  border-bottom: none;
}

/* Section headers */
.section-num {
  color: var(--text-color-light);
  font-weight: 400;
  margin-right: 0.25em;
}

.section-tagline {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-color-light);
  margin-top: -0.5em;
  margin-bottom: 1em;
}

/* Lists */
ul {
  margin: 1em 0;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

.problem-list,
.not-list {
  list-style: none;
  padding-left: 0;
}

.problem-list li,
.not-list li {
  margin-bottom: 1em;
  padding-left: 0;
}

.problem-list strong,
.not-list strong {
  color: var(--primary-color);
}

/* Aside text */
.aside {
  font-style: italic;
  color: var(--text-color-light);
  margin-top: 1.5em;
}

/* Signup Form */
.signup-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-color-secondary);
  border-radius: 0.5rem;
}

.checkbox-group {
  margin-bottom: 1.5rem;
}

.checkbox-group label {
  display: block;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.form-row input[type="email"]:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 1px;
  border-color: var(--link-color);
}

.form-row button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: var(--primary-color);
  color: var(--bg-color);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.form-row button:hover {
  background-color: var(--accent-color);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
}

footer p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-color-light);
}

footer a {
  color: var(--text-color-light);
}

footer a:hover {
  color: var(--link-color);
}

/* GitHub Activity Section */
.github-activity {
  margin-top: 2rem;
}

.github-activity h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.github-activity h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color-light);
  margin-bottom: 0.75rem;
}

.activity-subtitle {
  font-size: 0.9rem;
  color: var(--text-color-light);
  margin-bottom: 1rem;
}

.activity-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-color-secondary);
  border-radius: 0.5rem;
  min-width: 100px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-color-light);
  margin-top: 0.25rem;
}

.recent-commits ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.recent-commits li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.recent-commits li:last-child {
  border-bottom: none;
}

.recent-commits li.loading,
.recent-commits li.error {
  color: var(--text-color-light);
  font-style: italic;
}

.commit-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.commit-link:hover .commit-message {
  text-decoration: underline;
}

.commit-sha {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--link-color);
  background: var(--bg-color-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  flex-shrink: 0;
}

.commit-message {
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commit-date {
  color: var(--text-color-light);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .hero h1 {
    font-size: 2.25rem;
  }

  .headline {
    font-size: 1.25rem;
  }

  .subheadline,
  .intro {
    font-size: 1rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row button {
    width: 100%;
  }
}
