/* Behaviors formerly supplied by the theme, plus the dependency-free gallery. */
html { scroll-behavior:smooth; }
.x-masthead { position:sticky; top:0; z-index:9999; }
/* Negative row gutters in the original overhang by 7px. Clip only the overhang. */
.x-main { overflow-x:clip; }
.x-scroll-top.in { opacity:.375; margin-bottom:0; cursor:pointer; }
.x-scroll-top.in:hover { opacity:1; }
a:focus-visible,button:focus-visible { outline:2px solid #ff8500; outline-offset:3px; }
.has-graphic:focus-visible .x-graphic-primary:not(:only-child) { opacity:0; }
.has-graphic:focus-visible .x-graphic-secondary { opacity:1; }
.illustration-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding-bottom:10px; }
.illustration-card { min-width:0; background:white; border:1px solid #e5e5e5; }
.gallery-open { display:block; position:relative; aspect-ratio:1.25; overflow:hidden; }
.gallery-open img { display:block; width:100%;height:100%;object-fit:cover; }
.gallery-open::after { content:'⌕';position:absolute;inset:0;display:grid;place-items:center;background:rgba(0,0,0,.5);color:white;font:40px sans-serif;opacity:0;transition:opacity .3s; }
.gallery-open:hover::after,.gallery-open:focus-visible::after { opacity:1; }
.gallery-caption { display:block; padding:30px 10px 40px; min-height:88px; font:700 15px/18px Raleway,sans-serif; text-align:center;color:#000; }
.gallery-caption:hover {color:#000;}
.gallery-dialog { position:fixed; inset:0; width:100vw; max-width:none; height:100dvh;max-height:none;padding:0;margin:0;border:0;background:rgba(30,30,30,.9);color:#ccc;z-index:20000; }
.gallery-dialog::backdrop {background:transparent;}
.gallery-dialog .lightbox-image { position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:100%;max-height:calc(100% - 88px);width:auto;height:auto; }
.gallery-toolbar {position:absolute;top:0;right:0;display:flex;z-index:2;}
.gallery-dialog button {color:#ccc;background:rgba(30,30,30,.5);border:0;border-radius:0;box-shadow:none;text-shadow:none;cursor:pointer;width:44px;height:44px;margin:0;padding:0;font:24px/44px sans-serif;}
.gallery-dialog button:hover {background:rgba(0,0,0,.7);color:white;}
.gallery-counter {position:absolute;left:40px;top:14px;font:13px sans-serif;}
.gallery-prev,.gallery-next {position:absolute;top:calc(50% - 22px);z-index:2;}
.gallery-prev {left:0;}.gallery-next{right:0;}
.gallery-thumbs {position:absolute;right:0;top:44px;bottom:0;width:220px;background:#ddd;overflow:auto;display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:4px;padding:4px;z-index:3;}
.gallery-thumbs[hidden],.gallery-share[hidden]{display:none;}
.gallery-thumbs button {width:100%;height:80px;}.gallery-thumbs img{width:100%;height:100%;object-fit:cover;}
.gallery-share {position:absolute;inset:35% 10% auto;background:white;padding:30px;color:#444;text-align:center;z-index:4;}
.gallery-share a{margin:10px;display:inline-block;}.gallery-share input{width:100%;}
@media(max-width:1170px){.illustration-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:960px){.illustration-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.illustration-grid{grid-template-columns:1fr;}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto;}*,*::before,*::after{transition:none!important;}}
/* Essential Grid used rounded masonry placement and six visible rows. */
.illustration-grid{display:block;position:relative;padding:0;}
.illustration-card{position:absolute;}
.gallery-caption{padding:30px 30px 40px;min-height:0;border-top:1px solid #e5e5e5;}
.x-bg-layer-lower-image{top:auto;bottom:0;height:110%;}
/* Flat image swaps do not need 3-D layers; keeps offscreen screenshot painting reliable. */
.x-graphic-primary:not(:only-child),.x-graphic-secondary {backface-visibility:visible;}
/* The original thumbnails use CSS background cover, whose subpixel rasterization
   differs from object-fit even when the box and image are the same size. */
.gallery-open{background-size:cover;background-position:center;background-repeat:no-repeat;}
.gallery-open img{visibility:hidden;}
/* Match the original gallery's composited image resampling. Clip row gutters at
   the document boundary so offscreen image layers still paint in full-page captures. */
.x-main{overflow-x:visible;}
html{overflow-x:clip;}
.gallery-open{transform:translate3d(0,0,0);backface-visibility:hidden;}
.home .x-main{overflow-x:clip;}
.gallery-dialog .lightbox-image{cursor:zoom-in;touch-action:none;}
.gallery-dialog .lightbox-image.zoomed{max-width:none;max-height:none;cursor:zoom-out;}
