/* ================================================================
   Email Preview — an ARTIFACT, not a nav page (G.4.8). No sidebar, no app
   shell — it is the deliverable being previewed, opened target="_blank" from
   the VIP Offer's Invite In send and from the client's room.

   Two styling authorities:
   1. THE CHROME around the email — app.css tokens.
   2. THE EMAIL BODY (.pm-email) — exempt, carries its own type and colour,
      because a real mail client renders it, not the portal.
   ================================================================ */

/* No app shell, so the body scrolls itself (app.css clips body to 100%). */
html, body { height: auto; }
body { background: var(--color-bg); overflow-y: auto; }

.pm-artifact { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }

.pm-artifact__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pm-artifact__bar .spacer { flex: 1; }
.pm-artifact__bar .badge svg { width: 11px; height: 11px; }
.pm-artifact__title { font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; margin: 0; white-space: nowrap; }

/* Meta strip — what the recipient's inbox shows above the body. */
.pm-mailmeta {
  border: 1px solid var(--color-border); border-bottom: 0;
  border-radius: 5px 5px 0 0; background: var(--color-surface-alt);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 6px;
}
.pm-mailmeta__row { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; }
.pm-mailmeta__k { flex: none; width: 62px; color: var(--color-text-subtle); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding-top: 2px; }
.pm-mailmeta__v { color: var(--color-text); min-width: 0; }
.pm-mailmeta__v b { font-weight: 600; }

.pm-mailframe {
  border: 1px solid var(--color-border); border-radius: 0 0 5px 5px;
  overflow: hidden; background: #EFEAE3;
  padding: 28px 16px;
}

/* ================================================================
   THE EMAIL BODY — exempt region (G.4.8). Tenant brand is DATA, resolved at
   render (D29): it reaches the header band, the link colour and the button.
   ================================================================ */
.pm-email {
  --tenant-brand: #6B4F35;      /* Verona Stone Suppliers — per-tenant, resolved at render */
  --tenant-brand-fg: #FFFFFF;
  --tenant-brand-soft: #F6F1EB;
  max-width: 600px; margin: 0 auto;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.65; color: #2B2B2B;
  background: #FFFFFF; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(31, 27, 22, .08);
}
.pm-email a { color: var(--tenant-brand); }

/* Header band. CONSTRAIN THE SLOT, DO NOT TRUST THE ASSET (D29): fixed height,
   max width, and the image scales inside it — never clipped. The tenant uploads
   one logo; it is inked white here so it survives whatever band colour they pick,
   the same treatment the showroom's top bar gives it. */
.pm-email__head {
  background: var(--tenant-brand); padding: 22px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pm-email__logoslot { height: 40px; max-width: 220px; display: flex; align-items: center; }
.pm-email__logoslot img { height: 100%; max-width: 100%; width: auto; object-fit: contain; display: block; filter: brightness(0) invert(1); }
.pm-email__eyebrow {
  color: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}

.pm-email__body { padding: 36px 36px 8px; }
.pm-email__p { margin: 0 0 16px; }
/* S127/OR36 - the sentence carries an ADDRESS now, not a code. `.pm-email__codeinline` (mono, tinted,
   the six characters set in the run of text) went with the credential it was built to print. */
.pm-email__link { color: var(--tenant-brand); font-weight: 600; text-decoration: underline; }

.pm-email__sig { display: flex; gap: 12px; align-items: center; margin: 24px 0 0; }
.pm-email__sigface { width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; background: #F3EEE8; }
.pm-email__signame { font-weight: 600; color: #1F1B16; line-height: 1.3; }
.pm-email__sigcontact { font-size: 13px; color: #6E655B; }

.pm-email__rule { height: 1px; background: #EAE4DC; border: 0; margin: 30px 0 24px; }

/* The pieces. Named, serialled, real. No price — that lives in his room. */
.pm-email__pieces { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-email__piece { border: 1px solid #EAE4DC; border-radius: 6px; overflow: hidden; background: #FFFFFF; }
.pm-email__piecefig { width: 100%; height: 120px; object-fit: cover; display: block; background: #F3EEE8; }
.pm-email__piecetxt { padding: 10px 12px 12px; }
.pm-email__piecename { font-weight: 600; font-size: 14px; color: #1F1B16; line-height: 1.35; }
.pm-email__piecespec { font-size: 12px; color: #6E655B; margin-top: 2px; line-height: 1.4; }

/* The door: the button. The code line under it is gone with the room (S127/OR36). */
.pm-email__door {
  background: var(--tenant-brand-soft); border-radius: 6px;
  padding: 24px 20px; text-align: center; margin: 26px 0 36px;
}
.pm-email__btn {
  display: inline-block; background: var(--tenant-brand); color: var(--tenant-brand-fg) !important;
  text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 13px 32px; border-radius: 5px;
}

.pm-email__foot {
  background: #FAF8F5; border-top: 1px solid #EFEAE3;
  padding: 20px 36px; text-align: center;
  font-size: 12px; color: #8A8078; line-height: 1.6;
}
/* Attribution, not presence (D29). */
.pm-email__poweredby { color: #A39A90; }

@media (max-width: 620px) {
  .pm-mailframe { padding: 0; background: #FFFFFF; }
  .pm-email { border-radius: 0; box-shadow: none; }
  .pm-email__body, .pm-email__head, .pm-email__foot { padding-left: 20px; padding-right: 20px; }
  .pm-email__eyebrow { display: none; }
  .pm-email__pieces { grid-template-columns: 1fr; }
}
