/* share-tylerdurden nudge module — LinkedIn follow modal
 * AIR design system: Poppins display, DM Sans body, -0.04em tracking.
 */

.share-nudge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483641;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.share-nudge-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.share-nudge-modal {
  position: relative;
  width: min(92vw, 420px);
  height: min(85vh, 560px);
  max-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  background: #BFDDE8 center / cover no-repeat;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  container-type: inline-size;
  container-name: nudge;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1A2121; /* AIR text-primary */
}

.share-nudge-backdrop.is-open .share-nudge-modal {
  transform: scale(1);
}

/* Countdown / close — top right. Compact pill that holds the countdown
 * digits, then morphs to ✕ at zero. Countdown and ✕ render at identical size. */
.share-nudge-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #1A2121;
  font-family: "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  z-index: 4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

@keyframes share-nudge-pop {
  0%   { transform: scale(0.78); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.share-nudge-close.is-counting {
  animation: share-nudge-pop 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* When countdown completes, button flips to dark ✕ at the same size, becomes clickable */
.share-nudge-close.is-ready {
  background: #000;
  color: #fff;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
}

.share-nudge-close.is-ready:hover {
  transform: scale(1.1);
  background: #1A2121;
}

/* Background image fills modal */
.share-nudge-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Bottom content card — frosted panel that floats over the lower portion of the image.
 * Holds the headline + CTA together so contrast is guaranteed regardless of image region. */
.share-nudge-content {
  position: relative;
  z-index: 2;
  margin: auto 18px 18px;
  padding: 22px 22px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Headline: AIR Poppins, tight tracking, high contrast */
.share-nudge-headline {
  margin: 0;
  text-align: center;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  color: #1A2121;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-size: clamp(20px, 7cqw, 26px);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.share-nudge-alias {
  display: inline;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* CTA button — AIR button-primary (black/black) */
.share-nudge-cta {
  position: relative;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: #000;
  color: #fff;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.share-nudge-cta:hover {
  background: #1A2121;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
}

.share-nudge-cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.share-nudge-cta-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
}

/* Small screens: tighten spacing */
@container nudge (max-width: 360px) {
  .share-nudge-content {
    margin: auto 14px 14px;
    padding: 18px 18px 16px;
    gap: 14px;
  }
  .share-nudge-cta { padding: 12px 18px; font-size: 14px; }
  .share-nudge-close { width: 40px; height: 40px; font-size: 18px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .share-nudge-backdrop,
  .share-nudge-modal,
  .share-nudge-close,
  .share-nudge-cta {
    transition: none;
  }
}
