/* New Ross Photo Gallery v2.0.19 — contained entirely within gallery contexts. */
body.newross-gallery-page #content {
  box-sizing: border-box;
  min-width: 0;
  display: flow-root;
}
body.newross-gallery-page #left-column { display: none !important; }
body.newross-gallery-page #main-column {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}
body.newross-gallery-page #main-column > .entry-content {
  float: none;
  width: 100%;
  box-sizing: border-box;
}
body.newross-gallery-page #main-column > .entry-content > .inner {
  box-sizing: border-box;
  max-width: 100%;
  padding: clamp(12px, 3vw, 27px) !important;
  margin: 0 !important;
}
body.newross-gallery-page #content .entry-title {
  margin: 0 0 14px;
  padding: 0 0 12px;
  font-size: clamp(30px, 4vw, 41px);
  line-height: 1.18;
  text-align: left;
}
.nr-gallery, .nr-gallery * { box-sizing: border-box; }
.nr-gallery { width: 100%; min-width: 0; margin: 16px 0 24px; }
.nr-gallery-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  margin: 0 0 20px;
  padding: 0 2px 13px;
  color: #4b6260;
  border-bottom: 1px solid #dbe5de;
  font-size: 15px;
}
.nr-gallery-count { font-weight: 700; color: #225847; }
.nr-gallery-tip { font-size: 14px; }
.nr-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  width: 100%;
  min-width: 0;
}
#content .nr-gallery-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e2e9e2;
  border-radius: 11px;
  box-shadow: 0 3px 12px rgba(15, 55, 43, .065);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
