/*
 * Minimal, content-first styling. Propshaft's `stylesheet_link_tag :app`
 * includes every file in this directory, so actiontext.css loads alongside it.
 */

:root {
  --bg: #fffefb;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e4e2dd;
  --accent: #1a1a1a;
  --error: #a8322d;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #e8e6e1;
    --muted: #9a978f;
    --rule: #2e2e34;
    --accent: #e8e6e1;
    --error: #e8837d;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---------- header ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 2.5rem 0 1.25rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.masthead__title a { text-decoration: none; }

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.masthead nav a,
.masthead nav button {
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav button:hover {
  color: var(--fg);
  text-decoration: underline;
}

/* ---------- typography ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 0.75rem;
}

h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.3125rem; }
h3 { font-size: 1.0625rem; }

p, ul, ol, blockquote, pre { margin: 0 0 1.25rem; }

blockquote {
  margin-left: 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
}

pre {
  overflow-x: auto;
  padding: 0.875rem 1rem;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.meta {
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: 0.02em;
}

/* ---------- post list ---------- */

.post-list { list-style: none; padding: 0; margin: 0; }

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
}

.post-list a {
  text-decoration: none;
  flex: 1;
}

.post-list a:hover { text-decoration: underline; }

.post-list time {
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  font-size: 0.6875rem;
  font-family: system-ui, -apple-system, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* ---------- article body ---------- */

.post-body img,
.trix-content img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

.post-body figure,
.trix-content figure {
  margin: 1.75rem 0;
}

.post-body figcaption,
.trix-content figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
}

/* ---------- forms ---------- */

form { margin: 0; }

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

input:focus, textarea:focus, trix-editor:focus {
  outline: 2px solid var(--fg);
  outline-offset: -1px;
}

.field { margin-bottom: 1.25rem; }

.field--inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field--inline label { margin: 0; }

input[type="checkbox"] { margin: 0; }

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

button, input[type="submit"] {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 4px;
  cursor: pointer;
}

button:hover, input[type="submit"]:hover { opacity: 0.85; }

.button--plain {
  background: none;
  color: var(--muted);
  border: none;
  padding: 0;
  text-decoration: underline;
}

.button--plain:hover { color: var(--fg); }

/* Honeypot: hidden from humans, tempting to bots. */
.nickname-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- comments ---------- */

.comments {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.comment {
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--rule);
}

.comment__head {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  margin-bottom: 0.35rem;
}

.comment__author {
  font-weight: 700;
  font-size: 0.9375rem;
}

.comment__body { margin: 0; white-space: pre-wrap; }

.comment:target {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

/* ---------- flash & errors ---------- */

.flash {
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1px solid var(--rule);
}

.flash--alert { color: var(--error); border-color: currentColor; }

.errors {
  color: var(--error);
  font-size: 0.875rem;
  font-family: system-ui, -apple-system, sans-serif;
  margin-bottom: 1.25rem;
}

.errors ul { margin: 0; padding-left: 1.25rem; }

/* ---------- footer ---------- */

.footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: system-ui, -apple-system, sans-serif;
}
