/* Project 400 v3.6.8 — justified galleries for all news posts and Customizer page galleries.
 * Gallery-only presentation: article text, typography, page copy and surrounding layouts are untouched.
 */
.p400-justified-gallery {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:var(--p400-gallery-gap,8px)!important;
  grid-template-columns:none!important;
  grid-auto-rows:auto!important;
  overflow:visible!important;
}
.p400-justified-gallery > .p400-justified-row {
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:var(--p400-gallery-row-height,220px)!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  gap:var(--p400-gallery-gap,8px)!important;
  overflow:visible!important;
}
.p400-justified-gallery > .p400-justified-row > * {
  position:relative!important;
  display:block!important;
  flex:var(--p400-gallery-item-ratio,1) 1 0px!important;
  box-sizing:border-box!important;
  width:0!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  grid-row:auto!important;
  grid-column:auto!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

/* News posts: every row is justified to the exact width of the article text column. */
body.single-post #main .darcis-article-body .p400-justified-gallery--post {
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  max-width:100%!important;
  margin:clamp(22px,3vw,34px) 0!important;
  padding:0!important;
  gap:8px!important;
  background:transparent!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post > .p400-justified-row {
  width:100%!important;
  gap:8px!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post > .p400-justified-row > :is(figure,.gallery-item,li.blocks-gallery-item) {
  position:relative!important;
  display:block!important;
  flex:var(--p400-gallery-item-ratio,1) 1 0px!important;
  width:0!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  grid-row:auto!important;
  grid-column:auto!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:9px!important;
  background:#4e1111!important;
  isolation:isolate!important;
  box-sizing:border-box!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post > .p400-justified-row > :is(figure,.gallery-item,li.blocks-gallery-item) :is(.gallery-icon,.gallery-icon>a,picture,figure>a,.gallery-item>a,a.p400-gallery-launch) {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  box-sizing:border-box!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post > .p400-justified-row > :is(figure,.gallery-item,li.blocks-gallery-item) img {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  aspect-ratio:auto!important;
  object-fit:cover!important;
  object-position:center!important;
  transform:none!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post > .p400-justified-row > :is(figure,.gallery-item,li.blocks-gallery-item)::before {
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:2!important;
  display:block!important;
  pointer-events:none!important;
  background:linear-gradient(0deg,rgba(78,17,17,.43) 0%,rgba(78,17,17,.14) 25%,rgba(78,17,17,0) 58%)!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post :is(figcaption,.gallery-caption,.wp-caption-text) {
  position:absolute!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  z-index:3!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:10px 12px!important;
  color:#fff!important;
  text-align:left!important;
  font-size:13px!important;
  line-height:1.4!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post .p400-gallery-launch {
  position:absolute!important;
  inset:0!important;
  z-index:5!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:inherit!important;
  background:transparent!important;
  color:transparent!important;
  text-decoration:none!important;
  cursor:zoom-in!important;
  box-shadow:none!important;
}
body.single-post #main .darcis-article-body .p400-justified-gallery--post .p400-gallery-launch:focus-visible {
  outline:3px solid #c8a24a!important;
  outline-offset:-5px!important;
}

/* Customizer-managed ministry and Youth galleries use the same justified rows.
   Their existing headings, section backgrounds, gold trim and visibility controls remain. */
.p400x22-gallery-viewport.p400-justified-gallery,
.p400y19-gallery-track.p400-justified-gallery,
.p400-gallery-standard__viewport.p400-justified-gallery,
.p400m-page.p400x-v3321 .p400x22-gallery-viewport.p400-justified-gallery,
.p400m-page.p400m--youth-ministry .p400y19-gallery-track.p400-justified-gallery {
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  grid-template-columns:none!important;
  grid-auto-rows:auto!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
  gap:8px!important;
  scroll-snap-type:none!important;
  scrollbar-width:none!important;
}
.p400x22-gallery-viewport.p400-justified-gallery > .p400-justified-row,
.p400y19-gallery-track.p400-justified-gallery > .p400-justified-row,
.p400-gallery-standard__viewport.p400-justified-gallery > .p400-justified-row {
  display:flex!important;
  width:100%!important;
  gap:8px!important;
}
.p400x22-gallery-viewport.p400-justified-gallery > .p400-justified-row > .p400x22-gallery-cell,
.p400y19-gallery-track.p400-justified-gallery > .p400-justified-row > .p400y19-gallery-slide,
.p400-gallery-standard__viewport.p400-justified-gallery > .p400-justified-row > .p400-gallery-standard__item {
  display:block!important;
  flex:var(--p400-gallery-item-ratio,1) 1 0px!important;
  width:0!important;
  max-width:none!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  grid-column:auto!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
.p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame,
.p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame,
.p400-gallery-standard__viewport.p400-justified-gallery .p400m-photo-frame,
.p400-gallery-standard__viewport.p400-justified-gallery figure,
.p400m-page.p400x-v3321 .p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame,
.p400m-page.p400m--youth-ministry .p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame {
  position:relative!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  margin:0!important;
  padding:0!important;
  border-radius:3px 3px 18px 3px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
.p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame::after,
.p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame::after,
.p400-gallery-standard__viewport.p400-justified-gallery .p400m-photo-frame::after,
.p400m-page.p400x-v3321 .p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame::after,
.p400m-page.p400m--youth-ministry .p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame::after {
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:2!important;
  display:block!important;
  pointer-events:none!important;
  background:linear-gradient(0deg,rgba(78,17,17,.43) 0%,rgba(78,17,17,.14) 25%,rgba(78,17,17,0) 58%)!important;
}
.p400x22-gallery-viewport.p400-justified-gallery .p400x23-gallery-open,
.p400y19-gallery-track.p400-justified-gallery .p400x23-gallery-open,
.p400-gallery-standard__viewport.p400-justified-gallery .p400x23-gallery-open,
.p400m-page.p400x-v3321 .p400x22-gallery-viewport.p400-justified-gallery .p400x23-gallery-open,
.p400m-page.p400m--youth-ministry .p400y19-gallery-track.p400-justified-gallery .p400x23-gallery-open {
  position:absolute!important;
  inset:0!important;
  z-index:4!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:inherit!important;
  background:transparent!important;
  color:transparent!important;
  line-height:0!important;
  cursor:zoom-in!important;
  box-shadow:none!important;
}
.p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame img,
.p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame img,
.p400-gallery-standard__viewport.p400-justified-gallery img,
.p400m-page.p400x-v3321 .p400x22-gallery-viewport.p400-justified-gallery .p400m-photo-frame img,
.p400m-page.p400m--youth-ministry .p400y19-gallery-track.p400-justified-gallery .p400m-photo-frame img {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:cover!important;
  object-position:center!important;
  border-radius:0!important;
}

/* Shared full-screen viewer: burgundy backdrop, soft fade, no navigation/reload. */
dialog.p400-photo-dialog-v366 {
  position:fixed;
  inset:0;
  box-sizing:border-box;
  width:100vw;
  max-width:100vw;
  height:100dvh;
  max-height:100dvh;
  margin:0;
  padding:clamp(12px,3vw,30px);
  border:0;
  background:rgba(19,8,10,.94);
  color:#fff;
  overflow:hidden;
  opacity:0;
  transition:opacity .19s ease;
  overscroll-behavior:contain;
  touch-action:pan-x pan-y;
}
dialog.p400-photo-dialog-v366[open] {display:grid;place-items:center;}
dialog.p400-photo-dialog-v366.is-visible {opacity:1;}
dialog.p400-photo-dialog-v366::backdrop {background:rgba(12,5,6,.88);}
.p400-photo-dialog-v366 .p400-photo-shell {
  position:relative;
  width:100%;
  height:100%;
  max-width:min(1260px,100%);
  display:flex;
  justify-content:center;
  align-items:center;
}
.p400-photo-dialog-v366 .p400-photo-main {
  max-width:100%;
  max-height:calc(100% - 24px);
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-height:0;
}
.p400-photo-dialog-v366 .p400-photo-main img {
  display:block;
  max-width:min(100%,1200px);
  max-height:calc(100dvh - 126px);
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:5px;
  box-shadow:0 14px 50px #0005;
  opacity:.72;
  transition:opacity .18s ease;
}
.p400-photo-dialog-v366 .p400-photo-main img.is-changing {opacity:1;}
.p400-photo-dialog-v366 .p400-photo-main figcaption {
  font:400 13px/1.45 system-ui,sans-serif;
  text-align:center;
  max-width:80ch;
  max-height:3.3em;
  overflow:hidden;
  color:#f6e9e3;
}
.p400-photo-dialog-v366 .p400-photo-control {
  position:absolute;
  z-index:2;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border:1px solid #ffffff66;
  border-radius:50%;
  background:#361518e6;
  color:#fff;
  font:600 28px/1 system-ui,sans-serif;
  cursor:pointer;
  touch-action:manipulation;
}
.p400-photo-dialog-v366 .p400-photo-control:hover {background:#70282e;}
.p400-photo-dialog-v366 .p400-photo-control:focus-visible {outline:3px solid #e0b94e;outline-offset:3px;}
.p400-photo-dialog-v366 .p400-photo-close {top:8px;right:8px;}
.p400-photo-dialog-v366 .p400-photo-prev {left:6px;top:50%;transform:translateY(-50%);}
.p400-photo-dialog-v366 .p400-photo-next {right:6px;top:50%;transform:translateY(-50%);}
.p400-photo-dialog-v366 .p400-photo-counter {
  position:absolute;
  top:13px;
  left:15px;
  color:#f6e9e3;
  font:600 12px system-ui,sans-serif;
}
@media(max-width:760px) {
  .p400-justified-gallery > .p400-justified-row {gap:6px!important;}
  .p400-justified-gallery--post {gap:6px!important;}
  .p400x22-gallery-viewport.p400-justified-gallery,
  .p400y19-gallery-track.p400-justified-gallery {gap:6px!important;}
}
@media(max-width:600px) {
  dialog.p400-photo-dialog-v366 {padding:10px 8px;}
  .p400-photo-dialog-v366 .p400-photo-main img {max-width:100%;max-height:calc(100dvh - 118px);}
  .p400-photo-dialog-v366 .p400-photo-control {width:39px;height:39px;font-size:25px;}
  .p400-photo-dialog-v366 .p400-photo-prev {left:0;}
  .p400-photo-dialog-v366 .p400-photo-next {right:0;}
}
@media(prefers-reduced-motion:reduce) {
  dialog.p400-photo-dialog-v366,
  .p400-photo-dialog-v366 .p400-photo-main img {transition:none;}
}


/* v3.6.8 — classic WordPress [gallery] shortcode is laid out by PHP.
   This is the primary layout, not a JavaScript-dependent enhancement. */
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] {
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:clamp(22px,3vw,34px) 0!important;
  padding:0!important;
  gap:8px!important;
  box-sizing:border-box!important;
  background:transparent!important;
}
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] > .p400-justified-row {
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:var(--p400-gallery-row-ratio,4 / 1)!important;
  margin:0!important;
  padding:0!important;
  gap:8px!important;
  box-sizing:border-box!important;
}
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] > .p400-justified-row > figure.gallery-item {
  position:relative!important;
  display:block!important;
  flex:var(--p400-gallery-item-ratio,1) 1 0px!important;
  width:0!important;
  max-width:none!important;
  min-width:0!important;
  height:100%!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:9px!important;
  background:#4e1111!important;
  isolation:isolate!important;
  box-sizing:border-box!important;
}
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] .gallery-icon {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
}
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] figure.gallery-item::before {
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:2!important;
  display:block!important;
  pointer-events:none!important;
  background:linear-gradient(0deg,rgba(78,17,17,.34) 0%,rgba(78,17,17,.11) 24%,rgba(78,17,17,0) 56%)!important;
}
body.single-post #main .darcis-article-body
.gallery.p400-justified-gallery--post[data-p400-server-layout="1"] figure.gallery-item .p400-gallery-launch {
  position:absolute!important;
  inset:0!important;
  z-index:5!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:inherit!important;
  background:transparent!important;
  color:transparent!important;
  text-decoration:none!important;
  cursor:zoom-in!important;
  box-shadow:none!important;
}
@media(max-width:600px) {
  body.single-post #main .darcis-article-body
  .gallery.p400-justified-gallery--post[data-p400-server-layout="1"] > .p400-justified-row {
    flex-direction:column!important;
    height:auto!important;
    aspect-ratio:auto!important;
    gap:7px!important;
  }
  body.single-post #main .darcis-article-body
  .gallery.p400-justified-gallery--post[data-p400-server-layout="1"] > .p400-justified-row > figure.gallery-item {
    flex:none!important;
    width:100%!important;
    height:auto!important;
    aspect-ratio:var(--p400-gallery-image-ratio,4 / 3)!important;
  }
}
