/* Share sheet — vlastní styly (ne .btn), ať funguje i na KdoJaku bez portal CSS. */
.share-sheet {
  --share-ink: var(--color-text, var(--kj-ink, #0c1210));
  --share-muted: var(--color-text-muted, var(--kj-muted, #6a7870));
  --share-surface: var(--color-surface, var(--kj-surface-raised, #ffffff));
  --share-line: var(--color-border, var(--kj-line, rgb(12 18 16 / 10%)));
  --share-accent: var(--color-primary, var(--kj-accent, #1a6b45));
  --share-accent-deep: var(--color-primary-hover, var(--kj-accent-deep, #0e4a2e));
  --share-accent-soft: var(--color-primary-soft, var(--kj-accent-soft, #e8f4ee));
  --share-radius: var(--radius-lg, var(--kj-radius, 1.05rem));
  --share-radius-sm: var(--radius-md, var(--kj-radius-sm, 0.75rem));
  --share-font: var(--font-body, var(--kj-font-body, "Figtree", ui-sans-serif, system-ui, sans-serif));
  --share-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  inset: 0;
  z-index: 3500;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: var(--share-font);
}

.share-sheet[hidden] {
  display: none !important;
}

body.share-sheet-open {
  overflow: hidden;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgb(12 18 16 / 48%);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.share-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22.5rem);
  padding: 1.35rem 1.35rem 1.15rem;
  border: 1px solid var(--share-line);
  border-radius: var(--share-radius);
  background: var(--share-surface);
  box-shadow:
    0 1px 0 rgb(12 18 16 / 4%),
    0 24px 56px rgb(12 18 16 / 16%);
  color: var(--share-ink);
}

.share-sheet-title {
  margin: 0 2rem 0.35rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--share-ink);
}

.share-sheet-intro {
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--share-muted);
  word-break: break-word;
}

.share-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.share-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.2rem;
  border-radius: var(--share-radius-sm);
  text-decoration: none;
  color: var(--share-ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background 0.18s var(--share-ease), transform 0.18s var(--share-ease);
}

.share-sheet-item:hover,
.share-sheet-item:focus-visible {
  background: var(--share-accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.share-sheet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 6px 14px rgb(12 18 16 / 12%);
}

.share-sheet-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.share-sheet-icon--whatsapp {
  background: #25d366;
}

.share-sheet-icon--messenger {
  background: linear-gradient(135deg, #00b2ff, #006aff);
}

.share-sheet-icon--facebook {
  background: #1877f2;
}

.share-sheet-icon--x {
  background: #0f172a;
}

.share-sheet-actions {
  display: grid;
  gap: 0.55rem;
}

.share-sheet-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--share-accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 18%) inset,
    0 10px 22px color-mix(in srgb, var(--share-accent) 28%, transparent);
  transition: transform 0.18s var(--share-ease), box-shadow 0.18s var(--share-ease), filter 0.18s var(--share-ease);
}

.share-sheet-copy:hover,
.share-sheet-copy:focus-visible {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 22%) inset,
    0 14px 28px color-mix(in srgb, var(--share-accent) 34%, transparent);
  outline: none;
}

.share-sheet-copy:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.share-sheet-copy-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.95;
}

.share-sheet-copy-icon svg {
  display: block;
}

.share-sheet-system {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--share-line);
  border-radius: 999px;
  background: transparent;
  color: var(--share-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--share-ease), color 0.18s var(--share-ease), border-color 0.18s var(--share-ease);
}

.share-sheet-system:hover,
.share-sheet-system:focus-visible {
  background: var(--share-accent-soft);
  border-color: color-mix(in srgb, var(--share-accent) 28%, var(--share-line));
  color: var(--share-ink);
  outline: none;
}

.share-sheet-hint {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--share-muted);
  text-align: center;
}

.share-sheet-feedback {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-success, var(--kj-ok, #15803d));
  text-align: center;
}

@media (max-width: 360px) {
  .share-sheet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .share-sheet-copy {
    box-shadow: 0 10px 22px rgb(26 107 69 / 22%);
  }

  .share-sheet-copy:hover,
  .share-sheet-copy:focus-visible {
    box-shadow: 0 14px 28px rgb(26 107 69 / 28%);
  }

  .share-sheet-system:hover,
  .share-sheet-system:focus-visible {
    border-color: rgb(26 107 69 / 28%);
  }
}
