/* ============================================
   EDIT LINKS FOR DECAP CMS
   Edit buttons shown when logged in via Netlify Identity
   ============================================ */

/* Edit button on card image (top right corner) */
.edit-card-link {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(197, 100, 28, 0.95);
  color: white !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
}

/* Ensure icon is visible */
.edit-card-link i {
  color: white;
  font-size: 16px;
  line-height: 1;
}

.edit-card-link.edit-link-visible {
  opacity: 1;
  transform: scale(1);
}

.edit-card-link:hover {
  background: #a0501a;
  transform: scale(1.1) !important;
  box-shadow: 0 4px 12px rgba(197, 100, 28, 0.4);
}

.edit-card-link:active {
  transform: scale(0.95) !important;
}

/* Ensure card image has position relative for absolute positioning */
.post-card-image {
  position: relative;
}

/* Edit link on post title (inline with title) */
.edit-post-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 16px;
  background: rgba(197, 100, 28, 0.1);
  color: #c5641c;
  border-radius: 8px;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  vertical-align: middle;
  opacity: 0;
  transform: translateY(-2px) scale(0.8);
}

.edit-post-link.edit-link-visible {
  opacity: 1;
  transform: translateY(-2px) scale(1);
}

.edit-post-link:hover {
  background: rgba(197, 100, 28, 0.2);
  color: #a0501a;
  transform: translateY(-2px) scale(1.1);
}

.edit-post-link:active {
  transform: translateY(-2px) scale(0.95);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .edit-card-link {
    width: 36px;
    height: 36px;
    font-size: 14px;
    top: 8px;
    right: 8px;
  }

  .edit-post-link {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-left: 8px;
  }
}

/* Accessibility: Focus states */
.edit-card-link:focus-visible,
.edit-post-link:focus-visible {
  outline: 3px solid #c5641c;
  outline-offset: 2px;
}

/* Animation for appearing */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.edit-link-visible {
  animation: fadeInScale 0.3s ease forwards;
}
