/* MyCabina — event galleries (/galerii, password page, event gallery).
   Loaded after site.css and built on its tokens and components. */

/* ---------- Shared ---------- */
.gfooter { padding-block: 0 2rem; }
.gfooter .site-footer { margin-top: 0; border-top: 0; padding-top: 2rem; }

.events,
.gate,
.album-view { padding-block: clamp(7rem, 14vh, 10rem) var(--section); min-height: 80svh; }

.events__head,
.album-view__head {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
@media (min-width: 62rem) {
  .events__head,
  .album-view__head { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; }
}

@media (prefers-reduced-motion: no-preference) {
  .events .line > span { animation: line-up 1.1s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
}

.events__empty { display: grid; gap: .75rem; padding-block: 3rem; }

/* ---------- /galerii: every event is a print on the table ---------- */
.events__intro { display: grid; gap: 1.75rem; }
.events__search { max-width: 24rem; }
.events__search .input::-webkit-search-cancel-button { -webkit-appearance: none; }

.events__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3.5vw, 3rem);
}
.events__none { padding-block: 2rem; }

.event {
  display: grid;
  gap: 1.35rem;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
}
.event__print {
  rotate: var(--r, 0deg);
  transition: rotate .5s var(--ease), translate .5s var(--ease), box-shadow .5s var(--ease);
}
.events__grid li:nth-child(4n + 1) .event__print { --r: -1.8deg; }
.events__grid li:nth-child(4n + 2) .event__print { --r: 1.2deg; }
.events__grid li:nth-child(4n + 3) .event__print { --r: -.7deg; }
.events__grid li:nth-child(4n + 4) .event__print { --r: 2deg; }
.event__print img,
.event__blank {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--sand);
}
.event__blank { display: grid; place-items: center; background: var(--paper); color: var(--tan); }
.event__blank svg { width: 2.75rem; height: 2.75rem; stroke-width: 1; }
.event:hover .event__print,
.event:focus-visible .event__print {
  rotate: 0deg;
  translate: 0 -.4rem;
}
.event__body { display: grid; gap: .2rem; justify-items: start; }
.event__name { transition: color .25s; }
.event:hover .event__name { color: var(--brown); }
.event__date { color: var(--ink-2); }
.event__details { color: var(--ink-3); }
.event__lock,
.gate__tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--brown);
  font-weight: 560;
}
.event__lock { margin-top: .35rem; font-size: .95rem; }
.event__lock svg,
.gate__tag svg { width: 1rem; height: 1rem; flex: none; }

/* Prints are dealt onto the page once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .events__grid li { animation: deal .8s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 350ms); }
}
@keyframes deal {
  from { opacity: 0; translate: 0 2.5rem; rotate: 4deg; }
}

/* ---------- Password page ---------- */
.gate__grid { display: grid; gap: clamp(3rem, 7vw, 6rem); align-items: center; }
.gate__copy { display: grid; gap: 1.5rem; justify-items: start; }
.gate__copy .h1 { font-size: clamp(3.2rem, 13vw, 7rem); overflow-wrap: anywhere; }
.gate__form { width: min(100%, 26rem); margin-top: .5rem; }
.gate__help { display: grid; gap: .5rem; color: var(--ink-2); }
.gate__pile { display: none; position: relative; width: min(100%, 26rem); aspect-ratio: 1.3; justify-self: center; }
.gate__sheet { position: absolute; inset: 8% 6% auto 6%; width: auto; aspect-ratio: 1.42; padding: 0; }
.gate__sheet:nth-child(1) { rotate: -9deg; translate: -6% 4%; }
.gate__sheet:nth-child(2) { rotate: 6deg; translate: 7% 7%; }
.gate__sheet:nth-child(3) { rotate: -2deg; display: grid; place-items: center; }
.gate__lock { color: var(--tan); }
.gate__lock svg { width: 3.5rem; height: 3.5rem; stroke-width: 1; }
@media (min-width: 62rem) {
  .gate__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .gate__copy .h1 { font-size: clamp(4.5rem, 7.4vw, 7.5rem); }
  .gate__pile { display: block; }
}

/* ---------- Event gallery ---------- */
.album-view__title { display: grid; gap: 1rem; }
.album-view__title .h1 { overflow-wrap: anywhere; }
.album-view__where { font-size: clamp(1.125rem, 1.5vw, 1.3rem); color: var(--brown); font-weight: 500; }
.album-view__intro { display: grid; gap: 1.25rem; }
.album-view__links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.6rem, 1.6vw, 1.25rem);
}
@media (min-width: 40rem) { .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 75rem) { .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shots li { content-visibility: auto; contain-intrinsic-size: auto 14rem; }
.shot {
  display: block;
  width: 100%;
  padding: clamp(.25rem, .6vw, .45rem);
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 1px 1px rgb(26 20 14 / .07), 0 6px 16px -8px rgb(26 20 14 / .28);
  cursor: zoom-in;
  transition: translate .4s var(--ease), box-shadow .4s var(--ease);
}
.shot img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--sand); }
.shot:hover { translate: 0 -.3rem; box-shadow: 0 1px 1px rgb(26 20 14 / .07), 0 18px 30px -14px rgb(26 20 14 / .4); }
@media (prefers-reduced-motion: no-preference) {
  .shots li:nth-child(-n + 12) { animation: deal .7s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms + 250ms); }
  .shots li:nth-child(2) { --n: 1; } .shots li:nth-child(3) { --n: 2; } .shots li:nth-child(4) { --n: 3; }
  .shots li:nth-child(5) { --n: 4; } .shots li:nth-child(6) { --n: 5; } .shots li:nth-child(7) { --n: 6; }
  .shots li:nth-child(8) { --n: 7; } .shots li:nth-child(9) { --n: 8; } .shots li:nth-child(10) { --n: 9; }
  .shots li:nth-child(11) { --n: 10; } .shots li:nth-child(12) { --n: 11; }
}

/* Viewer (extends .lightbox from site.css) */
.viewer .lightbox__bar { flex-wrap: wrap; justify-content: center; }
@media (max-width: 30rem) {
  .viewer .lightbox__bar { gap: .4rem; }
  .viewer .lightbox__count { min-width: 0; padding-inline: .2rem; }
}
.viewer .lightbox__bar .btn svg { width: 1rem; height: 1rem; }
.viewer .lightbox__print { touch-action: pan-y; }
.viewer .lightbox__print img { transition: opacity .2s; }
.viewer.is-loading .lightbox__print img { opacity: .55; }
::view-transition-group(shot) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }
::view-transition-old(shot), ::view-transition-new(shot) { height: 100%; object-fit: cover; }

/* Instagram reminder, shown once after scrolling a while */
.nudge {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .4rem .4rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 14px 34px -12px rgb(26 20 14 / .6);
  translate: -50% 0;
  white-space: nowrap;
  transition: translate .5s var(--ease), opacity .5s var(--ease);
}
.nudge.is-away { translate: -50% 150%; opacity: 0; }
.nudge .icon-btn { width: 2.25rem; height: 2.25rem; color: var(--cream); box-shadow: none; }
.nudge .icon-btn:hover { background: var(--cream); color: var(--ink); }
.nudge :focus-visible { outline-color: var(--tan); }
