/* The real envelope, scaled down to fit a panel. Shared by the compose
 * screens and the homepage feature tile. */

.env-live-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px 36px;
  align-items: start;
}

.env-live-col {
  min-width: 0;
  container-type: inline-size;
}

.env-live-caption {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.env-live-frame {
  --env-preview-w: 380px;
  --env-preview-h: 500px;
  --env-scale: calc(var(--env-preview-w) / 708px);
  --kb-envelope-background-color: var(--env-paper, #c41e3a);
  --kb-envelope-font-color: var(--env-ink, #ffffff);
  position: relative;
  width: var(--env-preview-w);
  height: calc(var(--env-preview-h) * var(--env-scale));
  margin: 0;
  overflow: visible;
  pointer-events: none;
}

@supports (width: 1cqi) {
  .env-live-frame {
    width: 100%;
    --env-preview-w: 100cqi;
    --env-scale: calc(100cqi / 708px);
  }
}

.env-live-frame.is-open { --env-preview-h: 765px; }
.env-live-frame.is-closed { --env-preview-h: 500px; }

.env-live-scale {
  position: absolute;
  top: 0;
  left: 0;
  width: 708px;
  height: var(--env-preview-h);
  transform-origin: 0 0;
  transform: scale(var(--env-scale));
}

.env-live-frame #recipient-motion-wrapper {
  position: relative;
  display: block;
  visibility: visible;
  width: 708px;
  height: var(--env-preview-h);
  transform: none;
}

.env-live-frame #recipient-envelope-container,
.env-live-frame #base-envelope {
  position: relative;
  width: 708px;
  height: var(--env-preview-h);
  filter: none;
}

.env-live-frame #envelope-front-container {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 708px;
  box-sizing: content-box;
  border: 0;
  transform: none;
}

.env-live-frame #envelope-tilt {
  position: relative;
  display: flex;
  flex-direction: column;
  transform: none;
}

.env-live-frame #front-ground {
  position: absolute;
  left: 0;
  top: 277px;
  width: 708px;
  height: 488px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 0;
}

.env-live-frame #flap-hinge {
  position: relative;
  width: 708px;
  height: 277px;
  flex-shrink: 0;
  overflow: visible;
  z-index: 20;
}

.env-live-frame #seal-top {
  position: absolute;
  left: 0;
  bottom: 0;
}

.env-live-frame #seal-front,
.env-live-frame #recipient-card-container,
.env-live-frame #card-stage,
.env-live-frame .flip-btn,
.env-live-frame #overlay-animation {
  display: none !important;
}

.env-live-frame #envelope-back {
  width: 708px;
  height: 500px;
  border-radius: 6px;
  background-color: var(--kb-envelope-background-color);
  color: var(--kb-envelope-font-color);
  font-size: 3.125rem;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 300;
  display: none;
  place-items: center;
  position: relative;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.25);
}

.env-live-frame.is-closed #envelope-front-container { display: none !important; }
.env-live-frame.is-closed #envelope-back { display: grid; }
.env-live-frame.is-open #envelope-back { display: none !important; }
.env-live-frame.is-open #pocket-cover,
.env-live-frame.is-open #flap-shadow {
  display: none !important;
}
.env-live-frame.is-open #envelope-lining-bottom {
  z-index: 11;
}

.env-live-frame .env-closed-face {
  width: 708px;
  height: 500px;
  border-radius: 6px;
  background-color: var(--kb-envelope-background-color);
  color: var(--kb-envelope-font-color);
  font-size: 3.125rem;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 300;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.25);
}

.env-live-frame .title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  max-height: 360px;
  width: 82%;
  overflow-wrap: anywhere;
}

.env-live-frame .stamp-wrap {
  position: absolute;
  right: 20px;
  top: 18px;
  width: 112px;
  height: 112px;
  color: #3a184f;
}

.env-live-frame .stamp-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.env-live-frame #pocket-clip {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  height: 488px;
}

.env-live-frame #envelope-lining-bottom,
.env-live-frame #envelope-shadow {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
}

.env-live-frame #envelope-bottom {
  position: relative;
  z-index: 10;
  overflow: hidden;
  display: block;
}

.env-live-frame #flap-shadow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 12;
  overflow: visible;
  pointer-events: none;
}

.env-live-frame #pocket-cover {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 15;
  pointer-events: none;
}
