/* The Life Review's memory attachments. Scoped to avoid changing other albums. */
.memory-album {
  --album-ink: #344438;
  --album-muted: #7b7d6c;
  --album-line: #dedbc9;
  margin-top: 35px;
  color: var(--album-ink);
}
.memory-album-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.memory-album-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--album-muted);
}
.memory-album .memory-album-heading h3 {
  font-family: inherit;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.14;
  letter-spacing: -.045em;
}
.memory-album-heading > p {
  max-width: 180px;
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--album-muted);
  text-align: right;
}
.memory-album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px 23px;
  align-items: start;
}
.memory-entry {
  min-width: 0;
  position: relative;
  isolation: isolate;
  padding: 15px;
  border: 1px solid #e8e2d1;
  border-radius: 4px;
  background: #fffdf6;
  box-shadow: 0 5px 13px #544e3810;
}
.memory-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #75816d;
}
.memory-entry-number { color: #a09c87; font-variant-numeric: tabular-nums; }
.memory-attachments { position: relative; min-width: 0; }
.memory-portraits { display: flex; gap: 8px; min-width: 0; }
.memory-photo { flex: 1; min-width: 0; margin: 0; }
.memory-photo-image {
  height: 186px;
  position: relative;
  overflow: hidden;
  background: #e5e3d9;
}
.memory-photo-image > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  filter: saturate(.85);
}
.memory-photo > figcaption {
  overflow: hidden;
  padding: 7px 3px 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a7e6f;
}
.memory-photo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: Georgia, serif;
  font-size: 55px;
  font-style: italic;
  color: #859781;
  background: radial-gradient(ellipse at 50% 80%, #c4cfb6, transparent 70%), #e4e9d9;
}
.memory-keepsake {
  position: absolute;
  width: 100px;
  right: -3px;
  bottom: 4px;
  margin: 0;
  padding: 5px 5px 4px;
  background: #fffdf4;
  border: 1px solid #e5ddca;
  box-shadow: 0 3px 9px #3b3d3224;
  transform: rotate(7deg);
}
.memory-keepsake > img {
  width: 100%;
  height: 78px;
  display: block;
  object-fit: cover;
}
.memory-keepsake > figcaption {
  margin-top: 4px;
  font-size: 7px;
  line-height: 1.2;
  text-align: center;
  color: #797765;
}
.memory-entry--keepsake .memory-photo > figcaption { max-width: calc(100% - 95px); }
.memory-entry-copy { padding: 16px 2px 0; }
.memory-category {
  display: block;
  margin-bottom: 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.5;
  text-transform: uppercase;
  color: #8a866f;
  overflow-wrap: anywhere;
}
.memory-album .memory-caption {
  margin: 0;
  font-family: inherit;
  font-size: 20px;
  font-weight: 690;
  letter-spacing: -.035em;
  line-height: 1.17;
  overflow-wrap: anywhere;
}
.memory-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}
.memory-effect {
  padding: 4px 7px;
  border: 1px solid #dce4d2;
  border-radius: 5px;
  background: #edf3e5;
  color: #536c4f;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.memory-effect--negative { background: #f8ece4; border-color: #eedcd0; color: #956751; }
.memory-details { margin-top: 14px; border-top: 1px solid var(--album-line); }
.memory-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 39px;
  padding: 10px 0 0;
  cursor: pointer;
  list-style: none;
  color: #7e816e;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
}
.memory-details > summary::-webkit-details-marker { display: none; }
.memory-details > summary > span { font-size: 15px; transition: transform .18s ease; }
.memory-details[open] > summary > span { transform: rotate(90deg); }
.memory-details > summary:focus-visible { outline: 3px solid #a08ab8; outline-offset: 4px; border-radius: 3px; }
.memory-details > div { padding: 12px 0 5px; overflow-wrap: anywhere; }
.memory-details strong { font-size: 12px; line-height: 1.5; }
.memory-details p { margin: 7px 0 0; font-size: 12px; line-height: 1.7; color: #747863; }

/* A classic print, held by a short piece of translucent tape. */
.memory-entry--polaroid { padding: 13px 13px 8px; transform: rotate(-.7deg); }
.memory-entry--polaroid::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -8px;
  left: 37%;
  width: 69px;
  height: 20px;
  background: #c9c9a17a;
  transform: rotate(-6deg);
  clip-path: polygon(2% 0,100% 3%,97% 100%,0 96%);
}
.memory-entry--polaroid .memory-photo-image { height: 205px; }
.memory-entry--polaroid .memory-entry-copy { padding: 16px 5px 0; }

/* A postcard with a portrait stamp and an inset, corner-mounted print. */
.memory-entry--postcard { background: #edf0e2; transform: rotate(.6deg); padding: 16px; }
.memory-entry--postcard .memory-entry-top { padding-bottom: 15px; }
.memory-entry--postcard .memory-entry-number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 26px;
  border: 1px dashed #a3ae92;
  font-family: Georgia, serif;
  color: #718066;
}
.memory-entry--postcard .memory-photo { padding: 7px; background: #fffdf6; box-shadow: 0 2px 4px #40513712; }
.memory-entry--postcard .memory-photo-image { height: 164px; }
.memory-entry--postcard .memory-photo-corners::before,
.memory-entry--postcard .memory-photo-corners::after {
  content: '';
  width: 24px;
  height: 24px;
  position: absolute;
  z-index: 1;
  background: #a7b697;
}
.memory-entry--postcard .memory-photo-corners::before { top: -1px; left: -1px; clip-path: polygon(0 0,100% 0,0 100%); }
.memory-entry--postcard .memory-photo-corners::after { bottom: -1px; right: -1px; clip-path: polygon(100% 0,100% 100%,0 100%); }
.memory-entry--postcard .memory-category { color: #728164; }

/* Perforated edges and a numbered stub make a little life ticket. */
.memory-entry--ticket {
  background: #f6e6c7;
  border-color: #e9d8b5;
  border-radius: 10px;
  padding: 15px 16px 8px;
}
.memory-entry--ticket::before,
.memory-entry--ticket::after {
  content: '';
  position: absolute;
  top: 35px;
  width: 14px;
  height: 14px;
  background: #faf4e6;
  border: 1px solid #e9d8b5;
  border-radius: 50%;
}
.memory-entry--ticket::before { left: -8px; clip-path: inset(0 0 0 50%); }
.memory-entry--ticket::after { right: -8px; clip-path: inset(0 50% 0 0); }
.memory-entry--ticket .memory-entry-top { border-bottom: 1px dashed #d1b78c; margin-bottom: 13px; color: #907651; }
.memory-entry--ticket .memory-photo { display: flex; align-items: end; gap: 10px; }
.memory-entry--ticket .memory-photo-image { width: 50%; flex: none; height: 141px; border-radius: 45% 45% 4px 4px; }
.memory-entry--ticket .memory-photo > figcaption { white-space: normal; overflow-wrap: anywhere; margin-bottom: 8px; font-family: Georgia, serif; font-style: italic; font-size: 15px; color: #8d7755; }
.memory-entry--ticket.memory-entry--keepsake .memory-photo > figcaption { display: none; }
.memory-entry--ticket .memory-keepsake { width: 99px; bottom: -3px; }
.memory-entry--ticket .memory-details { border-top-style: dashed; border-color: #d1b78c; }

/* A contact strip contains only the life and the participants we actually know. */
.memory-entry--contact { padding: 13px 13px 8px; background: #f6f3ec; transform: rotate(-.4deg); }
.memory-entry--contact .memory-portraits {
  padding: 17px 8px 14px;
  gap: 5px;
  position: relative;
  background: #394038;
  border-radius: 2px;
}
.memory-entry--contact .memory-portraits::before,
.memory-entry--contact .memory-portraits::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 4px;
  background: repeating-linear-gradient(90deg,#d9d9c7 0 8px,transparent 8px 19px);
  opacity: .65;
}
.memory-entry--contact .memory-portraits::before { top: 6px; }
.memory-entry--contact .memory-portraits::after { bottom: 6px; }
.memory-entry--contact .memory-photo-image { height: 164px; }
.memory-entry--contact .memory-photo > figcaption { color: #e2dfcb; font-size: 9px; padding: 7px 2px 0; }
.memory-entry--contact .memory-photo:only-child { max-width: 72%; margin: auto; }
.memory-entry--contact .memory-photo:only-child .memory-photo-image { height: 164px; }
.memory-entry--contact .memory-keepsake { bottom: 12px; }

/* A quiet receipt, with a clipped print and a clean tear at the foot. */
.memory-entry--receipt { padding: 15px 17px 15px; background: #fdfcf2; border-bottom: 0; transform: rotate(.6deg); }
.memory-entry--receipt::after {
  content: '';
  position: absolute;
  height: 7px;
  left: -1px;
  right: -1px;
  bottom: -6px;
  background: linear-gradient(135deg,#fdfcf2 25%,transparent 25%) -5px 0 / 10px 10px,linear-gradient(225deg,#fdfcf2 25%,transparent 25%) -5px 0 / 10px 10px;
}
.memory-entry--receipt .memory-entry-top { font-family: ui-monospace, monospace; border-bottom: 1px dashed #cbcbb7; margin-bottom: 14px; }
.memory-entry--receipt .memory-photo-image { height: 155px; filter: saturate(.6); border: 5px solid #fff; box-shadow: 0 1px 5px #443f3820; }
.memory-entry--receipt .memory-caption { font-family: Georgia, serif; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.memory-entry--receipt .memory-details { border-top-style: dashed; }
.memory-album-empty { padding: 48px 20px; text-align: center; border: 1px dashed #c9cdb8; border-radius: 8px; }
.memory-album-empty > span { font-size: 32px; color: #829779; }
.memory-album-empty h4 { margin: 12px 0 8px; font-size: 20px; }
.memory-album-empty p { margin: 0; font-size: 13px; color: var(--album-muted); }
@media (max-width: 1000px) {
  .memory-album-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .memory-album { margin-top: 28px; }
  .memory-album-heading { display: block; margin-bottom: 23px; }
  .memory-album-heading > p { max-width: none; text-align: left; margin-top: 10px; font-size: 10px; }
  .memory-album-grid { grid-template-columns: minmax(0,1fr); gap: 26px; }
  .memory-entry { transform: none; }
  .memory-photo-image { height: 205px; }
  .memory-entry--contact .memory-photo-image { height: 175px; }
  .memory-album .memory-caption { font-size: 21px; }
  .memory-details > summary { min-height: 44px; font-size: 11px; }
  .memory-details p { font-size: 13px; }
  .memory-effect { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .memory-details > summary > span { transition: none; }
}
/* Use the existing square face crop for a complete, readable face. Full-length
   fallback art gets its own taller print rather than a wide forehead crop. */
.memory-album .memory-photo-image--face{width:min(100%,190px);height:190px;margin-inline:auto;border-radius:3px}
.memory-album .memory-photo-image--face>img{object-fit:contain;object-position:center}
.memory-album .memory-photo-image--portrait{width:min(100%,170px);height:260px;margin-inline:auto}
.memory-entry--ticket .memory-photo-image--face{width:50%;height:auto;aspect-ratio:1;flex:none;border-radius:45% 45% 4px 4px}
.memory-entry--contact .memory-photo-image--face{height:auto;aspect-ratio:1}
.memory-photo>figcaption{text-align:center}

/* The scene carries the memory; portraits remain for the actual people met. */
.memory-context-scene{display:block;position:relative;width:100%;aspect-ratio:1;overflow:hidden;background:#e7e5da}
.memory-context-scene>img,.memory-context-scene>svg{display:block;width:100%;height:100%;object-fit:cover}
.memory-entry--context{padding:14px 14px 8px;background:#fffdf7;transform:rotate(-.25deg)}
.memory-entry--context .memory-photo-corners{display:none}
.memory-chapter-picture{display:grid;grid-template-rows:repeat(var(--chapter-rows,3),minmax(0,1fr));aspect-ratio:1;overflow:hidden;background:#e7e5da}
.memory-chapter-row{position:relative;min-height:0;overflow:hidden;border-bottom:3px solid #fffdf4}
.memory-chapter-row:last-child{border-bottom:0}
.memory-chapter-row .memory-context-scene{width:100%;height:100%;aspect-ratio:auto}
.memory-chapter-row>b{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,#122a21dd);padding:18px 10px 7px;color:#fffdf4;font-size:13px;line-height:1.3;text-shadow:0 1px 2px #0008}
.memory-entry--chapter{padding:14px 14px 8px;background:#f6f7ec;transform:rotate(.2deg)}
.memory-chapter-summary{font-size:13px;color:#65745d;line-height:1.5;margin:8px 0 0}
.memory-chapter-records>section{padding:12px 0;border-bottom:1px dashed #d7d7c7}
.memory-chapter-records>section:last-child{border:0}
.memory-chapter-records>section strong{font-size:14px}
.memory-chapter-records>section p{margin:7px 0;font-size:13px;line-height:1.55}

.memory-scene-summary{font-size:13px;line-height:1.5;color:#596d59;margin:8px 0 12px}
/* A shared keepsake portrait: quiet ivory/brass framing for every partnership. */
.memory-entry--partnership{background:#fffdf6;border-color:#d7d2c2}
.memory-partnership{margin:0;display:grid;justify-items:center;padding:6px 0 1px}
.memory-partnership svg{display:block;width:100%;height:auto;filter:drop-shadow(0 5px 6px #4945371a)}
.memory-partnership figcaption{font-family:Georgia,serif;font-size:20px;font-weight:500;text-align:center;padding:12px 8px 5px;color:#414e46;line-height:1.35}
.memory-partnership figcaption span{color:#8a7d5c;margin:0 6px}
.memory-entry--partnership .memory-photo-corners{display:none}
.memory-memento{position:relative;min-height:245px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:15px;text-align:center;padding:28px 22px;background:repeating-linear-gradient(0deg,transparent,transparent 27px,#c5b99e36 28px),#f1e8d8;border:1px solid #d5c9b0;border-radius:4px;color:#555b4b}
.memory-memento-seal{display:grid;place-items:center;width:60px;height:60px;border:1px solid #bba46e;border-radius:50%;color:#9b7e3c;background:#fffdf3b3}
.memory-memento-seal svg{width:32px;height:32px;margin:0!important}
.memory-memento small{font-size:11px;text-transform:uppercase;letter-spacing:.14em}.memory-memento strong{font-family:Georgia,serif;font-size:24px;font-weight:500;line-height:1.3}.memory-memento>span:not(.memory-memento-seal){font-size:13px}.memory-memento>i{font-style:normal;color:#b29355}
.memory-chapter-row .memory-memento{min-height:0;height:100%;padding:7px;gap:5px}.memory-chapter-row .memory-memento strong,.memory-chapter-row .memory-memento small,.memory-chapter-row .memory-memento>i{display:none}.memory-chapter-row .memory-memento-seal{width:45px;height:45px}
