/* ── HarvestWizard Ghost Theme ── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:         #faf7f0;
  --bg-elev:    #ffffff;
  --bg-tint:    #ede6d3;
  --line:       #e6dfc9;
  --ink:        #2a2a22;
  --ink-2:      #4a4a3e;
  --ink-3:      #7a7568;
  --ink-4:      #a8a290;
  --moss-50:    #eef2e7;
  --moss-100:   #d8e0c5;
  --moss-500:   #4f6c3b;
  --moss-600:   #3d5a2c;
  --moss-700:   #2f4623;
  --terra:      #b85c3a;
  --terra-soft: #e8b89c;
  --ochre:      #c79a3f;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(60,50,20,.04), 0 4px 12px rgba(60,50,20,.06);
  --shadow-lg:  0 2px 4px rgba(60,50,20,.04), 0 12px 32px rgba(60,50,20,.10);
  --display:    "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:       "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --max-w:      760px;
  --max-w-wide: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--moss-600); text-decoration: none; }
a:hover { color: var(--moss-500); }

/* ── Nav ── */
.hw-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,247,240,.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.hw-nav-inner {
  width: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hw-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--moss-700);
  text-decoration: none;
}
.hw-nav-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--moss-500), var(--moss-700));
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(40,80,20,.25);
}
.hw-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hw-nav-links a {
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 5px 11px;
  border-radius: 7px;
  transition: color .15s, background .15s;
}
.hw-nav-links a:hover { color: var(--ink); background: var(--moss-50); }
.hw-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--moss-500);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 8px;
  transition: background .15s;
}
.hw-nav-cta:hover { background: var(--moss-600) !important; color: #fff !important; }

/* ── Hero (homepage) ── */
.hw-hero {
  text-align: center;
  padding: 72px 24px 56px;
  background: linear-gradient(180deg, var(--moss-50) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hw-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in oklch, var(--moss-500) 12%, var(--bg-elev));
  color: var(--moss-600);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hw-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 16px;
}
.hw-hero p {
  font-size: 17px;
  color: var(--ink-3);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Post grid ── */
.hw-feed {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 56px 24px;
}
.hw-feed-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 28px;
}
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Featured post — spans full width */
.hw-grid .hw-card:first-child {
  grid-column: 1 / -1;
}
.hw-grid .hw-card:first-child .hw-card-img {
  aspect-ratio: 16/7;
}
.hw-grid .hw-card:first-child .hw-card-title {
  font-size: clamp(22px, 3vw, 32px);
}

/* ── Card ── */
.hw-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.hw-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.hw-card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-tint);
}
.hw-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.hw-card:hover .hw-card-img img { transform: scale(1.03); }
.hw-card-no-img {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--moss-50), var(--bg-tint));
  display: grid;
  place-items: center;
  font-size: 40px;
}
.hw-card-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.hw-card-tag {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--moss-500);
  margin-bottom: 8px;
}
.hw-card-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 10px;
}
.hw-card-title a { color: inherit; }
.hw-card-title a:hover { color: var(--moss-600); }
.hw-card-excerpt {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hw-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.hw-card-meta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--moss-100);
  flex-shrink: 0;
}
.hw-card-meta-author {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.hw-card-meta-date {
  font-size: 12px;
  color: var(--ink-4);
  margin-left: auto;
}

/* ── Pagination ── */
.hw-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 56px;
}
.hw-pagination a,
.hw-pagination span {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-2);
  transition: border-color .15s, color .15s, background .15s;
}
.hw-pagination a:hover { border-color: var(--moss-500); color: var(--moss-500); background: var(--moss-50); }
.hw-pagination-count { border: 0 !important; background: none !important; color: var(--ink-4) !important; }

/* ── Post page ── */
.hw-post-header {
  max-width: var(--max-w);
  margin: 48px auto 0;
  padding: 0 24px;
  text-align: center;
}
.hw-post-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--moss-500);
  background: var(--moss-50);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.hw-post-title {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 20px;
}
.hw-post-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}
.hw-post-byline-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--moss-100);
}
.hw-post-byline-info { text-align: left; }
.hw-post-byline-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.hw-post-byline-date {
  font-size: 12px;
  color: var(--ink-4);
}

/* ── Feature image ── */
.hw-post-feature-img {
  max-width: 920px;
  margin: 0 auto 48px;
  padding: 0 24px;
}
.hw-post-feature-img img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ── Post content ── */
.hw-post-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.hw-post-content p { margin-bottom: 1.5em; color: var(--ink-2); line-height: 1.8; }
.hw-post-content h2 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 2.5em 0 .8em;
  padding-top: .5em;
  border-top: 2px solid var(--moss-100);
}
.hw-post-content h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin: 2em 0 .7em;
}
.hw-post-content h4 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 1.5em 0 .5em; }
.hw-post-content ul, .hw-post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
  color: var(--ink-2);
}
.hw-post-content li { margin-bottom: .5em; line-height: 1.7; }
.hw-post-content blockquote {
  border-left: 3px solid var(--moss-500);
  padding: 16px 20px;
  margin: 2em 0;
  background: var(--moss-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--display);
  font-size: 18px;
  font-style: italic;
  color: var(--ink-2);
}
.hw-post-content blockquote p { margin: 0; }
.hw-post-content pre {
  background: var(--ink);
  color: #ece8d9;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5em;
  font-size: 13.5px;
  line-height: 1.6;
}
.hw-post-content code {
  font-size: .9em;
  background: var(--bg-tint);
  color: var(--terra);
  padding: 2px 6px;
  border-radius: 4px;
}
.hw-post-content pre code { background: none; color: inherit; padding: 0; }
.hw-post-content a { color: var(--moss-600); text-decoration: underline; text-underline-offset: 3px; }
.hw-post-content a:hover { color: var(--moss-500); }
.hw-post-content img {
  border-radius: var(--radius);
  margin: 2em 0;
  box-shadow: var(--shadow);
}
.hw-post-content hr {
  border: none;
  border-top: 2px solid var(--line);
  margin: 2.5em 0;
}
.hw-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 14px;
}
.hw-post-content th {
  background: var(--moss-50);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--moss-100);
}
.hw-post-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

