/*
 * Owner kebab menu + delete confirm — own posts and activities only.
 */

.owner-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: 4;
}

.owner-menu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #262633;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.owner-menu__toggle:hover,
.owner-menu__toggle[aria-expanded="true"] {
  background: #f5f6fa;
  color: #2c3038;
}

.owner-menu__toggle:focus-visible {
  outline: 2px solid rgb(16 139 136 / 35%);
  outline-offset: 2px;
}

.owner-menu__toggle-icon {
  display: block;
}

.owner-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 168px;
  padding: 8px;
  border: 1px solid #eaebea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 0 0.5px rgb(66 71 76 / 18%),
    0 12px 32px rgb(44 48 56 / 14%);
  transform-origin: top right;
  animation: owner-menu-panel-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.owner-menu__edit {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text, #2c3038);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.owner-menu__edit:hover {
  background: #f5f6fa;
  color: #2c3038;
}

.owner-menu__panel[hidden] {
  display: none;
}

.owner-menu__panel.is-fixed {
  position: fixed;
  margin: 0;
  z-index: 80;
}

.owner-menu__delete.btn {
  width: 100%;
  min-width: 152px;
}

.owner-menu-removing {
  overflow: hidden;
  pointer-events: none;
  animation: owner-menu-remove 0.32s ease forwards;
}

.owner-confirm {
  z-index: 120;
}

.owner-confirm__dialog {
  max-width: 360px;
  padding: var(--space-32) var(--space-24) var(--space-24);
  border-radius: 16px;
  text-align: center;
  box-shadow:
    0 24px 48px rgb(44 48 56 / 16%),
    0 8px 16px rgb(44 48 56 / 8%);
  animation: owner-confirm-in 0.22s ease-out;
}

.owner-confirm.is-open .popup__backdrop {
  animation: owner-confirm-backdrop-in 0.22s ease-out;
}

.owner-confirm__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-meta);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.owner-confirm__close:hover {
  color: var(--color-text);
  background: #f0f1f5;
}

.owner-confirm__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-16);
  border-radius: 50%;
  background: #fff0f0;
  color: #ec5b5b;
}

.owner-confirm__title {
  margin: 0 0 var(--space-8);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.owner-confirm__text {
  margin: 0 0 var(--space-24);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-meta);
}

.owner-confirm__actions {
  display: flex;
  gap: var(--space-12);
  width: 100%;
}

.owner-confirm__btn {
  flex: 1;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}

body.owner-confirm-open {
  overflow: hidden;
}

body.owner-confirm-open .popup__backdrop {
  backdrop-filter: blur(2px);
}

@keyframes owner-menu-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes owner-menu-remove {
  from {
    opacity: 1;
    max-height: 1400px;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-width: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@keyframes owner-confirm-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes owner-confirm-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .owner-menu__panel,
  .owner-menu-removing,
  .owner-confirm__dialog,
  .owner-confirm.is-open .popup__backdrop {
    animation: none;
  }
}

@media (min-width: 768px) {
  .owner-menu__toggle {
    width: 24px;
    height: 24px;
    color: #2c3038;
  }
}
