/* Framed figures for the WordPress pages: real wp-admin screenshots, and
 * hand-built mockups of the two screens we have no screenshot of.
 *
 * Loaded by BOTH templates/project_wordpress.html (the in-app setup page) and
 * templates/docs_wordpress.html (the public reference), which is the whole
 * reason it is a file rather than two inline blocks — the mockups are the
 * single depiction of what the customer is about to see, and two copies of
 * that in two stylesheets is how one of them ends up showing a button the
 * plugin no longer has. The markup half lives in templates/_wp_mock.html.
 *
 * ── On the colours ──
 * Everything under .wpm is a FIXED literal, not a theme.css token, and that is
 * deliberate: these pixels depict WordPress, which is always light. Flipping
 * them with our theme would produce a dark "screenshot" of a screen that
 * cannot look like that, directly beside a real screenshot that doesn't flip —
 * so the mockup would stop matching both WordPress and its own neighbours.
 * Same exemption widget.css and templates/email/* have, for the same reason.
 * The values are sampled from static/images/docs/wordpress/wordpress-full.png
 * rather than taken from upstream WordPress defaults, so a mockup and the real
 * crop above it agree; re-sample them if that screenshot is ever recaptured on
 * a different admin colour scheme.
 *
 * The FRAME around a figure is ours, so it uses theme tokens normally. */

/* ── The frame ──
   One component for screenshots and mockups alike. They are the same kind of
   object to a reader — "this is what your screen looks like" — and framing
   them differently would imply a distinction that isn't there. */
.wpm-frame {
  margin: 14px 0 0;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--well);
  /* Lifts a light figure off a dark page so it reads as an inset panel rather
     than a hole punched in the layout. */
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.wpm-frame img {
  display: block;
  width: 100%;
  height: auto;
}
/* A screenshot wide enough to be unreadable when scaled into a column opens in
   the in-page lightbox below (static/js/wp_mock_zoom.js). The href still points
   at the full-size file, so a page that loads this markup without that script
   still opens the image, just in the same tab instead of the overlay. */
a.wpm-zoom { display: block; position: relative; cursor: zoom-in; }
a.wpm-zoom::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--accent-rgb), 0);
  transition: background var(--dur-fast, .2s) ease;
}
a.wpm-zoom:hover::after { background: rgba(var(--accent-rgb), .1); }

/* ── Lightbox viewer ──
   Opened by wp_mock_zoom.js on a [data-wpm-lightbox] click. This chrome is OUR
   UI, not a WordPress depiction, so unlike everything under .wpm it uses theme
   tokens and is expected to flip with the site theme. Built once and reused —
   the script toggles [hidden] rather than re-creating the overlay per open. */
.wpm-lb {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  flex-direction: column;
}
.wpm-lb[hidden] { display: none; }
.wpm-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(2px);
}
.wpm-lb-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 12px;
  flex: 0 0 auto;
}
.wpm-lb-pct {
  min-width: 42px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  font-variant-numeric: tabular-nums;
}
.wpm-lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-fast, .2s) ease, border-color var(--dur-fast, .2s) ease;
}
.wpm-lb-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); }
.wpm-lb-btn:disabled { opacity: .35; cursor: default; }
.wpm-lb-btn:disabled:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.wpm-lb-btn svg { width: 17px; height: 17px; }
.wpm-lb-close { margin-left: 8px; }
.wpm-lb-stage {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 24px;
}
.wpm-lb-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  transition: transform .15s ease;
  cursor: zoom-in;
}
/* Once zoomed past "fit", the image no longer needs to shrink to the stage and
   panning takes over via the stage's own scrollbars. */
.wpm-lb.is-zoomed .wpm-lb-img { max-width: none; max-height: none; cursor: zoom-out; }
.wpm-lb.is-zoomed .wpm-lb-stage { align-items: flex-start; justify-content: flex-start; }

/* ── Window chrome ──
   A slim dark bar carrying the path to the screen shown below it. Present on
   crops and mockups, omitted on the full-page screenshot (which already
   contains the real admin bar). It is what tells a reader that the pale block
   beneath is a WordPress screen and not a piece of our own UI. */
.wpm-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1e1e1e;
  border-bottom: 1px solid #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #b6b9bd;
  letter-spacing: .01em;
}
.wpm-chrome svg {
  /* block, or the inline baseline gap under the glyph pushes it off-centre
     against the label despite align-items:center. */
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #fff;
  opacity: .9;
}
.wpm-chrome b { color: #fff; font-weight: 600; }

/* Caption sits OUTSIDE the light figure, on our surface, because it is our
   sentence about the picture rather than part of the picture. */
.wpm-cap {
  margin: 8px 2px 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.wpm-cap b { color: var(--text); font-weight: 600; }
.wpm-cap code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--well);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}

