{"version":3,"file":"Rails.BAySDPs0.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/MFEx0O0J8ThrOUuTdk8P/070pTJozkFvNkAfoXJe6/Rails.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState}from\"react\";/**\n * iClosed — Page Rails, ported to a self-contained Framer code component\n * (from src/components/layout/PageRails).\n *\n * The two vertical hairlines that run down the site at the 1440 container's\n * edges. On the Next site these are drawn ONCE for the whole page rather than\n * per section, because per-section rails can only span their own section — any\n * gap between sections (a section's top padding, a stack gap) leaves a visible\n * break in the line, and every new section is a fresh chance to break it.\n *\n * READ THIS BEFORE USING IT — there is a better way.\n *\n * The robust way to draw rails is NOT an overlay. It is a left/right BORDER on\n * the single frame that wraps the whole page. attio.com does exactly that:\n * a `max-width: 1440px; padding: 0 24px` container holding one `border-x`\n * child that contains the entire page. Because every section renders *inside*\n * that border, nothing can ever paint over it — there is no z-index at all\n * (theirs is `position: static; z-index: auto`).\n *\n * In Framer you get that for free: select the page's content frame, cap it at\n * 1440, and give it a 1px left and right border in the design panel. No code\n * component, no stacking to manage. Prefer that.\n *\n * Use THIS component only when you cannot wrap the page in a single frame — for\n * example to redraw the rails in a lighter colour across a dark band, which is\n * also what Attio does (a second, darker-stroked border layer pinned over the\n * dark region).\n *\n * An overlay has to win a stacking contest against every section it crosses,\n * which is why it is the fragile option. By default this component sets NO\n * z-index, so Framer's layer order governs: put it directly under the header\n * and above the sections you want it to cross. Only set the z-index control if\n * you specifically need to force it above something.\n *\n * Everything is scoped under `.icnr-*` so no styles leak into the rest of the\n * document.\n *//* Width is the standard container formula: cap at the container, but never let\n   the rails reach the screen edge — below the cap they keep a fixed gutter and\n   shrink with the viewport. No media query needed; min() does both jobs. */const CSS=`\n.icnr-root {\n  position: fixed;\n  top: 0;\n  bottom: 0;\n  left: 50%;\n  transform: translateX(-50%);\n  width: min(var(--icnr-max), 100% - var(--icnr-gutter) * 2);\n  pointer-events: none;\n}\n.icnr-root::before,\n.icnr-root::after {\n  content: \"\";\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: 1px;\n  background: var(--icnr-color);\n}\n.icnr-root::before { left: 0; }\n.icnr-root::after { right: 0; }\n`;/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 1440\n * @framerIntrinsicHeight 40\n */export default function PageRails(props){const{containerWidth=1440,gutter=32,color=\"#e5e7eb\",hideBelow=0,zIndex}=props;/* Optional, and off by default — the rails now inset themselves rather than\n       running to the screen edge, so there is no width at which they have to be\n       dropped. Set it if you want them gone on phones. */const[visible,setVisible]=useState(true);useEffect(()=>{if(!hideBelow){setVisible(true);return;}const mq=window.matchMedia(`(min-width: ${hideBelow+1}px)`);const sync=()=>setVisible(mq.matches);sync();mq.addEventListener(\"change\",sync);return()=>mq.removeEventListener(\"change\",sync);},[hideBelow]);if(!visible)return null;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsx(\"div\",{className:\"icnr-root\",style:{/* z-index is deliberately omitted unless asked for, so\n                           Framer's layer order decides what covers what. */...zIndex==null?null:{zIndex},[\"--icnr-max\"]:`${containerWidth}px`,[\"--icnr-gutter\"]:`${gutter}px`,[\"--icnr-color\"]:color}})]});}PageRails.defaultProps={containerWidth:1440,gutter:32,color:\"#e5e7eb\",hideBelow:0};addPropertyControls(PageRails,{containerWidth:{type:ControlType.Number,title:\"Max width\",min:600,max:2e3,step:10,displayStepper:true,description:\"Cap for the rails — 1440 matches the design.\"},gutter:{type:ControlType.Number,title:\"Min gutter\",min:0,max:120,step:4,description:\"Kept clear of the screen edge once the viewport is narrower than the cap.\"},color:{type:ControlType.Color,title:\"Colour\"},hideBelow:{type:ControlType.Number,title:\"Hide below\",min:0,max:2e3,step:10,description:\"0 = never hide. The rails inset themselves instead.\"},zIndex:{type:ControlType.Number,title:\"z-index\",min:0,max:100,step:1,description:\"Leave empty so Framer's layer order decides. Only set this to force the rails above a specific layer.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PageRails\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"40\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1440\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Rails.map"],"mappings":"6MAgEG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,iBAAe,KAAK,SAAO,GAAG,QAAM,UAAU,YAAU,EAAE,UAAQ,EAErD,CAAC,EAAQ,GAAYA,EAAS,EAAI,EAA4R,OAA1R,MAAc,CAAC,GAAG,CAAC,EAAU,CAAC,EAAW,EAAI,EAAE,MAAO,CAAC,IAAM,EAAG,EAAO,WAAW,eAAe,EAAU,EAAE,IAAI,EAAQ,MAAS,EAAW,EAAG,OAAO,EAA4C,OAA1C,EAAK,EAAE,EAAG,iBAAiB,SAAS,CAAI,MAAY,EAAG,oBAAoB,SAAS,CAAI,CAAE,EAAE,CAAC,CAAS,CAAC,EAAM,EAAwC,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAG,CAAC,CAAC,EAAe,EAAK,MAAM,CAAC,UAAU,YAAY,MAAM,CACvd,GAAG,GAAQ,KAAK,KAAK,CAAC,QAAM,EAAG,aAAc,GAAG,EAAe,IAAK,gBAAiB,GAAG,EAAO,IAAK,eAAgB,CAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAD8K,IAC5K,uBAnE9H,IAAoD,IAAsC,EAsCtF,EAAI;;;;;;;;;;;;;;;;;;;;;EA6BuH,EAAU,aAAa,CAAC,eAAe,KAAK,OAAO,GAAG,MAAM,UAAU,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