/* Under the Loupe. Without the view (no script, no engine, reduced motion, motion off,
 * the editor) the photographs are the native Gallery's own cropped grid on its sheet.
 * Mounted, the root carries .patternpaste-lens-live and the Gallery two track lists the
 * view writes (--patternpaste-lens-x, -y): a grid of explicit tracks whose sizes glide.
 * The column count is decided here: the Gallery's Columns setting, capped per width. */
.patternpaste-designed-lens{--patternpaste-lens-film:var(--pp-ink);--patternpaste-lens-mark:var(--pp-primary);--patternpaste-lens-rule:var(--pp-rule);--patternpaste-lens-pad:clamp(6px,1cqi,12px)}
.patternpaste-designed-lens[data-treatment="designed"]{--patternpaste-lens-paper:#efeadf;--patternpaste-lens-ink:#1c2230;--patternpaste-lens-film:#16181c;--patternpaste-lens-mark:#c13221;--patternpaste-lens-rule:#1c223040;font-family:"Avenir Next",Avenir,"Segoe UI",sans-serif}
.patternpaste-designed-lens[data-treatment="designed"]:not(.has-background){background:var(--patternpaste-lens-paper)}
.patternpaste-designed-lens[data-treatment="designed"]:not(.has-text-color){color:var(--patternpaste-lens-ink)}
.patternpaste-designed-lens .patternpaste-lens-intro{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr);align-items:end;gap:var(--patternpaste-designed-block-gap,clamp(16px,3cqi,48px));padding-bottom:clamp(20px,3cqi,36px);margin-bottom:clamp(16px,2.4cqi,28px);border-bottom:1px solid var(--patternpaste-lens-rule)}
.patternpaste-designed-lens .patternpaste-lens-kicker{grid-column:1/-1;font-size:12px;line-height:1.5;letter-spacing:.16em}
.patternpaste-designed-lens .patternpaste-lens-heading{font-size:clamp(38px,5.6cqi,84px);line-height:1;letter-spacing:-.03em;overflow-wrap:break-word}
.patternpaste-designed-lens .patternpaste-lens-lede{max-width:38ch;font-size:clamp(15px,1.25cqi,18px);line-height:1.55}
.patternpaste-designed-lens[data-treatment="designed"] .patternpaste-lens-heading{font-family:Georgia,"Times New Roman",serif;font-style:italic;font-weight:400}
.patternpaste-designed-lens[data-treatment="designed"] :is(.patternpaste-lens-kicker,.patternpaste-lens-bar,.patternpaste-lens-note){font-family:ui-monospace,Menlo,Consolas,monospace}
.patternpaste-designed-lens[data-treatment="designed"]:not(.has-text-color) .patternpaste-lens-intro:not(.has-text-color) .patternpaste-lens-kicker:not(.has-text-color){color:var(--patternpaste-lens-mark)}
.patternpaste-designed-lens .patternpaste-lens-note{margin-top:clamp(14px,2cqi,24px);font-size:13px;line-height:1.5;letter-spacing:.04em}
.editor-styles-wrapper .patternpaste-designed-lens .patternpaste-lens-intro>.block-editor-inner-blocks{display:contents}
.editor-styles-wrapper .patternpaste-designed-lens .patternpaste-lens-intro>.block-editor-inner-blocks>.block-editor-block-list__layout{display:grid;grid-column:1/-1;grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr);align-items:end;gap:var(--patternpaste-designed-block-gap,clamp(16px,3cqi,48px))}
.editor-styles-wrapper .patternpaste-designed-lens .patternpaste-lens-intro>.block-editor-inner-blocks>.block-editor-block-list__layout>.patternpaste-lens-kicker{grid-column:1/-1}

