/* Irish Slang · Share Dialog Styles */

body.sp-dialog-open {
  overflow: hidden;
}

.sp-share-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(38rem, 94vw);
  width: 100%;
  margin: auto;
  color: var(--ink);
}

.sp-share-dialog::backdrop {
  background: rgba(10, 25, 18, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Fallback for browsers without native dialog backdrop */
.sp-share-dialog[open] {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.sp-share-modal {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
}

.sp-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.sp-share-heading {
  font: 800 1.25rem/1.2 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sp-share-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: all 150ms var(--ease);
}

.sp-share-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.sp-share-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sp-share-content {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  gap: 1.25rem;
}

.sp-share-previews {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}

.sp-share-card-wrap {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 26rem;
  justify-items: center;
}

.sp-share-card-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.sp-share-preview-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--line);
  display: block;
  background: #1e4d3a;
}

.sp-share-loading {
  font-size: 0.9375rem;
  color: var(--muted);
  padding: 3rem 1rem;
  text-align: center;
}

.sp-share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.sp-share-native-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3rem;
  font-weight: 700;
  font-size: 1rem;
}
.sp-share-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 150ms var(--ease);
}

.sp-share-page-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.sp-share-page-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sp-share-previews.sp-share-single .sp-share-page-btn {
  display: none;
}

.sp-share-downloads {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.sp-share-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms var(--ease);
}

.sp-share-dl-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.sp-share-dl-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sp-share-help {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  margin: 0;
  padding: 0.25rem 0.5rem;
}

.sp-share-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--band-soft);
}

.sp-share-retry-btn {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.sp-share-retry-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .sp-share-dialog[open] {
    padding: 0.75rem 0.5rem;
  }
  .sp-share-modal {
    border-radius: 10px;
    max-height: calc(100vh - 1.5rem);
  }
  .sp-share-header {
    padding: 0.75rem 1rem;
  }
  .sp-share-content {
    padding: 1rem 0.75rem;
    gap: 1rem;
  }
  .sp-share-native-btn,
  .sp-share-page-btn,
  .sp-share-dl-btn {
    min-height: 2.75rem;
    font-size: 0.875rem;
  }
}
