/* Blog pages. Flat reading column; only links (post, ingredient, product,
   button) are raised, matching the app's "elevated = pressable" rule. */
:root {
  --bg: #F4EAD7; --card: #FBF3EA; --primary: #5B6B45; --ink: #3B2C28;
  --muted: #6A554E; --line: #E3D7C3; color-scheme: light;
  --raised: 4px 5px 12px rgba(176,161,142,.45), -4px -4px 9px rgba(255,255,255,.9);
  --raised-hover: 6px 8px 18px rgba(176,161,142,.55), -5px -5px 11px rgba(255,255,255,.95);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.7; }
a { color: var(--primary); }

.page { max-width: 760px; margin: 0 auto; padding: 8px 16px 56px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 8px 0 20px; }
.crumbs a { text-decoration: none; }
h1 { font-size: 38px; line-height: 1.15; font-weight: 900; letter-spacing: -.01em; margin: 0 0 12px; }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.lede { font-size: 20px; color: var(--muted); margin: 0 0 8px; }

article { font-size: 18px; }
article h2 { font-size: 26px; line-height: 1.25; font-weight: 900; margin: 44px 0 12px; }
article h3 { font-size: 20px; font-weight: 800; margin: 28px 0 8px; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 16px; padding-left: 22px; }
article li { margin: 0 0 8px; }
article .small { font-size: 15px; color: var(--muted); }
article table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 4px 0 20px; }
article th, article td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
article th { font-weight: 800; }
article figure { margin: 8px 0 24px; }
article figure img { display: block; width: 100%; height: auto; border-radius: 16px; }
article figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
article hr { border: none; border-top: 1px solid var(--line); margin: 40px 0 24px; }

/* Ingredient cards: link to /ingredients/<slug>. */
.ings { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 8px 0 24px; }
a.ing { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: linear-gradient(145deg, #fdf8f0, var(--bg)); box-shadow: var(--raised); transition: box-shadow .12s, transform .12s; }
a.ing:hover, a.post:hover, a.btn:hover { box-shadow: var(--raised-hover); transform: translateY(-1px); }
.ing-name { font-weight: 900; font-size: 16px; line-height: 1.3; }
.ing-name::after { content: ' \203A'; color: var(--primary); }
.ing-note { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 9px; }
.chip.b { color: #2E7D32; background: rgba(46,125,50,.10); }
.chip.r0 { color: #6B7280; background: rgba(107,114,128,.10); }
.chip.r1 { color: #B45309; background: rgba(245,158,11,.12); }
.chip.r2 { color: #C62828; background: rgba(198,40,40,.10); }

/* Product cards: same markup and styles as the /products hub
   (functions-vision-only/product-hub.js); change both together. */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; margin: 8px 0 28px; }
.product { position: relative; background: linear-gradient(145deg, #fdf8f0, var(--bg)); border-radius: 16px;
  box-shadow: var(--raised); transition: box-shadow .12s, transform .12s; }
.product:hover { box-shadow: var(--raised-hover); transform: translateY(-1px); }
.product .pmain { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.product .shot { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 12px 64px 0 12px; }
.product .shot img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product .shot svg { width: 34px; height: 34px; color: var(--primary); opacity: .45; }
.product .body { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px 14px; }
.product .pbrand { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.product .pname { font-weight: 800; font-size: 15.5px; line-height: 1.35; }
.pside { position: absolute; top: 12px; right: 12px; width: 40px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pscore { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-size: 15px; font-weight: 900;
  background: #EFEAE2; box-shadow: 3px 4px 8px rgba(176,161,142,.69), -3px -3px 6px rgba(255,255,255,.95); }
.pcounts { display: flex; flex-direction: column; align-items: center; width: 40px; padding: 8px 0; border-radius: 13px; text-decoration: none;
  background: linear-gradient(135deg, #FAF6ED, #F4EAD7); box-shadow: 3px 4px 8px rgba(176,161,142,.69), -3px -3px 6px rgba(255,255,255,.95); }
.pcounts:active { box-shadow: inset 3px 3px 6px rgba(137,122,100,.4), inset -3px -3px 6px rgba(255,255,255,.85); }
.pcounts svg { width: 18px; height: 18px; color: var(--ink); margin-bottom: 4px; }
.pcounts b { font-size: 13px; font-weight: 800; line-height: 1.2; }
.s-good { color: #617C37; } .s-ok { color: #C98A3C; } .s-bad { color: #C6655A; }
.c-good { color: #617C37; } .c-neutral { color: #BCB4AA; } .c-bad { color: #C6655A; }

/* Post list (blog index + "read next"). */
.posts { display: grid; gap: 16px; margin: 8px 0 24px; }
a.post { display: block; padding: 20px 22px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: linear-gradient(145deg, #fdf8f0, var(--bg)); box-shadow: var(--raised); transition: box-shadow .12s, transform .12s; }
a.post.has-thumb { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.post .thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; }
.post .pt { display: block; font-size: 21px; font-weight: 900; line-height: 1.3; margin-bottom: 6px; }
.post .pd { display: block; font-size: 16px; color: var(--muted); }
.post .pm { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; font-weight: 700; }
.posts.compact a.post { padding: 14px 18px; }
.posts.compact .pt { font-size: 17px; margin: 0; }

/* App download: the buttons are the only raised part. */
.app { margin: 44px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.app h2 { margin-top: 0; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
a.btn { display: inline-block; padding: 12px 22px; border-radius: 16px; background: var(--primary); color: #fff; font-weight: 800;
  font-size: 16px; text-decoration: none; box-shadow: 4px 6px 12px rgba(91,107,69,.35); transition: box-shadow .12s, transform .12s; }

.appfooter { max-width: 1120px; margin: 18px auto 0; padding: 8px 16px 18px; text-align: center; }
.appfooter hr { border: none; border-top: 1px solid #E0E0E0; margin: 8px 0; }
.flinks a { color: #616161; text-decoration: none; font-weight: 700; font-size: 15px; margin: 0 4px; padding: 6px 8px; display: inline-block; }
.flinks a:hover { color: var(--primary); }
.fcopy { color: #757575; font-size: 13px; margin-top: 2px; }

@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .lede { font-size: 18px; }
  article { font-size: 17px; }
  article h2 { font-size: 23px; margin-top: 36px; }
  .ings { grid-template-columns: 1fr; }
  a.post.has-thumb { grid-template-columns: 84px 1fr; gap: 14px; padding: 16px; }
  .post .thumb { width: 84px; height: 84px; }
  .post .pd { display: none; }
  article table { font-size: 15px; }
  article th, article td { padding: 8px 6px; }
}
