/* Top Transfer — Photo Gallery, Lightbox and Image CTA
   Loaded only on pages that use these blocks (and inside the editor). */

/* ——— Gallery ——— */
.tt-gallery {
  --tt-row: 240px;
  --tt-row-scale: 1;
  --tt-gap: 0.75rem;
  width: 100%;
}
@media (max-width: 900px) {
  .tt-gallery { --tt-row-scale: 0.8; --tt-gap: 0.6rem; }
}
@media (max-width: 600px) {
  .tt-gallery { --tt-row-scale: 0.44; --tt-gap: 0.4rem; }
}

.tt-gallery__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tt-gap);
}

/* Justified rows: every photo keeps its own proportions, rows share a height. */
.tt-gallery--justified .tt-gallery__grid::after {
  content: "";
  flex-grow: 999999;
}
.tt-gallery--justified .tt-gallery__item {
  position: relative;
  min-width: 0;
  flex-grow: calc(var(--w, 4) / var(--h, 3) * 100);
  flex-basis: calc(var(--tt-row) * var(--tt-row-scale) * var(--w, 4) / var(--h, 3));
}
.tt-gallery--justified .tt-gallery__link {
  aspect-ratio: var(--w, 4) / var(--h, 3);
}

/* Even grid: cropped tiles. */
.tt-gallery--grid .tt-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.tt-gallery--grid .tt-gallery__item { position: relative; min-width: 0; }
.tt-gallery--grid .tt-gallery__link { aspect-ratio: 4 / 3; }
@media (max-width: 600px) {
  .tt-gallery--grid .tt-gallery__grid { grid-template-columns: 1fr 1fr; }
}

