/**
 * Social Share System Styles
 * Lightweight, accessible, dark/light theme compatible
 */

.share-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px 0;
  padding: 20px 0;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--accent);
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html.dark .share-btn:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.share-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.share-btn:active {
  transform: translateY(0);
}

.share-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-icon svg {
  width: 100%;
  height: 100%;
}

.share-text {
  display: none;
}

/* Show text on larger screens */
@media (min-width: 480px) {
  .share-text {
    display: inline;
  }
}

/* Mobile: stacked layout */
@media (max-width: 479px) {
  .share-buttons {
    gap: 6px;
  }

  .share-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .share-icon {
    width: 18px;
    height: 18px;
  }
}

/* Tablet: two rows if needed */
@media (max-width: 599px) and (min-width: 480px) {
  .share-buttons {
    max-width: 320px;
  }
}

/* Toast notification */
.share-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  padding: 12px 20px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

html.dark .share-toast {
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}

.share-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Mobile toast positioning */
@media (max-width: 479px) {
  .share-toast {
    bottom: 16px;
    left: 16px;
    right: 16px;
    transform: translateY(150px);
  }

  .share-toast.show {
    transform: translateY(0);
  }
}

/* Accessibility: keyboard navigation */
.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dark theme adjustments */
html.dark .share-btn {
  border-color: rgba(245, 245, 245, 0.15);
}

html.dark .share-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .share-btn,
  .share-toast {
    transition: none;
  }

  .share-btn:hover {
    transform: none;
  }
}

/* Print: hide share buttons */
@media print {
  .share-bar {
    display: none;
  }
}
