/* Factory Mag Front — completely scoped to prevent altering theme typography/layout. */
.factory-mag{--fm-accent:#5b5ce2;--fm-background:#f6f7fb;--fm-text:#172033;--fm-radius:16px;--fm-gap:20px;--fm-container:1340px;box-sizing:border-box;width:100%;background:var(--fm-background);color:var(--fm-text);padding:clamp(24px,4vw,60px) 16px;line-height:1.45;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.factory-mag,.factory-mag *{box-sizing:border-box}
.factory-mag a{text-decoration:none;color:inherit}
.factory-mag a:hover{color:var(--fm-accent)}
.factory-mag .fm-magazine-inner{max-width:var(--fm-container);margin:0 auto}
.factory-mag .fm-layout-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:clamp(22px,3vw,40px) var(--fm-gap);align-items:start}
.factory-mag .fm-section{grid-column:span var(--fm-span);min-width:0}
.factory-mag .fm-section__header{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid color-mix(in srgb,var(--fm-text) 16%,transparent);padding-bottom:14px;margin-bottom:20px}
.factory-mag .fm-section__title{font-size:clamp(20px,2vw,29px);font-weight:800;letter-spacing:-.035em;line-height:1.18;margin:0;color:var(--fm-text)}
.factory-mag .fm-section__title a{color:inherit;text-decoration:none;transition:color .18s ease}
.factory-mag .fm-section__title a:hover,.factory-mag .fm-section__title a:focus-visible{color:var(--fm-accent)}
.factory-mag .fm-section__title:before{content:"";display:inline-block;width:5px;height:20px;background:var(--fm-accent);border-radius:8px;margin-right:11px;vertical-align:-3px}
.factory-mag .fm-section__more{font-size:13px;font-weight:700;white-space:nowrap;color:var(--fm-accent)}
.factory-mag .fm-section__posts{display:grid;gap:var(--fm-gap);min-width:0}
.factory-mag .fm-section--grid .fm-section__posts{grid-template-columns:repeat(2,minmax(0,1fr))}
.factory-mag .fm-section--grid[style*="--fm-span:12"] .fm-section__posts{grid-template-columns:repeat(3,minmax(0,1fr))}
.factory-mag .fm-section--grid[style*="--fm-span:3"] .fm-section__posts,.factory-mag .fm-section--grid[style*="--fm-span:4"] .fm-section__posts{grid-template-columns:1fr}
.factory-mag .fm-section--hero .fm-section__posts{grid-template-columns:repeat(4,minmax(0,1fr))}
.factory-mag .fm-section--hero .fm-post:first-child{grid-column:span 2;grid-row:span 2}
.factory-mag .fm-section--list .fm-section__posts{grid-template-columns:1fr}
.factory-mag .fm-post{min-width:0;background:#fff;border-radius:var(--fm-radius);overflow:hidden;box-shadow:0 8px 28px rgb(18 26 45 / 5%);transition:transform .18s ease,box-shadow .18s ease}
.factory-mag .fm-post:hover{transform:translateY(-2px);box-shadow:0 12px 32px rgb(18 26 45 / 9%)}
.factory-mag .fm-post__media{display:block;position:relative;aspect-ratio:16/10;overflow:hidden;background:color-mix(in srgb,var(--fm-accent) 13%,#dae1ec)}
.factory-mag .fm-post__image{display:block;width:100%;height:100%;object-fit:cover;transition:transform .35s ease}
.factory-mag .fm-post:hover .fm-post__image{transform:scale(1.035)}
.factory-mag .fm-post__media--empty{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,color-mix(in srgb,var(--fm-accent) 20%,#edf2f8),#dfe6ee)}
.factory-mag .fm-post__placeholder{font-size:50px;opacity:.22;color:var(--fm-accent)}
.factory-mag .fm-post__body{padding:17px 18px 20px}
.factory-mag .fm-post__category{display:inline-block;color:var(--fm-accent);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.09em;margin-bottom:7px}
.factory-mag .fm-post__title{font-size:clamp(15px,1.4vw,19px);font-weight:800;line-height:1.34;letter-spacing:-.025em;margin:0 0 9px;overflow-wrap:anywhere;color:var(--fm-text)}
.factory-mag .fm-post__excerpt{font-size:13px;color:color-mix(in srgb,var(--fm-text) 70%,#fff);line-height:1.65;margin:0 0 11px}
.factory-mag .fm-post__date{display:block;font-size:12px;color:color-mix(in srgb,var(--fm-text) 55%,#fff);margin-top:9px}
.factory-mag .fm-section--hero .fm-post--featured .fm-post__media{aspect-ratio:16/10}
.factory-mag .fm-section--hero .fm-post--featured .fm-post__title{font-size:clamp(21px,2.2vw,31px);line-height:1.16}
.factory-mag .fm-section--hero .fm-post:not(.fm-post--featured) .fm-post__media{aspect-ratio:16/9}
.factory-mag .fm-section--hero .fm-post:not(.fm-post--featured) .fm-post__body{padding:12px 13px 14px}
.factory-mag .fm-section--hero .fm-post:not(.fm-post--featured) .fm-post__excerpt{display:none}
.factory-mag .fm-section--hero .fm-post:not(.fm-post--featured) .fm-post__title{font-size:14px}
.factory-mag .fm-section--list .fm-post{display:grid;grid-template-columns:minmax(90px,34%) minmax(0,1fr);min-height:110px}
.factory-mag .fm-section--list .fm-post__media{aspect-ratio:auto;height:100%;min-height:110px}
.factory-mag .fm-section--list .fm-post__body{padding:13px 15px}
.factory-mag .fm-section--list .fm-post__title{font-size:15px;margin-bottom:5px}
.factory-mag .fm-section--list .fm-post__category{font-size:10px;margin-bottom:5px}
.factory-mag .fm-section--list .fm-post__date{font-size:11px}
@media(max-width:1050px){.factory-mag .fm-section{grid-column:span 12}.factory-mag .fm-section--grid[style*="--fm-span:12"] .fm-section__posts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.factory-mag .fm-section--hero .fm-section__posts{grid-template-columns:repeat(2,minmax(0,1fr))}.factory-mag .fm-section--hero .fm-post:first-child{grid-column:span 2;grid-row:auto}.factory-mag .fm-section--grid .fm-section__posts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.factory-mag{padding:24px 12px}.factory-mag .fm-layout-grid{gap:30px}.factory-mag .fm-section--grid .fm-section__posts,.factory-mag .fm-section--grid[style*="--fm-span:12"] .fm-section__posts{grid-template-columns:1fr}.factory-mag .fm-section--hero .fm-section__posts{grid-template-columns:1fr}.factory-mag .fm-section--hero .fm-post:first-child{grid-column:auto}.factory-mag .fm-post__body{padding:14px 15px}.factory-mag .fm-section__title{font-size:22px}}
@media(prefers-reduced-motion:reduce){.factory-mag .fm-post,.factory-mag .fm-post__image{transition:none}}

/* Hero text-only alternative. Isolated from the classic four-column hero. */
.factory-mag .fm-section--hero .fm-section__posts.fm-hero-text-grid{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);
  align-items:stretch;
  gap:clamp(16px,2vw,28px);
  width:100%;
}
.factory-mag .fm-hero-text-main,.factory-mag .fm-hero-text-rest{min-width:0}
.factory-mag .fm-hero-text-main>.fm-post{display:flex;flex-direction:column;height:100%;grid-column:auto;grid-row:auto}
.factory-mag .fm-hero-text-main>.fm-post .fm-post__media{aspect-ratio:16/9;width:100%}
.factory-mag .fm-hero-text-main>.fm-post .fm-post__body{flex:1;padding:20px 22px 23px}
.factory-mag .fm-hero-text-rest{display:flex;flex-direction:column;gap:clamp(12px,1.3vw,20px);min-width:0}
.factory-mag .fm-hero-text-rest>.fm-post{display:flex;flex:1 1 0;align-items:center;min-height:96px;grid-column:auto;grid-row:auto}
.factory-mag .fm-hero-text-rest>.fm-post .fm-post__body{width:100%;padding:18px 22px}
.factory-mag .fm-hero-text-rest>.fm-post .fm-post__category{margin-bottom:9px}
.factory-mag .fm-hero-text-rest>.fm-post .fm-post__title{font-size:clamp(15px,1.2vw,19px);line-height:1.4;margin:0 0 9px}
.factory-mag .fm-hero-text-rest>.fm-post .fm-post__date{margin-top:10px}
.factory-mag .fm-hero-text-rest>.fm-post .fm-post__excerpt{display:none}
@media(max-width:760px){
 .factory-mag .fm-section--hero .fm-section__posts.fm-hero-text-grid{grid-template-columns:minmax(0,1fr)}
 .factory-mag .fm-hero-text-rest>.fm-post{flex:auto;min-height:96px}
}

/* v3.1: classic explicitly shows secondary thumbnails; text variation never outputs them. */
.factory-mag .fm-section--hero.fm-section--hero .fm-section__posts:not(.fm-hero-text-grid) .fm-post:not(.fm-post--featured) .fm-post__media{display:block!important}
.factory-mag .fm-section--hero_text .fm-hero-text-rest .fm-post__media{display:none!important}

/* v3.3 — Per-block excerpt preferences override old presentation defaults. */
.factory-mag .fm-section--hero.fm-excerpts--all .fm-post:not(.fm-post--featured) .fm-post__excerpt{display:block}
.factory-mag .fm-section--hero_text.fm-excerpts--all .fm-hero-text-rest>.fm-post .fm-post__excerpt{display:block}

/* v3.5: per-row sticky blocks; the row bounds the sticky travel distance. */
.factory-mag .fm-layout-grid{display:block}
.factory-mag .fm-layout-row{grid-column:1 / -1;width:100%;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:var(--fm-gap);align-items:start;margin-bottom:clamp(22px,3vw,40px);min-width:0}
.factory-mag .fm-layout-row:last-child{margin-bottom:0}
.factory-mag .fm-layout-row>.fm-section--sticky{position:sticky;top:90px;z-index:2;align-self:start}
@media(max-width:1050px){.factory-mag .fm-layout-row{row-gap:clamp(22px,3vw,40px)}.factory-mag .fm-layout-row>.fm-section--sticky{position:static;top:auto}}

/* v3.6: row wrapper must span the entire 12-column grid even if legacy CSS is cached. */
.factory-mag .fm-layout-grid > .fm-layout-row{grid-column:1 / -1;width:100%;min-width:0}

/* v3.8: JavaScript sets inline fixed positioning; placeholder preserves original grid column. */
.factory-mag .fm-layout-row>.fm-sticky-placeholder{min-width:0;pointer-events:none}

/* v3.9: section stays in-grid; scrolling translation is handled by sticky.js. */
.factory-mag .fm-layout-row>.fm-section--sticky{position:relative!important;top:auto!important;align-self:start}
@media(max-width:1050px){.factory-mag .fm-layout-row>.fm-section--sticky{transform:none!important}}
