/* ============================================================
 * share-image.css — styles for share-image.js module
 * Loaded on any page that uses ShareImage.init()
 * Depends on: design-system.css (tokens must be present)
 * ============================================================ */

/* ── Trigger button wrapper ──────────────────────────────────── */
.si-trigger-wrap {
  display: flex;
  justify-content: center;
  padding: var(--space-2) 0 var(--space-6);
}

.si-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.si-trigger:hover                { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.si-trigger:disabled             { cursor: wait; opacity: 0.35; }
.si-trigger[data-si-loading]     { opacity: 0.4; pointer-events: none; }
.si-trigger[data-si-loading]::after { content: ' …'; }

/* ── Overlay ─────────────────────────────────────────────────── */
.si-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.si-overlay[hidden] { display: none; }

.si-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(4px);
}

/* ── Dialog ──────────────────────────────────────────────────── */
.si-dialog {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.50);
}

.si-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.si-close:hover { color: var(--text-primary); }

/* ── Image preview ───────────────────────────────────────────── */
.si-preview-wrap {
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 52vh;
}

.si-preview-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ── Action buttons ──────────────────────────────────────────── */
.si-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.si-btn {
  flex: 1;
  min-width: 110px;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s;
}
.si-btn:hover    { opacity: 0.85; }
.si-btn:disabled { opacity: 0.4; cursor: wait; }

.si-btn--primary   { background: var(--accent); color: #fff; }
.si-btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-secondary);
  opacity: 0.8;
}
.si-btn--secondary:hover { opacity: 1; }

.si-btn--webshare  { background: var(--navy, #003f5c); color: #fff; }

/* ── Copy confirmation message ───────────────────────────────── */
.si-copy-msg {
  min-height: 1.2em;
  font-size: 0.80rem;
  color: var(--accent);
  text-align: center;
  margin: 0;
}
