/* Chrome for a widget when it is rendered as a standalone page /
   embedded in an iframe. Kept separate from theme.css so these
   page-level rules never leak onto the main site body. */

html, body {
  margin: 0;
  padding: 0;
  background: transparent;          /* let the host page's paper show through */
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.widget-root {
  padding: 4px 2px 8px;
  font-size: 15px;
}

/* the screen-reader summary each widget ships with */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

svg { display: block; width: 100%; height: auto; }

/* shared control styling so the bare <button>/<input> in the
   widgets look intentional and on-brand */
button {
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink2);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .08s;
}
button:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
button:active:not(:disabled) {
  transform: translateY(1px);
  background: var(--color-background-secondary);
  border-color: var(--amber);
}
button:disabled { opacity: .4; cursor: default; }

input[type="range"] {
  accent-color: var(--amber);
  height: 4px;
  cursor: pointer;
}

/* keyboard focus for in-widget controls */
button:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* widgets are iframes — they don't inherit the site's reduced-motion rule */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
