/*
 * Field Notebook — Reading redesign (single post + single recipe)
 * Scoped entirely under .rx so the rest of the site is untouched.
 * Reuses the theme's brand tokens from main.css (--paper, --ink, --sage,
 * --rust, --grey, --bone, --serif, --mono). Loaded only on single post/recipe.
 */
.rx{
  --rx-header-h:64px;      /* set at runtime from .site-header height */
  --rx-sub-h:54px;
  --rx-radius:12px;
  --rx-line:rgba(28,28,28,.15);
  --rx-line-2:rgba(28,28,28,.08);
  --rx-sage-deep:var(--sage-deep,#485a4c);
  --rx-rust-deep:#8c4630;
  --rx-sage-tint:rgba(92,115,97,.13);
  --rx-rust-tint:rgba(168,90,60,.12);
  --rx-paper-2:#ECE7DB;
  --rx-title:clamp(2.4rem,1.7rem + 2.6vw,3.7rem);
  --rx-flow:clamp(2rem,1.4rem + 2vw,3.1rem);
  --rx-gutter:clamp(1.2rem,4vw,4rem);
}
.rx *{box-sizing:border-box}
.rx .rx-wrap{max-width:1180px;margin:0 auto;padding:0 var(--rx-gutter)}

/* Neutralise the theme card-layout classes that post_class() stamps on the
   <article>. In main.css, .recipe is a flex grid-card (display:flex; border;
   overflow:hidden; :hover transform) — left unchecked it flexes the hero and
   body apart and clips the sticky title. Guard .post too. */
.rx.rx-recipe,.rx.rx-post{display:block;background:none;border:0;border-radius:0;overflow:visible;box-shadow:none;transform:none;transition:none;padding:0;margin:0}
.rx.rx-recipe:hover,.rx.rx-post:hover{transform:none;box-shadow:none}

/* reveal motion (safe fallback: visible without JS / reduced-motion) */
.rx.anim [data-rx-reveal]{opacity:0;transform:translateY(16px);transition:opacity .6s ease,transform .6s cubic-bezier(.2,.7,.2,1)}
.rx.anim [data-rx-reveal].in{opacity:1;transform:none}

/* ---------- collapsing sticky title (sits under the fixed site header) ---------- */
.rx-subhead{position:fixed;top:var(--rx-header-h);left:0;right:0;z-index:95;background:rgba(244,241,234,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--rx-line);transform:translateY(-118%);opacity:0;transition:transform .38s cubic-bezier(.2,.7,.2,1),opacity .3s;pointer-events:none}
.rx-subhead.show{transform:none;opacity:1;pointer-events:auto}
.rx-subin{display:flex;align-items:center;gap:1rem;height:var(--rx-sub-h);max-width:1180px;margin:0 auto;padding:0 var(--rx-gutter)}
.rx-sub-title{font-family:var(--serif);font-size:clamp(1rem,.9rem + .4vw,1.2rem);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.rx-sub-meta{display:flex;align-items:center;gap:.9rem;white-space:nowrap}
.rx-sub-serves{font-family:var(--mono);font-size:.76rem;color:var(--grey)}
@media(max-width:560px){.rx-sub-serves{display:none}}

/* ---------- save button ---------- */
.rx-save{display:inline-flex;align-items:center;gap:.45rem;font-family:var(--mono);font-size:.74rem;letter-spacing:.05em;text-transform:uppercase;border:1px solid var(--ink);background:transparent;color:var(--ink);border-radius:999px;padding:.5rem .95rem;cursor:pointer;transition:.18s;white-space:nowrap}
.rx-save svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7;transition:.18s}
.rx-save:hover{background:var(--ink);color:var(--paper)}
.rx-save.is-saved{background:var(--sage);border-color:var(--sage);color:#fff}
.rx-save.is-saved svg{fill:currentColor}

/* ---------- share button (matches the save button) ---------- */
.rx-share{display:inline-flex;align-items:center;gap:.45rem;font-family:var(--mono);font-size:.74rem;letter-spacing:.05em;text-transform:uppercase;border:1px solid var(--ink);background:transparent;color:var(--ink);border-radius:999px;padding:.5rem .95rem;cursor:pointer;transition:.18s;white-space:nowrap}
.rx-share svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.rx-share:hover{background:var(--ink);color:var(--paper)}
.rx-share.is-copied{background:var(--sage);border-color:var(--sage);color:#fff}

/* ---------- integrated hero ---------- */
.rx-hero{min-height:calc(92svh - var(--rx-header-h));display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:calc(var(--rx-header-h) + clamp(1.6rem,4vh,3rem)) 0 clamp(2.4rem,5vh,3.6rem);position:relative}
.rx-eyebrow{font-family:var(--mono);font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--grey);display:flex;flex-wrap:nowrap;gap:.4rem .55rem;align-items:center;justify-content:center;margin:0 auto 1.4rem;max-width:100%}
@media(max-width:640px){.rx-eyebrow{flex-wrap:wrap}}
.rx-eyebrow .rx-pill{border:1px solid var(--rx-line);border-radius:999px;padding:.28rem .58rem;color:var(--ink);white-space:nowrap}
.rx-eyebrow .rx-pill--hi{border-color:var(--sage);color:var(--rx-sage-deep);background:var(--rx-sage-tint)}
.rx-hero h1{font-family:var(--serif);font-weight:400;font-size:var(--rx-title);max-width:20ch;margin:0 auto;letter-spacing:-.022em;line-height:1.05}
.rx-dek{font-family:var(--serif);font-weight:300;font-style:italic;font-size:1.5rem;line-height:1.34;color:var(--grey);max-width:46ch;margin:1.05rem auto 0}
.rx-actions{display:flex;gap:.9rem;justify-content:center;align-items:center;margin-top:1.5rem;flex-wrap:wrap}
.rx-ghost{font-family:var(--mono);font-size:.76rem;letter-spacing:.05em;text-transform:uppercase;color:var(--rx-sage-deep);text-decoration:none;display:inline-flex;gap:.4rem;align-items:center;padding:.55rem .5rem;border-bottom:1px solid transparent;transition:.15s}
.rx-ghost:hover{border-bottom-color:var(--sage)}
.rx-macrobar{margin:1.9rem auto 0;border-top:1px solid var(--rx-line);border-bottom:1px solid var(--rx-line);display:flex;justify-content:center;flex-wrap:wrap}
.rx-macrobar .rx-m{padding:.7rem 1.35rem;border-right:1px solid var(--rx-line-2)}
.rx-macrobar .rx-m:last-child{border-right:0}
.rx-macrobar .rx-mv{font-family:var(--serif);font-size:1.55rem;line-height:1}
.rx-macrobar .rx-ml{font-family:var(--mono);font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;color:var(--grey);margin-top:.34rem}
.rx-macrocap{font-family:var(--mono);font-size:.7rem;letter-spacing:.09em;text-transform:uppercase;color:var(--grey);margin-top:.9rem}
.rx-herofig{margin:clamp(1.8rem,4vw,2.6rem) auto 0;max-width:840px;width:100%}
.rx-herofig img{width:100%;height:clamp(220px,36vh,340px);object-fit:cover;object-position:center 44%;border-radius:var(--rx-radius);border:1px solid var(--rx-line)}
.rx-herofig figcaption{font-family:var(--hand,"Caveat",cursive);font-weight:600;font-size:1.3rem;color:var(--rust);margin-top:.55rem}

/* ---------- reading grid + sticky rail ---------- */
.rx-grid{display:grid;grid-template-columns:minmax(300px,340px) minmax(0,1fr);gap:clamp(1.6rem,4vw,4.5rem);align-items:start;padding:clamp(2rem,4vw,3rem) 0 5rem;border-top:1px solid var(--rx-line)}
.rx-grid--post{grid-template-columns:minmax(210px,250px) minmax(0,1fr)}
.rx-rail{position:sticky;top:calc(var(--rx-header-h) + var(--rx-sub-h) + 14px);display:flex;flex-direction:column;gap:.9rem;max-height:calc(100vh - var(--rx-header-h) - var(--rx-sub-h) - 26px);overflow:auto;scrollbar-width:thin}
.rx-rail::-webkit-scrollbar{width:6px}.rx-rail::-webkit-scrollbar-thumb{background:var(--rx-line);border-radius:9px}
.rx-panel{background:var(--rx-paper-2);border:1px solid var(--rx-line);border-radius:var(--rx-radius);padding:1.15rem 1.2rem;background-image:radial-gradient(rgba(28,28,28,.045) 1px,transparent 1px);background-size:16px 16px;background-position:-1px -1px}
.rx-plabel{font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--grey);display:flex;align-items:center;gap:.5rem;margin-bottom:1rem}
.rx-plabel::after{content:"";flex:1;height:1px;background:var(--rx-line)}

/* calculator */
.rx-servrow{display:flex;align-items:center;justify-content:center;gap:1rem}
.rx-stepper{display:flex;align-items:center;gap:.7rem}
.rx-stepper button{width:46px;height:46px;border-radius:50%;border:1px solid var(--ink);background:transparent;font-size:1.5rem;line-height:1;cursor:pointer;color:var(--ink);transition:.18s;display:grid;place-items:center;font-family:var(--serif)}
.rx-stepper button:hover{background:var(--ink);color:var(--paper)}
.rx-stepper button:active{transform:scale(.92)}
.rx-servbig{text-align:center;min-width:82px}
.rx-servbig .rx-n{font-family:var(--serif);font-size:2.6rem;line-height:.9;display:block}
.rx-servbig .rx-u{font-family:var(--mono);font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:var(--grey)}
.rx-calrow{display:flex;align-items:center;gap:.5rem;justify-content:center;margin-top:1rem;padding-top:.95rem;border-top:1px dashed var(--rx-line)}
.rx-calrow label{font-family:var(--mono);font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;color:var(--grey)}
.rx-calrow input{font-family:var(--serif);font-size:1.4rem;width:5rem;border:0;border-bottom:2px solid var(--sage);background:transparent;color:var(--ink);text-align:right;padding:.1rem}
.rx-calrow input:focus{outline:none;border-color:var(--ink)}
.rx-calrow .rx-suf{font-family:var(--mono);font-size:.66rem;letter-spacing:.06em;text-transform:uppercase;color:var(--grey)}
.rx-scalenote{font-family:var(--hand,"Caveat",cursive);font-weight:600;font-size:1.2rem;color:var(--rust);text-align:center;margin-top:.7rem;line-height:1.1}
.rx-readsep{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--rx-line)}
.rx-sublabel{font-family:var(--mono);font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;color:var(--grey);margin-bottom:.65rem}
.rx-readout{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.rx-readout .rx-r{background:var(--paper);border:1px solid var(--rx-line-2);border-radius:8px;padding:.6rem .7rem}
.rx-readout .rx-rv{font-family:var(--serif);font-size:1.45rem;line-height:1}
.rx-readout .rx-rl{font-family:var(--mono);font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:var(--grey);margin-top:.32rem}
.rx-reset{margin-top:.9rem;width:100%;font-family:var(--mono);font-size:.68rem;letter-spacing:.05em;text-transform:uppercase;background:transparent;border:0;color:var(--rx-sage-deep);cursor:pointer;text-decoration:underline;text-underline-offset:3px}

/* rail rating summary */
.rx-rate-compact .rx-row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;margin:.4rem 0}
.rx-rate-compact .rx-ax{font-family:var(--mono);font-size:.72rem;letter-spacing:.05em;text-transform:uppercase;color:var(--ink)}
.rx-rate-compact .rx-sc{font-family:var(--serif);font-size:1.1rem}
.rx-rate-compact .rx-sc small{font-family:var(--mono);font-size:.64rem;color:var(--grey);letter-spacing:.03em}
.rx-rate-compact .rx-go{margin-top:.75rem;width:100%;font-family:var(--mono);font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--ink);background:transparent;border-radius:999px;padding:.6rem;cursor:pointer;transition:.18s}
.rx-rate-compact .rx-go:hover{background:var(--ink);color:var(--paper)}

