/* Native article tools. All public rules are opt-in, not global theme resets. */
.ben-article-tool{box-sizing:border-box;max-width:100%;margin:1.2em 0;}
.ben-article-tool.ben-photo-block{display:block;width:100%;clear:both;}
.ben-article-tool.ben-photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,2vw,18px);align-items:start;}
.ben-article-tool figure.ben-photo-unit{min-width:0;margin:0 0 1.2em;padding:0;overflow:hidden;}
.ben-article-tool.ben-layout-photo>a,.ben-article-tool figure.ben-photo-unit>a{display:block;width:100%;margin:0;padding:0;}
.ben-article-tool.ben-layout-photo img,.ben-article-tool figure.ben-photo-unit img{display:block;width:100%!important;max-width:100%;height:auto!important;float:none!important;margin:0!important;}
.ben-article-tool.ben-photo-grid figure.ben-photo-unit img{aspect-ratio:4/3;object-fit:cover;}
.ben-article-tool img.ben-photo-shape-square{border-radius:0!important;}
.ben-article-tool img.ben-photo-shape-rounded{border-radius:18px!important;}
.ben-article-tool img.ben-photo-shape-circle{border-radius:50%!important;aspect-ratio:1/1!important;object-fit:cover!important;}
.ben-article-tool figcaption{font-size:.9em;line-height:1.5;margin:.4em 0 0;text-align:left;white-space:pre-line;}
.ben-article-tool .ben-photo-step-title,.ben-article-tool .ben-photo-legend{display:block;white-space:pre-line;}
.ben-article-tool.ben-photo-steps figure{padding-bottom:1em;border-bottom:1px solid currentColor;}
.ben-article-tool.ben-pdf-colored{clear:both;overflow-wrap:anywhere;}
.ben-article-tool.ben-pdf-colored>p{margin:.5em 0;}
.ben-article-tool.ben-pdf-colored>p:first-child{margin-top:0;}
.ben-article-tool.ben-pdf-colored>p:last-child{margin-bottom:0;}
@media(max-width:360px){.ben-article-tool.ben-photo-grid{grid-template-columns:minmax(0,1fr);}}
/* A separate lightbox for native articles; the magazine keeps its own reader. */
.ben-at-dialog{box-sizing:border-box;width:min(94vw,1100px);max-width:94vw;max-height:92vh;max-height:92dvh;background:#172525;color:#fff;border:0;border-radius:12px;padding:12px;overscroll-behavior:contain;}
.ben-at-dialog::backdrop{background:rgba(0,0,0,.8);}
.ben-at-dialog figure{margin:0;text-align:center;}
.ben-at-dialog figure img{display:block;max-width:100%;max-height:68vh;max-height:68dvh;width:auto;height:auto;object-fit:contain;margin:0 auto;border-radius:0;}
.ben-at-dialog figcaption{white-space:pre-line;overflow-wrap:anywhere;padding:8px;color:#fff;max-height:12vh;overflow:auto;}
.ben-at-dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px;}
.ben-at-dialog button{min-width:44px;min-height:44px;padding:6px 12px;border:1px solid #ffffff80;border-radius:6px;background:#243c3b;color:#fff;cursor:pointer;font:inherit;}
.ben-at-dialog button:disabled{opacity:.4;cursor:default;}
.ben-at-dialog button:focus-visible{outline:2px solid #fff;outline-offset:2px;}
/* Admin panel and its preview, not other WordPress panels. */
.ben-at-panel [hidden]{display:none!important;}
.ben-at-panel .ben-at-toolbar,.ben-at-panel .ben-at-options{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.ben-at-panel .ben-at-item{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px;padding:10px 0;border-bottom:1px solid #dcdcde;}
.ben-at-panel .ben-at-item>img{width:76px;height:76px;object-fit:cover;}
.ben-at-panel .ben-at-fields{display:grid;gap:6px;min-width:0;}
.ben-at-panel .ben-at-preview{display:flow-root;padding:12px;border:1px solid #dcdcde;border-radius:4px;background:white;color:#1d2327;max-width:720px;overflow-wrap:anywhere;}
.ben-at-panel .ben-at-preview .ben-article-tool{margin-top:0;}
.ben-at-panel .ben-at-status-error{color:#b32d2e;font-weight:600;}

/* V0.2.75.10 — native article toolbar, grid and visible gallery controls. */
#wp-content-media-buttons .ben-at-open .dashicons,.wp-media-buttons .ben-at-open .dashicons{display:inline-block;vertical-align:middle;line-height:1;width:18px;height:18px;font-size:18px;margin:0 3px 0 0;position:static;transform:none;}
.wp-media-buttons .ben-at-open{display:inline-flex;align-items:center;justify-content:center;gap:3px;}
.ben-article-tool.ben-photo-block.ben-photo-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start;gap:clamp(8px,2vw,18px);}
.ben-article-tool.ben-photo-grid>figure.ben-photo-unit{width:100%!important;max-width:100%!important;min-width:0!important;float:none!important;margin:0!important;}
@media(max-width:360px){.ben-article-tool.ben-photo-block.ben-photo-grid{grid-template-columns:minmax(0,1fr)!important;}}
.ben-at-dialog-stage{position:relative;padding-inline:54px;}
.ben-at-dialog .ben-at-dialog-nav{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;pointer-events:none;}
.ben-at-dialog .ben-at-dialog-nav[hidden]{display:none!important;}
.ben-at-dialog .ben-at-dialog-nav button{pointer-events:auto;font-size:32px;line-height:1;border-radius:50%;width:44px;height:44px;padding:0;display:grid;place-items:center;}
.ben-at-dialog .ben-at-dialog-stage:has(.ben-at-dialog-nav[hidden]){padding-inline:0;}
@media(max-width:600px){.ben-at-dialog-stage{padding-inline:0;}.ben-at-dialog .ben-at-dialog-nav button{background:#243c3be8;box-shadow:0 1px 5px #0006;}.ben-at-dialog .ben-at-dialog-nav{inset-inline:4px;}}
/* Native article lightbox: visible controls, thumbnails and touch navigation. */
.ben-at-dialog .ben-at-dialog-thumbs{display:flex;gap:6px;overflow-x:auto;max-width:100%;padding:5px 2px;overscroll-behavior-inline:contain;}
.ben-at-dialog .ben-at-dialog-thumbs[hidden],.ben-at-dialog figcaption[hidden]{display:none!important;}
.ben-at-dialog .ben-at-dialog-thumbs button{flex:0 0 60px;min-width:0;width:60px;height:48px;min-height:0;padding:2px!important;overflow:hidden;}
.ben-at-dialog .ben-at-dialog-thumbs button[aria-current=true]{border:2px solid #fff;}
.ben-at-dialog .ben-at-dialog-thumbs img{display:block;width:100%!important;height:100%!important;object-fit:cover!important;margin:0!important;}
.ben-at-dialog figure img{touch-action:pan-y pinch-zoom;max-height:58vh;max-height:58dvh;}
.ben-at-dialog figure.ben-at-zoom{overflow:auto;max-height:58vh;max-height:58dvh;}
.ben-at-dialog figure.ben-at-zoom img{width:200%!important;max-width:none!important;max-height:none!important;height:auto!important;touch-action:pan-x pan-y pinch-zoom;}

/* Native article viewer: same compact controls and pan behaviour as the studio. */
html body dialog.ben-at-dialog[open]{position:fixed!important;inset:0!important;margin:auto!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;width:min(97vw,1200px)!important;height:92vh!important;height:92dvh!important;max-width:97vw!important;max-height:92dvh!important;padding:8px!important;overflow:hidden!important;background:#102322!important;color:#fff!important;box-sizing:border-box!important;}
html body dialog.ben-at-dialog .ben-at-dialog-bar{margin:0!important;gap:6px;min-width:0;}
html body dialog.ben-at-dialog button{appearance:none!important;box-sizing:border-box!important;box-shadow:none!important;text-transform:none!important;transform:none!important;letter-spacing:normal!important;float:none!important;margin:0!important;min-width:0!important;max-width:none!important;min-height:0!important;line-height:1!important;}
html body dialog.ben-at-dialog button::before,html body dialog.ben-at-dialog button::after{content:none!important;display:none!important;}
html body dialog.ben-at-dialog :is(.ben-at-close,.ben-at-zoom-button,.ben-at-dialog-nav button){display:grid!important;place-items:center!important;flex:0 0 44px!important;width:44px!important;height:44px!important;padding:0!important;border-radius:50%!important;font:400 28px/1 system-ui,sans-serif!important;color:#fff!important;background:#243c3b!important;border:1px solid #ffffff85!important;}
html body dialog.ben-at-dialog .ben-at-close{background:#dfe4db!important;color:#172a2a!important;}
html body dialog.ben-at-dialog .ben-at-zoom-button svg{width:22px!important;height:22px!important;display:block!important;pointer-events:none;}
html body dialog.ben-at-dialog .ben-at-dialog-stage{min-width:0;min-height:0;padding:0!important;overflow:hidden;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figure{display:flex;flex-direction:column;justify-content:center;min-height:0;min-width:0;width:100%!important;height:100%!important;max-height:none!important;margin:0!important;overflow:hidden;float:none!important;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figure>img{display:block;width:100%!important;height:100%!important;min-height:0;flex:1;max-width:100%!important;max-height:100%!important;object-fit:contain!important;margin:0 auto!important;touch-action:pan-y;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figcaption{flex:none;max-height:4em;overflow:auto;margin:5px 0;padding:0;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figure.ben-at-zoom{display:block;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scroll-behavior:auto;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figure.ben-at-zoom>img{width:var(--ben-at-zoom-w)!important;height:var(--ben-at-zoom-h)!important;max-width:none!important;max-height:none!important;touch-action:pan-x pan-y;user-select:none;cursor:grab;}
html body dialog.ben-at-dialog .ben-at-dialog-stage figure.ben-at-panning>img{cursor:grabbing;}
html body dialog.ben-at-dialog .ben-at-dialog-thumbs button{flex:0 0 58px!important;width:58px!important;height:48px!important;padding:0!important;border:2px solid transparent!important;opacity:.72;background:transparent!important;}
html body dialog.ben-at-dialog .ben-at-dialog-thumbs button[aria-current=true]{border-color:white!important;opacity:1;}
@media(max-height:500px){html body dialog.ben-at-dialog[open]{height:96dvh!important;max-height:96dvh!important;padding:4px!important;}html body dialog.ben-at-dialog .ben-at-dialog-thumbs button{height:36px!important;flex-basis:45px!important;}}

.button.ben-poll-pick-button{display:inline-flex!important;align-items:center!important;justify-content:center;gap:5px;}
.button.ben-poll-pick-button .dashicons{display:inline-block!important;position:static!important;transform:none!important;vertical-align:middle!important;margin:0!important;width:18px!important;height:18px!important;font-size:18px!important;line-height:18px!important;flex:0 0 18px;}
