/* HealthyLifeSync — editorial redesign (S162 night build).
   Mobile-first; Pinterest traffic ~85% mobile. Fonts: Fraunces (display) + Inter (text). */

:root {
  --bg: #f8f5ef;
  --surface: #fffdf9;
  --ink: #232b26;
  --ink-soft: #64716a;
  --line: #e7e1d5;
  --brand: #2e7d5b;
  --brand-deep: #1d4d38;
  --brand-tint: #e2efe8;
  --accent: #c96f4a;
  --maxw: 1140px;
  --textw: 720px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 43, 38, 0.05), 0 4px 16px rgba(35, 43, 38, 0.06);
  --shadow-hover: 0 2px 4px rgba(35, 43, 38, 0.06), 0 12px 28px rgba(35, 43, 38, 0.12);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  /* category colours */
  --cat-recipes: #b85c38;   --cat-recipes-tint: #f7e8e0;
  --cat-health: #2e7d5b;    --cat-health-tint: #e2efe8;
  --cat-lifestyle: #7c5fa5; --cat-lifestyle-tint: #ece5f4;
  --cat-diy: #a8802f;       --cat-diy-tint: #f3ead6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-deep); }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 249, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
  padding: 0.7rem 1.1rem;
  max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 1.45rem; font-weight: 700; color: var(--brand-deep);
  text-decoration: none; letter-spacing: -0.02em;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand:hover { color: var(--brand); }
.site-nav {
  display: flex; align-items: center; gap: 0.15rem;
  margin-left: auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; max-width: 100%;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 0.35rem 0.7rem; border-radius: 999px; white-space: nowrap;
  text-decoration: none; color: var(--ink-soft);
  font-size: 0.92rem; font-weight: 500;
}
.site-nav a:hover { color: var(--brand-deep); background: var(--brand-tint); }

/* ---------- home: intro + chips ---------- */
.home-intro { margin: 1.9rem 0 0.4rem; }
.home-intro h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.15; margin: 0 0 0.35rem;
}
.home-intro p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; max-width: 46rem; }

.cat-chips {
  display: flex; gap: 0.5rem; flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 1.3rem 0 0.2rem; padding-bottom: 0.25rem;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips a {
  flex: none; padding: 0.42rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); text-decoration: none;
  font-size: 0.9rem; font-weight: 600;
}
.cat-chips a:hover { border-color: var(--brand); color: var(--brand-deep); }
.cat-chips a.active { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }

/* ---------- category chip (shared) ---------- */
.chip {
  display: inline-block; padding: 0.18rem 0.65rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; text-decoration: none;
  background: var(--brand-tint); color: var(--brand-deep);
}
.chip.cat-recipes { background: var(--cat-recipes-tint); color: var(--cat-recipes); }
.chip.cat-health { background: var(--cat-health-tint); color: var(--cat-health); }
.chip.cat-lifestyle { background: var(--cat-lifestyle-tint); color: var(--cat-lifestyle); }
.chip.cat-diy { background: var(--cat-diy-tint); color: var(--cat-diy); }
a.chip:hover { filter: brightness(0.96); }

