/* InviteKit part: the gallery patterns and the full-screen viewer (gallery.js). Colours come from the design's --k-* variables. */
.k-gal { position: relative; width: 100%; max-width: 720px; margin: 0 auto; color: var(--k-ink);
  /* a design whose section runs edge to edge still gets a 16px gutter; one with its own padding gets none extra */
  padding-inline: max(0px, calc(16px - (100vw - 100%) / 2)); }
.k-gal--filmstrip { padding-inline: 0; }
.k-gal__t { position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.k-gal__fx { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: calc(var(--k-radius, 8px) * .6); background: color-mix(in srgb, var(--k-card) 80%, var(--k-paper));
  box-shadow: 0 14px 26px -18px color-mix(in srgb, var(--k-ink) 60%, transparent); will-change: transform; }
.k-gal__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.k-gal__t:focus-visible { outline: none; }
.k-gal__t:focus-visible .k-gal__fx { box-shadow: 0 0 0 2px var(--k-paper), 0 0 0 4px var(--k-accent); }
.k-gal.is-anim:not(.is-in) .k-gal__fx { opacity: 0; }

/* grid: tidy rows, every photo the same size */
.k-gal--grid .k-gal__in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.k-gal--grid .k-gal__t { aspect-ratio: 1; }
.k-gal--grid[data-n="1"] .k-gal__in { grid-template-columns: 1fr; }
.k-gal--grid[data-n="1"] .k-gal__t { aspect-ratio: 4 / 3; }
@media (min-width: 760px) { .k-gal--grid:not([data-n="1"]):not([data-n="2"]):not([data-n="4"]) .k-gal__in { grid-template-columns: repeat(3, minmax(0, 1fr)); } .k-gal--grid, .k-gal--masonry, .k-gal--mosaic { max-width: 960px; } }

/* masonry: bricks of every height */
.k-gal--masonry .k-gal__in { columns: 2; column-gap: 8px; }
.k-gal--masonry .k-gal__t { aspect-ratio: var(--ar, 1); margin-bottom: 8px; break-inside: avoid; }
.k-gal--masonry[data-n="1"] .k-gal__in { columns: 1; }
@media (min-width: 760px) { .k-gal--masonry:not([data-n="1"]):not([data-n="2"]) .k-gal__in { columns: 3; } }

/* polaroid: prints tossed on a table, tilted, with a caption strip */
.k-gal--polaroid .k-gal__in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 6px; padding: 10px 4px 18px; }
.k-gal--polaroid .k-gal__t { rotate: var(--r); margin-bottom: -6px; z-index: 1; }
.k-gal--polaroid .k-gal__t:nth-child(even) { margin-top: 26px; }
.k-gal--polaroid .k-gal__t:hover, .k-gal--polaroid .k-gal__t:focus-visible { z-index: 3; }
.k-gal--polaroid .k-gal__fx { display: grid; grid-template-rows: auto auto; gap: 0; padding: 7px 7px 0; border-radius: 2px; background: color-mix(in srgb, var(--k-card) 55%, #fffdf8); overflow: visible;
  box-shadow: 0 18px 24px -16px color-mix(in srgb, var(--k-ink) 70%, transparent), 0 0 0 1px color-mix(in srgb, var(--k-ink) 8%, transparent); }
.k-gal--polaroid .k-gal__img { aspect-ratio: 1 / 1.05; height: auto; }
.k-gal--polaroid .k-gal__cap { display: block; min-height: 2.1em; padding: .35em .2em .4em; font: 400 clamp(1rem, 4.4vw, 1.2rem)/1.15 var(--k-script); color: #3a3032; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-gal--polaroid[data-n="1"] .k-gal__in { grid-template-columns: minmax(0, 70%); justify-content: center; }
@media (min-width: 760px) { .k-gal--polaroid:not([data-n="1"]):not([data-n="2"]) .k-gal__in { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; } .k-gal--polaroid .k-gal__t:nth-child(even) { margin-top: 0; } .k-gal--polaroid .k-gal__t:nth-child(3n+2) { margin-top: 30px; } }

/* filmstrip: a strip of frames that glides sideways like a reel */
.k-gal--filmstrip { max-width: none; overflow: hidden; }
.k-gal__reel { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.k-gal__reel::-webkit-scrollbar { display: none; }
.k-gal__film { display: flex; gap: 10px; width: max-content; padding: 26px 40px; background:
  radial-gradient(circle, var(--k-paper) 0 3px, transparent 3.5px) 0 7px / 18px 18px repeat-x,
  radial-gradient(circle, var(--k-paper) 0 3px, transparent 3.5px) 0 calc(100% - 7px) / 18px 18px repeat-x,
  color-mix(in srgb, var(--k-deep, #111) 75%, #0b0b0d); border-radius: 4px; }
.k-gal--filmstrip .k-gal__t { flex: none; width: clamp(180px, 58vw, 300px); aspect-ratio: 4 / 3; scroll-snap-align: center; }
.k-gal--filmstrip .k-gal__fx { border-radius: 2px; box-shadow: none; }
.k-gal--filmstrip .k-gal__img { filter: saturate(1.05) contrast(1.03); }

/* carousel: one photo in front, its neighbours peeking, turning round */
.k-gal__stage { position: relative; touch-action: pan-y; }
.k-gal--carousel .k-gal__stage { aspect-ratio: 1 / .86; perspective: 1100px; transform-style: preserve-3d; }
.k-gal--carousel .k-gal__t { position: absolute; left: 21%; top: 4%; width: 58%; height: 86%; transition: transform .7s var(--k-spring, cubic-bezier(.3, 1.3, .4, 1)), opacity .5s ease, filter .5s ease;
  transform: translateX(calc(var(--o, 0) * 64%)) rotateY(calc(var(--o, 0) * -26deg)) scale(calc(1 - var(--ao, 0) * .17)); z-index: calc(10 - var(--ao, 0)); opacity: calc(1 - var(--ao, 0) * .28); filter: brightness(calc(1 - var(--ao, 0) * .14)); }
.k-gal--carousel .k-gal__t[data-o]:not([data-o="0"]):not([data-o="1"]):not([data-o="-1"]) { opacity: 0; pointer-events: none; }
.k-gal--carousel .k-gal__t:not(.is-on) { cursor: pointer; }

/* slideshow: one photo at a time, a slow pan and zoom, a soft fade */
.k-gal--slideshow .k-gal__stage { aspect-ratio: 4 / 5; overflow: hidden; border-radius: calc(var(--k-radius, 8px) * .6); box-shadow: 0 22px 40px -26px color-mix(in srgb, var(--k-ink) 80%, transparent); }
@media (min-width: 760px) { .k-gal--slideshow .k-gal__stage { aspect-ratio: 16 / 10; } }
.k-gal--slideshow .k-gal__t { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.k-gal--slideshow .k-gal__t.is-on { opacity: 1; z-index: 2; }
.k-gal--slideshow .k-gal__fx { border-radius: 0; box-shadow: none; }
.k-gal--slideshow.is-playing .k-gal__t.is-on .k-gal__img { animation: kGalKen var(--ms, 6s) ease-out both; }
.k-gal--slideshow .k-gal__t:nth-child(3n+2) .k-gal__img { --kx: 4%; --ky: -3%; }
.k-gal--slideshow .k-gal__t:nth-child(3n) .k-gal__img { --kx: -3%; --ky: 4%; }
@keyframes kGalKen { from { transform: scale(1.14) translate(var(--kx, -4%), var(--ky, -3%)); } to { transform: scale(1) translate(0, 0); } }
.k-gal__scap { position: relative; margin: .8rem 0 0; min-height: 1.4em; text-align: center; font: italic 400 1.05rem/1.4 var(--k-display); color: var(--k-ink-2, var(--k-ink)); }

/* stack: a stack to tap through, with progress bars on top */
.k-gal--stack { max-width: 420px; }
.k-gal--stack .k-gal__stage { aspect-ratio: 4 / 5; margin-top: 10px; }
.k-gal--stack .k-gal__t { position: absolute; inset: 0 0 30px; transition: transform .6s var(--k-spring, cubic-bezier(.3, 1.3, .4, 1)), opacity .4s ease;
  transform: translateY(calc(var(--d, 0) * 14px)) scale(calc(1 - var(--d, 0) * .05)); z-index: calc(10 - var(--d, 0)); opacity: calc(1 - var(--d, 0) * .12); }
.k-gal--stack .k-gal__t[data-depth]:not([data-depth="0"]):not([data-depth="1"]):not([data-depth="2"]) { opacity: 0; pointer-events: none; }
.k-gal--stack .k-gal__t.is-gone { animation: kGalFly .7s cubic-bezier(.4, 0, .2, 1) both; z-index: 11; }
@keyframes kGalFly { 0% { transform: none; opacity: 1; } 55% { transform: translateX(-125%) rotate(-16deg); opacity: 0; } 100% { transform: translateY(42px) scale(.85); opacity: 0; } }
.k-gal--stack .k-gal__fx { border-radius: calc(var(--k-radius, 8px) * .9); box-shadow: 0 24px 34px -22px color-mix(in srgb, var(--k-ink) 80%, transparent); }
.k-gal__bars { display: flex; gap: 4px; }
.k-gal__bars i { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--k-ink) 16%, transparent); }
.k-gal__bars b { display: block; height: 100%; background: var(--k-accent); transform-origin: 0 50%; transform: scaleX(0); }
.k-gal__bars i.is-done b { transform: none; }
.k-gal__bars i.is-on b { transform: none; }
.k-gal--stack.is-playing .k-gal__bars i.is-on b { animation: kGalBar var(--ms, 5s) linear both; }
@keyframes kGalBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* controls for the one-at-a-time patterns */
.k-gal__ctl { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .7rem; }
.k-gal__nav { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--k-ink);
  background: color-mix(in srgb, var(--k-card) 80%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-ink) 14%, transparent); transition: transform .35s var(--k-spring, ease); }
.k-gal__nav:active { transform: scale(.9); }
.k-gal__nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.k-gal__dots { display: flex; gap: 6px; }
.k-gal__dots i { width: 6px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--k-ink) 22%, transparent); transition: width .4s var(--k-spring, ease), background .3s; }
.k-gal__dots i.is-on { width: 18px; background: var(--k-accent); }
.k-gal__count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.k-gal[data-n="1"] .k-gal__ctl { display: none; }

/* mosaic: one hero photo and a few small ones that trade places */
.k-gal--mosaic .k-gal__in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; grid-auto-flow: dense; }
.k-gal--mosaic .k-gal__t { aspect-ratio: 1; }
.k-gal--mosaic .k-gal__t:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.k-gal--mosaic[data-n="1"] .k-gal__in, .k-gal--mosaic[data-n="2"] .k-gal__in { grid-template-columns: 1fr; }
.k-gal--mosaic[data-n="1"] .k-gal__t, .k-gal--mosaic[data-n="2"] .k-gal__t { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
/* the rows always close: the hero spans the full width when the rest come in threes, and a lone last photo takes two places */
.k-gal--mosaic:is([data-n="4"], [data-n="7"], [data-n="10"]) .k-gal__t:first-child { grid-column: span 3; grid-row: span 2; }
.k-gal--mosaic:is([data-n="5"], [data-n="8"], [data-n="11"]) .k-gal__t:last-child { grid-column: span 2; aspect-ratio: auto; }

/* design touches */
.k-root[data-template="gatsby"] .k-gal__fx, .k-root[data-template="premiere"] .k-gal__fx { border-radius: 0; box-shadow: 0 0 0 1px var(--k-gold), 0 18px 28px -18px #000; }
.k-root[data-template="gatsby"] .k-gal--polaroid .k-gal__fx { background: #101010; }
.k-root[data-template="gatsby"] .k-gal--polaroid .k-gal__cap { font: 500 .64rem/2 var(--k-label); letter-spacing: .3em; text-transform: uppercase; color: var(--k-gold); }
.k-root[data-template="afterglow"] .k-gal__fx { box-shadow: 0 0 0 1px color-mix(in srgb, var(--k-accent) 70%, transparent), 0 0 24px -6px var(--k-accent); }
.k-root[data-template="evermore"] .k-gal--slideshow .k-gal__stage { border-radius: 999px 999px 6px 6px / 40% 40% 6px 6px; }
.k-root[data-tone="dark"] .k-gal--polaroid .k-gal__cap, .k-root[data-template="nightfall"] .k-gal--polaroid .k-gal__cap { color: #3a3032; }

/* ---------- the full-screen viewer ---------- */
html.k-lb-open, html.k-lb-open body { overflow: hidden; }
.k-lb { position: fixed; inset: 0; z-index: 2147483000; color: #f7f3ec; touch-action: none; }
.k-lb__bd { position: absolute; inset: 0; background: color-mix(in srgb, var(--k-deep, #111) 28%, #060608); opacity: .97; }
.k-lb__track { position: absolute; inset: 0; display: flex; will-change: transform; }
.k-lb__s { flex: none; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 56px 0 84px; overflow: hidden; }
@media (min-width: 600px) { .k-lb__s { padding: 56px 64px 84px; } }
.k-lb__z { display: grid; place-items: center; width: 100%; height: 100%; transform-origin: 50% 50%; will-change: transform; }
.k-lb__img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.k-lb.is-flying .k-lb__track { opacity: 0; }
.k-lb__fly { position: fixed; z-index: 3; object-fit: cover; pointer-events: none; border-radius: 4px; }
.k-lb__top { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 0 18px; pointer-events: none; }
.k-lb__n { font: 500 .72rem/1 var(--k-label); letter-spacing: .24em; color: color-mix(in srgb, #fff 75%, transparent); }
.k-lb__b { pointer-events: auto; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: color-mix(in srgb, #fff 12%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent); transition: transform .35s var(--k-spring, ease), opacity .2s; }
.k-lb__b:active { transform: scale(.9); }
.k-lb__b:disabled { opacity: .25; cursor: default; }
.k-lb__b:focus-visible { outline: 2px solid var(--k-gold, #d8b46a); outline-offset: 3px; }
.k-lb__b svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.k-lb__prev, .k-lb__next { position: absolute; z-index: 2; top: 50%; margin-top: -22px; }
.k-lb__prev { left: 10px; } .k-lb__next { right: 10px; }
@media (max-width: 599px) { .k-lb__prev, .k-lb__next { top: auto; bottom: 18px; margin: 0; } }
.k-lb.is-zoomed .k-lb__prev, .k-lb.is-zoomed .k-lb__next { opacity: 0; pointer-events: none; }
.k-lb__foot { position: absolute; z-index: 2; left: 64px; right: 64px; bottom: 0; display: grid; place-items: center; min-height: 84px; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.k-lb__cap { margin: 0; max-width: 34rem; text-align: center; font: italic 400 clamp(1rem, 4vw, 1.2rem)/1.4 var(--k-display, Georgia, serif); color: #f7f3ec; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .k-gal .k-gal__t, .k-gal .k-gal__img, .k-gal .k-gal__bars b { transition: none !important; animation: none !important; }
  .k-gal--stack .k-gal__t.is-gone { opacity: calc(1 - var(--d, 0) * .12); }
}
