/* Tilt gallery with lightbox (20 Ekim 2026), after the grid layout of tilt-gallery-pro.framer.website.
   Behaviour lives in tilt-gallery.js. Bricks-ready: self-contained, site tokens are used with fallbacks.
   Grid: six columns of square photos with a 12px gap (as in the reference); three on small laptops and tablets,
   two on phones. */
.tilt-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tilt-gallery__item { margin: 0; perspective: 1000px; transition: scale .45s cubic-bezier(.2, .7, .2, 1); }
.tilt-gallery__link { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-md, 12px); background: #eee; cursor: pointer; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease; }
.tilt-gallery__link:focus-visible { outline: 2px solid var(--kak-red, #ed1c24); outline-offset: 3px; }
.tilt-gallery__link img { display: block; width: calc(100% + 24px); max-width: none; height: calc(100% + 24px); margin: -12px; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
/* Hover (mouse only): the card grows 5% and tilts towards the pointer; the script sets the rotation. */
.tilt-gallery__item.is-tilting { position: relative; z-index: 2; scale: 1.05; }
.tilt-gallery__item.is-tilting .tilt-gallery__link { box-shadow: 0 20px 40px rgb(0 0 0 / 30%); transition-duration: .15s, .45s; }
.tilt-gallery__item.is-tilting img { transition-duration: .15s; }

/* Lightbox: full screen, the photo whole in the middle, boxed controls (dark face, red on hover, 6px glass frame). */
.has-tilt-lightbox { overflow: hidden; }
.tilt-lightbox { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 90px 30px 120px; box-sizing: border-box; border: 0; background: rgb(0 0 0 / 92%); color: #fff; opacity: 0; transition: opacity .3s ease; }
.tilt-lightbox:not([open]) { display: none; }
.tilt-lightbox::backdrop { background: transparent; }
.tilt-lightbox.is-open { opacity: 1; }
.tilt-lightbox__stage { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; margin: 0; }
.tilt-lightbox__image { display: block; max-width: min(100%, 1200px); max-height: calc(100dvh - 210px); object-fit: contain; border-radius: var(--radius-md, 12px); opacity: 0; scale: .96; transition: opacity .3s ease, scale .4s cubic-bezier(.2, .7, .2, 1); }
.tilt-lightbox.is-open .tilt-lightbox__image.is-ready { opacity: 1; scale: 1; }
.tilt-lightbox__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tilt-lightbox__shell { position: relative; isolation: isolate; display: flex; border-radius: calc(var(--radius-sm, 8px) + 6px); }
/* On the near-black backdrop the usual 6% glass is the same tone as the #151515 face, so the frame is lifted to 14%. */
.tilt-lightbox__shell::after { content: ''; position: absolute; z-index: -1; inset: -6px; border-radius: inherit; background: rgb(255 255 255 / 14%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tilt-lightbox__shell--close { position: absolute; top: 30px; right: 30px; }
.tilt-lightbox__nav { position: absolute; bottom: 36px; left: 50%; display: flex; gap: 24px; translate: -50% 0; }
.tilt-lightbox.is-single .tilt-lightbox__nav { display: none; }
.tilt-lightbox__control { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--radius-sm, 8px); background: var(--kak-control-bg, #151515); color: #fff; cursor: pointer; transition: background-color .25s ease; }
.tilt-lightbox__control:hover, .tilt-lightbox__control:focus-visible { background: var(--kak-red, #ed1c24); }
.tilt-lightbox__control:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tilt-lightbox__control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
.tilt-lightbox__control--prev svg { rotate: 180deg; }

@media (prefers-reduced-motion: reduce) {
  .tilt-gallery__item, .tilt-gallery__link, .tilt-gallery__link img, .tilt-lightbox, .tilt-lightbox__image { transition: none; }
}
@media (max-width: 1100px) {
  .tilt-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .tilt-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* An odd last photo would sit alone in the two-column grid; phones leave it out. */
  .tilt-gallery > .tilt-gallery__item:last-child:nth-child(odd) { display: none; }
  .tilt-lightbox { padding: 80px 16px 110px; }
  .tilt-lightbox__shell--close { top: 20px; right: 20px; }
  .tilt-lightbox__nav { bottom: 30px; }
  .tilt-lightbox__control { width: 44px; height: 44px; }
  .tilt-lightbox__image { max-height: calc(100dvh - 190px); }
}
