/* ============================================================
   VETTO · share.css
   Styles for the shared sharing layer (share.js): rich share modal,
   text-selection quote bar, chart/board share buttons, copy toast.
   Reads the semantic design tokens from css/tokens.css (loaded via
   site.css). No raw hex except where a brand surface needs opacity.
   ============================================================ */

/* ---- global copy/confirmation toast ---------------------------------- */
.vs-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  background: var(--lav-bright);
  color: var(--warm-bg);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 34px rgba(20, 16, 12, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.vs-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.vs-toast svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---- text-selection quote bar ---------------------------------------- */
.vs-quotebar {
  position: absolute;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: var(--lav-bright);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 26px rgba(20, 16, 12, 0.3);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.vs-quotebar.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* little pointer under the bar */
.vs-quotebar::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--lav-bright);
  transform: rotate(45deg);
  border-radius: 2px;
}
.vs-qbtn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--warm-bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease;
}
.vs-qbtn:hover { background: rgba(255, 255, 255, 0.14); }
.vs-qbtn svg { width: 15px; height: 15px; }

/* ---- chart / board share affordance ---------------------------------- */
.figure { position: relative; }
/* condensed version of the primary share button (same colour/type/hover),
   shown top-right of a chart on hover. Matches the post's share button. */
.vs-cap-share {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--lav-bright);
  border-radius: var(--radius-pill);
  background: var(--lav-bright);
  color: var(--warm-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, filter 180ms ease;
}
.figure:hover .vs-cap-share,
.vs-cap-share:focus-visible { opacity: 1; }
.vs-cap-share:hover { filter: brightness(1.18); }
.vs-cap-share svg { width: 15px; height: 15px; }
@media (hover: none) { .vs-cap-share { opacity: 1; } } /* always show on touch */

/* ---- chart "enlarge" affordance -------------------------------------- */
/* A quiet icon button, top-right of a chart on hover — opens the chart in a
   lightbox. Uses the secondary surface (matches the post's icon buttons),
   not the dark share pill, so it reads as a utility, not a share action. */
.vs-cap-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-pill);
  background: var(--warm-bg-3);
  color: var(--lav);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.figure:hover .vs-cap-zoom,
.vs-cap-zoom:focus-visible { opacity: 1; }
.vs-cap-zoom:hover { color: var(--lav-bright); border-color: var(--lav-faint); background: var(--warm-bg-2); }
.vs-cap-zoom svg { width: 16px; height: 16px; display: block; }
@media (hover: none), (max-width: 640px) { .vs-cap-zoom { opacity: 1; } } /* always show on touch / small screens */

/* ---- chart zoom lightbox --------------------------------------------- */
.vs-zoom {
  position: fixed;
  inset: 0;
  z-index: 2147483400;
  display: flex;
  overflow-y: auto;               /* gráfico maior que a tela: rola o overlay, como a página */
  padding: clamp(12px, 3vw, 40px);
  background: rgba(20, 16, 12, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}
.vs-zoom.is-open { opacity: 1; pointer-events: auto; }
.vs-zoom-dialog {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  margin: auto;                   /* centraliza quando cabe; rola quando não cabe */
  background: var(--warm-bg);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 70px rgba(20, 16, 12, 0.4);
  padding: clamp(16px, 2.2vw, 26px);
  transform: translateY(10px) scale(0.99);
  transition: transform 220ms var(--ease-out);
}
.vs-zoom.is-open .vs-zoom-dialog { transform: none; }
.vs-zoom-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.vs-zoom-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.3;
  color: var(--lav-bright);
  margin: 0;
}
.vs-zoom-close {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--lav-soft);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 180ms ease, border-color 180ms ease;
}
.vs-zoom-close:hover { color: var(--lav-bright); border-color: var(--lav); }
.vs-zoom-close svg { width: 16px; height: 16px; }
/* the live Plotly node is lifted in here and told to fill the box */
.vs-zoom-body {
  flex: 1 1 auto;
  min-height: min(50vh, 500px);   /* gráficos baixos ainda ganham um palco decente */
}
.vs-zoom-body .plotly-graph-div,
.vs-zoom-body .js-plotly-plot {
  width: 100% !important;         /* altura fica com o layout do próprio gráfico */
}
@media (max-width: 720px) {
  .vs-zoom-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .vs-zoom-body .plotly-graph-div,
  .vs-zoom-body .js-plotly-plot,
  .vs-zoom-body .vs-zoom-svg { min-width: 560px; }
}

