:root {
  --bg: #fafaf7;
  --bg-muted: #f3f5f0;
  --text: #1a2e1a;
  --text-muted: #5c6b5c;
  --accent: #3d7a54;
  --accent-dark: #2a573c;
  --border: #e2e8df;
  --radius: 1rem;
  --radius-pill: 999px;
  --content-width: 42rem;
  --feed-width: 56rem;
  --shadow: 0 12px 40px rgba(26, 46, 26, 0.08);
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 10%, rgba(125, 185, 145, 0.18), transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(125, 185, 145, 0.12), transparent 40%);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav a,
.site-nav button {
  font: inherit;
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.site-nav a:hover,
.site-nav button:hover {
  color: var(--text);
}

.article-edit-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
  white-space: nowrap;
}

.article-edit-link:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
}

.page-shell {
  position: relative;
  width: min(var(--feed-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.featured {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.featured-card {
  display: grid;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.25rem);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.featured-card:hover {
  border-color: #cfd8cb;
}

.featured-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-muted);
}

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

.featured-card__eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.featured-card__title {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.featured-card__teaser {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.featured-card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.feed-header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.feed-grid {
  display: grid;
  gap: 1.25rem;
}

.feed-card {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.feed-card:hover {
  border-color: #cfd8cb;
}

.feed-card__image {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--bg-muted);
}

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

.feed-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.feed-card__teaser {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.feed-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (min-width: 768px) {
  .featured-card {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .feed-card {
    grid-template-columns: 1fr;
  }
}

.source-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.source-banner-logo {
  height: 22px;
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
}

.source-banner a {
  color: var(--accent-dark);
  font-weight: 600;
}

.editor-import {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.editor-import__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.editor-import__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.editor-import__brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.editor-import__help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: help;
}

.editor-import__help:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.editor-import__tooltip {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  z-index: 10;
  width: max-content;
  max-width: 15rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.25rem);
  background: #fff;
  box-shadow: 0 2px 8px rgba(26, 46, 26, 0.1);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

.editor-import__help:hover .editor-import__tooltip,
.editor-import__help:focus-visible .editor-import__tooltip {
  opacity: 1;
  visibility: visible;
}

.editor-import__logo {
  height: 22px;
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
}

.editor-import__opt-in {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.editor-import__opt-in input {
  width: auto;
  margin: 0;
}

.editor-import__controls:not([hidden]) {
  display: grid;
  gap: 0.35rem;
}

.editor-import__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.editor-import__row input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.25rem);
  background: #fff;
  font: inherit;
}

@media (max-width: 640px) {
  .editor-import__row {
    grid-template-columns: 1fr;
  }
}

.article-page {
  position: relative;
  width: min(var(--content-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--text);
}

.article-hero {
  margin: 0 0 2rem;
  overflow: hidden;
  border-radius: calc(var(--radius) + 0.25rem);
  background: var(--bg-muted);
}

.article-hero figcaption {
  padding: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.article-hero img {
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
}

.editor-field--featured {
  border: 0;
  padding: 0;
  margin: 0;
}

.editor-field--featured legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.editor-radio-group {
  display: flex;
  gap: 1.25rem;
}

.editor-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.editor-radio input {
  width: auto;
  margin: 0;
}

.article-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.article-meta {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-teaser {
  margin: 0 0 2rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.article-body p,
.article-body ul {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

.article-body h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.article-body h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.article-body ul {
  padding-left: 1.25rem;
}

.article-figure {
  margin: 2rem 0;
}

.article-figure img {
  width: 100%;
  border-radius: var(--radius);
}

.article-figure figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.editor-shell {
  width: min(64rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.editor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.editor-header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.editor-header__title {
  display: grid;
  gap: 0.35rem;
}

.editor-status {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.editor-status[data-status="published"] {
  color: var(--accent-dark);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-actions--bottom {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

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

.editor-field {
  display: grid;
  gap: 0.35rem;
}

.editor-field span {
  font-size: 0.9rem;
  font-weight: 600;
}

.editor-field input,
.editor-field textarea,
.editor-field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.25rem);
  background: #fff;
  font: inherit;
  color: var(--text);
}

.editor-field input[type="datetime-local"] {
  max-width: 22rem;
}

.editor-field textarea {
  min-height: 5rem;
  resize: vertical;
}

.editor-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.editor-preview {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
}

.hero-field {
  gap: 0.65rem;
}

.hero-preview {
  margin-top: 0.25rem;
}

.hero-status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-status[data-state="uploading"] {
  color: var(--text-muted);
}

.hero-status[data-state="embedded"] {
  color: var(--accent-dark);
}

.hero-status[data-state="embedded"]::before {
  content: "✓ ";
}

.editor-preview img {
  width: 100%;
  max-height: 16rem;
  object-fit: cover;
  display: block;
}

.blocks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-field--content {
  gap: 0.85rem;
  margin-top: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.25rem);
  background: rgba(255, 255, 255, 0.72);
}

#blocks {
  display: grid;
  gap: 1rem;
}

.block-item {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.block-item textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.25rem);
  background: #fff;
  font: inherit;
  color: var(--text);
  line-height: 1.75;
  resize: vertical;
}

.block-item textarea[data-auto-grow] {
  resize: none;
  overflow-y: hidden;
  min-height: calc(1.8rem + 1.75em);
}

.block-item--paragraph textarea {
  font-size: 1.05rem;
}

.block-item--heading textarea {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}

.block-item--heading textarea[data-auto-grow] {
  min-height: calc(1.8rem + 1.4em);
}

.block-item--list textarea {
  min-height: 10rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.block-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.block-item__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.block-item button {
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
}

.editor-message {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--bg-muted);
  color: var(--text-muted);
}

.editor-message[data-type="error"] {
  background: #fdecec;
  color: #8a1f1f;
}

.editor-message[data-type="success"] {
  background: #edf7ef;
  color: var(--accent-dark);
}

.editor-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.editor-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
}

.editor-list-item small {
  color: var(--text-muted);
}