/* jump nav */
.rx-jump a{display:flex;align-items:center;gap:.55rem;font-family:var(--mono);font-size:.8rem;letter-spacing:.03em;color:var(--ink);text-decoration:none;padding:.4rem 0;border-bottom:1px solid var(--rx-line-2);transition:.15s}
.rx-jump a:last-child{border-bottom:0}
.rx-jump a::before{content:"";width:6px;height:6px;border-radius:1px;background:var(--rx-line);transition:.15s}
.rx-jump a:hover,.rx-jump a.active{color:var(--rx-sage-deep)}
.rx-jump a:hover::before,.rx-jump a.active::before{background:var(--sage)}

/* ---------- body ---------- */
.rx-body{min-width:0}
.rx-body>.prose{max-width:64ch}
.rx-body .prose h2{scroll-margin-top:calc(var(--rx-header-h) + var(--rx-sub-h) + 18px)}
.rx-serv-tag{font-family:var(--mono);font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;color:var(--grey);margin:0 0 1rem}
/* scaled ingredient quantity marker (JS wraps the number in .rx-q) */
.rx-q{font-family:var(--mono);color:var(--rx-sage-deep);white-space:nowrap;transition:color .3s}
.rx-q.pulse{animation:rx-pulse .5s ease}
@keyframes rx-pulse{0%{color:var(--rust)}100%{color:var(--rx-sage-deep)}}
/* recipe body parity with the prototype — section index numbers, clean
   ingredient/variation rows, serif method numerals (scoped to .rx-recipe) */