/* ---- rich share modal ------------------------------------------------- */
.vs-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 16, 12, 0.44);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}
.vs-modal.is-open { opacity: 1; pointer-events: auto; }
.vs-dialog {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--warm-bg);
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 70px rgba(20, 16, 12, 0.4);
  transform: translateY(10px) scale(0.99);
  transition: transform 220ms var(--ease-out);
  padding: clamp(20px, 3vw, 30px);
}
.vs-modal.is-open .vs-dialog { transform: none; }
.vs-dhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.vs-dtitle {
  font-family: var(--font-lit);
  font-size: clamp(20px, 3vw, 26px);
  color: var(--lav-bright);
  margin: 0;
}
.vs-close {
  width: 34px; height: 34px;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--lav-soft);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 180ms ease, border-color 180ms ease;
}
.vs-close:hover { color: var(--lav-bright); border-color: var(--lav); }
.vs-close svg { width: 16px; height: 16px; }

/* preview card */
.vs-preview {
  display: block;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  background: var(--warm-bg-2);
  overflow: hidden;
  margin-bottom: 22px;
}
/* the thumbnail = a live, scaled snapshot of the shared page's header */
.vs-shot {
  position: relative;
  width: 100%;
  height: 156px;
  overflow: hidden;
  background: var(--warm-bg);
  border-bottom: 1px solid var(--warm-line);
}
.vs-shot-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  padding: 26px 30px;
  box-sizing: border-box;
  pointer-events: none;
}
.vs-shot-inner > * { margin-top: 0; }
.vs-preview img {
  display: block;
  width: 100%;
  height: 156px;
  object-fit: cover;
  background: var(--warm-line);
}
.vs-preview-meta { min-width: 0; padding: 12px 14px; }
.vs-preview-site {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lav-faint);
  margin-bottom: 3px;
}
.vs-preview-title {
  font-family: var(--font-read);
  font-size: 15px;
  color: var(--lav-bright);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* channel grid */
.vs-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}
.vs-chan {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--lav-bright);
  font-family: var(--font-read);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.vs-chan:hover { background: var(--warm-bg-2); border-color: var(--lav); transform: translateY(-1px); }
.vs-chan svg,
.vs-chan .vs-chan-ico { width: 18px; height: 18px; flex: 0 0 auto; color: var(--lav); }
.vs-chan.is-copied { border-color: var(--accent); color: var(--accent); }
.vs-chan.is-copied svg { color: var(--accent); }

/* embed row */
.vs-embed { margin-top: 18px; }
.vs-embed-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lav-faint);
  margin-bottom: 7px;
}
.vs-embed-row { display: flex; gap: 8px; }
.vs-embed-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--warm-line);
  border-radius: var(--radius-md);
  background: var(--warm-bg-2);
  color: var(--lav-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}
.vs-embed-copy {
  flex: 0 0 auto;
  padding: 0 16px;
  border: 1px solid var(--lav);
  border-radius: var(--radius-pill);
  background: var(--lav);
  color: var(--warm-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.vs-embed-copy:hover { opacity: 0.86; }
.vs-embed-copy.is-copied { background: var(--accent); border-color: var(--accent); }

/* The page-level "share" trigger is NOT a bespoke style — it is the shared
   design-system primary button (.btn.btn--primary in components.css). Pages
   render <button class="btn btn--primary">…</button>; nothing to define here. */

/* ---- print: hide the sharing feature UI ------------------------------ */
@media print {
  .vs-toast, .vs-quotebar, .vs-cap-share, .vs-cap-zoom, .vs-modal, .vs-zoom { display: none !important; }
}
