/* A zine post printed in two inks. Soft 18px corners everywhere; the card sits on a halftone
   "shadow" instead of a drop shadow, and the peach ink is printed a few pixels off register. */
.post {
  --w: 360px;
  position: relative;
  width: min(var(--w), calc(100vw - 32px));
  padding: 14px 14px 16px;
  border-radius: 18px;
  isolation: isolate; /* the two layers below stay behind the content, even inside a scaled reel stage */
}

/* Halftone shadow: a dot screen in the second ink, offset down and to the right... */
.post::before,
.post::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
}

.post::before {
  translate: 12px 12px;
  background: radial-gradient(circle, var(--ink2) 2.4px, transparent 2.9px) 0 0 / 8px 8px;
}

/* ...and the card itself printed over it. */
.post::after {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--line);
}

/* ---------- Header ---------- */
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink2);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--ink1);
  font: 800 16px/1 var(--font);
  letter-spacing: -0.04em;
}

.who { flex: 1; display: grid; margin: 0; line-height: 1.2; }
.who strong { font-size: 15px; font-weight: 750; }
.who span { font: 400 11px/1.4 var(--mono); color: var(--muted); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.icon-btn svg { width: 26px; height: 26px; fill: currentColor; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink2) 35%, transparent); }
.icon-btn:focus-visible, .like:focus-visible { outline: 3px solid var(--ink1); outline-offset: 2px; }

/* ---------- The print ---------- */
.art {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--line);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.print { display: block; width: 100%; height: 100%; }
.print .ink-skin { fill: #ffc6a8; }
.print .ink-bridal, .print pattern circle { fill: #741a2f; }

/* The words are HTML over the SVG (SVG text renders badly inside the scaled reel stage),
   sized in container units so they scale with the print. */
.art { container-type: inline-size; }
.art-issue, .art-hello { position: absolute; left: 6.1cqw; pointer-events: none; }
.art-issue { top: 6.4cqw; color: #741a2f; font: 700 3.6cqw/1 var(--mono); letter-spacing: 0.2em; }
.art-hello { bottom: 3.6cqw; color: #fff8f2; font: italic 800 17.8cqw/1 var(--font); letter-spacing: -0.04em; }

/* The big heart stamped on a double tap. */
.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170px;
  height: 170px;
  margin: -85px 0 0 -85px;
  pointer-events: none;
  opacity: 0;
}

.stamp-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.stamp-ink.ink2 { fill: #fff8f2; translate: 7px 6px; }
.stamp-ink.ink1 { fill: #741a2f; }

/* ---------- Actions ---------- */
.actions { display: flex; align-items: center; gap: 2px; margin: 8px -6px 2px; }
.actions .save { margin-left: auto; }

.like {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.heart { position: relative; display: block; width: 30px; height: 30px; }
.heart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.heart-line { fill: var(--ink1); }

/* Two inks fill the heart from the bottom up. The peach one is printed slightly off register. */
.heart-ink { clip-path: inset(100% 0 0 0); }
.heart-ink.ink1 { fill: var(--ink1); }
.heart-ink.ink2 { fill: var(--ink2); translate: 4px 3px; }
.like[aria-pressed="true"] .heart-ink { clip-path: inset(0 0 0 0); }

/* Halftone dots that burst out of the heart (created by script.js). */
.dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
}

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  border: 3px dotted var(--ink1);
  pointer-events: none;
}

/* ---------- Likes, caption ---------- */
.likes { display: flex; align-items: baseline; gap: 5px; margin: 4px 0 6px; font-size: 15px; font-weight: 750; }

/* Odometer: each digit is a column that only moves when that digit changes. */
.odometer { display: inline-flex; font: 700 15px/1 var(--mono); font-variant-numeric: tabular-nums; }
.odometer .digit { position: relative; display: inline-block; height: 1.1em; overflow: hidden; }
.odometer .digit > span { display: block; line-height: 1.1em; }

.caption { margin: 0; font-size: 14px; line-height: 1.45; }
.caption strong { font-weight: 750; margin-right: 4px; }
.time { margin: 8px 0 0; font: 400 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root:not([data-reel]) .stamp-ink.ink2 { fill: #2b0c15; }
}
