@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:opsz,wght@6..72,500;6..72,700&display=swap");
:root {
  --bg: #f5efe3;
  --paper: rgba(255, 252, 246, 0.88);
  --paper-strong: #fffaf2;
  --ink: #1f1c18;
  --muted: #6d6355;
  --line: rgba(80, 62, 42, 0.16);
  --accent: #a24a2d;
  --accent-strong: #7c331c;
  --accent-soft: rgba(162, 74, 45, 0.12);
  --shadow: 0 18px 50px rgba(65, 44, 25, 0.12);
  --radius: 24px;
  --content-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 32%), linear-gradient(180deg, #f7f2e8 0%, #efe6d8 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.24) 1px, transparent 1px, transparent 18px);
}

::selection {
  background: rgba(162, 74, 45, 0.18);
}

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

button {
  cursor: pointer;
}

.blog-shell {
  width: min(100% - 2rem, var(--content-width));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-kicker,
.section-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.brand-title {
  font-family: "Newsreader", serif;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1;
}

.blog-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-list,
.post-panel,
.editor-panel,
.status-panel {
  padding: clamp(1.25rem, 2vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2,
.status-panel h2,
.editor-header h2,
.post-panel-header h1 {
  margin: 0.2rem 0 0.5rem;
  font-family: "Newsreader", serif;
  line-height: 1.05;
}

.section-heading h2,
.status-panel h2,
.editor-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-heading p,
.status-panel p,
.editor-header p {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.post-card {
  min-height: 100%;
}

.post-card-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  width: 100%;
  min-height: 100%;
  padding: 1.35rem;
  border: 1px solid rgba(162, 74, 45, 0.14);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 246, 235, 0.9));
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.post-card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(162, 74, 45, 0.34);
  box-shadow: 0 14px 32px rgba(86, 51, 27, 0.12);
}

.post-card h3 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 1.7rem;
  line-height: 1.1;
}

.post-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.post-preview {
  margin: 0;
  color: var(--muted);
}

.text-link {
  margin-top: auto;
  color: var(--accent-strong);
  font-weight: 600;
}

.post-panel-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-panel-actions {
  margin-bottom: 1.5rem;
}

.post-panel-header {
  margin-bottom: 1.5rem;
}

.post-panel-header h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.post-body {
  font-size: 1.02rem;
  white-space: pre-wrap;
}

.editor-header {
  margin-bottom: 1.25rem;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-group span {
  font-weight: 600;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(81, 62, 42, 0.18);
  border-radius: 18px;
  background: var(--paper-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-group textarea {
  min-height: 18rem;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: rgba(162, 74, 45, 0.52);
  box-shadow: 0 0 0 4px rgba(162, 74, 45, 0.12);
}

.primary-button,
.secondary-button {
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff7f2;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.secondary-button {
  background: transparent;
  border-color: rgba(81, 62, 42, 0.18);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: rgba(162, 74, 45, 0.24);
}

.primary-button:disabled,
.secondary-button:disabled,
.field-group input:disabled,
.field-group textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.inline-error,
.error-panel {
  border-color: rgba(162, 49, 45, 0.24);
}

.inline-error {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(162, 49, 45, 0.24);
  border-radius: 18px;
  background: rgba(162, 49, 45, 0.08);
  color: #7c1e12;
}

.error-list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: #7c1e12;
}

@media (max-width: 760px) {
  .blog-shell {
    width: min(100% - 1rem, var(--content-width));
    padding-top: 0.6rem;
  }
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  .post-grid {
    grid-template-columns: 1fr;
  }
  .post-panel-header h1 {
    font-size: 2.6rem;
  }
  .field-group textarea {
    min-height: 14rem;
  }
}