.rx-recipe .rx-body{counter-reset:rxsec}
.rx-recipe .rx-body .prose h2{counter-increment:rxsec;font-size:var(--step-2);font-weight:430;margin:2.2rem 0 .7rem}
.rx-recipe .rx-body .prose h2::before{content:counter(rxsec,decimal-leading-zero);font-family:var(--mono);font-size:.7rem;letter-spacing:.08em;color:var(--sage);font-weight:500;margin-right:.55rem;vertical-align:.34em}
.rx-recipe .rx-body .prose ul{list-style:none;margin:.6rem 0 0;padding:0;max-width:60ch}
.rx-recipe .rx-body .prose ul li{padding:.55rem 0;border-bottom:1px dotted var(--rx-line);line-height:1.5;margin:0}
.rx-recipe .rx-body .prose ol{list-style:none;counter-reset:m;margin:.6rem 0 0;padding:0;max-width:62ch}
.rx-recipe .rx-body .prose ol li{counter-increment:m;position:relative;padding:.15rem 0 1.1rem 3.2rem;border-bottom:1px solid var(--rx-line-2);line-height:1.6;margin:0}
.rx-recipe .rx-body .prose ol li:last-child{border-bottom:0}
.rx-recipe .rx-body .prose ol li::before{content:counter(m);position:absolute;left:0;top:0;bottom:1.1rem;display:flex;align-items:center;font-family:var(--serif);font-size:1.9rem;color:var(--sage);line-height:1;width:2.6rem}
.rx-st-empty{color:var(--grey);opacity:.55}
/* Storage & safety heading joins the section numbering */
.rx-recipe .rx-storage h2{counter-increment:rxsec}
.rx-recipe .rx-storage h2::before{content:counter(rxsec,decimal-leading-zero);font-family:var(--mono);font-size:.7rem;letter-spacing:.08em;color:var(--sage);font-weight:500;margin-right:.55rem;vertical-align:.34em}
/* per-ingredient macro contribution (P/C/F) — scales with servings */
.rx-ing-macros{display:block;margin-top:.25rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.03em;color:var(--rx-sage-deep)}
/* optional "hero point" callout */
.rx-hero-point{max-width:64ch;background:var(--rx-sage-tint);border:1px solid var(--sage);border-left-width:4px;border-radius:var(--rx-radius);padding:1rem 1.2rem;margin:0 0 1.6rem}
.rx-hero-point .rx-hp-label{font-family:var(--mono);font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;color:var(--rx-sage-deep);display:block;margin-bottom:.35rem}
.rx-hero-point p{margin:0;font-family:var(--serif);font-size:var(--step-1);line-height:1.4;color:var(--ink)}
/* consistent boxes — pairing table matches the rating/storage width + radius */
.rx-recipe .rx-body .prose table{width:100%;max-width:64ch;border:1px solid var(--rx-line);border-radius:var(--rx-radius);margin:1.4rem 0}