/* ── The wp-admin surface ── */
.wpm {
  --wpa-bg:      #f0f0f1;
  --wpa-white:   #fff;
  --wpa-head:    #1d2327;
  --wpa-ink:     #3c434a;
  --wpa-muted:   #646970;
  --wpa-blue:    #3858e9;
  --wpa-line:    #c3c4c7;
  --wpa-field:   #8c8f94;

  background: var(--wpa-bg);
  color: var(--wpa-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 18px 20px 22px;
  /* Mockups are laid out at a fixed reading size and scaled by the column, not
     reflowed — a "screenshot" that rewraps its own text at 380px stops looking
     like a capture of anything. */
  min-width: 0;
}
.wpm * { box-sizing: border-box; }

.wpm-h1 {
  font-size: 21px;
  font-weight: 400;
  color: var(--wpa-head);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wpm-h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--wpa-head);
  margin: 0 0 6px;
}
.wpm-p { margin: 0 0 12px; color: var(--wpa-ink); }
.wpm-p:last-child { margin-bottom: 0; }
.wpm-muted { color: var(--wpa-muted); font-size: 12px; }

/* WordPress's own two button tiers. Primary is the filled action, secondary is
   the outlined one — the plugin's editor panel uses both, so both are needed
   for that mockup to be honest about which control is which. */
.wpm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 3px;
  border: 1px solid var(--wpa-blue);
  background: var(--wpa-white);
  color: var(--wpa-blue);
  white-space: nowrap;
}
.wpm-btn-primary {
  background: var(--wpa-blue);
  border-color: var(--wpa-blue);
  color: #fff;
  font-weight: 500;
}

.wpm-field {
  display: block;
  width: 100%;
  background: var(--wpa-white);
  border: 1px solid var(--wpa-field);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--wpa-head);
  min-height: 34px;
}
.wpm-field.is-placeholder { color: #8b8f94; }
.wpm-field-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
}
.wpm-ta { min-height: 74px; white-space: pre-wrap; }
.wpm-hint { margin: 5px 0 0; font-size: 12px; color: var(--wpa-muted); }

/* WordPress renders a checkbox as a 1em box with a blue check when set. */
.wpm-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--wpa-ink);
}
.wpm-box {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1px solid var(--wpa-field);
  border-radius: 3px;
  background: var(--wpa-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wpm-box.is-on { background: var(--wpa-blue); border-color: var(--wpa-blue); }
.wpm-box svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3; fill: none; }

.wpm-row { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 14px; }
.wpm-row:last-child { margin-bottom: 0; }
.wpm-label {
  width: 150px;
  flex-shrink: 0;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wpa-head);
}
.wpm-ctl { flex: 1; min-width: 0; }

.wpm-rule { height: 1px; background: var(--wpa-line); margin: 16px 0; border: 0; }

/* ── The upload dropzone (Plugins → Add New → Upload Plugin) ── */
.wpm-upload {
  background: var(--wpa-white);
  border: 1px solid var(--wpa-line);
  border-radius: 3px;
  padding: 26px 20px;
  text-align: center;
}
.wpm-upload .wpm-p { color: var(--wpa-muted); }
.wpm-upload-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.wpm-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wpa-white);
  border: 1px solid var(--wpa-field);
  border-radius: 3px;
  padding: 4px 10px 4px 4px;
  font-size: 12.5px;
  color: var(--wpa-head);
}
.wpm-file span {
  background: #f0f0f1;
  border: 1px solid var(--wpa-field);
  border-radius: 2px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--wpa-head);
}

/* ── A meta box (the editor's AI assistant panel) ──
   Rendered at the width WordPress gives the `side` context so it reads as the
   editor sidebar rather than a full-width form. */
.wpm-metabox {
  background: var(--wpa-white);
  border: 1px solid var(--wpa-line);
  border-radius: 3px;
  max-width: 320px;
}
.wpm-metabox-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--wpa-line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wpa-head);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wpm-metabox-head::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--wpa-muted);
  border-bottom: 1.6px solid var(--wpa-muted);
  transform: rotate(45deg) translate(-2px, -2px);
}
.wpm-metabox-body { padding: 12px; }
.wpm-metabox-body > * + * { margin-top: 10px; }
.wpm-btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Editor canvas, for the assistant mockup's context ──
   The panel alone is ambiguous; beside a suggestion of the post being written
   it is obviously the editor. Deliberately vague — grey bars, not fake copy,
   which would read as a real post and invite people to look for meaning. */
/* stretch, not flex-start: the panel is the taller of the two, and a canvas
   that stops halfway down leaves a grey void beside it that no real editor
   has. */
.wpm-editor { display: flex; gap: 16px; align-items: stretch; }
.wpm-canvas {
  flex: 1;
  min-width: 0;
  background: var(--wpa-white);
  border: 1px solid var(--wpa-line);
  border-radius: 3px;
  padding: 18px;
}
.wpm-lines { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.wpm-lines i { display: block; height: 8px; border-radius: 3px; background: #e4e5e7; }
.wpm-title-line { height: 15px !important; width: 62%; background: #d5d7da !important; }

@media (max-width: 700px) {
  .wpm { padding: 14px; font-size: 12.5px; }
  .wpm-row { flex-direction: column; gap: 6px; }
  .wpm-label { width: auto; padding-top: 0; }
  .wpm-editor { flex-direction: column; }
  .wpm-canvas { width: 100%; }
  .wpm-metabox { max-width: none; width: 100%; }
  .wpm-h1 { font-size: 18px; }
}
