/* ============================================================
   Base
   ============================================================ */
:root {
  --bg: #FAF8F5;
  --text: #2C2C2C;
  --muted: #6B6B6B;
  --accent: #7A8B6F;
  --accent-soft: #F2F4EF;
  --border: #E8E4DE;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.container { max-width: 720px; margin: 0 auto; padding: 0 32px; }

/* ============================================================
   Header
   ============================================================ */
header {
  position: sticky;
  top: 0;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  z-index: 100;
}
header.scrolled { border-bottom-color: var(--border); }
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordmark {
  font-family: 'Lora', serif;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}
nav ul { display: flex; gap: 32px; list-style: none; align-items: center; }
nav a { font-size: 14px; color: var(--muted); transition: color 0.2s ease; }
nav a:hover { color: var(--text); }
nav a.icon { display: flex; align-items: center; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 140px 0 120px; text-align: center; }
.hero h1 { font-size: 46px; margin-bottom: 28px; letter-spacing: -0.01em; }
.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 40px;
  font-weight: 300;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: #6A7B60; transform: translateY(-1px); }

/* ============================================================
   Pillars
   ============================================================ */
.pillars { padding: 40px 0 100px; border-top: 1px solid var(--border); }
.pillars-grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 32px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: center;
}
.pillar h3 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}
.pillar p { font-size: 15px; color: var(--muted); line-height: 1.65; font-weight: 300; }

/* ============================================================
   Writing list
   ============================================================ */
