{"version":3,"file":"StoryBody.CPderYc7.mjs","names":["useRef","__esmMin","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","addPropertyControls","init_framer_DcxuU94H","useIsStaticRenderer","ControlType","StoryBody","props","selfRef","isStatic","s","targetLayer","css","scope","body","w","img","narrowBelow","next","init_StoryBody"],"sources":["https:/framerusercontent.com/modules/N9sSbABx9Ia1KmarnWIu/QfrHPGwBSQL6u9HYcGq0/StoryBody.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Story Body\n *\n * Reading rhythm for a CMS rich text body: headings sit closer to their own\n * text than to the paragraph before them, quotes and images get room around\n * them, and photos fill the column. Small images (logos, icons) keep their\n * own size. Place it next to the rich text layer and set its layer name.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function StoryBody(props){const{targetLayer=\"Story Body\",narrowBelow=400}=props;const selfRef=useRef(null);const isStatic=useIsStaticRenderer();const s=`[data-framer-name=\"${targetLayer}\"]`;// Spacing scale: 28 between paragraphs, 20 from a heading to its text, 64 around images and\n// quotes, 88 before a section heading. Tablet and phone step down proportionally.\nconst css=`\n${s} > p + p { margin-top: 28px !important; }\n${s} > img { display: block; width: 100% !important; height: auto !important; margin-top: 64px !important; }\n${s} > img[data-story-narrow] { width: auto !important; max-width: 100%; }\n${s} > img + * { margin-top: 64px !important; }\n${s} > img + img { margin-top: 24px !important; }\n${s} > img + p[data-story-caption] { margin-top: 16px !important; }\n${s} > * + h2 { margin-top: 88px !important; }\n${s} > * + h3 { margin-top: 56px !important; }\n${s} > h2 + *, ${s} > h3 + * { margin-top: 20px !important; }\n${s} > blockquote { margin-top: 64px !important; }\n${s} > blockquote + * { margin-top: 64px !important; }\n${s} > p + ul, ${s} > p + ol { margin-top: 20px !important; }\n${s} > ul + *, ${s} > ol + * { margin-top: 32px !important; }\n${s} > p { text-wrap: pretty; }\n${s} > h2, ${s} > h3 { text-wrap: balance; }\n@media (max-width: 1199px) {\n  ${s} > img, ${s} > img + *, ${s} > blockquote, ${s} > blockquote + * { margin-top: 56px !important; }\n  ${s} > * + h2 { margin-top: 72px !important; }\n  ${s} > * + h3 { margin-top: 48px !important; }\n}\n@media (max-width: 809px) {\n  ${s} > p + p { margin-top: 24px !important; }\n  ${s} > img, ${s} > img + *, ${s} > blockquote, ${s} > blockquote + * { margin-top: 44px !important; }\n  ${s} > img + img { margin-top: 16px !important; }\n  ${s} > * + h2 { margin-top: 56px !important; }\n  ${s} > * + h3 { margin-top: 40px !important; }\n  ${s} > h2 + *, ${s} > h3 + * { margin-top: 16px !important; }\n  ${s} > ul + *, ${s} > ol + * { margin-top: 24px !important; }\n}\n`;useEffect(()=>{if(isStatic)return;// Mark small images and short captions, which the stylesheet treats differently.\nlet scope=selfRef.current?.parentElement||null;while(scope&&!scope.querySelector(s))scope=scope.parentElement;const body=scope?.querySelector(s);if(!body)return;body.querySelectorAll(\":scope > img\").forEach(img=>{const w=Number(img.getAttribute(\"width\"))||img.naturalWidth/2;if(w&&w<narrowBelow)img.setAttribute(\"data-story-narrow\",\"\");const next=img.nextElementSibling;if(next&&next.tagName===\"P\"&&(next.textContent||\"\").trim().length<90&&!/[.!?]$/.test((next.textContent||\"\").trim())){next.setAttribute(\"data-story-caption\",\"\");}});},[isStatic,targetLayer,narrowBelow]);return /*#__PURE__*/_jsx(\"div\",{ref:selfRef,\"aria-hidden\":true,style:{width:1,height:1,pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"style\",{children:css})});}addPropertyControls(StoryBody,{targetLayer:{type:ControlType.String,title:\"Body layer\",defaultValue:\"Story Body\"},narrowBelow:{type:ControlType.Number,title:\"Small image\",defaultValue:400,min:100,max:800,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StoryBody\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"1\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StoryBody.map"],"mappings":"A,yLAYG,SAAwBW,EAAU,EAAM,CAAC,GAAK,CAAC,cAAY,aAAa,cAAY,KAAKC,EAAYC,EAAQb,EAAO,IAAI,EAAQc,EAASL,EAAoB,EAAQM,EAAE,sBAAsBC,EAAY,IAEtMC,EAAI;EACRF,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE;EACFA,EAAE,aAAaA,EAAE;EACjBA,EAAE;EACFA,EAAE;EACFA,EAAE,aAAaA,EAAE;EACjBA,EAAE,aAAaA,EAAE;EACjBA,EAAE;EACFA,EAAE,SAASA,EAAE;;IAEXA,EAAE,UAAUA,EAAE,cAAcA,EAAE,iBAAiBA,EAAE;IACjDA,EAAE;IACFA,EAAE;;;IAGFA,EAAE;IACFA,EAAE,UAAUA,EAAE,cAAcA,EAAE,iBAAiBA,EAAE;IACjDA,EAAE;IACFA,EAAE;IACFA,EAAE;IACFA,EAAE,aAAaA,EAAE;IACjBA,EAAE,aAAaA,EAAE;;EAGuiB,OAD1jBX,MAAc,CAAC,GAAGU,EAAS,OAC7B,IAAII,EAAML,EAAQ,SAAS,eAAe,KAAK,KAAMK,GAAO,CAACA,EAAM,cAAcH,CAAC,GAAE,EAAMG,EAAM,cAAc,IAAMC,EAAKD,GAAO,cAAcH,CAAC,EAAMI,GAAYA,EAAK,iBAAiB,cAAc,CAAC,CAAC,QAAQ,GAAK,CAAC,IAAMC,EAAE,OAAOC,EAAI,aAAa,OAAO,CAAC,GAAGA,EAAI,aAAa,EAAKD,GAAGA,EAAEE,GAAYD,EAAI,aAAa,oBAAoB,EAAE,EAAE,I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