.pgm-heading{text-align:center}.pgm-gallery{background:#808080;width:100%;box-sizing:border-box;padding:16px;color:white}.pgm-toolbar{display:flex;justify-content:center;align-items:center;gap:12px;padding:8px;flex-wrap:wrap}.pgm-gallery button{cursor:pointer;color:#222;background:#eee;border:1px solid #ccc;padding:8px 14px;border-radius:4px;font:inherit}.pgm-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:12px;align-items:center}.pgm-gallery .pgm-thumb{background:none;border:0;padding:0;display:flex;justify-content:center;align-items:center}.pgm-thumb img{max-width:100%;max-height:240px;width:auto;height:auto;border:1px solid #d3d3d3;box-sizing:border-box}.pgm-stage{display:flex;align-items:center;justify-content:space-between;gap:8px}.pgm-stage img{min-width:0;max-width:calc(100% - 100px);max-height:75vh;width:auto;height:auto;object-fit:contain;border:2px solid #d3d3d3}.pgm-gallery [hidden]{display:none!important}.pgm-gallery:fullscreen{overflow:auto;width:100%;height:100%;background:#808080}.pgm-gallery:fullscreen .pgm-stage img{max-height:85vh}.pgm-gallery button:focus-visible{outline:3px solid white;outline-offset:3px}

.pgm-gallery-post .pgm-wrap,.pgm-gallery-post .pgm-gallery{width:100%;max-width:none;min-width:0}.pgm-gallery-post .entry-content,.pgm-gallery-post .wp-block-post-content,.pgm-gallery-post article,.pgm-gallery-post #primary,.pgm-gallery-post .content-area,.pgm-gallery-post main{width:100%;max-width:none;flex:1 1 100%;box-sizing:border-box}.pgm-gallery-post .entry-content>.pgm-wrap,.pgm-gallery-post .wp-block-post-content>.pgm-wrap{max-width:none!important;width:100%}.pgm-gallery-post #secondary,.pgm-gallery-post .widget-area,.pgm-gallery-post .sidebar{display:none}.pgm-gallery-post .entry-title,.pgm-gallery-post .wp-block-post-title{display:none}.pgm-gallery-post .pgm-heading h2{display:block}

/* Gallery width: override theme content constraints and use a flexible image stage. */

.pgm-gallery-post .pgm-wrap,.pgm-gallery-post .pgm-gallery,.pgm-gallery-post .pgm-grid,.pgm-gallery-post .pgm-view,.pgm-gallery-post .pgm-stage{width:100%!important;max-width:none!important;min-width:0;box-sizing:border-box;align-self:stretch;margin-inline:0!important}

.pgm-gallery-post .pgm-gallery{display:block!important; padding:12px;}

.pgm-gallery-post .pgm-stage{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;}

.pgm-gallery-post .pgm-stage img{display:block;object-fit:contain;box-sizing:border-box;justify-self:center;}

.pgm-gallery-post .pgm-stage img{width:auto!important;height:auto!important;max-width:100%!important;max-height:75vh!important;border:2px solid #d3d3d3;}

.pgm-gallery-post .pgm-gallery:fullscreen .pgm-stage img{max-height:85vh!important;}

.pgm-gallery-post .pgm-gallery:fullscreen{width:100%!important;height:100%!important;}

.pgm-gallery-post .entry-content,.pgm-gallery-post .wp-block-post-content,.pgm-gallery-post .pgm-wrap{--wp--style--global--content-size:100%;--wp--style--global--wide-size:100%;max-width:none!important;}

/* Gallery-only viewport breakout, independent of theme wrapper widths. */

body.pgm-gallery-post{overflow-x:clip}

.pgm-gallery-post .pgm-gallery:not(:fullscreen){position:relative!important;left:50%!important;width:var(--pgm-viewport-width,100vw)!important;max-width:none!important;margin-left:calc(var(--pgm-viewport-width,100vw) / -2)!important;margin-right:0!important;}

.pgm-gallery-post .pgm-gallery .pgm-toolbar{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;justify-content:center;align-items:center;gap:12px;margin:0 0 30px!important;padding:8px 0 0!important;overflow-x:auto;}

.pgm-gallery-post .pgm-gallery button:not(.pgm-thumb){border-radius:8px!important;white-space:nowrap;flex:0 0 auto;margin:0!important;}

.pgm-gallery-post .pgm-gallery .pgm-stage img{width:auto!important;height:auto!important;max-width:100%!important;max-height:75vh!important;object-fit:contain;justify-self:center;align-self:center;box-sizing:border-box;padding:0!important;aspect-ratio:auto!important;}

.pgm-gallery-post .pgm-gallery:fullscreen .pgm-stage img{max-height:85vh!important;}

@media(max-width:600px){.pgm-gallery-post .pgm-gallery .pgm-toolbar{justify-content:safe center;gap:6px}.pgm-gallery-post .pgm-toolbar button{font-size:12px;padding:7px 8px}}

.pgm-gallery-post .pgm-gallery:not(:fullscreen){left:calc(50% + var(--pgm-offset,0px))!important;}



.pgm-event-cards {display:grid;grid-template-columns:1fr;gap:18px;width:100%;max-width:none;}

.pgm-event-cards .pgm-event-card {display:flex;align-items:center;gap:16px;min-height:132px;padding:12px;box-sizing:border-box;border:1px solid #aaa;border-radius:8px;box-shadow:0 2px 5px #0002;text-decoration:none;color:inherit;}

.pgm-event-cards .pgm-event-card:hover,.pgm-event-cards .pgm-event-card:focus-visible {border-color:#555;box-shadow:0 3px 8px #0003;}

.pgm-event-cards .pgm-event-card-image {width:108px!important;height:108px!important;max-width:108px!important;flex:0 0 108px;object-fit:cover;object-position:center top;display:block;margin:0!important;border-radius:3px;}

.pgm-event-card-text {flex:1;min-width:0;text-align:center;}

.pgm-event-card-text h2,.pgm-event-card-text p {margin:4px 0!important;text-align:center;overflow-wrap:anywhere;}

.pgm-event-card-text h2 {font-size:1.3rem;}

@media(max-width:480px){.pgm-event-cards .pgm-event-card-image{width:80px!important;height:80px!important;max-width:80px!important;flex-basis:80px;}.pgm-event-cards .pgm-event-card{gap:10px;}}

.pgm-event-cards{grid-template-columns:repeat(var(--pgm-columns,2),minmax(0,1fr));align-items:stretch;container-type:inline-size;}

.pgm-event-cards .pgm-event-card{min-width:0;height:100%;gap:12px;}

.pgm-event-cards .pgm-event-card-image{width:min(108px,35%)!important;max-width:35%!important;height:108px!important;max-height:108px!important;min-height:108px!important;aspect-ratio:auto!important;flex:0 0 min(108px,35%);object-fit:cover!important;object-position:center top!important;}

@media(max-width:900px){.pgm-event-cards{grid-template-columns:repeat(min(var(--pgm-columns,2),2),minmax(0,1fr));}}

@media(max-width:550px){.pgm-event-cards{grid-template-columns:1fr;}}



/* Uniform card rows; narrow columns retain a fixed thumbnail height. */

.pgm-event-cards{grid-auto-rows:1fr;}

.pgm-event-cards .pgm-event-card{min-height:134px;}



/* Gallery thumbnails only: equal height, intrinsic aspect ratio, flexible rows. */

.pgm-gallery .pgm-grid{display:flex!important;flex-wrap:wrap!important;justify-content:center;align-items:center;gap:12px;}

.pgm-gallery .pgm-grid .pgm-thumb{display:flex!important;flex:0 0 auto!important;width:auto!important;height:160px!important;min-height:160px!important;max-height:160px!important;max-width:100%!important;padding:0!important;margin:0!important;border:0!important;align-items:center;justify-content:center;box-sizing:border-box;}

.pgm-gallery .pgm-grid .pgm-thumb img{display:block!important;width:auto!important;height:160px!important;min-height:160px!important;max-height:160px!important;max-width:100%!important;aspect-ratio:auto!important;object-fit:contain!important;padding:0!important;margin:0!important;border:1px solid #d3d3d3!important;box-sizing:border-box;}



/* Rounded corners on gallery thumbnails only. */

.pgm-gallery .pgm-grid .pgm-thumb,.pgm-gallery .pgm-grid .pgm-thumb img{border-radius:8px!important;}

.pgm-gallery .pgm-grid .pgm-thumb{overflow:hidden;}



/* Hidden state must override the thumbnail flex layout. */

.pgm-gallery .pgm-grid[hidden],.pgm-gallery .pgm-view[hidden],.pgm-gallery .pgm-toolbar [hidden]{display:none!important;}


.pgm-loading[hidden]{display:none!important}.pgm-loading{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:99999;background:#333;color:white;padding:24px;border-radius:12px;box-shadow:0 4px 25px #0008;display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;pointer-events:none;max-width:85vw}.pgm-gear{font-size:48px;line-height:1;animation:pgm-spin 2s linear infinite}@keyframes pgm-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.pgm-gear{animation:none}}

.pgm-gallery .pgm-filename{text-align:center;color:#fff;margin:8px 0 0;font-size:16px;overflow-wrap:anywhere}.pgm-gallery [data-download]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;background:#eee;color:#222;border:1px solid #ccc;border-radius:8px;padding:8px 12px;text-decoration:none;line-height:1}.pgm-gallery [data-download]:focus-visible{outline:3px solid white;outline-offset:3px}.pgm-gallery [data-download] svg{display:block}.pgm-gallery:fullscreen .pgm-stage img{max-height:calc(85vh - 32px)!important}
