/* ==========================================================================
   Social Share Bar — HAMCO Sports News
   Desktop: fixed left vertical stack
   Mobile: fixed bottom horizontal bar
   Selectors match template-parts/single/social-share-bar.php
   Uses global variables from variables.css
   ========================================================================== */

/* ---------- Share Bar Base ---------- */
.hn-share-bar {
  position: fixed;
  left: var(--hn-space-5);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--hn-space-1);
  z-index: var(--hn-z-dropdown);
}

/* ---------- Share Button ---------- */
.hn-share-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--hn-radius-full);
  background: var(--hn-white);
  box-shadow: var(--hn-shadow-sm);
  color: var(--hn-gray-600);
  cursor: pointer;
  transition: all var(--hn-transition-base);
  position: relative;
  text-decoration: none;
}

.hn-share-bar-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.hn-share-bar-btn:hover svg {
  transform: scale(1.15);
}

.hn-share-bar-btn:focus-visible {
  outline: 2px solid var(--hn-red);
  outline-offset: 2px;
}

/* ---------- Platform Hover Colors ---------- */
.hn-share-bar-btn--twitter:hover {
  background: #1DA1F2;
  color: var(--hn-white);
}

.hn-share-bar-btn--facebook:hover {
  background: #1877F2;
  color: var(--hn-white);
}

.hn-share-bar-btn--reddit:hover {
  background: #FF4500;
  color: var(--hn-white);
}

.hn-share-bar-btn--copy:hover {
  background: var(--hn-black);
  color: var(--hn-white);
}

.hn-share-bar-btn--bookmark:hover {
  background: var(--hn-red);
  color: var(--hn-white);
}

/* ---------- Bookmarked State ---------- */
.hn-share-bar-btn--bookmark.is-bookmarked {
  background: var(--hn-red);
  color: var(--hn-white);
}

/* ---------- Copy Confirmation Tooltip ---------- */
.hn-share-bar-btn--copy .hn-copy-tooltip {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--hn-black);
  color: var(--hn-white);
  font-family: var(--hn-font-body);
  font-size: 11px;
  font-weight: 600;
  padding: var(--hn-space-1) var(--hn-space-3);
  border-radius: var(--hn-radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.hn-share-bar-btn--copy .hn-copy-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--hn-black);
}

.hn-share-bar-btn--copy.is-copied .hn-copy-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ---------- Share Count Badge ---------- */
.hn-share-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--hn-red);
  color: var(--hn-white);
  font-family: var(--hn-font-body);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 var(--hn-space-1);
}

/* ---------- Divider ---------- */
.hn-share-divider {
  width: 24px;
  height: 1px;
  background: var(--hn-gray-200);
  margin: var(--hn-space-1) auto;
}

/* ==========================================================================
   Responsive — Mobile horizontal bar
   ========================================================================== */
@media (max-width: 1024px) {
  .hn-share-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 0;
    background: var(--hn-white);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    border-radius: 0;
  }

  .hn-share-bar-btn {
    width: 48px;
    height: 44px;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    max-width: 72px;
  }

  .hn-share-divider {
    width: 1px;
    height: 24px;
    margin: auto 0;
  }

  /* Tooltip shows above on mobile */
  .hn-share-bar-btn--copy .hn-copy-tooltip {
    left: 50%;
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
  }

  .hn-share-bar-btn--copy .hn-copy-tooltip::before {
    right: auto;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--hn-black);
  }
}

/* Add body padding on mobile so content isn't hidden behind the bar */
@media (max-width: 1024px) {
  body.has-share-bar {
    padding-bottom: 56px;
  }
}