/* ---------- featured post ---------- */
.featured {
  display: grid; gap: 0; margin: 1.4rem 0 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.featured a.card-link { display: grid; gap: 0; color: inherit; text-decoration: none; grid-template-columns: 1fr; }
.featured .media { aspect-ratio: 16/10; overflow: hidden; }
.featured .media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.featured a:hover .media img { transform: scale(1.03); }
.featured .body { padding: 1.3rem 1.3rem 1.5rem; display: flex; flex-direction: column; justify-content: center; gap: 0.55rem; align-items: flex-start; }
.featured .kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.featured h2 { margin: 0; font-size: clamp(1.45rem, 3.4vw, 2.1rem); line-height: 1.2; }
.featured p { margin: 0; color: var(--ink-soft); }
.featured .meta { font-size: 0.85rem; color: var(--ink-soft); }
.featured a:hover h2 { color: var(--brand-deep); }

/* ---------- card grid ---------- */
.post-list {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-card a.card-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; height: 100%; }
.card-media { aspect-ratio: 3/2; overflow: hidden; flex: none; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.post-card a:hover .card-media img { transform: scale(1.045); }
/* no-photo fallback panel */
.card-media.noimg {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-tint), #f2ede3);
  position: relative;
}
.card-media.noimg.cat-recipes { background: linear-gradient(135deg, var(--cat-recipes-tint), #f6efe8); }
.card-media.noimg.cat-health { background: linear-gradient(135deg, var(--cat-health-tint), #edf3ea); }
.card-media.noimg.cat-lifestyle { background: linear-gradient(135deg, var(--cat-lifestyle-tint), #f1ecf6); }
.card-media.noimg.cat-diy { background: linear-gradient(135deg, var(--cat-diy-tint), #f5efe2); }
.card-media.noimg .initial {
  font-family: var(--serif); font-weight: 700;
  font-size: 4.2rem; line-height: 1; color: rgba(35, 43, 38, 0.22);
}
.card-media.noimg svg.leafbg {
  position: absolute; right: -18px; bottom: -22px;
  width: 110px; height: 110px; opacity: 0.14;
}
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card-body h2 { margin: 0; font-size: 1.18rem; line-height: 1.32; }
.post-card a:hover .card-body h2 { color: var(--brand-deep); }
.card-body p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; }
.card-body .meta { font-size: 0.8rem; color: var(--ink-soft); margin-top: auto; padding-top: 0.4rem; }

/* ---------- pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 2.2rem 0 3rem;
}
.pagination a {
  display: inline-block; padding: 0.55rem 1.2rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--brand-deep); font-weight: 600; font-size: 0.92rem;
  text-decoration: none; box-shadow: var(--shadow);
}
.pagination a:hover { border-color: var(--brand); background: var(--brand-tint); }
.pagination .pageinfo { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- article ---------- */
.post-wrap { max-width: var(--textw); margin: 0 auto; }
article.post { padding: 2rem 0 1rem; }
article.post .topmeta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
article.post .topmeta .dot { color: var(--line); }
article.post .topmeta time, article.post .topmeta .rtime { color: var(--ink-soft); font-size: 0.88rem; }
article.post h1 {
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1.14; margin: 0 0 1.1rem; font-weight: 700;
}
article.post figure.hero { margin: 0 0 1.6rem; }
article.post figure.hero img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 16/9; object-fit: cover;
}
.post-body { font-size: 1.05rem; line-height: 1.78; }
.post-body > p:first-of-type { font-size: 1.14rem; color: #33403a; }
.post-body h2 {
  font-size: 1.5rem; margin: 2.2rem 0 0.7rem; line-height: 1.25;
  padding-bottom: 0.35rem; position: relative;
}
.post-body h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 52px; height: 3px; border-radius: 2px; background: var(--brand);
}
.post-body h3 { font-size: 1.2rem; margin: 1.7rem 0 0.5rem; }
.post-body img { border-radius: 10px; }
.post-body blockquote {
  margin: 1.4rem 0; padding: 1rem 1.25rem;
  background: var(--surface); border-left: 4px solid var(--brand);
  border-radius: 0 10px 10px 0; color: #46524c; font-style: italic;
}
.post-body blockquote p { margin: 0; }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li { margin: 0.3rem 0; }
.post-body figure { margin: 1.5rem 0; }
.post-body figcaption { font-size: 0.85rem; color: var(--ink-soft); text-align: center; margin-top: 0.4rem; }
.post-body a { text-decoration-color: rgba(46, 125, 91, 0.4); text-underline-offset: 2px; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.post-body th { background: var(--brand-tint); }

.pdf-dl { margin: 0 0 1.4rem; }
.btn-pdf {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem; border-radius: 999px;
  background: var(--brand-deep); color: #fff !important;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  box-shadow: var(--shadow);
}
.btn-pdf:hover { background: var(--brand); }
.btn-pdf svg { width: 18px; height: 18px; }

.photo-credit { font-size: 0.75rem; color: var(--ink-soft); margin-top: 1.4rem; }
.photo-credit a { color: var(--ink-soft); }

/* ---------- related posts ---------- */
.related { margin: 2.8rem 0 3rem; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.2rem; }
.related h2 { font-size: 1.45rem; margin: 0; }
.related-head a.more { font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.related .post-list { margin-top: 1rem; }

/* ---------- affiliate product box (renders only when affiliates.json has entries) ---------- */
.product-box {
  margin: 1.6rem 0; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow);
}
.product-box .pb-kicker {
  display: block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.25rem;
}
.product-box .pb-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.product-box .pb-title:hover { text-decoration: underline; }
.product-box .pb-note { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.product-box .pb-disclosure { display: block; margin-top: 0.5rem; font-size: 0.75rem; color: var(--ink-soft); }

/* ---------- static pages ---------- */
.page {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6rem 1.3rem 2rem; margin: 2rem auto 3rem;
  max-width: var(--textw);
}
.page h1 { font-size: 1.9rem; margin-top: 0.2rem; line-height: 1.2; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--brand-deep); color: #dfe9e2;
  margin-top: 3.5rem; padding: 2.5rem 0 1.5rem; font-size: 0.92rem;
}
.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1fr; }
.footer-brand .brand { color: #fff; font-size: 1.3rem; }
.footer-brand p { margin: 0.6rem 0 0; color: #b9cec1; max-width: 30rem; }
.site-footer h3 {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: #9dbcaa; margin: 0 0 0.6rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.3rem 0; }
.site-footer a { color: #dfe9e2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(223, 233, 226, 0.18);
  margin-top: 2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between;
  color: #a8c2b2; font-size: 0.82rem;
}
.footer-bottom p { margin: 0; }

/* ---------- newsletter CTA ---------- */
.nl-cta { background: var(--brand-tint); border-radius: 10px; margin: 2.4rem 0; padding: 2rem 1.4rem; }
.nl-cta-inner { max-width: var(--textw); margin: 0 auto; }
.nl-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.4rem; }
.nl-heading { font-family: 'Fraunces', serif; font-size: 1.35rem; font-weight: 700; color: var(--brand-deep); margin: 0 0 0.5rem; }
.nl-sub { color: var(--text); font-size: 0.95rem; margin: 0 0 1.2rem; }
.nl-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nl-input { flex: 1 1 200px; padding: 0.65rem 0.9rem; border: 1.5px solid #9dbcaa; border-radius: 6px; font-size: 0.95rem; background: #fff; color: var(--text); outline: none; }
.nl-input:focus { border-color: var(--brand); }
.nl-btn { background: var(--brand-deep); color: #fff; border: none; border-radius: 6px; padding: 0.65rem 1.3rem; font-size: 0.95rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.nl-btn:hover { background: var(--brand); }
.nl-btn:disabled { opacity: 0.6; cursor: wait; }
.nl-msg { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--accent); min-height: 1.2em; }
.nl-success { color: var(--brand-deep); font-weight: 600; margin: 0; }

/* ---------- responsive ---------- */
@media (min-width: 620px) {
  .post-list { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (min-width: 900px) {
  body { font-size: 17px; }
  .post-list { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .featured a.card-link { grid-template-columns: 7fr 5fr; align-items: stretch; }
  .featured .media { aspect-ratio: auto; min-height: 360px; max-height: 460px; position: relative; }
  .featured .media img { position: absolute; inset: 0; }
  .featured .body { padding: 2rem 2.2rem; }
  article.post { padding-top: 2.6rem; }
}