/* ── Tags on post ── */
.hw-post-tags {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hw-post-tags a {
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-tint);
  color: var(--ink-3);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  transition: border-color .15s, color .15s;
}
.hw-post-tags a:hover { border-color: var(--moss-500); color: var(--moss-500); }

/* ── Related posts ── */
.hw-related {
  background: var(--bg-tint);
  border-top: 1px solid var(--line);
  padding: 48px 24px;
}
.hw-related-inner { max-width: var(--max-w-wide); margin: 0 auto; }
.hw-related h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.hw-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ── Tag page ── */
.hw-tag-header {
  background: linear-gradient(135deg, var(--moss-50), var(--bg-tint));
  border-bottom: 1px solid var(--line);
  padding: 56px 24px 40px;
  text-align: center;
}
.hw-tag-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.hw-tag-header h1 {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.hw-tag-header p { font-size: 15px; color: var(--ink-3); max-width: 480px; margin: 0 auto; }

/* ── Footer ── */
.hw-footer {
  background: var(--ink);
  color: #ece8d9;
  padding: 48px 24px 32px;
}
.hw-footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 24px;
}
.hw-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hw-footer-brand-name { font-family: var(--display); font-size: 18px; font-weight: 600; }
.hw-footer-brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--moss-500), var(--moss-700));
  display: grid; place-items: center; font-size: 16px;
}
.hw-footer-tagline { font-size: 13px; color: rgba(236,232,217,.55); }
.hw-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.hw-footer-links a { font-size: 13.5px; color: rgba(236,232,217,.7); transition: color .15s; }
.hw-footer-links a:hover { color: #fff; }
.hw-footer-bottom {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.hw-footer-copy { font-size: 12.5px; color: rgba(236,232,217,.4); }
.hw-footer-copy a { color: rgba(236,232,217,.55); }
.hw-footer-copy a:hover { color: #fff; }

/* ── Ghost subscribe form ── */
.hw-subscribe {
  background: linear-gradient(135deg, var(--moss-500), var(--moss-700));
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin: 48px auto;
  max-width: var(--max-w);
}
.hw-subscribe h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.hw-subscribe p { font-size: 14px; color: rgba(255,255,255,.8); margin-bottom: 20px; }
.hw-subscribe form { display: flex; gap: 8px; max-width: 400px; margin: 0 auto; }
.hw-subscribe input[type="email"] {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
}
.hw-subscribe input[type="email"]::placeholder { color: rgba(255,255,255,.55); }
.hw-subscribe button {
  height: 40px;
  padding: 0 18px;
  background: #fff;
  color: var(--moss-700);
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.hw-subscribe button:hover { background: var(--moss-50); }

/* ── Error page ── */
.hw-error {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.hw-error-code { font-family: var(--display); font-size: 80px; color: var(--moss-100); font-weight: 700; line-height: 1; margin-bottom: 8px; }
.hw-error h1 { font-family: var(--display); font-size: 26px; color: var(--ink); margin-bottom: 12px; }
.hw-error p { color: var(--ink-3); margin-bottom: 24px; }
.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--moss-500);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 8px;
  transition: background .15s;
}
.hw-btn:hover { background: var(--moss-600); color: #fff; }

/* ── Koenig card widths (required by Ghost) ── */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 2em calc(50% - 42.5vw);
}
.kg-width-full {
  position: relative;
  width: 100vw;
  margin: 2em calc(50% - 50vw);
}
.kg-image-card img,
.kg-gallery-card img { width: 100%; border-radius: var(--radius); }
.kg-gallery-container { display: flex; flex-direction: column; }
.kg-gallery-row { display: flex; gap: 8px; margin-bottom: 8px; }
.kg-gallery-image { flex: 1; overflow: hidden; border-radius: var(--radius); }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.kg-bookmark-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2em 0;
}
.kg-bookmark-container { display: flex; text-decoration: none; color: inherit; }
.kg-bookmark-content { flex: 1; padding: 16px 20px; }
.kg-bookmark-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.kg-bookmark-description { font-size: 13px; color: var(--ink-3); }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-4); }
.kg-bookmark-thumbnail { width: 160px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.kg-callout-card {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: var(--moss-50);
  border-left: 3px solid var(--moss-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2em 0;
}
.kg-callout-emoji { font-size: 22px; flex-shrink: 0; }
.kg-toggle-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 2em 0;
}
.kg-toggle-heading-text { font-weight: 600; color: var(--ink); }
.kg-video-card { margin: 2em 0; }
.kg-video-card video { width: 100%; border-radius: var(--radius); }

/* ── Responsive ── */
@media (max-width: 680px) {
  .hw-nav-links { display: none; }
  .hw-hero { padding: 48px 20px 36px; }
  .hw-grid { grid-template-columns: 1fr; }
  .hw-grid .hw-card:first-child { grid-column: 1; }
  .hw-subscribe form { flex-direction: column; }
  .hw-subscribe input[type="email"], .hw-subscribe button { width: 100%; }
  .hw-footer-inner { flex-direction: column; gap: 20px; }
}
