:root {
  --bg: #f4f0e8;
  --paper: #fffdf9;
  --paper-strong: #ffffff;
  --ink: #161514;
  --muted: #6d675f;
  --line: rgba(22, 21, 20, 0.12);
  --accent: #d44b2f;
  --accent-soft: #f5d2c8;
  --shadow: 0 20px 60px rgba(20, 18, 16, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(212, 75, 47, 0.1), transparent 24%),
    linear-gradient(180deg, #faf5ee 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell,
.admin-shell {
  min-height: 100vh;
}

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

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

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand span,
.eyebrow,
.site-nav a:hover,
.article-meta a,
.tag-list a:hover {
  color: var(--accent);
}

.site-nav,
.article-meta,
.section-heading,
.tag-list,
.admin-actions,
.sidebar-links,
.search-form,
.pagination,
.stats-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a,
.sidebar-links a,
.tag-list a,
.pagination a,
.admin-actions a {
  color: var(--muted);
}

.page-content {
  padding-bottom: 64px;
}

.hero-grid,
.content-grid,
.editor-layout {
  display: grid;
  gap: 24px;
}

.hero-grid {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  margin: 16px 0 34px;
}

.hero-copy,
.featured-card,
.article-card,
.panel,
.article-page,
.login-card,
.admin-main,
.admin-table,
.editor-main,
.editor-sidebar {
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy,
.featured-card__content,
.article-card__body,
.panel,
.article-page,
.login-card,
.admin-main,
.editor-main,
.editor-sidebar {
  padding: 28px;
}

.hero-copy h1,
.section-heading h1,
.article-page h1,
.featured-card h2,
.article-card h3 {
  font-family: var(--font-display);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(3rem, 8vw, 5.6rem);
  max-width: 12ch;
}

.lede,
.hero-copy p,
.article-card p,
.panel span,
.empty-state,
.site-footer p {
  color: var(--muted);
  line-height: 1.7;
}

.featured-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.featured-card img,
.article-page__hero {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.featured-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.content-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  align-items: start;
}

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

.article-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
}

.article-card__image img {
  height: 100%;
  object-fit: cover;
}

.article-card h3 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin-bottom: 10px;
}

.panel h3,
.section-heading h2,
.editor-sidebar legend {
  font-family: var(--font-display);
  margin-top: 0;
}

.tag-list a,
.status-badge,
.button,
button,
.button-link {
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.tag-list a {
  font-size: 0.92rem;
}

.search-form input,
.editor-form input,
.editor-form textarea,
.editor-form select,
.login-card input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.search-form {
  margin-top: 26px;
}

.search-form input {
  min-width: min(100%, 340px);
}

button,
.button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  border: 0;
}

.button--ghost,
.button-link {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-link {
  padding: 0;
  border: 0;
}

.article-page {
  max-width: 900px;
  margin: 0 auto;
}

.prose {
  font-size: 1.08rem;
  line-height: 1.9;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin-top: 1.8em;
}

.prose img {
  margin: 24px 0;
  border-radius: var(--radius-sm);
}

.site-footer {
  padding: 24px 0 48px;
}

.login-page,
.admin-body {
  background: #eee6db;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
}

.admin-sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 18px;
}

.admin-sidebar nav {
  display: grid;
  gap: 10px;
}

.admin-main {
  margin: 24px;
}

.admin-table {
  overflow: hidden;
}

.stats-grid {
  margin: 0 0 18px;
}

.stat-card {
  min-width: 180px;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 2rem;
}

.automation-panel {
  margin: 18px 0;
}

.automation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.panel--soft {
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.automation-defaults summary {
  cursor: pointer;
  color: var(--muted);
}

.automation-defaults pre {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: auto;
}

.admin-table__row {
  display: grid;
  grid-template-columns: 2fr 120px 120px 220px;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.admin-table__row--head {
  color: var(--muted);
  border-top: 0;
}

.editor-layout {
  grid-template-columns: minmax(0, 2fr) minmax(290px, 0.9fr);
  align-items: start;
}

.editor-main,
.editor-sidebar,
.editor-form,
.upload-inline,
.markdown-toolbar,
.editor-sidebar fieldset,
.automation-form,
.automation-grid,
.automation-defaults__body {
  display: grid;
  gap: 14px;
}

.editor-form label,
.login-card label {
  display: grid;
  gap: 8px;
}

.editor-sidebar fieldset {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.markdown-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

.markdown-toolbar button {
  background: var(--paper-strong);
  color: var(--ink);
  border: 1px solid var(--line);
}

textarea {
  resize: vertical;
}

.markdown-preview {
  min-height: 200px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.admin-thumb {
  width: 140px;
  border-radius: 16px;
}

.status-badge--draft {
  background: #f1e2af;
}

.status-badge--published {
  background: #cce6d8;
}

.form-error {
  color: #9f1f08;
}

.admin-notice {
  color: #245a32;
}

@media (max-width: 960px) {
  .hero-grid,
  .content-grid,
  .editor-layout,
  .admin-shell,
  .article-card,
  .admin-table__row,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    margin: 0;
    border-radius: 0;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