/* storage & safety */
.rx-storage{margin-top:var(--rx-flow);scroll-margin-top:calc(var(--rx-header-h) + var(--rx-sub-h) + 18px)}
.rx-storage h2{font-family:var(--serif);font-weight:430;font-size:var(--step-2,1.6rem);margin:0 0 .7rem}
.rx-storage-grid{display:grid;gap:1px;border:1px solid var(--rx-line);border-radius:var(--rx-radius);overflow:hidden;max-width:64ch;background:var(--rx-line)}
.rx-st-row{display:grid;grid-template-columns:2.6rem 7.4rem 1fr;gap:.4rem;align-items:start;padding:.9rem 1rem;background:var(--rx-paper-2)}
.rx-st-row.warn{background:var(--rx-rust-tint)}
.rx-st-ic{color:var(--rx-sage-deep)}.rx-st-row.warn .rx-st-ic{color:var(--rust)}
.rx-st-ic svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.6}
.rx-st-k{font-family:var(--mono);font-size:.74rem;letter-spacing:.05em;text-transform:uppercase;color:var(--ink);padding-top:.15rem}
.rx-st-v{color:var(--ink);font-size:.97rem;line-height:1.5}

/* rating block (full) */
.rx-ratebox{margin-top:var(--rx-flow);border:1px solid var(--rx-line);border-radius:var(--rx-radius);padding:clamp(1.2rem,3vw,1.9rem);background:var(--rx-paper-2);max-width:54ch;background-image:radial-gradient(rgba(28,28,28,.045) 1px,transparent 1px);background-size:18px 18px;scroll-margin-top:calc(var(--rx-header-h) + var(--rx-sub-h) + 18px);max-width:64ch}
.rx-ratebox h2{font-family:var(--serif);font-weight:430;font-size:var(--step-2,1.6rem);margin:0 0 .2rem}
.rx-ratebox .rx-sub{font-family:var(--mono);font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:var(--grey);margin-bottom:1.2rem}
.rx-axis{margin:1rem 0}
.rx-axhead{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:.45rem}
.rx-axname{font-weight:600;font-size:1rem}
.rx-axavg{font-family:var(--mono);font-size:.74rem;color:var(--grey)}
.rx-axavg b{font-family:var(--serif);font-size:1.2rem;color:var(--ink);font-weight:430}
.rx-stars{display:flex;gap:.3rem}
.rx-stars button{border:0;background:transparent;cursor:pointer;padding:.1rem;line-height:0}
.rx-stars svg{width:32px;height:32px;stroke:var(--rx-sage-deep);fill:none;stroke-width:1.4;transition:.12s}
.rx-stars button.on svg,.rx-stars button.hover svg{fill:var(--sage);stroke:var(--sage)}
.rx-stars button:active svg{transform:scale(.86)}
.rx-submit{margin-top:1.1rem;font-family:var(--mono);font-size:.74rem;letter-spacing:.07em;text-transform:uppercase;background:var(--ink);color:var(--paper);border:0;border-radius:999px;padding:.72rem 1.35rem;cursor:pointer;transition:.18s}
.rx-submit:disabled{opacity:.4;cursor:not-allowed}
.rx-submit:not(:disabled):hover{background:var(--rx-sage-deep)}
.rx-thanks{font-family:var(--hand,"Caveat",cursive);font-size:1.5rem;font-weight:600;color:var(--rust);margin-top:.7rem;min-height:1.1em}
.rx-note{font-size:.84rem;color:var(--grey);margin-top:1rem;padding-top:.9rem;border-top:1px solid var(--rx-line)}