#content .nr-gallery-card:hover {
  transform: translateY(-3px);
  border-color: #bed5c6;
  box-shadow: 0 9px 22px rgba(15, 55, 43, .12);
}
#content .nr-gallery-card:focus-visible { outline: 3px solid #246e87; outline-offset: 3px; }
#content .nr-gallery-figure {
  float: none !important;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  border: 0;
}
.nr-gallery-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #edf1eb;
}
body.newross-gallery-page #main-column .entry-content .nr-gallery-image-wrap img,
#content .entry-content .nr-gallery-image-wrap img {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  aspect-ratio: 4 / 3;
  object-fit: cover !important;
  object-position: center;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  transition: transform .28s ease;
}
#content .nr-gallery-card:hover img { transform: scale(1.045); }
#content .nr-gallery-figure figcaption {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 10px 12px 12px;
  margin: 0;
  min-height: 45px;
  color: #244e45;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.38;
  text-align: left;
}
.nr-gallery-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 6px;
  padding-top: 20px;
  border-top: 1px solid #dbe5de;
  font-size: 14px;
  color: #516761;
}
.nr-gallery-page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#content .nr-gallery-page-links > :is(a,span) {
  display: inline-flex;
  min-width: 39px;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #ccdad0;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 600;
  color: #255747;
  background: #fff;
}
#content .nr-gallery-page-links > a:hover { background: #ecf4ee; }
#content .nr-gallery-page-links > span[aria-current="page"] {
  border-color: #295e44;
  background: #295e44;
  color: #fff;
}
/* The lightbox is a real modal dialog; it can show the original uncropped image. */
.nr-gallery-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(98vw, 1200px);
  max-width: 98vw;
  max-height: 96dvh;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: none;
  border-radius: 12px;
  color: #fff;
  background: #111c17;
  box-shadow: 0 22px 80px #0008;
}
.nr-gallery-lightbox::backdrop { background: rgba(3, 15, 10, .89); }
.nr-gallery-lightbox-inner {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr) 54px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-height: 96dvh;
  padding: 40px 8px 8px;
}
.nr-gallery-lightbox .nr-gallery-large {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(96dvh - 115px);
  margin: auto;
  object-fit: contain;
}
.nr-gallery-lightbox button {
  appearance: none;
  color: #fff;
  border: 0;
  background: rgba(255,255,255,.14);
  cursor: pointer;
  font: inherit;
}
.nr-gallery-lightbox button:hover { background: rgba(255,255,255,.27); }
.nr-gallery-lightbox button:focus-visible { outline: 3px solid #a3dac3; outline-offset: 3px; }
.nr-gallery-lightbox .nr-gallery-close {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 2;
  width: 35px;
  height: 35px;
  border-radius: 100%;
  font-size: 27px;
  line-height: 1;
}
.nr-gallery-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  border-radius: 8px;
  font-size: 22px !important;
}
.nr-gallery-arrow[hidden] { display: none; }
.nr-gallery-prev { grid-column: 1; grid-row: 1; justify-self: center; }
.nr-gallery-next { grid-column: 3; grid-row: 1; justify-self: center; }
.nr-gallery-lightbox-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  padding: 12px 15px 3px;
  color: #f0f4f1;
  font-size: 15px;
  line-height: 1.35;
}
.nr-gallery-position { white-space: nowrap; color: #b7cbbf; }
@media (max-width: 840px) {
  .nr-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
}
@media (max-width: 480px) {
  body.newross-gallery-page #main-column > .entry-content > .inner { padding: 12px !important; }
  .nr-gallery-intro { align-items: flex-start; }
  .nr-gallery-tip { display: none; }
  .nr-gallery-grid { gap: 10px; }
  #content .nr-gallery-figure figcaption { padding: 8px 9px 10px; font-size: 13px; min-height: 44px; }
  .nr-gallery-lightbox { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  .nr-gallery-lightbox-inner { grid-template-columns: 42px minmax(0,1fr) 42px; max-height: 100dvh; padding: 46px 3px 8px; }
  .nr-gallery-lightbox .nr-gallery-large { max-height: calc(100dvh - 120px); }
  .nr-gallery-arrow { width: 37px; height: 44px; }
}
@media (max-width: 350px) {
  .nr-gallery-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .nr-gallery-card, .nr-gallery-card img { transition: none !important; }
}

/* If the legacy 10Web shortcode cannot be replaced, give its existing
   standard-thumbnail markup a fluid, touch-friendly layout as a fallback. */
body.newross-gallery-page [id^="bwg_container"] { max-width: 100% !important; min-width: 0 !important; }
body.newross-gallery-page .bwg-container.bwg-standard-thumbnails,
body.newross-gallery-page [class*="bwg-container-"][class*="bwg-standard-thumbnails"] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  justify-content: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.newross-gallery-page .bwg-container.bwg-standard-thumbnails .bwg-item,
body.newross-gallery-page [class*="bwg-standard-thumbnails"] .bwg-item {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 9px;
  overflow: hidden;
}
body.newross-gallery-page [class*="bwg-standard-thumbnails"] .bwg-item img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
@media (max-width: 840px) {
  body.newross-gallery-page [class*="bwg-standard-thumbnails"][class*="bwg-container"],
  body.newross-gallery-page .bwg-container.bwg-standard-thumbnails { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 350px) {
  body.newross-gallery-page [class*="bwg-standard-thumbnails"][class*="bwg-container"],
  body.newross-gallery-page .bwg-container.bwg-standard-thumbnails { grid-template-columns: minmax(0, 1fr) !important; }
}
/* Gutenberg's core image galleries elsewhere in the theme also adapt. */
.entry-content .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.entry-content .wp-block-gallery .wp-block-image { float: none !important; width: 100% !important; margin: 0 !important; }

/* Preserve touch targets and fluid aspect ratios on legacy 10Web markup
   when a legacy gallery is intentionally retained. */
body.newross-gallery-page [class*="bwg-standard-thumbnails"] .bwg-item a {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border-radius: 9px;
  overflow: hidden;
}
body.newross-gallery-page [class*="bwg-standard-thumbnails"] .bwg-item a img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  aspect-ratio: 4/3;
  height: auto !important;
  object-fit: cover;
}
