/* Shared image lightbox (how-it-works, profile, club gallery, …) */

body.cp-lightbox-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.cp-lightbox {
  padding: 0;
  border: 1px solid rgba(244, 241, 234, 0.12);
  border-radius: 18px;
  background: #0c0c10;
  color: var(--ink, #f4f1ea);
  width: min(92vw, 440px);
  max-width: min(92vw, calc(100vw - 1rem));
  max-height: min(88vh, 88dvh, 920px);
  height: auto;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  box-sizing: border-box;
}

.cp-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.cp-lightbox__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  background: rgba(7, 7, 8, 0.92);
  flex-shrink: 0;
}

.cp-lightbox__title {
  margin: 0;
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.cp-lightbox__fullsize {
  padding: 0.42rem 0.75rem;
  border: 1px solid rgba(244, 241, 234, 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft, rgba(244, 241, 234, 0.72));
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cp-lightbox__fullsize:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(244, 241, 234, 0.28);
  color: var(--ink, #f4f1ea);
}

.cp-lightbox__fullsize[aria-pressed="true"] {
  border-color: rgba(212, 165, 116, 0.45);
  color: var(--accent, #d4a574);
  background: rgba(212, 165, 116, 0.08);
}

.cp-lightbox__fullsize:focus-visible,
.cp-lightbox__close:focus-visible {
  outline: 2px solid var(--accent, #d4a574);
  outline-offset: 2px;
}

.cp-lightbox__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 241, 234, 0.14);
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #f4f1ea);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cp-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(244, 241, 234, 0.28);
}

.cp-lightbox__scroll {
  max-height: calc(min(88vh, 88dvh, 920px) - 3.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #3a3a42 #0a0a0b;
  display: grid;
  place-items: center;
  background: #070708;
  min-height: 0;
}

.cp-lightbox__scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.cp-lightbox__scroll::-webkit-scrollbar-track {
  background: #0a0a0b;
}

.cp-lightbox__scroll::-webkit-scrollbar-thumb {
  background: #3a3a42;
  border-radius: 8px;
  border: 2px solid #0a0a0b;
}

.cp-lightbox__scroll::-webkit-scrollbar-thumb:hover {
  background: #4e4e58;
}

/* Fit: image stays within the modal viewport */
.cp-lightbox__scroll img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(min(88vh, 88dvh, 920px) - 3.5rem);
  object-fit: contain;
}

/* Full-size: natural pixel width, scroll inside the modal */
.cp-lightbox.is-fullsize {
  width: min(96vw, 920px);
  max-width: min(96vw, calc(100vw - 1rem));
  max-height: min(94vh, 94dvh);
  border-radius: 14px;
}

.cp-lightbox.is-fullsize .cp-lightbox__scroll {
  max-height: calc(min(94vh, 94dvh) - 3.5rem);
  overflow-x: auto;
  overflow-y: auto;
  place-items: start center;
}

.cp-lightbox.is-fullsize .cp-lightbox__scroll img {
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  object-fit: contain;
}

@media (max-width: 720px) {
  .cp-lightbox {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 14px;
  }

  .cp-lightbox__chrome {
    padding: 0.65rem 0.7rem;
    gap: 0.5rem;
  }

  .cp-lightbox__fullsize {
    padding: 0.35rem 0.55rem;
    font-size: 0.65rem;
  }

  .cp-lightbox__scroll {
    max-height: calc(100dvh - 1rem - 3.5rem);
  }

  .cp-lightbox__scroll img {
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 1rem - 3.5rem);
  }

  .cp-lightbox.is-fullsize {
    width: calc(100vw - 0.5rem);
    max-width: calc(100vw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    height: auto;
    border-radius: 12px;
  }

  .cp-lightbox.is-fullsize .cp-lightbox__scroll {
    max-height: calc(100dvh - 0.5rem - 3.5rem);
    overflow-x: auto;
    overflow-y: auto;
    place-items: start center;
  }

  .cp-lightbox.is-fullsize .cp-lightbox__scroll img {
    width: auto;
    max-width: none;
    max-height: none;
    height: auto;
    object-fit: contain;
  }
}