.writing { padding: 100px 0; border-top: 1px solid var(--border); }
.section-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 48px;
}
.post {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: opacity 0.2s ease;
}
.post:hover { opacity: 0.7; }
.post h2 { font-size: 24px; margin-bottom: 12px; }
.post-meta { font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.post-meta .cat { color: var(--accent); }
.post-meta .dot { margin: 0 8px; opacity: 0.5; }
.all-writing {
  display: inline-block;
  margin-top: 40px;
  font-size: 15px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ============================================================
   Post count line
   ============================================================ */
.post-count {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  margin-top: -28px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Search panel — scaled 20% smaller
   ============================================================ */
.search-panel {
  background: #F2F4EF;
  border: 1px solid #DFE3D9;
  border-radius: 8px;
  padding: 32px 38px;
  margin-bottom: 38px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.search-box { max-width: 100%; }
.search-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5E6B52;
  font-weight: 500;
  margin-bottom: 14px;
}
.search-field {
  display: flex;
  align-items: stretch;
  background: #FFFFFF;
  border: 1px solid #C9D1BD;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 139, 111, 0.15);
}
.search-icon {
  display: flex;
  align-items: center;
  padding: 0 6px 0 20px;
  color: #7A8B6F;
  pointer-events: none;
  flex-shrink: 0;
}
.search-icon svg {
  width: 21px;
  height: 21px;
}
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  padding: 22px 16px;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.search-field input::placeholder {
  color: #8A8F82;
  opacity: 0.85;
}
.search-field button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0 34px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.search-field button:hover { background: #6A7B60; }

/* Category dropdown */
.category-select {
  border: none;
  border-left: 1px solid #E0E3DB;
  background: transparent;
  padding: 0 32px 0 18px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8B6F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  flex-shrink: 0;
  max-width: 170px;
}
.category-select:hover,
.category-select:focus { color: var(--accent); }

/* Summary line */
.search-summary {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.search-summary strong { color: var(--text); font-weight: 500; }
.search-clear {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  margin-left: 8px;
}
.search-clear:hover { color: #6A7B60; }

/* ============================================================
   Newsletter
   ============================================================ */
.newsletter {
  background: var(--accent-soft);
  padding: 100px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.newsletter h2 { font-size: 30px; margin-bottom: 16px; }
.newsletter p {
  font-size: 16px;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 36px;
  font-weight: 300;
}
.signup { display: flex; gap: 10px; max-width: 460px; margin: 0 auto 16px; }
.signup input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.signup input:focus { border-color: var(--accent); }
.signup button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}
.signup button:hover { background: #6A7B60; }
.microcopy { font-size: 13px; color: var(--muted); opacity: 0.8; }

/* ============================================================
   About
   ============================================================ */
.about { padding: 120px 0; }
.about h1 { font-size: 36px; margin-bottom: 48px; }
.about p { font-size: 17px; margin-bottom: 24px; color: var(--text); font-weight: 300; }
.about p.lead {
  font-size: 20px;
  color: var(--text);
  font-weight: 400;
  font-family: 'Lora', serif;
  line-height: 1.6;
}
.about hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }
.about em { color: var(--muted); }

/* ============================================================
   Footer
   ============================================================ */
footer { padding: 80px 0 60px; border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.footer-brand { font-family: 'Lora', serif; font-size: 18px; letter-spacing: 0.05em; }
.footer-tagline { font-size: 14px; color: var(--muted); font-weight: 300; }
.footer-nav { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-legal { font-size: 13px; color: var(--muted); opacity: 0.7; }

/* ============================================================
   Single Post
   ============================================================ */
.post-single { padding: 120px 0 100px; }
.post-single h1 { font-size: 40px; margin-bottom: 20px; letter-spacing: -0.01em; }
.post-single .post-meta {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.post-body { font-size: 18px; line-height: 1.8; color: var(--text); font-weight: 300; }
.post-body p { margin-bottom: 24px; }
.post-body h2 { font-size: 26px; margin: 48px 0 16px; }
.post-body h3 { font-size: 20px; margin: 36px 0 12px; }
.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--muted);
}
.post-body a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.back-link { display: inline-block; margin-top: 64px; font-size: 15px; color: var(--accent); }

/* ============================================================
   Admin
   ============================================================ */
.admin-body { background: #F4F2EE; font-family: 'Inter', sans-serif; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 48px 32px 80px; }
.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  margin-bottom: 24px;
}
.admin-card h2 {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 20px;
}

/* Admin top bar */
.admin-bar { background: #fff; border-bottom: 1px solid var(--border); }
.admin-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-bar-brand {
  font-family: 'Lora', serif;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--text);
}
.admin-bar-brand span {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 8px;
  vertical-align: middle;
}
.admin-bar-nav a {
  font-size: 13px;
  color: var(--muted);
  margin-left: 24px;
  transition: color 0.2s ease;
}
.admin-bar-nav a:hover { color: var(--text); }

/* Page heading */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: 'Lora', serif;
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 6px;
}
.page-sub { font-size: 14px; color: var(--muted); }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.btn-primary:hover { background: #6A7B60; }

/* Post list table */
.post-list-card { padding: 0; overflow: hidden; }
.post-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.post-table thead th {
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: #FCFBF9;
}
.post-table tbody td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.post-table tbody tr:last-child td { border-bottom: none; }
.post-table tbody tr:hover { background: #FCFBF9; }
.col-title a {
  font-family: 'Lora', serif;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}
.col-title a:hover { color: var(--accent); }
.col-cat { color: var(--accent); font-size: 13px; }
.col-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.col-status { width: 110px; }
.col-actions { text-align: right; white-space: nowrap; width: 140px; }
.action-link { font-size: 13px; color: var(--muted); margin-left: 16px; text-decoration: none; }
.action-link:hover { color: var(--text); }
.action-link.delete:hover { color: #A65A4E; }

/* Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.draft { background: #F4E8E4; color: #A65A4E; }

/* Notices & empty state */
.notice {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 24px;
}
.empty-state { text-align: center; padding: 80px 32px; }
.empty-title { font-family: 'Lora', serif; font-size: 20px; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

/* Admin form */
.admin-form label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.admin-form input[type=text],
.admin-form input[type=password],
.admin-form input[type=email],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  margin-bottom: 24px;
  outline: none;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus { border-color: var(--accent); }
.admin-form textarea { min-height: 360px; resize: vertical; line-height: 1.7; }
.admin-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.admin-form button:hover { background: #6A7B60; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .hero { padding: 90px 0 80px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .pillars-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .post h2 { font-size: 20px; }
  .signup { flex-direction: column; }
  nav ul { gap: 20px; }
  nav a { font-size: 13px; }
  .header-inner { padding: 18px 24px; }
  .container { padding: 0 24px; }
  .about h1 { font-size: 28px; }
  .about p.lead { font-size: 18px; }
  .post-single h1 { font-size: 30px; }
  .post-table thead { display: none; }
  .post-table tbody tr {
    display: block;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
  }
  .post-table tbody td { display: block; padding: 4px 24px; border: none; }
  .col-title a { font-size: 17px; }
  .col-actions { text-align: left; margin-top: 12px; }
  .action-link:first-child { margin-left: 0; }
  .page-head { align-items: flex-start; }
}

@media (max-width: 640px) {
  .search-panel {
    padding: 22px 16px;
    margin-bottom: 26px;
  }
  .search-label {
    font-size: 10px;
    margin-bottom: 11px;
  }
  .search-field {
    flex-wrap: wrap;
    border-radius: 7px;
  }
  .search-icon { padding: 0 4px 0 14px; }
  .search-icon svg { width: 19px; height: 19px; }
  .search-field input {
    padding: 18px 12px;
    font-size: 14px;
  }
  .search-field button {
    width: 100%;
    padding: 14px;
    border-radius: 0;
    font-size: 14px;
  }
  .category-select {
    width: 100%;
    border-left: none;
    border-top: 1px solid #E0E3DB;
    padding: 14px 32px 14px 16px;
    font-size: 14px;
    max-width: none;
  }
}

/* ---------- Quill editor ---------- */
#toolbar-container {
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #FCFBF9;
  font-family: 'Inter', sans-serif;
}
.ql-toolbar.ql-snow {
  border: none;
  padding: 8px 12px;
}
.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill { fill: var(--muted); }
.ql-snow .ql-picker-label { color: var(--muted); }
.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill { fill: var(--accent); }
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active { color: var(--accent); }

#editor-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 4px 4px;
  min-height: 360px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
.ql-editor {
  padding: 20px 24px;
  min-height: 360px;
}
.ql-editor h2 {
  font-family: 'Lora', serif;
  font-size: 24px;
  margin: 24px 0 12px;
}
.ql-editor h3 {
  font-family: 'Lora', serif;
  font-size: 19px;
  margin: 20px 0 10px;
}
.ql-editor blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 16px 0;
  font-style: italic;
  color: var(--muted);
}
.ql-editor p { margin-bottom: 14px; }

/* ============================================================
   Resources page
   ============================================================ */
.resources-hero {
  padding: 120px 0 60px;
  text-align: center;
}
.resources-hero h1 {
  font-size: 42px;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.resources-intro {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.7;
}

.resources-section {
  padding: 40px 0 100px;
}

.resource-category {
  margin-bottom: 64px;
}
.resource-category:last-child {
  margin-bottom: 0;
}

.resource-category-title {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Resource card ---------- */
.resource-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 36px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.resource-card:hover {
  border-color: #D6DCCB;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.resource-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.resource-tag {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.resource-arrow {
  font-size: 20px;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.resource-card:hover .resource-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.resource-title {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.35;
}

.resource-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}

/* ---------- Resources responsive ---------- */
@media (max-width: 640px) {
  .resources-hero { padding: 80px 0 40px; }
  .resources-hero h1 { font-size: 30px; }
  .resources-intro { font-size: 16px; }
  .resources-section { padding: 20px 0 60px; }
  .resource-category-title { font-size: 19px; }
  .resource-card { padding: 24px 24px; }
  .resource-title { font-size: 19px; }
}

