/* Robo Themes preview: a bar to switch designs, pages and screen sizes over the static preview in a frame. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../../assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}

:root {
  --ink: #17140f;
  --ink-2: #2a251d;
  --paper: #f3eee4;
  --muted: #b5ab98;
  --accent: #c8391f;
  --bar: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #8c8578;
  color: var(--paper);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.pv-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  height: var(--bar);
  padding: 0 20px;
  background: var(--ink);
}

.pv-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.pv-back:hover {
  color: #fff;
}

.pv-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pv-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.pv-field select {
  min-width: 0;
  max-width: 280px;
  height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid #4a4235;
  border-radius: 20px;
  background: var(--ink-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23f3eee4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--paper);
  font: inherit;
  font-size: 0.9375rem;
  appearance: none;
  cursor: pointer;
}

.pv-devices {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border-radius: 22px;
  background: var(--ink-2);
}

.pv-devices button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 32px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.pv-devices button:hover {
  color: var(--paper);
}

.pv-devices button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
}

.pv-download {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.1;
}

.pv-download[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pv-soon {
  font-size: 0.6875rem;
  font-weight: 500;
  opacity: 0.85;
}

.pv-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

select:focus-visible,
button:focus-visible,
.pv-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* the stage: the frame fills it on a desktop, and stands as a device in the middle otherwise */
.pv-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.pv-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pv-stage[data-device="tablet"],
.pv-stage[data-device="phone"] {
  padding: 24px;
}

.pv-stage[data-device="tablet"] iframe {
  width: 834px;
  max-width: 100%;
  height: min(1112px, 100%);
  border-radius: 18px;
  box-shadow: 0 0 0 10px var(--ink), 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.pv-stage[data-device="phone"] iframe {
  width: 390px;
  max-width: 100%;
  height: min(844px, 100%);
  border-radius: 26px;
  box-shadow: 0 0 0 10px var(--ink), 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

/* a phone or a small window: the frame is the screen itself */
@media (max-width: 900px) {
  .pv-devices,
  .pv-label {
    display: none;
  }
  .pv-download {
    margin-left: auto;
  }
  .pv-stage[data-device] {
    padding: 0;
  }
  .pv-stage[data-device] iframe {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  :root {
    --bar: auto;
  }
  .pv-bar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 16px;
  }
  .pv-back span,
  .pv-download {
    display: none;
  }
  .pv-field {
    flex: 1 1 0;
  }
  .pv-field select {
    width: 100%;
    max-width: none;
  }
}
