/* Visor de captura compartida — modal y página /catch/{id} */

.capture-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.capture-share-overlay[hidden] {
  display: none !important;
}

.capture-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(6px);
}

.capture-share-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #0f172a;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.capture-share-dialog-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  padding: 0.5rem 0.5rem 0;
  background: #0f172a;
}

.capture-share-close {
  position: static;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.capture-share-close:hover {
  background: rgba(30, 41, 59, 0.95);
}

.capture-share-stage {
  position: relative;
  overflow: hidden;
  background: #020617;
  min-height: 240px;
  max-height: min(72vh, 720px);
  touch-action: none;
  cursor: zoom-in;
}

.capture-share-stage.capture-share-stage--dragging {
  cursor: grabbing;
}

.capture-share-zoom-wrap {
  position: relative;
  transform-origin: center center;
  will-change: transform;
}

.capture-share-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 720px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.capture-share-gradient {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.capture-share-gradient--top {
  top: 0;
  height: 28%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent);
}

.capture-share-gradient--bottom {
  bottom: 0;
  height: 32%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.35) 55%, transparent);
}

.capture-share-brand {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.capture-share-brand--top {
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: calc(100% - 4rem);
}

.capture-share-brand--bottom {
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
}

.capture-share-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  object-fit: cover;
}

.capture-share-wordmark {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 3vw, 1.35rem);
  line-height: 1;
}

.capture-share-wordmark-ai {
  color: #15a8dc;
}

.capture-share-wordmark-peces {
  color: #fff;
}

.capture-share-author {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
}

.capture-share-species {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1rem, 3.2vw, 1.45rem);
  line-height: 1.25;
}

.capture-share-metrics {
  margin: 0.25rem 0 0;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  color: #fef3c7;
}

.capture-share-footer {
  padding: 0.75rem 1rem 1rem;
}

.capture-share-overlay--desktop .capture-share-footer {
  display: none;
}

.capture-share-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #15a8dc, #0e7490);
  color: #fff;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(21, 168, 220, 0.35);
}

.capture-share-app-btn:hover {
  filter: brightness(1.06);
}

body.capture-share-open {
  overflow: hidden;
}

.capture-share-overlay--photo .capture-share-brand,
.capture-share-overlay--photo .capture-share-gradient {
  display: none;
}

.capture-share-overlay--photo .capture-share-stage {
  cursor: zoom-in;
}

.capture-share-overlay--photo .capture-share-photo {
  max-height: min(80vh, 820px);
}

.capture-share-trigger {
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  width: 100%;
}

a.capture-share-trigger {
  display: block;
  text-decoration: none;
}

body.capture-share-page {
  margin: 0;
  min-height: 100vh;
  background: #0b1120;
  color: #e2e8f0;
  font-family: 'Nunito', system-ui, sans-serif;
}

.capture-share-page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.capture-share-page-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
}

.capture-share-page-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1rem 2rem;
  max-width: 920px;
  margin: 0 auto;
}

.capture-share-page-viewer {
  width: 100%;
}

.capture-share-page-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #020617;
}

.capture-share-page-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}

.capture-share-page-noimg {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 1.1rem;
}

.capture-share-page-cta {
  width: min(420px, 100%);
}

.capture-share-page-loading,
.capture-share-page-error {
  text-align: center;
  padding: 3rem 1rem;
  color: #cbd5e1;
}

.capture-share-page-link {
  color: #15a8dc;
}

@media (max-width: 640px) {
  .capture-share-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .capture-share-stage {
    max-height: calc(100vh - 120px);
  }

  .capture-share-photo {
    max-height: calc(100vh - 120px);
  }
}
