/* Gaining with Grace — recipe site styles (built on the shared tokens) */
@import url('./colors_and_type.css');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--fg1); line-height: 1.7; background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.read { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.link { color: var(--terracotta-d); font-weight: 800; }

/* NAV */
header { position: sticky; top: 0; z-index: 50; background: rgba(255,252,246,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.gwg-mark { height: 38px; }
.gwg-wordmark { font-size: 1.4rem; }
.navlinks { display: flex; gap: 26px; align-items: center; }
.navlinks a { color: var(--stone); font-weight: 600; font-size: .95rem; transition: color .2s; cursor: pointer; white-space: nowrap; }
.navlinks a:hover, .navlinks a.active { color: var(--forest); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--terracotta); color: var(--paper); font-weight: 700; padding: 12px 22px; border-radius: 999px; transition: transform .16s, box-shadow .22s; font-size: .92rem; border: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(200,116,78,.38); }
.btn.ghost { background: transparent; color: var(--forest); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--terracotta); color: var(--terracotta-d); transform: translateY(-2px); box-shadow: none; }
.menu-btn { display: none; }

/* BLOG HEADER */
.blog-head { background: var(--cream); padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.blog-head .eyebrow { color: var(--terracotta-d); font-weight: 800; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 16px; }
.blog-head h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.3rem,4.5vw,3.4rem); color: var(--forest); letter-spacing: -.012em; line-height: 1.08; max-width: 720px; margin-bottom: 16px; }
.blog-head h1 em { font-style: italic; color: var(--terracotta); font-weight: 500; }
.blog-head p { color: var(--stone); font-size: 1.18rem; max-width: 600px; line-height: 1.6; }

/* FILTER */
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 28px 0 0; }
.chip { font-family: var(--font-sans); font-size: .8rem; font-weight: 700; color: var(--stone); background: var(--paper); border: 1px solid var(--line); padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: all .16s; }
.chip:hover { border-color: var(--terracotta); color: var(--terracotta-d); }
.chip.active { background: var(--forest); border-color: var(--forest); color: var(--paper); }

/* FEED */
.feed { padding: 40px 0 104px; }
.empty { color: var(--stone); font-size: 1.05rem; grid-column: 1 / -1; padding: 40px 0; }
.empty code { font-family: ui-monospace, Menlo, monospace; background: var(--cream); padding: 2px 7px; border-radius: 6px; color: var(--terracotta-d); }

