/*
 * Quote Card — floating selection button, modal, share row, toast.
 * Uses the theme's --sm-* tokens with hard fallbacks so it also works if
 * lifted out of the theme.
 */

/* Floating "make a quote card" button, anchored above a text selection */
.smqc-fab {
  position: absolute;
  z-index: 9998;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--sm-text, #1f2328);
  color: #fff;
  font-family: var(--sm-font, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .28);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
}
.smqc-fab.on { opacity: 1; visibility: visible; }
.smqc-fab svg { width: 15px; height: 15px; fill: currentColor; }
.smqc-fab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}

/* Modal */
.smqc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 40, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}
.smqc-overlay.on { opacity: 1; visibility: visible; }

.smqc-modal {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  background: var(--sm-card, #fff);
  border-radius: var(--sm-radius, 22px);
  box-shadow: 0 24px 64px rgba(16, 24, 40, .38);
  font-family: var(--sm-font, 'Inter', system-ui, sans-serif);
  color: var(--sm-text, #1f2328);
  transform: translateY(8px);
  transition: transform .15s ease;
}
.smqc-overlay.on .smqc-modal { transform: none; }

.smqc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.smqc-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.smqc-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--sm-text-light, #6b7280);
}
.smqc-close:hover { color: var(--sm-text, #1f2328); }

.smqc-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--sm-radius-sm, 12px);
  border: 1px solid var(--sm-border, #e5e7eb);
  background: #f2f3f5;
  object-fit: contain;
}

/* Primary actions (download / native share) */
.smqc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.smqc-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--sm-border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: var(--sm-text, #1f2328);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.smqc-btn:hover { background: #f0f1f3; }
.smqc-btn svg { width: 16px; height: 16px; fill: currentColor; }
.smqc-btn--primary {
  flex-basis: 100%;
  background: var(--sm-text, #1f2328);
  color: #fff;
  border-color: var(--sm-text, #1f2328);
}
.smqc-btn--primary:hover { background: var(--sm-text, #1f2328); opacity: .9; }

/* Share icon row */
.smqc-shareLabel {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--sm-text-light, #6b7280);
}
.smqc-share {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 8px;
}
.smqc-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--sm-border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  color: var(--sm-text, #1f2328);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.smqc-ic:hover { background: var(--sm-text, #1f2328); color: #fff; border-color: var(--sm-text, #1f2328); }
.smqc-ic svg { width: 20px; height: 20px; fill: currentColor; }

/* Toast */
.smqc-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(6px);
  z-index: 10001;
  max-width: 88vw;
  padding: 10px 16px;
  background: var(--sm-text, #1f2328);
  color: #fff;
  border-radius: 999px;
  font-family: var(--sm-font, 'Inter', system-ui, sans-serif);
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.smqc-toast.on { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .smqc-btn { font-size: 13px; }
}

/* ─────────────────────────────────────────────────────────────
 * Inline Quote Card (author-inserted Gutenberg block)
 * ───────────────────────────────────────────────────────────── */
.smqc-inline {
  position: relative;
  margin: 34px 0;
  padding: 30px 28px 22px;
  background: #f7f8fa;
  border: 1px solid var(--sm-border, #e5e7eb);
  border-left: 4px solid var(--sm-text, #1f2328);
  border-radius: 0;
  font-family: var(--sm-font, 'Inter', system-ui, sans-serif);
}
.smqc-inline__mark {
  position: absolute;
  top: 4px;
  left: 18px;
  font-size: 58px;
  line-height: 1;
  color: #d7dbe0;
  font-family: Georgia, 'Times New Roman', serif;
  pointer-events: none;
}
/* Compound selector + later load order beats the theme's
   `.sm-article .content blockquote` left-border rule, so only the card
   (not the inner blockquote) carries a left border. */
.smqc-inline blockquote.smqc-inline__quote {
  margin: 0;
  padding: 0;
  border: 0;
  color: #333333; /* ~80% black — softer than the near-black body text */
  font-size: 21px;
  line-height: 1.5;
  font-weight: 600;
}
.smqc-inline__quote p { margin: 0 0 10px; }
.smqc-inline__quote p:last-child { margin: 0; }
.smqc-inline__cite {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  color: var(--sm-text-light, #6b7280);
}
.smqc-inline__cite:not(:empty)::before { content: "— "; }

.smqc-inline__share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sm-border, #e5e7eb);
}
.smqc-inline__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--sm-text-light, #6b7280);
  margin-right: 2px;
}
.smqc-inline__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--sm-border, #e5e7eb);
  border-radius: 50%;
  background: #fff;
  color: var(--sm-text, #1f2328);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.smqc-inline__btn:hover {
  background: var(--sm-text, #1f2328);
  color: #fff;
  border-color: var(--sm-text, #1f2328);
}
.smqc-inline__btn svg { width: 16px; height: 16px; fill: currentColor; }
.smqc-inline__btn--card { margin-left: auto; }
/* Instagram button (vertical image share) — brand gradient on hover */
.smqc-inline__btn--ig:hover {
  background: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5 100%);
  border-color: transparent;
  color: #fff;
}

/* Primary "Share image" action — the way the quote picture actually reaches social */
.smqc-inline__imgbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--sm-text, #1f2328);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .12s ease;
}
.smqc-inline__imgbtn:hover { opacity: .9; }
.smqc-inline__imgbtn svg { width: 16px; height: 16px; fill: currentColor; }
.smqc-inline__or {
  font-size: 12px;
  color: var(--sm-text-light, #6b7280);
  margin: 0 4px 0 8px;
}

/* Editor preview: hide the empty-caption dash, drop the interactive share bar */
.smqc-inline--editor .smqc-inline__cite::before { content: ""; }