/* The sheet: the photographs on a strip of film, in every mode. */
.patternpaste-designed-lens .patternpaste-lens-gallery{--patternpaste-lens-columns:3;padding:var(--patternpaste-lens-pad)}
.patternpaste-designed-lens .patternpaste-lens-gallery:not(.has-background){background:var(--patternpaste-lens-film)}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-1{--patternpaste-lens-columns:1}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-2{--patternpaste-lens-columns:2}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-4{--patternpaste-lens-columns:4}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-5{--patternpaste-lens-columns:5}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-6{--patternpaste-lens-columns:6}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-7{--patternpaste-lens-columns:7}
.patternpaste-designed-lens .patternpaste-lens-gallery.columns-8{--patternpaste-lens-columns:8}
/* A caption sits on its own dark slab, never on whatever the photograph happens to be. */
.patternpaste-designed-lens .patternpaste-lens-gallery figure.wp-block-image:has(figcaption)::before{display:none}
.patternpaste-designed-lens .patternpaste-lens-gallery figure.wp-block-image figcaption{background:rgba(14,15,18,.84);color:#fff;text-shadow:none;padding:8px 12px;font-family:inherit;font-size:12px;font-weight:500;line-height:1.4;text-align:left}

/* The bar the view adds: which frame the loupe is on, and how to drive it. */
.patternpaste-designed-lens .patternpaste-lens-bar{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding-bottom:10px;font-size:11px;line-height:1.5;letter-spacing:.14em;text-transform:uppercase}
.patternpaste-designed-lens .patternpaste-lens-count{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.patternpaste-designed-lens .patternpaste-lens-hint{text-align:right;opacity:.8;text-transform:none;letter-spacing:.02em}
.patternpaste-designed-lens .patternpaste-lens-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* The loupe: explicit tracks, the rest cell in the Gallery's own crop, an outer size that never moves. */
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery.wp-block-gallery{display:grid;grid-template-columns:var(--patternpaste-lens-x);grid-template-rows:var(--patternpaste-lens-y);height:calc((100cqi - 2 * var(--patternpaste-lens-pad)) / var(--patternpaste-lens-c,3) * var(--patternpaste-lens-rest,var(--patternpaste-lens-shape,.75)) * var(--patternpaste-lens-r,2));outline-offset:3px;counter-reset:patternpaste-lens-frame}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery:focus-visible{outline:2px solid currentColor}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery.wp-block-gallery figure.wp-block-image:not(#individual-image){width:auto;height:auto;min-width:0;min-height:0;margin:0;overflow:hidden;cursor:zoom-in;counter-increment:patternpaste-lens-frame}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.wp-block-image img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;-webkit-user-drag:none;user-select:none}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.wp-block-image::after{content:counter(patternpaste-lens-frame,decimal-leading-zero);position:absolute;top:6px;left:6px;padding:2px 5px;background:rgba(14,15,18,.72);color:#fff;font:600 10px/1.3 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.08em;pointer-events:none}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.patternpaste-lens-open img{outline:3px solid var(--patternpaste-lens-mark);outline-offset:-3px}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.wp-block-image figcaption{right:auto;bottom:12px;left:12px;width:max-content;max-width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.wp-block-image:not(.patternpaste-lens-open) figcaption{opacity:0;visibility:hidden}

/* Core's Enlarge button, on the magnified frame only, with a finger-sized target. */
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery .lightbox-trigger{opacity:0;pointer-events:none;width:44px;height:44px;top:10px!important;right:10px!important;border-radius:50%;background-color:rgba(14,15,18,.6)!important}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery .lightbox-trigger svg{width:16px;height:16px}
.patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.patternpaste-lens-open .lightbox-trigger{opacity:1;pointer-events:auto}

/* A tablet keeps four columns; a phone three square cells, where a tap magnifies. */
@container (max-width:900px){
  .patternpaste-designed-lens .patternpaste-lens-gallery{--patternpaste-lens-most:4}
}
@container (max-width:600px){
  .patternpaste-designed-lens .patternpaste-lens-intro{grid-template-columns:1fr}
  .patternpaste-designed-lens .patternpaste-lens-bar{flex-direction:column;gap:4px}
  .patternpaste-designed-lens .patternpaste-lens-hint{text-align:left}
  .patternpaste-designed-lens .patternpaste-lens-gallery{--patternpaste-lens-most:3;--patternpaste-lens-rest:max(1,var(--patternpaste-lens-shape,.75))}
  .patternpaste-designed-lens.patternpaste-lens-live .patternpaste-lens-gallery figure.wp-block-image figcaption{bottom:8px;left:8px;max-width:calc(100% - 16px);padding:6px 9px;font-size:11px}
  .editor-styles-wrapper .patternpaste-designed-lens .patternpaste-lens-intro>.block-editor-inner-blocks>.block-editor-block-list__layout{grid-template-columns:1fr}
}
