/* ==========================================================================
   embed_modal.css — the "Embed" toolbar button + the body-level embed modal
   on the MAIN site (loaded once from base.html). Distinct from embed.css,
   which styles the iframe surface itself.
   ========================================================================== */

/* --- Toolbar button (in the headline breadcrumb bar) -------------------- */
.rvt-embed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.rvt-embed-btn:hover { background: var(--bg-3); color: var(--accent); }
.rvt-embed-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Overlay + modal ---------------------------------------------------- */
.rvt-embed-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
}
.rvt-embed-overlay[hidden] { display: none; }

.rvt-embed-modal {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.rvt-embed-modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.rvt-embed-modal-title {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-0);
}
.rvt-embed-modal-close {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
}
.rvt-embed-modal-close:hover { color: var(--text-0); background: var(--bg-3); }

.rvt-embed-modal-body { padding: 16px 18px 20px; }

.rvt-embed-modal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: 16px;
}

.rvt-embed-fieldset { min-width: 180px; }
.rvt-embed-legend {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3, var(--text-2));
  margin-bottom: 8px;
}

.rvt-embed-sections { display: flex; flex-direction: column; gap: 6px; }
.rvt-embed-sections label,
.rvt-embed-theme label,
.rvt-embed-resize-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
}
.rvt-embed-theme { display: flex; gap: 14px; }
.rvt-embed-sections input,
.rvt-embed-theme input,
.rvt-embed-resize-row input { accent-color: var(--accent); }

.rvt-embed-resize-row { font-weight: 600; color: var(--text-0); }
.rvt-embed-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3, var(--text-2));
  max-width: 420px;
}

/* --- Live preview ------------------------------------------------------- */
.rvt-embed-preview-wrap { margin-bottom: 16px; }
.rvt-embed-preview {
  width: 100%;
  height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-0);
}

/* --- Snippet box -------------------------------------------------------- */
.rvt-embed-snippet-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rvt-embed-copy {
  font-size: 12px;
  font-weight: 700;
  color: var(--bg-0);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
.rvt-embed-copy:hover { filter: brightness(1.06); }
.rvt-embed-copy.is-copied { background: #4ec77b; color: #06210f; }

.rvt-embed-snippet {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}
.rvt-embed-open {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.rvt-embed-open:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .rvt-embed-modal-controls { gap: 14px; }
  .rvt-embed-preview { height: 240px; }
}
