:root {
  --bg: #f6eee3;
  --paper: #fff9f1;
  --paper-strong: #fffdf9;
  --ink: #3a2a20;
  --muted: #786457;
  --accent: #b55a3c;
  --accent-soft: #f6dfd1;
  --border: #e7d4c3;
  --site-font-family: "Segoe UI", Tahoma, sans-serif;
  --site-font-size: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--site-font-family);
  font-size: var(--site-font-size);
  background:
    radial-gradient(circle at 12% 12%, #fff8ef 0%, var(--bg) 56%),
    var(--bg);
  color: var(--ink);
}

.shell {
  width: min(900px, 92%);
  margin: 2.5rem auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 16px 44px rgba(86, 54, 36, 0.12);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  margin: 0;
  font-size: 1.1rem;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.95rem;
}

.nav-link:hover {
  border-color: var(--accent);
  background: #fdf0e5;
}

.nav-link.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
}

h2 {
  margin-top: 0;
}

p {
  line-height: 1.6;
}

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

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  filter: brightness(0.94);
}

.btn-danger {
  background: #8f3a2f;
}

.btn-danger:hover {
  filter: brightness(0.92);
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.9rem;
  background: var(--paper-strong);
}

.card h3 {
  margin: 0 0 0.4rem;
}

.card .date {
  color: var(--muted);
  font-size: 0.9rem;
}

form {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  font: inherit;
  background: var(--paper-strong);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 90, 60, 0.18);
}

textarea {
  min-height: 220px;
  resize: vertical;
}

.hint {
  margin: 0.2rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--accent-soft);
}

.error {
  background: #f4d4cc;
  color: #772b1b;
}

.content {
  white-space: pre-wrap;
  line-height: 1.75;
}

.content-flow {
  display: grid;
  gap: 0.8rem;
}

.content-flow .content {
  margin: 0;
}

.inline-content-image {
  display: block;
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f3e7d8;
  object-fit: cover;
}

.hero-image,
.excerpt-image,
.article-image {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f3e7d8;
  object-fit: cover;
}

.hero-image {
  margin: 0.75rem 0 1rem;
  max-height: 420px;
}

.excerpt-image {
  margin: 0.65rem 0 0.35rem;
  max-height: 320px;
}

.article-image {
  margin: 0.8rem 0 1rem;
  max-height: 420px;
}

.excerpt-title {
  margin-top: 0;
}

.excerpt-preview {
  margin: 0.35rem 0 0;
}

details.inline-open {
  margin-top: 0.7rem;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

a {
  color: var(--accent);
}

a:hover {
  color: #964731;
}

.section-block {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}

.stack {
  display: grid;
  gap: 0.35rem;
}

.small-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.number-input {
  max-width: 120px;
}
