/* ==========================================================================
   ALA Minimal Theme - Inspired by A List Apart
   Sans-serif adaptation
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-text-light: #888888;
  --color-bg: #ffffff;
  --color-bg-alt: #f9f9f9;
  --color-accent: #0066cc;
  --color-accent-hover: #004499;
  --color-border: #e5e5e5;
  
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  
  /* Sizing */
  --content-width: 700px;
  --site-width: 1200px;
  --spacing-unit: 1rem;
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-bg-alt);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background-color: var(--color-bg-alt);
  border-radius: 3px;
}

pre {
  margin: 2rem 0;
  padding: 1.5rem;
  overflow-x: auto;
  background-color: #1a1a1a;
  border-radius: 6px;
}

pre code {
  padding: 0;
  background-color: transparent;
  color: #e5e5e5;
  font-size: 0.875rem;
}

hr {
  margin: 3rem 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem var(--spacing-unit);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem var(--spacing-unit);
}

.header-content {
  max-width: var(--site-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem var(--spacing-unit);
  margin-top: 4rem;
}

.footer-content {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer-content p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Home Page
   -------------------------------------------------------------------------- */
.home-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.home-tagline {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin: 0;
}

.recent-posts h2 {
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.view-all {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Post List
   -------------------------------------------------------------------------- */
.list-header {
  margin-bottom: 3rem;
}

.list-header h1 {
  margin-top: 0;
}

.list-description {
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-summary {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-summary:last-child {
  border-bottom: none;
}

.post-summary-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.post-summary-title a {
  color: var(--color-text);
}

.post-summary-title a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.post-summary-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.post-summary-meta a {
  color: var(--color-text-muted);
}

.post-summary-meta a:hover {
  color: var(--color-accent);
}

.post-summary-description {
  margin: 0;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Single Post
   -------------------------------------------------------------------------- */
.post-header {
  margin-bottom: 3rem;
}

.post-title {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
}

.post-meta {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.post-meta a {
  color: var(--color-text-muted);
}

.post-meta a:hover {
  color: var(--color-accent);
}

.post-content {
  margin-bottom: 3rem;
  font-size: 0.9375rem;
}

.post-content h2 {
  margin-top: 3rem;
}

.post-content h3 {
  margin-top: 2.5rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.8125rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content th,
.post-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.post-content th {
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.post-content tbody tr:hover {
  background-color: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   Task Lists / Checkboxes
   -------------------------------------------------------------------------- */
.post-content input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--color-border);
  border-radius: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
  position: relative;
  cursor: default;
  flex-shrink: 0;
}

.post-content input[type="checkbox"]:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.post-content input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.post-content input[type="checkbox"]:disabled {
  opacity: 1;
  cursor: default;
}

/* Checked item text - muted color to show completion */
.post-content li:has(input[type="checkbox"]:checked) {
  color: var(--color-text-muted);
}

/* Task list alignment */
.post-content li:has(input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.5rem;
  padding-left: 0;
}

.post-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0.75rem;
  background-color: var(--color-bg-alt);
  border-radius: 3px;
}

.tag:hover {
  background-color: var(--color-border);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Post Navigation
   -------------------------------------------------------------------------- */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-nav a {
  display: flex;
  flex-direction: column;
  max-width: 45%;
}

.post-nav .next {
  text-align: right;
  margin-left: auto;
}

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.nav-title {
  font-weight: 500;
  color: var(--color-text);
}

.post-nav a:hover .nav-title {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.pagination a {
  font-weight: 500;
}

.pagination-next {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .site-nav {
    gap: 1.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .post-nav {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .post-nav a {
    max-width: 100%;
  }
  
  .post-nav .next {
    text-align: left;
    margin-left: 0;
  }
}
