:root {
  --color-bg: #fdfaf7;
  --color-text: #2a2420;
  --color-accent: #a8654f;
  --color-border: #e5ddd3;
  --color-muted: #83766a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

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

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: white;
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links form.logout-form {
  display: inline;
}

.nav-links button {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.container.narrow {
  max-width: 640px;
}

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

.post-list, .card-list, .admin-links, .admin-lesson-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  background: white;
}

.meta {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.price {
  font-weight: 600;
}

.prose {
  line-height: 1.75;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.form label.checkbox {
  flex-direction: row;
  align-items: center;
  font-weight: normal;
}

input, textarea, select {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

button, .button {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: fit-content;
}

.error {
  color: #a3312a;
}

.success {
  color: #2a7a3f;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

.admin-table form {
  display: inline;
}

.site-footer {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1b1815;
    --color-text: #ede6de;
    --color-border: #38322c;
    --color-muted: #a89d90;
  }
  .site-header, .card { background: #241f1a; }
}
