:root {
  --paper: #f7f0e4;
  --paper-strong: #fffaf4;
  --ink: #1f2330;
  --muted: #5f6779;
  --line: rgba(31, 35, 48, 0.12);
  --accent: #b3573d;
  --accent-dark: #7d311f;
  --olive: #4e5a46;
  --success: #276749;
  --danger: #8f2d1f;
  --shadow: 0 20px 40px rgba(31, 35, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(179, 87, 61, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(78, 90, 70, 0.12), transparent 30%),
    linear-gradient(180deg, #fdf8f0 0%, #f4ecde 100%);
  font-family: "Source Sans 3", sans-serif;
  min-height: 100vh;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header,
.section-header,
.toolbar,
.header-actions,
.hero-grid,
.feature-card,
.article-hero,
.dashboard-card,
.dashboard-actions,
.stats-grid,
.article-grid,
.form-grid {
  display: grid;
  gap: 1rem;
}

.site-header {
  grid-template-columns: minmax(0, 1fr) auto minmax(260px, 360px);
  align-items: center;
  margin-bottom: 1.5rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff5ea;
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
  box-shadow: var(--shadow);
}

.brand-name,
h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  letter-spacing: -0.02em;
}

.brand-name {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
}

.site-nav a {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
}

.site-nav a.active,
.site-nav a:hover {
  background: rgba(179, 87, 61, 0.12);
  color: var(--accent-dark);
}

.site-search {
  display: flex;
  gap: 0.6rem;
}

.site-search input,
input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(31, 35, 48, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 14rem;
}

.button,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff8f1;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(125, 49, 31, 0.18);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}

.button-ghost {
  background: rgba(78, 90, 70, 0.12);
  color: var(--olive);
  box-shadow: none;
}

.button-danger {
  background: linear-gradient(135deg, #a33b2d, var(--danger));
}

.page-shell {
  display: grid;
  gap: 1.5rem;
}

.hero-panel,
.feature-card,
.article-card,
.article-detail,
.dashboard-card,
.form-card,
.helper-card,
.empty-state,
.stat-card,
.flash {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgba(255, 251, 246, 0.8);
  box-shadow: var(--shadow);
}

.hero-panel,
.feature-card,
.article-detail,
.dashboard-card,
.form-card,
.empty-state,
.helper-card,
.flash {
  padding: 1.4rem;
}

.hero-panel {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 236, 218, 0.85)),
    linear-gradient(135deg, rgba(179, 87, 61, 0.08), transparent);
}

.eyebrow,
.kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-panel h1,
.section-header h1,
.section-header h2,
.feature-card h2,
.article-detail h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
}

.hero-copy,
.feature-subtitle,
.article-subtitle,
.dashboard-subtitle,
.hero-note p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-note,
.helper-card {
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background: rgba(78, 90, 70, 0.08);
  align-self: end;
}

.feature-card,
.article-hero {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.article-hero.no-media {
  grid-template-columns: minmax(0, 1fr);
}

.article-hero.no-media .article-hero-copy {
  max-width: 48rem;
}

.feature-copy,
.article-hero-copy {
  display: grid;
  gap: 0.85rem;
}

.feature-meta,
.article-card-date,
.dashboard-meta,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-body,
.article-card-body p,
.dashboard-subtitle {
  margin: 0;
}

.feature-media,
.article-hero-media,
.article-card-image {
  min-height: 18rem;
  border-radius: 1.2rem;
  overflow: hidden;
}

.feature-media img,
.article-hero-media img,
.article-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(179, 87, 61, 0.9), rgba(78, 90, 70, 0.78)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 35%);
  color: #fff8f1;
  text-align: center;
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
}

.section-header,
.header-actions,
.dashboard-actions,
.toolbar {
  align-items: center;
}

.section-header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.article-grid,
.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
  overflow: hidden;
}

.article-card-link {
  display: grid;
  min-height: 100%;
}

.article-card-body {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem 1.2rem 1.3rem;
}

.article-card h3,
.dashboard-card h2 {
  margin: 0;
  font-size: 1.6rem;
}

.article-card.compact .article-card-link {
  min-height: auto;
}

.article-detail {
  display: grid;
  gap: 1.5rem;
}

.back-link {
  color: var(--accent-dark);
  font-weight: 700;
}

.article-body {
  padding-top: 0.5rem;
}

.prose {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.75;
}

.prose h2,
.prose h3 {
  margin: 2rem 0 0.7rem;
  font-size: 1.7rem;
}

.prose p,
.prose ul {
  margin: 0 0 1.15rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.flash {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.flash-success {
  border-color: rgba(39, 103, 73, 0.28);
  background: rgba(230, 250, 239, 0.85);
}

.flash-error {
  border-color: rgba(143, 45, 31, 0.25);
  background: rgba(254, 236, 231, 0.9);
}

.admin-page .hero-panel,
.admin-page .feature-card {
  display: none;
}

.admin-header {
  margin-top: 0.5rem;
}

.stats-grid {
  gap: 1rem;
}

.stat-card {
  padding: 1.15rem 1.2rem;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  font-family: "Fraunces", serif;
}

.toolbar {
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.archive-hero .hero-copy,
.hero-note p {
  max-width: 44rem;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(31, 35, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.section-copy {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
  color: var(--muted);
  font-weight: 700;
}

.pagination .disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-list {
  display: grid;
  gap: 1rem;
}

.dashboard-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.dashboard-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.dashboard-actions {
  grid-auto-flow: row;
  align-content: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-published {
  background: rgba(39, 103, 73, 0.14);
  color: var(--success);
}

.status-draft {
  background: rgba(95, 103, 121, 0.12);
  color: var(--muted);
}

.status-archived {
  background: rgba(179, 87, 61, 0.12);
  color: var(--accent-dark);
}

.form-card {
  display: grid;
  gap: 1.25rem;
}

.article-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-card label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.full-width {
  grid-column: 1 / -1;
}

.admin-panel.narrow {
  width: min(100%, 36rem);
  margin: 2rem auto 0;
}

.empty-state {
  text-align: center;
}

.empty-state h3 {
  margin-top: 0;
  font-size: 1.8rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

code {
  padding: 0.18rem 0.4rem;
  border-radius: 0.45rem;
  background: rgba(31, 35, 48, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

@media (max-width: 960px) {
  .site-header,
  .feature-card,
  .article-hero,
  .dashboard-card,
  .toolbar,
  .article-form .form-grid,
  .stats-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    justify-content: start;
  }

  .dashboard-actions {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    grid-auto-flow: dense;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 0.75rem;
  }

  .hero-panel,
  .feature-card,
  .article-detail,
  .dashboard-card,
  .form-card,
  .empty-state,
  .helper-card,
  .flash {
    padding: 1rem;
    border-radius: 1.15rem;
  }

  .hero-panel h1,
  .section-header h1,
  .section-header h2,
  .feature-card h2,
  .article-detail h1 {
    font-size: 2.2rem;
  }

  .site-search {
    flex-direction: column;
  }
}