.tt-gallery__link {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius, 1rem);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  box-shadow: var(--shadow-sm, none);
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%) 0 0 / 220% 100%,
    var(--bg-3, #18181b);
  cursor: zoom-in;
  isolation: isolate;
}
.tt-gallery__link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: opacity 0.6s var(--ease, ease), transform 0.8s var(--ease, ease);
}
.tt-gallery__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 11, 0.45), transparent 45%);
  opacity: 0;
  transition: opacity var(--t, 280ms) var(--ease, ease);
  pointer-events: none;
}
.tt-gallery__zoom {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f1ec;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t, 280ms) var(--ease, ease), transform var(--t, 280ms) var(--ease, ease);
  backdrop-filter: blur(6px);
}
.tt-gallery__zoom svg { width: 1.05rem; height: 1.05rem; }
.tt-gallery__link:hover img,
.tt-gallery__link:focus-visible img { transform: scale(1.04); }
.tt-gallery__link:hover::after,
.tt-gallery__link:focus-visible::after,
.tt-gallery__link:hover .tt-gallery__zoom,
.tt-gallery__link:focus-visible .tt-gallery__zoom { opacity: 1; transform: none; }
.tt-gallery__link:focus-visible { outline: 2px solid var(--focus, #e0b07a); outline-offset: 3px; }

/* Lazy fade-in (only once the script runs, so no-JS visitors always see photos). */
.tt-gallery--js .tt-gallery__item:not(.is-loaded) .tt-gallery__link {
  animation: tt-shimmer 1.4s linear infinite;
}
.tt-gallery--js .tt-gallery__item:not(.is-loaded) img { opacity: 0; }
@keyframes tt-shimmer {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tt-gallery__link img, .tt-gallery__zoom { transition: none; }
  .tt-gallery__link:hover img { transform: none; }
  .tt-gallery--js .tt-gallery__item:not(.is-loaded) .tt-gallery__link { animation: none; }
}

/* ——— Lightbox ——— */
html.tt-lightbox-open { overflow: hidden; }
html.tt-lightbox-open body { overflow: hidden; }

.tt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(6, 6, 7, 0.97);
  color: #f4f1ec;
  opacity: 0;
  transition: opacity 0.3s var(--ease, ease);
  font-family: var(--font-body, system-ui, sans-serif);
}
.tt-lightbox[hidden] { display: none; }
.tt-lightbox.is-open { opacity: 1; }

.tt-lightbox__stage {
  position: absolute;
  inset: 4.25rem 0 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tt-lightbox__img {
  display: block;
  max-width: calc(100% - 7.5rem);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transition: transform 0.35s var(--ease, ease), opacity 0.35s var(--ease, ease);
  opacity: 0;
  cursor: zoom-in;
  will-change: transform;
  -webkit-user-drag: none;
}
.tt-lightbox__img.is-ready { opacity: 1; }
.tt-lightbox__img.no-anim { transition: opacity 0.35s var(--ease, ease); }
.tt-lightbox.is-zoomed .tt-lightbox__img { cursor: grab; box-shadow: none; }
.tt-lightbox.is-zoomed .tt-lightbox__img:active { cursor: grabbing; }
@media (max-width: 700px) {
  .tt-lightbox__img { max-width: 100%; border-radius: 0; }
}

.tt-lightbox__spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent, #c9864a);
  animation: tt-spin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.tt-lightbox.is-loading .tt-lightbox__spinner { opacity: 1; }
@keyframes tt-spin { to { transform: rotate(360deg); } }

.tt-lightbox__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(0.85rem, 3vw, 1.5rem);
  z-index: 2;
}
.tt-lightbox__count {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(244, 241, 236, 0.7);
  font-variant-numeric: tabular-nums;
}
.tt-lightbox__tools { display: flex; gap: 0.4rem; }

.tt-lightbox__btn,
.tt-lightbox__nav {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f1ec;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.tt-lightbox__btn svg,
.tt-lightbox__nav svg { width: 1.2rem; height: 1.2rem; }
.tt-lightbox__btn:hover,
.tt-lightbox__nav:hover {
  background: rgba(201, 134, 74, 0.18);
  border-color: rgba(201, 134, 74, 0.6);
  color: #fff;
}
.tt-lightbox__btn:disabled { opacity: 0.35; cursor: default; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); }
.tt-lightbox__btn:focus-visible,
.tt-lightbox__nav:focus-visible { outline: 2px solid var(--focus, #e0b07a); outline-offset: 3px; }

.tt-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 3.25rem;
  height: 3.25rem;
  margin-top: -1.625rem;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(6px);
}
.tt-lightbox__nav--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.tt-lightbox__nav--next { right: clamp(0.5rem, 2vw, 1.5rem); }
.tt-lightbox__nav[hidden] { display: none; }
.tt-lightbox.is-zoomed .tt-lightbox__nav { opacity: 0.35; }
@media (max-width: 700px) {
  .tt-lightbox__nav { top: auto; bottom: 0.65rem; margin-top: 0; width: 2.75rem; height: 2.75rem; }
}

.tt-lightbox__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 4.5rem;
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(244, 241, 236, 0.78);
  line-height: 1.45;
}
.tt-lightbox__caption[hidden] { display: none; }

/* ——— Image CTA ——— */
.feature-cta {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: clamp(30rem, 58vw, 42rem);
  padding-block: clamp(4.5rem, 11vw, 8rem);
  overflow: hidden;
  isolation: isolate;
  border-block: 1px solid var(--border, rgba(255, 255, 255, 0.07));
}
.feature-cta__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.feature-cta__media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 40%;
}
.feature-cta__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-veil, linear-gradient(105deg, rgba(10, 10, 11, 0.88) 0%, rgba(10, 10, 11, 0.55) 48%, rgba(10, 10, 11, 0.25) 100%));
}
.feature-cta--right .feature-cta__veil { transform: scaleX(-1); }
.feature-cta__inner {
  position: relative;
  display: flex;
}
.feature-cta--right .feature-cta__inner { justify-content: flex-end; }
.feature-cta__panel {
  width: 100%;
  max-width: 35rem;
  padding: clamp(1.6rem, 4vw, 2.75rem);
  background: color-mix(in srgb, var(--bg-2, #111113) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.14));
  border-radius: calc(var(--radius, 1rem) + 0.25rem);
  box-shadow: var(--shadow, 0 24px 64px rgba(0, 0, 0, 0.45));
}
.feature-cta__panel .section-head__title,
.feature-cta__panel h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}
.feature-cta__panel p:not([class]) {
  color: var(--text-2, rgba(244, 241, 236, 0.72));
  line-height: 1.7;
  font-size: 1.02rem;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .feature-cta__panel { background: var(--surface, #1c1c20); }
}
@media (max-width: 700px) {
  .feature-cta { min-height: 0; padding-block: 14rem 1.25rem; align-items: flex-end; }
  .feature-cta__veil { background: linear-gradient(to top, var(--bg, #0a0a0b) 8%, transparent 70%); transform: none !important; }
}

/* ——— Editor-only gallery controls ——— */
.tt-gallery--editing .tt-gallery__link { cursor: default; }
.tt-gallery--editing .tt-gallery__item img { opacity: 1 !important; }
.tt-gallery--editing .tt-gallery__tools {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(10, 10, 11, 0.82);
  opacity: 0;
  transition: opacity 0.15s;
}
.tt-gallery--editing .tt-gallery__item:hover .tt-gallery__tools,
.tt-gallery--editing .tt-gallery__item:focus-within .tt-gallery__tools,
.tt-gallery--editing.is-selected .tt-gallery__tools { opacity: 1; }
.tt-gallery--editing .tt-gallery__tools .components-button {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 2px;
  color: #f4f1ec;
  justify-content: center;
}
.tt-gallery--editing .tt-gallery__tools .components-button:disabled { opacity: 0.35; }
.tt-gallery--editing .tt-gallery__tools .components-button.is-destructive { color: #f08a8a; }
.tt-gallery--editing .tt-gallery__add {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}
.tt-gallery--editing .tt-gallery__add .components-button {
  padding: 6px 14px;
  height: auto;
  color: var(--text, #f4f1ec);
  border: 1px solid var(--border-2, rgba(255, 255, 255, 0.14));
  border-radius: 999px;
  box-shadow: none;
}

/* Classic Car Hire hero: keep the couple's heads in frame on wide screens. */
@media (min-width: 900px) {
  .page-hero__media img[src*="classic-cadillac-wedding-field"] { object-position: center 8%; }
}