.rx-backlink{display:inline-flex;gap:.5rem;align-items:center;font-family:var(--mono);font-size:.74rem;letter-spacing:.05em;text-transform:uppercase;color:var(--ink);text-decoration:none;margin-top:var(--rx-flow)}
.rx-backlink:hover{color:var(--rx-sage-deep)}

/* ---------- post specifics ---------- */
/* "On this page" for posts — rounded box, each item with a tiny square bullet */
.rx-toc{background:var(--rx-paper-2);border:1px solid var(--rx-line);border-radius:var(--rx-radius);padding:.45rem .85rem}
.rx-toc a{display:flex;align-items:center;gap:.55rem;color:var(--grey);text-decoration:none;padding:.34rem 0;transition:.15s;font-size:.9rem}
.rx-toc a::before{content:"";flex:none;width:6px;height:6px;border-radius:1px;background:var(--rx-line);transition:.15s}
.rx-toc a:hover{color:var(--ink)}
.rx-toc a:hover::before{background:var(--sage)}
.rx-toc a.active{color:var(--rx-sage-deep);font-weight:500}
.rx-toc a.active::before{background:var(--sage)}
.rx-prail{position:sticky;top:calc(var(--rx-header-h) + var(--rx-sub-h) + 14px)}
.rx-prail .rx-plabel{margin-bottom:.85rem}
.rx-prail .rx-save{margin-top:1.3rem}
/* handwritten aside inside post content (author adds <p class="rx-aside">…</p> or a blockquote.rx-aside) */
.rx-body .rx-aside{font-family:var(--hand,"Caveat",cursive);font-weight:600;font-size:1.5rem;line-height:1.2;color:var(--rust);max-width:40ch;margin:1.2rem 0;padding:.15rem 0 .15rem 1rem;border-left:2px solid var(--rust)}

@media(max-width:900px){
  .rx-grid,.rx-grid--post{grid-template-columns:1fr}
  .rx-rail,.rx-prail{position:static;max-height:none;overflow:visible}
  .rx-rail{order:-1}
  .rx-toc{display:block}
  /* keep each "On this page" point on its own line on mobile (was horizontal wrap) */
}
@media(prefers-reduced-motion:reduce){
  .rx.anim [data-rx-reveal]{opacity:1!important;transform:none!important;transition:none!important}
}
