/* PDF Poster > Quick Embedder: shortcode generator and the "Customize one PDF" popup.
   Only styles our own .pdfp-qe-* markup; CodeStar's fields keep their own styles.
   Uses the admin skin tokens when the skin is on, with plain fallbacks when it is off. */

.pdfp-qe-gen,
.pdfp-qe-modal {
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-gen h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-help {
  margin: 0 0 14px;
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-gen code {
  padding: 1px 5px;
  border-radius: 0;
  background: var(--pg-tint, #f0f0f1);
  font-family: var(--pg-mono, Menlo, Consolas, monospace);
  font-size: 12px;
}

/* ---- Shortcode generator: two joined boxes, [link icon | link | Generate] and [shortcode | Copy] ---- */
.pdfp-qe-crow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 10px;
  max-width: 1000px;
}

.pdfp-qe-group {
  display: flex;
  min-width: 0;
  border: 1px solid var(--pg-control, #8c8f94);
  background: var(--pg-surface, #fff);
}

.pdfp-qe-group:focus-within {
  border-color: var(--pg-pop, #1d5bd8);
  box-shadow: 0 0 0 3px var(--pg-focus, rgba(29, 91, 216, .28));
}

.pdfp-qe-group > .dashicons {
  flex: none;
  align-self: center;
  margin: 0 2px 0 12px;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-gen .pdfp-qe-url,
.pdfp-qe-gen .pdfp-qe-output {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pg-ink, #1d2327);
  font-size: 14px;
  box-shadow: none;
}

/* The box frames the field; the field itself never draws a border (the admin skin's input focus ring would) */
.pdfp-qe-group .pdfp-qe-url,
.pdfp-qe-group .pdfp-qe-url:focus,
.pdfp-qe-group .pdfp-qe-output,
.pdfp-qe-group .pdfp-qe-output:focus {
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
}

/* The shortcode box: dimmed until something is generated */
.pdfp-qe-codebox {
  border-color: var(--pg-border, #dcdcde);
  background: var(--pg-tint, #f6f7f7);
}

.pdfp-qe-gen .pdfp-qe-output {
  font-family: var(--pg-mono, Menlo, Consolas, monospace);
  font-size: 13px;
  color: var(--pg-muted, #8c8f94);
}

.pdfp-qe-gen.has-shortcode .pdfp-qe-codebox {
  border-color: var(--pg-pop-line, #c5d5f6);
  background: var(--pg-pop-wash, #f5f8fe);
}

.pdfp-qe-gen.has-shortcode .pdfp-qe-output {
  color: var(--pg-ink, #1d2327);
}

/* Buttons sit inside the boxes, so they lose their own border */
.pdfp-qe-group .button {
  flex: none;
  border: 0 !important;
}

.pdfp-qe-gen .button,
.pdfp-qe-modal .button {
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 38px;
}

.pdfp-qe-gen .pdfp-qe-generate,
.pdfp-qe-gen .pdfp-qe-copy,
.pdfp-qe-modal .button-primary {
  border-color: var(--pg-btn, #1d5bd8);
  background: var(--pg-btn, #1d5bd8);
  color: var(--pg-on-btn, #fff);
}

.pdfp-qe-gen .pdfp-qe-generate:hover,
.pdfp-qe-gen .pdfp-qe-generate:focus,
.pdfp-qe-gen .pdfp-qe-copy:hover,
.pdfp-qe-gen .pdfp-qe-copy:focus,
.pdfp-qe-modal .button-primary:hover,
.pdfp-qe-modal .button-primary:focus {
  border-color: var(--pg-btn-hover, #174bb4);
  background: var(--pg-btn-hover, #174bb4);
  color: var(--pg-on-btn, #fff);
}

.pdfp-qe-copy {
  flex: none;
  min-width: 80px;
}

.pdfp-qe-gen .pdfp-qe-copy.is-copied,
.pdfp-qe-modal .pdfp-qe-copy.is-copied {
  border-color: #1e7a3c;
  background: #1e7a3c;
}

.pdfp-qe-msg {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-msg:empty {
  display: none;
}

.pdfp-qe-msg[data-kind="error"] { color: var(--pg-danger, #b42318); }
.pdfp-qe-msg[data-kind="warn"] { color: #946200; }
.pdfp-qe-msg[data-kind="ok"] { color: #1e7a3c; }

/* CSF's own description style, but not floated (CSF floats it, which breaks the rows after it) */
.pdfp-qe-gen .csf-desc-text {
  float: none;
  margin-top: 8px;
}

.pdfp-qe-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 10px;
}

/* Text-style buttons: "Or choose from the Media Library", "Customize one PDF" */
.pdfp-qe-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pg-pop, #1d5bd8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.pdfp-qe-link:hover {
  text-decoration: underline;
}

.pdfp-qe-link:focus-visible {
  outline: 2px solid var(--pg-pop, #1d5bd8);
  outline-offset: 2px;
}

.pdfp-qe-gen .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

/* ---- "Watch tutorial" button in the page header (only when a video link is set) ---- */
.pdfp-qe-options .csf-buttons .pdfp-qe-video {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  border: 1px solid var(--pg-control, #c3c4c7);
  border-radius: 0;
  background: var(--pg-surface, #fff);
  color: var(--pg-ink, #1d2327);
  font-weight: 500;
  text-decoration: none;
  vertical-align: top;
}

.pdfp-qe-options .csf-buttons .pdfp-qe-video:hover,
.pdfp-qe-options .csf-buttons .pdfp-qe-video:focus {
  border-color: #e62117;
  background: var(--pg-surface, #fff);
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-options .csf-buttons .pdfp-qe-video:focus-visible {
  outline: 2px solid var(--pg-pop, #1d5bd8);
  outline-offset: 2px;
  box-shadow: none;
}

/* Red tile with a white play triangle, drawn in CSS so no image or icon font is needed */
.pdfp-qe-video-play {
  position: relative;
  flex: none;
  width: 20px;
  height: 14px;
  background: #e62117;
}

.pdfp-qe-video-play::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 8px;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent #fff;
}

/* ---- "Customize one PDF" popup ---- */
.pdfp-qe-modal {
  position: fixed;
  inset: 0;
  z-index: 100100; /* above the admin bar and menu */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 19, 27, .55);
}

.pdfp-qe-modal[hidden] {
  display: none;
}

body.pdfp-qe-modal-open {
  overflow: hidden;
}

.pdfp-qe-modal-box {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 0;
  background: var(--pg-surface, #fff);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

.pdfp-qe-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 12px;
}

.pdfp-qe-modal-head h2 {
  margin: 0;
  padding: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-modal-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-modal-x {
  flex: none;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--pg-ink-3, #50575e);
  cursor: pointer;
}

.pdfp-qe-modal-x:hover {
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-modal-x .dashicons {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.pdfp-qe-modal .pdfp-qe-modal-code {
  display: block;
  margin: 0 22px 10px;
  padding: 12px 14px;
  border-radius: 0;
  background: var(--pg-primary, #1f2533);
  color: #e8ecf3;
  font-family: var(--pg-mono, Menlo, Consolas, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-all;
}

.pdfp-qe-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 22px 6px;
}

.pdfp-qe-mrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--pg-rule, #f0f0f1);
}

.pdfp-qe-mrow:last-child {
  border-bottom: 0;
}

.pdfp-qe-mtext {
  min-width: 0;
  font-size: 13px;
}

.pdfp-qe-mtext strong {
  font-weight: 600;
  color: var(--pg-ink, #1d2327);
}

.pdfp-qe-mtext span {
  display: block;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-mtext small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--pg-muted, #8c8f94);
}

.pdfp-qe-chips {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.pdfp-qe-chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--pg-control, #c3c4c7);
  border-radius: 0;
  background: var(--pg-surface, #fff);
  color: var(--pg-ink, #1d2327);
  font-size: 12px;
  cursor: pointer;
}

.pdfp-qe-chip:hover {
  border-color: var(--pg-pop, #1d5bd8);
  color: var(--pg-pop, #1d5bd8);
}

.pdfp-qe-chip:focus-visible {
  outline: 2px solid var(--pg-pop, #1d5bd8);
  outline-offset: 1px;
}

.pdfp-qe-chip.is-on {
  border-color: var(--pg-pop, #1d5bd8);
  background: var(--pg-pop, #1d5bd8);
  color: var(--pg-on-pop, #fff);
}

.pdfp-qe-chip:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.pdfp-qe-mrow.is-locked .pdfp-qe-mtext span,
.pdfp-qe-mrow.is-locked .pdfp-qe-mtext small {
  opacity: .6;
}

.pdfp-qe-pro {
  margin-left: 6px;
  padding: 2px 6px;
  background: var(--pg-pop, #1d5bd8);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}

.pdfp-qe-pro:hover,
.pdfp-qe-pro:focus {
  color: #fff;
}

.pdfp-qe-modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--pg-rule, #f0f0f1);
  background: var(--pg-tint, #f6f7f7);
  font-size: 12px;
  color: var(--pg-ink-3, #50575e);
}

.pdfp-qe-modal-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

@media (max-width: 600px) {
  .pdfp-qe-mrow,
  .pdfp-qe-modal-foot {
    flex-wrap: wrap;
  }

  .pdfp-qe-chips {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .pdfp-qe-crow {
    grid-template-columns: minmax(0, 1fr);
  }
}