/* IMAGE PLACEHOLDER */
.ph { background-color: #F1E7D6; background-image: repeating-linear-gradient(135deg, #EADFCB 0 14px, #F1E7D6 14px 28px); display: flex; align-items: center; justify-content: center; }
.ph span { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .72rem; color: #A89878; background: rgba(255,252,246,.7); padding: 4px 10px; border-radius: 6px; }

/* TAGS */
.tag { display: inline-block; font-family: var(--font-sans); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--terracotta-d); background: var(--terracotta-12); padding: 5px 12px; border-radius: 999px; }

/* FEATURE */
.feature { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 40px; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature .ph { min-height: 320px; }
.feature .fbody { padding: 44px 42px; display: flex; flex-direction: column; gap: 16px; }
.feature h2 { font-family: var(--font-serif); font-weight: 600; font-size: 2rem; color: var(--forest); letter-spacing: -.01em; line-height: 1.14; }
.feature p { color: var(--stone); font-size: 1.05rem; line-height: 1.6; }
.feature .meta { font-size: .85rem; color: var(--stone); font-weight: 600; margin-top: auto; }
.feature .arrow { color: var(--terracotta-d); font-weight: 800; font-size: .95rem; display: inline-flex; gap: 6px; transition: gap .2s; }
.feature:hover .arrow { gap: 10px; }

/* GRID */
.grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; }
.post { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s, box-shadow .2s; cursor: pointer; display: flex; flex-direction: column; }
.post:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post .ph { height: 180px; }
.post .pbody { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.32rem; color: var(--forest); letter-spacing: -.01em; line-height: 1.2; }
.post p { color: var(--stone); font-size: .95rem; line-height: 1.55; }
.post .glance { margin-top: auto; }

/* RECIPE GLANCE STRIP */
.glance { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.glance .g { flex: 1; padding: 9px 6px; text-align: center; border-right: 1px solid var(--line); }
.glance .g:last-child { border-right: none; }
.glance .gk { font-family: var(--font-sans); font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
.glance .gv { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; color: var(--forest); margin-top: 2px; }
.glance .gv.t { color: var(--terracotta-d); }

/* ARTICLE */
.article { padding: 56px 0 96px; }
.article .back { font-family: var(--font-sans); font-weight: 700; font-size: .9rem; color: var(--terracotta-d); display: inline-flex; gap: 7px; align-items: center; cursor: pointer; margin-bottom: 28px; white-space: nowrap; }
.article .ahead { margin-bottom: 30px; }
.article .ahead .tag { margin-bottom: 18px; }
.article h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.2rem,4vw,3rem); color: var(--forest); letter-spacing: -.012em; line-height: 1.1; margin-bottom: 18px; }
.article .byline { display: flex; align-items: center; gap: 12px; color: var(--stone); font-size: .9rem; font-weight: 600; }
.article .byline .who { color: var(--bark); }
.article .byline .avatar { width: 42px; height: 42px; border-radius: 999px; background: var(--olive-16); display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-weight: 600; color: var(--olive-d); flex: none; }
.article .hero-ph { height: 380px; border-radius: 18px; margin: 32px 0 8px; }
.article .hero-cap { font-size: .82rem; color: var(--stone); text-align: center; margin-bottom: 36px; font-style: italic; }
.prose { font-size: 1.12rem; color: var(--bark); line-height: 1.8; }
.prose > p { margin-bottom: 24px; }
.prose .lead { font-size: 1.28rem; color: var(--forest); line-height: 1.55; margin-bottom: 28px; }
.prose h2 { font-family: var(--font-serif); font-weight: 600; font-size: 1.7rem; color: var(--forest); letter-spacing: -.01em; margin: 14px 0 14px; }
.prose strong { color: var(--bark); font-weight: 700; }
.prose > ul { margin: 0 0 24px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.prose > ul > li { padding-left: 26px; position: relative; }
.prose > ul > li::before { content: "\2192"; position: absolute; left: 0; color: var(--terracotta); font-weight: 800; }
.prose blockquote { margin: 8px 0 30px; padding: 4px 0 4px 26px; border-left: 3px solid var(--terracotta); }
.prose blockquote p { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 1.5rem; color: var(--forest); line-height: 1.4; margin: 0; }

/* INLINE RECIPE CARD */
.recipe-inline { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 32px; margin: 12px 0 34px; }
.recipe-inline .rtag { margin-bottom: 14px; }
.recipe-inline h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; color: var(--forest); margin-bottom: 16px; }
.recipe-inline .glance { background: var(--paper); margin-bottom: 22px; }
.recipe-inline .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.recipe-inline h4 { font-family: var(--font-sans); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--stone); margin-bottom: 12px; }
.recipe-inline ul { font-size: 1rem; line-height: 1.7; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.recipe-inline ul li { padding-left: 18px; position: relative; }
.recipe-inline ul li::before { content: "\2022"; position: absolute; left: 2px; color: var(--terracotta); font-weight: 800; }
.recipe-inline ol { font-size: 1rem; line-height: 1.7; padding-left: 20px; color: var(--bark); display: flex; flex-direction: column; gap: 10px; }
.recipe-inline .note { font-size: .9rem; color: var(--stone); margin-top: 20px; font-style: italic; }

hr.rule { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* FOOTER */
footer { background: var(--forest); color: var(--fg-on-dark); padding: 56px 0 30px; }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 34px; padding-bottom: 34px; border-bottom: 1px solid rgba(255,252,246,.1); }
.foot-brand { max-width: 330px; }
.foot-lockup { margin-bottom: 16px; }
.foot-brand p { font-size: .95rem; line-height: 1.6; }
.foot-col h5 { color: var(--paper); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; font-weight: 800; }
.foot-col a { display: block; color: var(--fg-on-dark); font-size: .95rem; margin-bottom: 10px; transition: color .2s; cursor: pointer; }
.foot-col a:hover { color: var(--terracotta); }
.copy { padding-top: 24px; font-size: .85rem; color: var(--fg-on-dark); }

/* MODAL (add a recipe via JSON) */
.modal-overlay { position: fixed; inset: 0; background: rgba(46,42,36,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--paper); border-radius: 22px; padding: 34px 34px 30px; max-width: 560px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.6rem; color: var(--forest); margin-bottom: 6px; letter-spacing: -.01em; }
.modal .sub { color: var(--stone); font-size: .96rem; margin-bottom: 18px; }
.modal .sub code { font-family: ui-monospace, Menlo, monospace; background: var(--cream); padding: 2px 7px; border-radius: 6px; color: var(--terracotta-d); font-size: .85em; }
.modal-close { float: right; background: none; border: none; font-size: 1.5rem; color: var(--stone); cursor: pointer; line-height: 1; }
#json-input { width: 100%; min-height: 240px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .85rem; line-height: 1.55; color: var(--bark); background: #FFFDF8; resize: vertical; tab-size: 2; }
#json-input:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(200,116,78,.16); }
#json-error { color: #B23B2E; font-size: .85rem; font-weight: 600; min-height: 1.2em; margin: 10px 0 0; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }

/* modal segmented mode toggle */
.modal-modes { display: inline-flex; gap: 4px; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 6px 0 16px; }
.modal-modes .seg { border: none; background: transparent; font-family: var(--font-sans); font-weight: 700; font-size: .85rem; color: var(--stone); padding: 7px 18px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.modal-modes .seg:hover { color: var(--terracotta-d); }
.modal-modes .seg.active { background: var(--paper); color: var(--forest); box-shadow: 0 1px 3px rgba(74,56,33,.12); }

/* JOURNAL list */
.entries { display: flex; flex-direction: column; }
.entry { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 30px 0; border-top: 1px solid var(--line); cursor: pointer; align-items: start; transition: background .15s; }
.entry:first-child { border-top: none; }
.entry:hover .entry-main h3 { color: var(--terracotta-d); }
.entry-date { font-family: var(--font-sans); font-size: .82rem; font-weight: 700; color: var(--stone); letter-spacing: .02em; padding-top: 4px; }
.entry-main { display: flex; flex-direction: column; gap: 10px; }
.entry-main .tag { align-self: flex-start; }
.entry-main h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.55rem; color: var(--forest); letter-spacing: -.01em; line-height: 1.18; transition: color .15s; }
.entry-main p { color: var(--stone); font-size: 1.02rem; line-height: 1.6; }
.entry-main .arrow { color: var(--terracotta-d); font-family: var(--font-sans); font-weight: 800; font-size: .9rem; display: inline-flex; gap: 6px; transition: gap .2s; }
.entry:hover .entry-main .arrow { gap: 10px; }

/* CALORIE CHIPS — food mentions in prose, ingredients, notes */
.cal { white-space: nowrap; border-bottom: 1px dotted var(--olive-d); cursor: help; }
.cal-k { display: inline-block; margin-left: 5px; font-family: var(--font-sans); font-size: .62em; font-weight: 800; letter-spacing: .02em; color: var(--olive-d); background: var(--olive-16); padding: 1px 7px; border-radius: 999px; vertical-align: baseline; }

/* EASIER-TO-SWALLOW PANEL (dysphagia-friendly) */
.soft-flag { display: inline-block; margin-top: 14px; font-family: var(--font-sans); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--olive-d); background: var(--olive-16); padding: 6px 13px; border-radius: 999px; }
.soft-option { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--olive); border-radius: 14px; padding: 24px 26px 22px; margin: 10px 0 30px; }
.soft-head { display: flex; align-items: center; gap: 11px; font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; color: var(--forest); margin-bottom: 12px; }
.soft-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--olive-16); position: relative; }
.soft-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--olive); }
.soft-pill { font-family: var(--font-sans); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--olive-d); background: var(--olive-16); padding: 4px 10px; border-radius: 999px; margin-left: auto; }
.soft-option p { font-size: 1rem; color: var(--bark); line-height: 1.6; margin-bottom: 12px; }
.soft-option ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 0; }
.soft-option ul li { padding-left: 22px; position: relative; font-size: .98rem; color: var(--bark); }
.soft-option ul li::before { content: "\2192"; position: absolute; left: 0; color: var(--olive-d); font-weight: 800; }
.soft-note { font-size: .82rem !important; color: var(--stone) !important; font-style: italic; margin-bottom: 0 !important; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature .ph { min-height: 220px; }
}
@media (max-width: 680px) {
  .navlinks { display: none; }
  .grid { grid-template-columns: 1fr; }
  .recipe-inline .cols { grid-template-columns: 1fr; }
  .article .hero-ph { height: 240px; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .entry-date { padding-top: 0; }
}
