:root {
  --bg: #f7f5f0;
  --paper: #ffffff;
  --ink: #1b1f23;
  --muted: #65707a;
  --line: #d9d4c9;
  --red: #a7352a;
  --green: #2e6f5e;
  --blue: #24587a;
  --gold: #9a6a16;
  --shadow: 0 18px 50px rgba(27, 31, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--ink);
}

button.danger {
  background: var(--red);
  border-color: var(--red);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

label input,
label textarea,
label select {
  color: var(--ink);
  font-weight: 500;
}

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 700;
}

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

.link-button {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.intro-band {
  min-height: 320px;
  display: grid;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(247, 245, 240, 0.98), rgba(247, 245, 240, 0.76)),
    repeating-linear-gradient(135deg, rgba(36, 88, 122, 0.13) 0 2px, transparent 2px 18px);
}

.intro-copy {
  width: min(780px, 100%);
  padding: 42px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.intro-copy h1,
.article-header h1,
.admin-heading h1,
.auth-panel h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-copy p:last-child,
.article-header p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.feed-layout,
.comments-section,
.admin-page,
.auth-panel,
.article-view {
  padding: 42px 0;
}

.section-heading,
.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2,
.admin-heading h1 {
  margin-bottom: 0;
}

.section-heading p,
.admin-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-card,
.comment,
.moderation-item,
.admin-row,
.auth-panel,
.article-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.post-card,
.comment,
.moderation-item,
.admin-row {
  padding: 22px;
}

.post-card h3 {
  margin-bottom: 10px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.post-card h3 a,
.text-link,
.source-link {
  color: var(--blue);
  font-weight: 800;
}

.post-card p,
.comment p,
.moderation-item p,
.admin-row p {
  color: var(--muted);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.post-meta span,
.post-meta time {
  border-left: 3px solid var(--gold);
  padding-left: 8px;
}

.article-view {
  padding: 34px;
}

.article-body {
  max-width: 780px;
  font-size: 1.08rem;
}

.vote-bar,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.comment-form,
.stacked-form,
.editor-form {
  display: grid;
  gap: 16px;
}

.comment-form,
.auth-panel {
  max-width: 680px;
}

.comment-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.comment time {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.admin-row h2,
.moderation-item h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.auth-panel {
  margin-top: 42px;
  padding: 28px;
}

.flash-stack {
  position: fixed;
  z-index: 10;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  max-width: 340px;
}

.flash {
  margin: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.flash.error {
  background: var(--red);
}

.flash.success {
  background: var(--green);
}

.empty-state {
  color: var(--muted);
}

.site-footer {
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .site-header,
  .section-heading,
  .admin-heading,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .intro-copy h1,
  .article-header h1,
  .admin-heading h1,
  .auth-panel h1 {
    font-size: 2.3rem;
  }

  .article-view {
    padding: 22px;
  }

  .row-actions > *,
  .vote-bar button,
  .admin-heading .button {
    width: 100%;
  }
}
