/* ===== Share dialog (publications) ===== */

.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: shareFade 0.18s ease;
}

.share-dialog {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px 22px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.45);
  font-family: 'Outfit', 'Inter', sans-serif;
  color: #0f172a;
  outline: none;
  animation: sharePop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.share-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #064e3b;
}

.share-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.share-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* --- The issue being shared --- */
.share-issue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #f8fafc;
  margin-bottom: 18px;
}

.share-issue-cover {
  width: 42px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #15803d, #064e3b);
}

.share-issue-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.share-issue-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-issue-text strong {
  font-size: 0.95rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-issue-text span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

/* --- Share targets --- */
.share-targets {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 6px;
}

.share-target {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.share-target:hover {
  background: #f8fafc;
}

.share-target:focus-visible,
.share-close:focus-visible,
.share-link button:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.45);
  outline-offset: 2px;
}

.share-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.35);
  transition: transform 0.18s ease;
}

.share-target:hover .share-icon {
  transform: translateY(-2px) scale(1.05);
}

.share-icon.is-whatsapp {
  background: #25d366;
}

.share-icon.is-instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.share-icon.is-gmail {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.share-icon.is-copy,
.share-icon.is-more {
  background: #f1f5f9;
  color: #0f172a;
}

.share-icon.is-copy.is-done {
  background: #dcfce7;
  color: #15803d;
}

/* --- Link field --- */
.share-link {
  display: flex;
  gap: 8px;
}

.share-link input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}

.share-link input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.share-link button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.share-link button:hover {
  background: linear-gradient(135deg, #15803d, #166534);
}

.share-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.85rem;
  font-weight: 600;
}

.share-hint {
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  text-align: center;
}

@keyframes shareFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sharePop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes shareSlideUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* Phones: a bottom sheet, like the system share sheet. */
@media (max-width: 560px) {
  .share-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .share-dialog {
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    animation: shareSlideUp 0.25s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-backdrop,
  .share-dialog {
    animation: none;
  }
  .share-icon,
  .share-target:hover .share-icon {
    transition: none;
    transform: none;
  }
}
