/* Project image layout. Used on the project pages and for the live preview in the project editor.
   Each row is a flex line. An image's width is a fraction of the row (set per image). Heights follow the image's own shape,
   so nothing is cropped unless a shape is chosen. "Equal heights" rows share the width by shape, so every image has the same height. */
.gallery { display: block; }
.g-row {
  --gap: 16px; --space: 16px;
  display: flex; flex-wrap: nowrap; gap: var(--gap); align-items: flex-start;
  margin-top: var(--space);
  padding-bottom: var(--capspace, 0px);   /* room for captions that hang below the images */
}
.gallery > .g-row:first-child { margin-top: 0; }
.g-row.a-center { align-items: center; }
.g-row.a-bottom { align-items: flex-end; }
.g-row.j-center { justify-content: center; }
.g-row.j-right { justify-content: flex-end; }
.g-row.j-between { justify-content: space-between; }
.g-row.rw-wide { width: min(calc(100vw - 2 * var(--pad, 24px)), 1480px); margin-left: 50%; transform: translateX(-50%); }
.g-row.rw-edge { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

.g-it { position: relative; margin: 0; min-width: 0; flex: 0 1 calc(var(--w, 1) * (100% + var(--gap)) - var(--gap)); }
.g-row.a-equal > .g-it { flex: var(--ar, 1.5) 1 0%; }

.g-media { position: relative; overflow: hidden; }
.g-media img { display: block; width: 100%; height: auto; }
.g-it.crop .g-media { aspect-ratio: var(--ar, 1.5); }
.g-it.crop .g-media img { height: 100%; object-fit: cover; object-position: var(--fp, 50% 50%); }
.g-it.bg-soft .g-media { background: rgba(28, 27, 33, .07); }
.g-it.bg-white .g-media { background: #fff; }
.g-it.bg-dark .g-media { background: #1C1B21; }

/* A caption below an image hangs under it and takes no height, so rows line up by the images themselves. */
.g-it figcaption { font-size: 13px; line-height: 1.45; color: var(--mute, #6A6972); }
.g-it.cap-below figcaption { position: absolute; left: 0; right: 0; top: 100%; margin: 10px 0 0; }
.g-it.cap-on figcaption { position: absolute; left: 16px; bottom: 14px; margin: 0; z-index: 1; color: #fff; opacity: .92; text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }

/* Videos */
.g-media video { display: block; width: 100%; height: auto; }
.g-it.crop .g-media video { height: 100%; object-fit: cover; object-position: var(--fp, 50% 50%); }
.vsound {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(24, 23, 29, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.vsound .vs-on { display: none; }
.vsound[aria-pressed="true"] .vs-on { display: inline; }
.vsound[aria-pressed="true"] .vs-off { display: none; }

/* Text blocks */
.g-text { display: flex; }
.g-text .g-tbox {
  width: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-start;
  padding: var(--tp, 0px); background: var(--tbg, transparent); color: var(--tc, inherit); text-align: var(--ta, left);
  font-family: var(--tff, var(--sans)); font-size: var(--tfs, 16px); font-weight: var(--tfw, 400); line-height: var(--tlh, 1.6); letter-spacing: var(--tls, 0em);
  overflow-wrap: anywhere;
}
.g-text.va-center .g-tbox { justify-content: center; }
.g-text.va-bottom .g-tbox { justify-content: flex-end; }
.g-text.t-italic .g-tbox { font-style: italic; }
.g-text.t-upper .g-tbox { text-transform: uppercase; }
.g-tbox .g-tx { margin: 0 0 .8em; font: inherit; letter-spacing: inherit; }
.g-tbox .g-tx:last-child { margin-bottom: 0; }
.g-tbox a { text-decoration: underline; text-underline-offset: 3px; }
.g-row.a-equal > .g-text { flex: 0 1 calc(var(--w, .33) * (100% + var(--gap)) - var(--gap)); align-self: stretch; }

@media (max-width: 720px) {
  .g-row:not(.phone-keep) { flex-direction: column; align-items: stretch; padding-bottom: 0; }
  .g-row:not(.phone-keep) .g-it.cap-below figcaption { position: static; margin-top: 10px; }
  .g-row:not(.phone-keep) > .g-it { flex: 0 0 auto; width: 100%; }
  .g-row.phone-keep { --gap: 8px; }
}
