/* Module pages (Windows first): shares the j2- system from jms2d_overview.css and
   adds the hero collage, the types strip, the checklist and the article row. */

/* hero: dark, centred copy, drawings arriving around it */
.j2w-hero{position:relative;overflow:hidden;background:#07050c;color:#f5f5f7;padding-top:clamp(56px,8vh,96px);padding-bottom:clamp(40px,5vw,72px)}
.j2w-hero::before{content:"";position:absolute;inset:0;background:radial-gradient(60% 50% at 50% 30%,rgba(119,33,108,.55),transparent 70%),radial-gradient(40% 40% at 85% 90%,rgba(119,33,108,.35),transparent 70%);pointer-events:none}
.j2w-hero-copy{position:relative;z-index:2;text-align:center}
.j2w-hero .j2-name{font-size:1.05rem;font-weight:600;color:#c983bf;margin-bottom:.7rem}
.j2w-hero h1{font-size:clamp(3rem,8vw,6.5rem);line-height:.95;font-weight:700!important;color:#fff;letter-spacing:-.03em;margin:0}
.j2w-hero .j2-sub{margin:1.2rem auto 1.5rem;color:#c9c9ce;max-width:34ch;font-size:clamp(1.05rem,1.5vw,1.35rem)}
.j2w-hero .j2-links{justify-content:center}
.j2w-hero .j2-links a{color:#d69ccd}
/* collage: a band of absolutely positioned drawings; positions come from inline custom properties */
.j2w-collage{position:relative;height:clamp(300px,34vw,460px);margin-top:clamp(24px,4vw,48px);z-index:1}
/* drawings sit square; each rises and fades into place, then (once settled) drifts a little with scroll */
.j2w-item{position:absolute;left:var(--x);top:var(--y);width:var(--w);margin:0;filter:drop-shadow(0 18px 30px rgba(0,0,0,.45));will-change:transform,opacity}
.j2w-item img{display:block;width:100%;height:auto}
.j2w-item.j2w-back{opacity:.75}
@media (prefers-reduced-motion:no-preference){
  .j2w-item{opacity:0;animation:j2w-arrive 1s cubic-bezier(.2,.7,.2,1) forwards;animation-delay:calc(.2s + var(--i,0)*.07s)}
  .j2w-item.j2w-back{opacity:0;animation-name:j2w-arrive-back}
  .j2w-item.is-in{animation:none;opacity:1}
  .j2w-item.j2w-back.is-in{opacity:.75}
  @keyframes j2w-arrive{from{opacity:0;transform:translateY(36px) scale(.94)}to{opacity:1;transform:none}}
  @keyframes j2w-arrive-back{from{opacity:0;transform:translateY(36px) scale(.94)}to{opacity:.75;transform:none}}
}
@media (max-width:760px){
  /* phone: one drawing at a time, each fading into the next */
  .j2w-hero{padding-bottom:clamp(36px,9vw,56px)}
  .j2w-collage{height:clamp(220px,58vw,300px);display:block;margin-top:clamp(20px,5vw,36px)}
  .j2w-item,.j2w-item.j2w-lg{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;width:auto!important;transform:none!important;filter:drop-shadow(0 12px 22px rgba(0,0,0,.45));animation:none;opacity:0;transition:opacity .65s ease}
  .j2w-item img{max-height:88%;max-width:min(66vw,300px);width:auto;height:auto}
  .j2w-item.is-show,.j2w-item.j2w-back.is-show{opacity:1}
  .j2w-item.j2w-back.is-in{opacity:0}
  .j2w-item.j2w-back.is-in.is-show{opacity:1}
}
}

/* item types use the .j2-gal card gallery from jms2d_overview.css */

/* intro prose */
.j2w-prose{font-size:clamp(1.1rem,1.5vw,1.3rem);line-height:1.5;color:var(--j2-text-2)}
.j2w-prose h2{font-size:clamp(1.6rem,2.6vw,2.2rem);line-height:1.15;margin:2rem 0 .8rem;color:var(--j2-text)}
.j2w-prose p{margin:0 0 1rem}
.j2w-prose b,.j2w-prose strong{color:var(--j2-text);font-weight:600}

/* right for you: checklist */
.j2w-fit h2{font-size:clamp(2rem,4.6vw,3.4rem);line-height:1.05;font-weight:700}
.j2w-fit p{color:var(--j2-text-2);font-size:clamp(1.05rem,1.5vw,1.3rem);margin:1rem auto 0;max-width:40ch}
.j2w-fit ul{list-style:none;margin:clamp(24px,3vw,40px) auto 0;padding:0;max-width:640px;text-align:left}
.j2w-fit li{position:relative;padding:.9rem 0 .9rem 2.4rem;border-top:1px solid rgba(29,29,31,.14);font-size:1.1rem}
.j2w-fit li:last-child{border-bottom:1px solid rgba(29,29,31,.14)}
.j2w-fit li::before{content:"";position:absolute;left:0;top:1.05rem;width:22px;height:22px;border-radius:50%;background:var(--j2-purple);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/svg%3E") center/contain no-repeat}
.j2w-fit li::after{content:"";position:absolute;left:6px;top:calc(1.05rem + 5px);width:10px;height:6px;border-left:2.2px solid #fff;border-bottom:2.2px solid #fff;transform:rotate(-45deg)}
.j2w-fit ul+p{margin-top:1.6rem;font-size:1rem}

/* related article */
.j2w-article{display:grid;grid-template-columns:200px 1fr;gap:1.6rem;align-items:center;max-width:760px;margin:clamp(24px,3vw,40px) auto 0;text-align:left}
.j2w-article img{width:100%;height:auto;border-radius:14px;display:block}
.j2w-article .j2w-date{font-size:.85rem;color:var(--j2-text-2);margin:0 0 .3rem}
.j2w-article h3{font-size:1.25rem;line-height:1.25}
.j2w-article p{margin:.5rem 0 0;color:var(--j2-text-2);font-size:.95rem}
.j2w-article a.j2w-more{display:inline-block;margin-top:.6rem;font-weight:500}
.j2w-article a.j2w-more::after{content:" \203A"}
@media (max-width:560px){.j2w-article{grid-template-columns:1fr}}

/* U-value illustration: drawing left, readout and controls right */
.j2u{display:grid;grid-template-columns:1.25fr 1fr;gap:clamp(20px,3vw,40px);align-items:center;background:#131316;border:1px solid #26262b;border-radius:24px;padding:clamp(18px,3vw,36px)}
.j2u-stage{min-width:0}
.j2u-svg{display:block;width:100%;height:auto}
.j2u-panel{text-align:left;min-width:0}
.j2u-vals{background:#0b0b0d;border:1px solid #26262b;border-radius:16px;padding:16px 18px;margin-bottom:18px}
.j2u-vh{font-size:.85rem;color:var(--j2-on-dark-2);margin-bottom:.5rem}
.j2u-vh span{margin-left:.35rem;opacity:.7}
.j2u-row{display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:baseline;padding:.45rem 0;border-top:1px solid #222227;font-size:.95rem;color:var(--j2-on-dark-2)}
.j2u-row b{font-size:1.7rem;font-weight:700;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.j2u-row i{font-style:normal;font-size:.9rem;color:var(--j2-on-dark-2);font-variant-numeric:tabular-nums;min-width:5.2ch;text-align:right}
.j2u-row:first-of-type b{color:#5fe3c4}
.j2u-ctl{display:block;margin:0 0 14px}
.j2u-ctl>span{display:block;font-size:.85rem;color:var(--j2-on-dark-2);margin-bottom:6px}
.j2u-ctl output{color:#fff;font-weight:600;font-variant-numeric:tabular-nums}
.j2u-ctl input[type=range]{width:100%;accent-color:#c983bf}
.j2u-ctl select{width:100%;background:#0b0b0d;color:#f5f5f7;border:1px solid #2c2c31;border-radius:10px;padding:10px 12px;font:inherit;font-size:.95rem}
.j2u-note{margin:6px 0 0;font-size:.8rem;color:var(--j2-on-dark-2);line-height:1.4}
@media (max-width:820px){.j2u{grid-template-columns:1fr}.j2u-panel{text-align:left}}

/* generic collage: the page's own CMS type images. Each figure is a column the
   full height of the band; the drawing fits inside it and sits on a common
   baseline, so tall and wide drawings never spill out of the hero. */
.j2w-collage-auto{height:clamp(260px,26vw,380px);padding-bottom:0}
.j2w-collage-auto .j2w-item{top:0;height:100%;display:flex;align-items:flex-end;justify-content:center;width:var(--w,12%)}
.j2w-collage-auto .j2w-item img{max-height:100%;max-width:100%;width:auto;height:auto;object-fit:contain}
.j2w-collage-auto[data-count="4"] .j2w-n1{--x:6%;--w:19%}  .j2w-collage-auto[data-count="4"] .j2w-n2{--x:29%;--w:19%}
.j2w-collage-auto[data-count="4"] .j2w-n3{--x:52%;--w:19%} .j2w-collage-auto[data-count="4"] .j2w-n4{--x:75%;--w:19%}
.j2w-collage-auto[data-count="5"] .j2w-n1{--x:2%;--w:17%}  .j2w-collage-auto[data-count="5"] .j2w-n2{--x:22%;--w:17%}
.j2w-collage-auto[data-count="5"] .j2w-n3{--x:42%;--w:17%} .j2w-collage-auto[data-count="5"] .j2w-n4{--x:62%;--w:17%}
.j2w-collage-auto[data-count="5"] .j2w-n5{--x:82%;--w:17%}
.j2w-collage-auto[data-count="6"] .j2w-n1{--x:1%;--w:15%}  .j2w-collage-auto[data-count="6"] .j2w-n2{--x:18%;--w:15%}
.j2w-collage-auto[data-count="6"] .j2w-n3{--x:35%;--w:15%} .j2w-collage-auto[data-count="6"] .j2w-n4{--x:52%;--w:15%}
.j2w-collage-auto[data-count="6"] .j2w-n5{--x:69%;--w:15%} .j2w-collage-auto[data-count="6"] .j2w-n6{--x:86%;--w:13%}
.j2w-collage-auto[data-count="7"] .j2w-n1{--x:0%;--w:13%}  .j2w-collage-auto[data-count="7"] .j2w-n2{--x:14.5%;--w:13%}
.j2w-collage-auto[data-count="7"] .j2w-n3{--x:29%;--w:13%} .j2w-collage-auto[data-count="7"] .j2w-n4{--x:43.5%;--w:13%}
.j2w-collage-auto[data-count="7"] .j2w-n5{--x:58%;--w:13%} .j2w-collage-auto[data-count="7"] .j2w-n6{--x:72.5%;--w:13%}
.j2w-collage-auto[data-count="7"] .j2w-n7{--x:87%;--w:13%}
/* eight or more: two rows of columns, each half the band's height */
.j2w-collage-auto[data-count="8"],.j2w-collage-auto[data-count="9"],.j2w-collage-auto[data-count="10"],.j2w-collage-auto[data-count="11"],.j2w-collage-auto[data-count="12"]{height:clamp(320px,36vw,520px)}
.j2w-collage-auto[data-count="10"] .j2w-item{height:46%;--w:16%}
.j2w-collage-auto[data-count="10"] .j2w-n1{--x:2%}  .j2w-collage-auto[data-count="10"] .j2w-n2{--x:22%} .j2w-collage-auto[data-count="10"] .j2w-n3{--x:42%} .j2w-collage-auto[data-count="10"] .j2w-n4{--x:62%} .j2w-collage-auto[data-count="10"] .j2w-n5{--x:82%}
.j2w-collage-auto[data-count="10"] .j2w-n6{--x:2%;top:54%}  .j2w-collage-auto[data-count="10"] .j2w-n7{--x:22%;top:54%} .j2w-collage-auto[data-count="10"] .j2w-n8{--x:42%;top:54%} .j2w-collage-auto[data-count="10"] .j2w-n9{--x:62%;top:54%} .j2w-collage-auto[data-count="10"] .j2w-n10{--x:82%;top:54%}
.j2w-collage-auto[data-count="8"] .j2w-item,.j2w-collage-auto[data-count="9"] .j2w-item,.j2w-collage-auto[data-count="11"] .j2w-item,.j2w-collage-auto[data-count="12"] .j2w-item{height:46%;--w:13%}
.j2w-collage-auto[data-count="8"] .j2w-n1,.j2w-collage-auto[data-count="12"] .j2w-n1{--x:2%} .j2w-collage-auto[data-count="8"] .j2w-n2,.j2w-collage-auto[data-count="12"] .j2w-n2{--x:18%} .j2w-collage-auto[data-count="8"] .j2w-n3,.j2w-collage-auto[data-count="12"] .j2w-n3{--x:34%} .j2w-collage-auto[data-count="8"] .j2w-n4,.j2w-collage-auto[data-count="12"] .j2w-n4{--x:50%}
.j2w-collage-auto[data-count="8"] .j2w-n5,.j2w-collage-auto[data-count="12"] .j2w-n5{--x:2%;top:54%} .j2w-collage-auto[data-count="8"] .j2w-n6,.j2w-collage-auto[data-count="12"] .j2w-n6{--x:18%;top:54%} .j2w-collage-auto[data-count="8"] .j2w-n7,.j2w-collage-auto[data-count="12"] .j2w-n7{--x:34%;top:54%} .j2w-collage-auto[data-count="8"] .j2w-n8,.j2w-collage-auto[data-count="12"] .j2w-n8{--x:50%;top:54%}
.j2w-collage-auto[data-count="12"] .j2w-n9{--x:66%} .j2w-collage-auto[data-count="12"] .j2w-n10{--x:82%} .j2w-collage-auto[data-count="12"] .j2w-n11{--x:66%;top:54%} .j2w-collage-auto[data-count="12"] .j2w-n12{--x:82%;top:54%}
.j2w-collage-auto[data-count="8"] .j2w-item{--w:19%} .j2w-collage-auto[data-count="8"] .j2w-n1{--x:5%} .j2w-collage-auto[data-count="8"] .j2w-n2{--x:28%} .j2w-collage-auto[data-count="8"] .j2w-n3{--x:51%} .j2w-collage-auto[data-count="8"] .j2w-n4{--x:74%} .j2w-collage-auto[data-count="8"] .j2w-n5{--x:5%} .j2w-collage-auto[data-count="8"] .j2w-n6{--x:28%} .j2w-collage-auto[data-count="8"] .j2w-n7{--x:51%} .j2w-collage-auto[data-count="8"] .j2w-n8{--x:74%}
/* single image hero (Bill of Materials): one large centred figure */
.j2w-collage-one{height:auto;display:flex;justify-content:center}
.j2w-collage-one .j2w-item{position:static;width:min(520px,80%);transform:none}
.j2w-collage-one .j2w-item img{border-radius:12px}
.j2w-single img{display:block;max-width:min(100%,760px);height:auto;margin:0 auto;border-radius:14px;box-shadow:0 2px 4px rgba(0,0,0,.08),0 24px 60px rgba(0,0,0,.18)}
@media (max-width:760px){.j2w-collage-auto,.j2w-collage-auto[data-count]{height:clamp(220px,58vw,300px)}.j2w-collage-auto .j2w-item,.j2w-collage-auto[data-count] .j2w-item{height:auto;top:auto;align-items:center}.j2w-collage-auto .j2w-item img{max-height:88%}.j2w-collage-one{height:auto}.j2w-collage-one .j2w-item{position:static;opacity:1;inset:auto}}

/* module switcher in the section nav */
.j2-switch{position:relative}
.j2-switch summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:.4rem;user-select:none}
.j2-switch summary::-webkit-details-marker{display:none}
.j2-switch summary svg{width:14px;height:14px;opacity:.6;transition:transform .2s}
.j2-switch[open] summary svg{transform:rotate(180deg)}
.j2-switch summary:hover{color:var(--j2-purple-link)}
.j2-switch-panel{position:absolute;left:-12px;top:calc(100% + 10px);z-index:30;min-width:280px;background:#fff;border:1px solid var(--j2-rule);border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.14);padding:10px}
.j2-switch-h{margin:4px 10px 8px;font-size:.75rem;letter-spacing:.04em;text-transform:uppercase;color:var(--j2-text-2)}
.j2-switch ul{list-style:none;margin:0;padding:0}
.j2-switch li a{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:10px;color:var(--j2-text);font-size:1rem;font-weight:500}
.j2-switch li a:hover{background:#f5f5f7;text-decoration:none}
.j2-switch li.is-current a{color:var(--j2-purple)}
.j2-switch li.is-current a::after{content:"";margin-left:auto;width:8px;height:8px;border-radius:50%;background:var(--j2-purple)}
.j2-switch-fig{flex:0 0 44px;height:44px;display:flex;align-items:center;justify-content:center;background:#f5f5f7;border-radius:10px}
.j2-switch-fig img{max-width:34px;max-height:34px;width:auto;height:auto}
.j2-switch-all{display:block;margin:6px 10px 4px;padding-top:10px;border-top:1px solid var(--j2-rule);font-size:.9rem;font-weight:500}
.j2-switch-all::after{content:" \203A"}
@media (max-width:560px){.j2-switch-panel{left:-12px;right:auto;min-width:min(280px,calc(100vw - 24px))}}

/* module status */
.j2w-badge{display:inline-block;vertical-align:middle;margin-left:.5rem;padding:.2rem .6rem;border-radius:999px;border:1px solid rgba(201,131,191,.6);color:#e3b8dc;font-size:.72rem;font-weight:600;letter-spacing:.03em;text-transform:uppercase}
.j2w-status{margin:1.4rem auto 0;max-width:44ch;font-size:.9rem;color:var(--j2-on-dark-2)}
