/* Polaroid masonry + lightbox styling for gallery pages */

.album-gallery {
  background:
    radial-gradient(circle at 16% 10%, rgba(212, 160, 23, 0.14), transparent 40%),
    radial-gradient(circle at 84% 20%, rgba(255, 75, 75, 0.12), transparent 42%),
    linear-gradient(160deg, #050505 0%, #0b0a08 56%, #050505 100%);
  padding: 3rem clamp(1rem, 4vw, 2rem) 5rem;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
  column-count: 4;
  column-gap: 2.5rem;
}

.album-gallery__item {
  background: #f5f0e8;
  padding: 8px 8px 36px;
  border-radius: 2px;
  box-shadow: 4px 6px 0 #111;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  break-inside: avoid;
  box-sizing: border-box;
  display: inline-block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 2rem;
}

.album-gallery__item--portrait {
  width: min(280px, 100%);
  max-width: min(280px, 100%);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.album-gallery__photo-wrap {
  position: relative;
  display: block;
  max-width: 100%;
}

.album-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.polaroid__download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d4a017;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.polaroid__download-btn--lightbox {
  width: 36px;
  height: 36px;
  bottom: 10px;
  right: 10px;
  opacity: 1;
  z-index: 4;
}

.polaroid__download-btn:hover {
  filter: brightness(1.06);
}

.polaroid__download-btn:focus-visible {
  opacity: 1;
  outline: 2px solid #1a1204;
  outline-offset: 2px;
}

@media (hover: hover) {
  .album-gallery__item:hover .polaroid__download-btn {
    opacity: 1;
  }
}

@media (hover: none), (pointer: coarse) {
  .polaroid__download-btn {
    opacity: 0.92;
  }
}

.album-gallery__item:hover img {
  opacity: 0.96;
}

.polaroid__caption {
  color: #2a1a08;
  text-align: center;
  line-height: 1.25;
  user-select: none;
  margin: 0;
}

.polaroid__caption--title {
  font-family: "Caveat", cursive;
  font-size: 15px;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.polaroid__caption--date {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.polaroid__caption--lightbox.polaroid__caption--title {
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  margin-top: 12px;
}

.polaroid__caption--lightbox.polaroid__caption--date {
  font-size: clamp(0.65rem, 2.2vw, 0.8rem);
  margin-top: 6px;
}

.album-gallery__item:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.album-gallery__item:nth-child(even) {
  transform: rotate(1deg);
}

.album-gallery__item:nth-child(3n) {
  transform: rotate(-0.5deg);
}

.album-gallery__item:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 6px 10px 0 #111;
  z-index: 2;
  position: relative;
}

@media (max-width: 1100px) {
  .album-gallery {
    column-count: 3;
  }
}

@media (max-width: 760px) {
  .album-gallery {
    column-count: 2;
    column-gap: 1.5rem;
    padding: 2rem 16px 4rem;
    text-align: center;
  }
  .album-gallery__item {
    display: inline-block;
    margin-left: 0;
    margin-right: 0;
    vertical-align: top;
  }
}

@media (max-width: 520px) {
  .album-gallery {
    column-count: 1;
    column-gap: 1.25rem;
    padding: 2rem 1rem 4rem;
    text-align: initial;
  }
  .album-gallery__item,
  .album-gallery__item--portrait {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 2rem;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 12%, rgba(212, 160, 23, 0.2), transparent 42%),
    radial-gradient(circle at 78% 18%, rgba(255, 75, 75, 0.16), transparent 44%),
    linear-gradient(160deg, #050505 0%, #0b0a08 56%, #050505 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(72px, 11vh, 120px) clamp(16px, 4vw, 48px);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__img-wrap {
  position: relative;
  background: #f5f0e8;
  padding: 8px 8px 32px;
  border-radius: 2px;
  box-shadow: 8px 14px 0 #111;
  width: fit-content;
  max-width: min(94vw, 720px);
  margin: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: visible;
}

.lightbox__img-wrap::before,
.lightbox__img-wrap::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 15px;
  background: rgba(255, 220, 100, 0.52);
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.lightbox__img-wrap::before {
  top: -6px;
  left: 4px;
  transform: rotate(-34deg);
  transform-origin: 30% 50%;
}

.lightbox__img-wrap::after {
  top: -5px;
  right: 4px;
  left: auto;
  transform: rotate(32deg);
  transform-origin: 70% 50%;
}

.lightbox__img-wrap--tape-b::before {
  top: -6px;
  left: 4px;
  transform: rotate(36deg);
  transform-origin: 30% 50%;
}

.lightbox__img-wrap--tape-b::after {
  top: -5px;
  right: 4px;
  left: auto;
  transform: rotate(-34deg);
  transform-origin: 70% 50%;
}

.lightbox__img-wrap--tape-c::before {
  top: -7px;
  left: 2px;
  transform: rotate(-46deg);
  transform-origin: 25% 50%;
}

.lightbox__img-wrap--tape-c::after {
  top: -6px;
  right: 2px;
  left: auto;
  transform: rotate(44deg);
  transform-origin: 75% 50%;
}

.lightbox__photo {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
}

.lightbox__photo img {
  display: block;
  max-width: min(94vw - 16px, 704px);
  max-height: min(68vh, 820px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  vertical-align: middle;
}

.lightbox__close {
  position: fixed;
  top: clamp(14px, 3vh, 28px);
  right: clamp(14px, 3vw, 28px);
  z-index: 10003;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
  outline: none;
}

.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.lightbox__prev:hover,
.lightbox__next:hover,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
  outline: none;
}

.lightbox__prev {
  left: clamp(12px, 2.5vw, 28px);
}

.lightbox__next {
  right: clamp(12px, 2.5vw, 28px);
}

.lightbox__download {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: none;
  width: 100%;
  max-width: 280px;
  margin: 14px auto 0;
  z-index: 1;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  background: #f4c430;
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lightbox__download:hover {
  filter: brightness(1.05);
}

.photo-follow-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-follow-modal[hidden] {
  display: none;
}

.photo-follow-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.photo-follow-modal__card {
  position: relative;
  z-index: 1;
  width: min(92vw, 430px);
  background: #f2efea;
  color: #1f1206;
  border-radius: 3px;
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 38px 30px 24px;
  text-align: center;
}

.photo-follow-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #4b3b2b;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
}

.photo-follow-modal__title {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: clamp(2.5rem, 8vw, 3.4rem);
  line-height: 0.88;
  font-weight: 700;
}

.photo-follow-modal__subtitle {
  margin: 10px 0 20px;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: #5b4a3b;
  font-family: "Courier New", Courier, monospace;
}

.photo-follow-modal__steps {
  display: grid;
  gap: 14px;
}

.photo-follow-link {
  width: 100%;
  border: none;
  border-radius: 7px;
  padding: 14px 15px;
  background: linear-gradient(90deg, #2a1706 0%, #362006 100%);
  color: #f3eadf;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.055em;
  font-size: 0.8rem;
}

.photo-follow-link.is-done {
  background: linear-gradient(90deg, #3a260f 0%, #4a3112 100%);
  outline: 2px solid rgba(212, 160, 23, 0.6);
}

.photo-follow-link__left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.photo-follow-link__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  overflow: hidden;
}

.photo-follow-link__icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}

.photo-follow-link__icon--ig {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 52%, #8134af 100%);
}

.photo-follow-link__icon--tt {
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.photo-follow-link__icon--yt {
  background: #ff2a1f;
}

.photo-follow-link__right {
  opacity: 0.72;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.photo-follow-modal__hint {
  margin: 26px 0 12px;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: #5b4a3b;
  font-family: "Courier New", Courier, monospace;
}

.photo-follow-modal__download {
  width: 100%;
  border: 1px solid rgba(75, 59, 43, 0.1);
  border-radius: 999px;
  padding: 14px 16px;
  background: #d4a017;
  color: #1a1204;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-family: "Courier New", Courier, monospace;
  cursor: pointer;
}

.photo-follow-modal__download:disabled {
  background: rgba(240, 238, 233, 0.55);
  color: rgba(75, 59, 43, 0.28);
  border-color: rgba(75, 59, 43, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  opacity: 1;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .lightbox {
    padding: 64px 8px;
  }

  .lightbox__prev,
  .lightbox__next {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .lightbox__photo img {
    max-height: min(58vh, 720px);
  }
}
