/* /tools/linkedin-inmail-generator/ in the painted theme (template-parts/painted/pages/linkedin-inmail-generator.php):
   beside the generator's form, the InMail as Maya meets it. One card: her inbox row (the sender's face, name, the InMail
   mark, the subject, the start of the first line), the row picked, then the InMail opened under it, its paragraphs, and
   two gauges against LinkedIn's limits, the subject's 200 and the body's 1,900 (--g, a share, unitless).

   On entry, from the first paint and in CSS alone: the row lands, is picked, the InMail opens under it (its rows grow
   from 0fr), its paragraphs come in one by one and the gauges fill. The drawn state is the opened InMail, so with
   reduced motion, or in a browser that runs no animation, it stands open from the first paint. */

.imo { display: grid; gap: 10px; margin: 0; text-align: left; }
.imo-h { margin: 0; font: 600 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--cd) 82%, #000); }
.imo-lead { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }

.imo-card { display: grid; margin-top: 2px; overflow: clip; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(70, 50, 36, .06), 0 18px 34px -26px rgba(80, 52, 40, .5); }
/* the inbox row, picked: the line's tint and its colour along the left edge */
.imo-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 16px 13px; background: color-mix(in srgb, var(--ct) 75%, #fff); box-shadow: inset 3px 0 0 var(--c); }
.imo-row .gsp-face { width: 36px; height: 36px; border-radius: 50%; }
.imo-rt { display: grid; gap: 3px; min-width: 0; }
.imo-who { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; line-height: 1.2; }
.imo-who b { font-weight: 600; color: var(--ink); }
.imo-tag { padding: 3px 7px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); font: 600 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cd); }
.imo-who time { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--mute); }
.imo-subj { margin: 2px 0 0; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.imo-prev { margin: 0; overflow: hidden; font-size: 12.5px; line-height: 1.4; color: var(--mute); white-space: nowrap; text-overflow: ellipsis; }

/* the InMail opened: the rows of a grid, so the opening can grow it from nothing */
.imo-open { display: grid; grid-template-rows: 1fr; }
.imo-in { min-height: 0; overflow: hidden; }
.imo-pad { display: grid; gap: 14px; padding: 14px 16px 16px 64px; border-top: 1px solid var(--line-2); }
.imo-body { display: grid; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--text); }
.imo-body p { margin: 0; }
/* the two gauges: the name, the bar, the count against the limit */
.imo-ms { display: grid; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.imo-m { display: grid; grid-template-columns: 58px minmax(0, 1fr) 94px; align-items: center; gap: 10px; margin: 0; }
.imo-mn { font: 600 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.imo-c { font: 500 11.5px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--mute); text-align: right; white-space: nowrap; }
.imo-c b { font-weight: 600; color: var(--cd); }
.imo-g { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line-2); }
.imo-g::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c); clip-path: inset(0 calc(100% - var(--g) * 1%) 0 0 round 999px); }
.imo-ft { font-size: 11.5px; line-height: 1.4; color: color-mix(in srgb, var(--mute) 75%, var(--ink)); }

/* the moment, in ms from the first paint */
@media (prefers-reduced-motion: no-preference) {
  .imo-row { animation: imo-land .45s cubic-bezier(.2, .8, .3, 1) 150ms backwards, imo-pick .35s ease 800ms backwards; }
  .imo-open { animation: imo-open .6s cubic-bezier(.3, .7, .2, 1) 1000ms backwards; }
  .imo-body p { animation: imo-in .4s ease calc(1250ms + var(--i) * 160ms) backwards; }
  .imo-m { animation: imo-in .3s ease calc(1900ms + var(--i) * 200ms) backwards; }
  .imo-g::before { animation: imo-fill .7s cubic-bezier(.3, .7, .3, 1) calc(2000ms + var(--i) * 200ms) backwards; }
}
@keyframes imo-land { from { opacity: 0; transform: translateY(10px); } }
@keyframes imo-pick { from { background-color: #fff; box-shadow: inset 0 0 0 var(--c); } }
@keyframes imo-open { from { grid-template-rows: 0fr; } }
@keyframes imo-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes imo-fill { from { clip-path: inset(0 100% 0 0 round 999px); } }

@media (max-width: 480px) {
  .imo-pad { padding-left: 16px; }
  .imo-m { grid-template-columns: 54px minmax(0, 1fr) 88px; }
}
