/* EDGE Meeting Gallery. Component and viewer styles are scoped to this module. */
.emg {
  --emg-height: 90vh;
  --emg-width: 1800px;
  --emg-padding: clamp(18px, 2.6vw, 58px);
  --emg-gap: 8px;
  --emg-radius: 10px;
  --emg-bg: #eee4e0;
  --emg-ink: #202620;
  --emg-surface-radius: 24px;
  --emg-display-font: "p22-mackinac-pro", Georgia, serif;
  --emg-ui-font: "neue-haas-grotesk-text", "Helvetica Neue", Arial, sans-serif;
  container-type: inline-size;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--emg-width);
  margin-inline: auto;
  padding: var(--emg-padding);
  min-width: 0;
  color: var(--emg-ink);
  background-color: var(--emg-bg);
  border-radius: var(--emg-surface-radius);
  font-family: var(--emg-ui-font);
  display: grid;
  align-content: stretch;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(170px, 1fr);
  gap: clamp(16px, 2.2vw, 32px);
  min-height: var(--emg-height);
}
@supports (height: 100svh) {
  .emg { --emg-height: 90svh; }
}
/* Default design values stay below Elementor's per-instance style selectors. */
.emg:where([data-emg-design="canvas"]) {
  --emg-radius: 0px;
  --emg-surface-radius: 0px;
  --emg-padding: clamp(18px, 3.6vw, 72px);
  padding: var(--emg-padding) 0 0;
}
.emg:where([data-emg-design="canvas"]) .emg-head { padding-inline: var(--emg-padding); }
/* Compensate the space consumed inside the original container. Width.js supplies
   the document's usable width, including when the editor runs in an iframe. */
