/* =============================================================================
   COMPONENT: RECOMMENDATIONS as airmail "letters to the editor"
   Avatar sits inside a perforated postage stamp.
   ============================================================================= */
.letter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--c-paper);
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(-45deg,
      var(--c-red) 0 12px, var(--c-paper) 12px 20px,
      #2f6fb0 20px 32px, var(--c-paper) 32px 40px) 10;
  box-shadow: var(--sh-lg);
}

.letter__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 82px; /* room for the postage stamp */
}

.letter__name { font: 400 var(--t-lg)/1 var(--f-display); text-transform: uppercase; }
.letter__role { margin-top: 4px; font-size: var(--t-xs); line-height: 1.4; color: var(--c-ink-soft); }

/* Postage stamp with the avatar inside */
.letter__stamp {
  --perf: 4px;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 74px;
  padding: 6px;
  background: var(--c-butter);
  rotate: 6deg;
  -webkit-mask:
    radial-gradient(circle at 50% 0, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 50% 0 / 12px 100% repeat-x,
    radial-gradient(circle at 50% 100%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 50% 100% / 12px 100% repeat-x,
    radial-gradient(circle at 0 50%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 0 50% / 100% 12px repeat-y,
    radial-gradient(circle at 100% 50%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 100% 50% / 100% 12px repeat-y;
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle at 50% 0, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 50% 0 / 12px 100% repeat-x,
    radial-gradient(circle at 50% 100%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 50% 100% / 12px 100% repeat-x,
    radial-gradient(circle at 0 50%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 0 50% / 100% 12px repeat-y,
    radial-gradient(circle at 100% 50%, #0000 var(--perf), #000 calc(var(--perf) + 0.5px)) 100% 50% / 100% 12px repeat-y;
  mask-composite: intersect;
}

.letter__stamp img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--c-ink);
  filter: saturate(0.9) contrast(1.05);
}

.letter__re {
  padding-block: 8px;
  border-block: 2px dashed rgb(22 19 15 / 0.4);
  font: 700 var(--t-xs)/1.45 var(--f-label);
  text-transform: uppercase;
}

.letter__body {
  font: 400 var(--t-base)/1.7 var(--f-body);
}

.letter__body p::before { content: "“"; }
.letter__body p::after  { content: "”"; }

.letter__sign {
  margin-top: auto;
  font: 700 var(--t-md)/1.3 var(--f-accent);
}

.letter__sign .stamp { margin-left: 10px; font-size: 0.8rem; vertical-align: middle; }

@media (max-width: 520px) {
  .letter__head { padding-right: 66px; }
  .letter__stamp { width: 60px; }
}
