/* Scoped product galleries; ordinary article images keep their layout. */
.nb-article-gallery{margin:22px 0;clear:both;min-width:0}
.nb-article-gallery .nb-gallery-main,.nb-article-gallery .nb-gallery-grid{display:grid;gap:10px;align-items:start;min-width:0}
.nb-article-gallery .nb-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.nb-article-gallery[data-nb-columns="2"] .nb-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.nb-article-gallery[data-nb-columns="4"] .nb-gallery-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.nb-article-gallery[data-nb-layout="single"] .nb-gallery-grid{grid-template-columns:minmax(0,1fr)}
.nb-article-gallery .nb-gallery-main{grid-template-columns:minmax(0,1fr);margin-bottom:10px}
.nb-article-gallery[data-nb-main="2"] .nb-gallery-main{grid-template-columns:repeat(2,minmax(0,1fr))}
.nb-article-gallery figure{min-width:0;margin:0!important;padding:0!important;border:0!important;background:transparent!important}
.nb-article-gallery figure>a{display:flex!important;align-items:center;justify-content:center;aspect-ratio:4/3;min-width:0;padding:8px;border:1px solid #cfd8e6;border-radius:9px;background:#f8faff;overflow:hidden;cursor:zoom-in}
.nb-article-gallery figure>a img{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;border:0!important;border-radius:0!important;box-shadow:none!important;margin:0!important;padding:0!important}
.nb-article-gallery .nb-gallery-main>figure>a{aspect-ratio:3/2;max-height:480px}
.nb-article-gallery[data-nb-layout="single"] figure>a{aspect-ratio:auto;max-height:none}
.nb-article-gallery[data-nb-layout="single"] figure>a img{height:auto!important;max-height:680px!important}
.nb-article-gallery figcaption{font:inherit;font-size:12px!important;line-height:1.6!important;text-align:center;color:#8491a6;margin:7px 0 0!important;padding:0 4px!important;overflow-wrap:anywhere}
.nb-article-gallery a:focus-visible{outline:2px solid #2563eb;outline-offset:3px}
.nb-gallery-warning{border-left:3px solid #d3a23d;background:#fff9e9;padding:9px 12px!important;font-size:12px!important;color:#806a3c!important;line-height:1.6!important}
@media(max-width:600px){.nb-article-gallery{margin:16px 0}.nb-article-gallery .nb-gallery-grid,.nb-article-gallery[data-nb-columns="4"] .nb-gallery-grid,.nb-article-gallery[data-nb-columns="2"] .nb-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.nb-article-gallery[data-nb-layout="single"] .nb-gallery-grid{grid-template-columns:minmax(0,1fr)}.nb-article-gallery[data-nb-main="2"] .nb-gallery-main{grid-template-columns:minmax(0,1fr)}.nb-article-gallery figure>a{padding:5px;border-radius:7px}.nb-article-gallery figcaption{font-size:11px!important}}

/* Seamless justified matrix: no per-image frames or captions interrupt the rows. */
.nb-article-gallery[data-nb-layout="justified"] .nb-gallery-grid{display:block}
.nb-article-gallery .nb-justified-row{display:flex;gap:10px;width:100%;margin:0 0 10px;padding:0;align-items:stretch;box-sizing:border-box}
.nb-article-gallery .nb-justified-row:last-child{margin-bottom:0}
.nb-article-gallery .nb-justified-row>figure{height:100%;width:0;min-width:0;overflow:hidden}
.nb-article-gallery[data-nb-layout="justified"] .nb-justified-row>figure>a{box-sizing:border-box;width:100%;height:100%;min-height:0;aspect-ratio:auto;padding:0;border:1px solid #cfd8e6;border-radius:0;background:transparent}
.nb-article-gallery[data-nb-layout="justified"] figcaption{display:none!important}
.nb-article-gallery[data-nb-layout="justified"] .nb-justified-row img{width:100%!important;height:100%!important;object-fit:contain!important}

/* Fixed main/detail compositions, arranged as one aligned matrix. */
.nb-article-gallery[data-nb-layout="feature"] figure>a{box-sizing:border-box;padding:0!important;border:1px solid #cfd8e6;border-radius:0;background:#fff}
.nb-article-gallery[data-nb-layout="feature"] figcaption{display:none!important}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:10px;aspect-ratio:3/2;max-height:560px;min-height:260px}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-main{grid-template-columns:minmax(0,1fr);margin-bottom:0;align-items:stretch;min-height:0}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(var(--nb-detail-count,2),minmax(0,1fr));align-items:stretch;min-height:0}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-gallery-no-details{grid-template-columns:minmax(0,1fr)}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] figure{height:100%;min-height:0}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] figure>a{aspect-ratio:auto;min-height:0;height:100%;max-height:none;width:100%}
@media(max-width:600px){
.nb-article-gallery[data-nb-layout="feature"][data-nb-main="2"]>.nb-gallery-main{grid-template-columns:repeat(2,minmax(0,1fr))}
.nb-article-gallery[data-nb-layout="feature"][data-nb-columns="3"]>.nb-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]{display:block;aspect-ratio:auto;max-height:none;min-height:0}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-main{margin-bottom:10px}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"][data-nb-columns="3"]>.nb-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] figure{height:auto}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] figure>a{aspect-ratio:4/3;height:auto}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-main figure>a{aspect-ratio:3/2}
}

/* Fixed-count vertical rows use intrinsic proportions: no capped main width or letterboxing. */
.nb-article-gallery[data-nb-layout="feature"]:not([data-nb-direction="horizontal"])>.nb-gallery-main,
.nb-article-gallery[data-nb-layout="feature"]:not([data-nb-direction="horizontal"])>.nb-gallery-grid{display:block}
.nb-article-gallery[data-nb-layout="feature"] .nb-fixed-row>figure>a{width:100%;height:100%;aspect-ratio:auto;max-height:none;min-height:0}
.nb-article-gallery[data-nb-layout="feature"] .nb-fixed-row>figure>a img{width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important}
@media(max-width:600px){.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-main,.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"]>.nb-gallery-grid{display:block}.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] .nb-fixed-row>figure{height:100%}.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"] .nb-fixed-row>figure>a{height:100%;aspect-ratio:auto}}

/* Natural-height right stacks: solve both column widths together, keeping every image intact. */
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-fit{aspect-ratio:auto;height:var(--nb-side-height);min-height:0;max-height:none}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-stack{display:block;aspect-ratio:auto;height:auto;min-height:0;max-height:none}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-stack>.nb-gallery-main{display:block;margin-bottom:10px}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-stack>.nb-gallery-grid{display:block}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-stack .nb-fixed-row>figure{height:100%}
.nb-article-gallery[data-nb-layout="feature"][data-nb-direction="horizontal"].nb-horizontal-stack .nb-fixed-row>figure>a{height:100%;aspect-ratio:auto;max-height:none}