.emg:is([data-emg-width="viewport"],[data-emg-design="canvas"]:not([data-emg-width="container"])) {
  width: var(--emg-page-width, 100%);
  max-width: none;
  margin-left: var(--emg-bleed-left, 0px);
  margin-right: calc(100% - var(--emg-page-width, 100%) - var(--emg-bleed-left, 0px));
  flex-shrink: 0;
}
.emg *, .emg *::before, .emg *::after { box-sizing: border-box; }
.emg [hidden] { display: none !important; }
.emg[data-emg-mode] { height: var(--emg-height); min-height: min-content; }
.emg .emg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 28px; min-width: 0; }
.emg .emg-heading {
  margin: 0; max-width: 23ch; min-width: 0;
  color: inherit; font-family: var(--emg-display-font); font-weight: 400;
  font-size: clamp(32px, 3.6vw, 64px); line-height: 1.04;
  letter-spacing: -.045em; text-wrap: balance; overflow-wrap: anywhere;
}
@supports (width: 1cqw) {
  .emg .emg-heading { font-size: clamp(31px, 4.1cqw, 66px); }
}
.emg .emg-tools { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex: none; max-width: 100%; margin-inline-start: auto; }
.emg .emg-hint { min-width: 0; max-width: 16ch; overflow-wrap: anywhere; margin: 0 8px 0 0; color: inherit; font-size: 13px; font-weight: 500; line-height: 1.35; }
.emg .emg-hint-touch { display: none; }
@media (pointer: coarse) {
  .emg .emg-hint-mouse { display: none; }
  .emg .emg-hint-touch { display: inline; }
}
.emg .emg-tools button, .emg-dialog button {
  appearance: none; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 34%, transparent);
  padding: 0; margin: 0; display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  color: inherit; box-shadow: none; background: transparent; font: inherit;
  cursor: pointer; touch-action: manipulation; transition: background-color 150ms ease;
}
.emg .emg-tools svg, .emg-dialog button svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.emg .emg-tools button:focus-visible, .emg-dialog button:focus-visible, .emg .emg-viewport:focus-visible,
.emg .emg-card:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.emg .emg-card:focus-visible { outline-offset: -5px; outline-color: white; }
@media (hover: hover) {
  .emg .emg-tools button:hover { background: rgba(255,255,255,.75); }
  .emg-dialog button:hover { background: rgba(255,255,255,.12); }
}
.emg .emg-viewport {
  position: relative; min-width: 0; min-height: 170px;
  border-radius: var(--emg-radius); overflow: hidden; isolation: isolate;
}
.emg:where([data-emg-design="canvas"]) .emg-viewport { border-radius: 0; }
.emg .emg-source { display: grid; min-height: 100%; gap: var(--emg-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.emg .emg-card {
  display: block; position: relative; min-width: 0; min-height: 0; margin: 0;
  aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--emg-radius); box-shadow: none; text-decoration: none;
  color: inherit; background-color: color-mix(in srgb, var(--emg-bg), var(--emg-ink) 8%);
}
.emg .emg-card .emg-image { display: block; position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; border: 0; border-radius: inherit; object-fit: cover; object-position: var(--emg-x, 50%) var(--emg-y, 50%); pointer-events: none; }
.emg[data-emg-mode="grid"] .emg-source { display: none; }
.emg[data-emg-mode="grid"] .emg-viewport { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y pinch-zoom; }
.emg[data-emg-dragging] .emg-viewport, .emg[data-emg-dragging] .emg-tile { cursor: grabbing; }
.emg .emg-plane { position: absolute; inset: 0; overflow: hidden; }
/* Mask the photographs themselves. Transparent edges reveal the actual surface
   beneath each pixel, including the site's background through a translucent fill. */
.emg:is([data-emg-fade="on"],[data-emg-design="canvas"]:not([data-emg-fade="off"])) .emg-plane,
.emg[data-emg-fade="on"] .emg-source {
  --emg-edge: clamp(0%, var(--emg-fade-size, 8%), 45%);
  --emg-mask-x: linear-gradient(to right, transparent, #000 var(--emg-edge),
                    #000 calc(100% - var(--emg-edge)), transparent);
  --emg-mask-y: linear-gradient(to bottom, transparent, #000 var(--emg-edge),
                    #000 calc(100% - var(--emg-edge)), transparent);
  -webkit-mask-image: var(--emg-mask-x), var(--emg-mask-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--emg-mask-x), var(--emg-mask-y);
  mask-composite: intersect;
}
.emg .emg-tile { position: absolute; top: 0; left: 0; margin: 0; aspect-ratio: auto; cursor: inherit; touch-action: inherit; -webkit-user-drag: none; }
.emg .emg-tile img { -webkit-user-drag: none; user-select: none; }
.emg .emg-tile-selected::after {
  content: ""; position: absolute; inset: 3px; border-radius: max(0px, calc(var(--emg-radius) - 3px));
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.45); pointer-events: none;
}
.emg[data-emg-mode="static"] .emg-source { position: absolute; inset: 0; grid-auto-rows: minmax(0, 1fr); }
.emg[data-emg-mode="static"] .emg-card { height: 100%; aspect-ratio: auto; }
.emg .emg-source:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.emg .emg-source:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emg[data-emg-mode="static"] .emg-source:has(> :nth-child(3):last-child) { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0,1fr)); }
.emg[data-emg-mode="static"] .emg-source:has(> :nth-child(3):last-child) > :first-child { grid-row: span 2; }
.emg:has(.emg-tools[hidden]):not(:has(.emg-heading)) { grid-template-rows: minmax(170px, 1fr); }
.emg:has(.emg-tools[hidden]):not(:has(.emg-heading)) .emg-head { display: none; }
.emg-empty { margin: 0; font-size: 14px; line-height: 1.6; }
.emg-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; padding: 0 !important; margin: -1px !important; border: 0 !important; }
@container (max-width: 900px) {
  .emg .emg-heading { max-width: 23ch; }
  .emg .emg-hint { font-size: 12px; }
}
@container (max-width: 560px) {
  .emg .emg-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .emg .emg-tools { width: 100%; margin: 0; justify-content: flex-end; }
  .emg .emg-hint { margin-right: auto; max-width: none; }
  .emg .emg-heading { max-width: none; }
  .emg .emg-source { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emg[data-emg-mode="static"] .emg-source:has(> :nth-child(2):last-child) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .emg[data-emg-mode="static"] .emg-source:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .emg[data-emg-mode="static"] .emg-source:has(> :nth-child(3):last-child) > :first-child {
    grid-row: auto; grid-column: 1 / -1;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .emg .emg-heading { font-size: clamp(26px, 3.4vw, 38px); }
}
/* Dialog stays in the widget subtree, on the browser's native top layer. */
.emg-dialog {
  box-sizing: border-box; width: min(96vw, 1640px); max-width: 100vw;
  height: min(94vh, 1280px); height: min(94svh, 1280px); max-height: 100%;
  padding: 0; margin: auto; border: 0; border-radius: 16px;
  color: #f8f7f2; background: #1c211c; font-family: "neue-haas-grotesk-text", "Helvetica Neue", Arial, sans-serif;
  overflow: auto;
}
.emg-dialog:not([open]) { display: none; }
.emg-dialog::backdrop { background: rgba(12,17,13,.88); }
.emg-dialog .emg-viewer { box-sizing: border-box; height: 100%; position: relative; display: flex; flex-direction: column; padding: clamp(12px, 2.5vmin, 28px); gap: 12px; }
.emg-dialog .emg-viewer-body { min-height: 0; min-width: 0; flex: 1; display: grid; place-items: center; }
.emg-dialog .emg-viewer-photo { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; object-fit: contain; }
.emg-dialog .emg-viewer-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 44px; }
:is(.emg-dialog, .emg-editor-viewer-sample) .emg-viewer-caption { color: inherit; font-size: 15px; line-height: 1.5; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
:is(.emg-dialog, .emg-editor-viewer-sample) .emg-viewer-count { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.emg .emg-editor-viewer-sample {
  position: absolute; inset: auto 0 0; z-index: 1; display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; padding: 14px 18px; background: #1c211c; color: #f8f7f2;
  font-family: var(--emg-ui-font); pointer-events: none;
}
.emg-dialog .emg-viewer-close { position: absolute; z-index: 1; right: 14px; top: 14px; background-color: #1c211c; color: white; }
@media (max-width: 640px) {
  .emg-dialog { width: 100%; max-width: 100%; height: 100vh; height: 100svh; border-radius: 0; }
  .emg-dialog .emg-viewer { padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
  :is(.emg-dialog, .emg-editor-viewer-sample) .emg-viewer-caption { flex: 1 0 100%; }
  .emg-dialog .emg-viewer-count { margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .emg *, .emg-dialog * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
