.bean-postcard {
  --paper: #f1e7ff;
  --pencil: #533a69;
  --binding: #b092c6;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(155px, .75fr);
  align-items: center;
  margin: clamp(14px, 3vw, 30px) 0;
  max-width: 740px;
  padding: clamp(8px, 1.6vw, 15px);
  border: 1px solid var(--binding);
  border-radius: 16px 28px 24px 15px;
  background: repeating-linear-gradient(0deg, transparent 0 21px, #45204e0b 21px 22px), var(--paper);
  box-shadow: 3px 4px 0 #56336f12;
}

.bean-postcard--mint {
  --paper: #dff1e7;
  --pencil: #30594d;
  --binding: #8db7a5;
}

.bean-postcard--honey {
  --paper: #fff0c8;
  --pencil: #634528;
  --binding: #ccb47f;
}

.bean-postcard--guava {
  --paper: #fce2e6;
  --pencil: #783c51;
  --binding: #d4aab6;
}

.bean-postcard--plain {
  --paper: #f4eef5;
  --pencil: #57465f;
  --binding: #bfb0c2;
  box-shadow: none;
}

.bean-postcard-photo {
  position: relative;
  padding: 5px;
  background: #fffdf3;
  border: 1px solid #46334029;
  border-radius: 9px;
  box-shadow: 0 2px 7px #39283621;
  transform: rotate(-1deg);
}

.bean-postcard-photo::before {
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 42%;
  width: 54px;
  height: 15px;
  background: repeating-linear-gradient(130deg, #f8d96dc4 0 4px, #fff2adcf 4px 8px);
  content: "";
  transform: rotate(4deg);
}

.bean-postcard--plain .bean-postcard-photo {
  transform: none;
}

.bean-postcard--plain .bean-postcard-photo::before {
  display: none;
}

.bean-postcard-photo > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.77;
  object-fit: cover;
  object-position: var(--photo-focus, center);
  border-radius: 5px;
}

.bean-postcard-note {
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 8px clamp(9px, 2vw, 18px);
  color: var(--pencil);
  text-align: center;
}

.bean-postcard .bean-postcard-prop {
  width: clamp(58px, 12vw, 112px);
  height: auto;
  aspect-ratio: 1.12;
  border: 0;
  object-fit: contain;
  transform: rotate(6deg);
  mix-blend-mode: multiply;
}

.bean-postcard-caption {
  max-width: 19ch;
  font-family: "Bean Serif", Georgia, serif;
  font-size: clamp(1.02rem, 2vw, 1.38rem);
  font-weight: 650;
  line-height: 1.15;
  text-wrap: balance;
}

.bean-postcard-credit {
  margin-top: 6px;
  font-size: .77rem;
  font-weight: 680;
  line-height: 1.35;
}

.bean-library .bean-shelf-picture {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.2;
  border: 0;
  border-radius: 8px;
  object-fit: cover;
  object-position: var(--photo-focus, center);
}

.bean-library .bean-shelves li {
  padding: 7px 8px 9px;
}

.bean-library .bean-shelves li > a {
  display: block;
  min-height: 44px;
  padding: 0 2px 5px;
}

.bean-shelf-picture + span {
  display: block;
  padding: 7px 0 0;
}

.bean-story-photo > img {
  object-position: 53% 52%;
}

.bean-story-photo > figcaption {
  min-height: 35px;
  line-height: 1.2;
  text-align: center;
}

.bean-family-album {
  margin: 30px 0 40px;
}

.bean-family-album > h2 {
  margin: 0 0 14px;
  font-size: clamp(1.82rem, 4.5vw, 3.2rem);
}

.bean-family-album > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 18px);
}

.bean-family-album figure {
  margin: 0;
  padding: 6px;
  border: 1px solid #d8c3dc;
  border-radius: 8px;
  background: #fffdf3;
  box-shadow: 2px 3px 0 #64407311;
}

.bean-family-album img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  border-radius: 4px;
  object-fit: cover;
  object-position: var(--photo-focus, center);
}

.bean-family-album figcaption {
  padding: 7px 4px 3px;
  color: #4d3857;
  font-size: .86rem;
  line-height: 1.3;
}

@media (max-width: 650px) {
  .bean-postcard {
    grid-template-columns: minmax(0, 1.63fr) minmax(0, 1fr);
  }
  .bean-postcard-photo > img {
    aspect-ratio: 1.18;
  }
  .bean-family-album > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .bean-postcard-note {
    padding-inline: 5px;
  }
}

@media print {
  .bean-postcard, .bean-shelf-picture { display: none !important; }
}

/* Give the image enough space for its actual subject and crop. */
.bean-postcard {
  max-width: 850px;
  grid-template-columns: minmax(0, 1.9fr) minmax(165px, .89fr);
  gap: clamp(8px, 2.4vw, 28px);
  padding: clamp(11px, 2vw, 20px);
  background: radial-gradient(ellipse at right top, #ffffff85 0, transparent 57%),
              repeating-linear-gradient(0deg, transparent 0 21px, #45204e0b 21px 22px),
              var(--paper);
}

.bean-postcard--portrait {
  grid-template-columns: minmax(0, 1fr) minmax(165px, .82fr);
  max-width: 710px;
}

.bean-postcard--portrait .bean-postcard-photo > img {
  aspect-ratio: 1.2;
}

.bean-postcard .bean-postcard-prop {
  width: clamp(69px, 14vw, 132px);
}

.bean-postcard-caption {
  font-size: clamp(1.12rem, 2.3vw, 1.57rem);
}

.bean-postcard-credit {
  font-size: .82rem;
}

.bean-story-photo > img {
  object-position: 52% 65%;
}

.bean-shelf-entries {
  display: grid;
  gap: 9px;
  padding-inline: 0;
}

.bean-entries .bean-shelf-guide {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid #d3c3d2;
  border-radius: 10px 18px 13px 11px;
  background: #fffdf3;
}

.bean-entries .bean-shelf-guide img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

@media (max-width: 510px) {
  .bean-postcard,
  .bean-postcard--portrait {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .bean-postcard-photo,
  .bean-postcard-photo::before {
    transform: none;
  }

  .bean-postcard-photo > img { aspect-ratio: 1.58; }
  .bean-postcard--portrait .bean-postcard-photo > img { aspect-ratio: 1.21; }

  .bean-postcard-note {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: start;
    align-items: center;
    gap: 2px 10px;
    padding: 3px 5px;
    text-align: start;
  }

  .bean-postcard .bean-postcard-prop { grid-row: 1 / -1; width: 100%; }
  .bean-postcard-caption { max-width: 100%; }
  .bean-postcard-credit { margin-top: 0; }
  .bean-entries .bean-shelf-guide { grid-template-columns: 47px minmax(0, 1fr); }
}

/* Keep the editorial photographs close to the guide copy that introduces them. */
.field-photo-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  column-gap: clamp(.45rem, 1.5vw, .9rem);
  align-items: start;
  margin-block: clamp(1.35rem, 3.5vw, 2.65rem);
}
.field-frame {
  display: grid;
  min-width: 0;
  margin: clamp(1.1rem, 2.65vw, 2rem) 0;
  background: #fbf4e3;
  border-block-end: 1px solid #cabda5;
}
.field-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: var(--photo-focus, center);
  background: #d6cdba;
}
.field-frame figcaption {
  display: grid;
  gap: .25rem;
  align-content: start;
  padding: .58rem .62rem .65rem;
  border-inline-start: 2px solid #47988e;
  color: #28493d;
  font: 1.02rem/1.35 var(--serif);
  overflow-wrap: break-word;
}
.field-frame figcaption small { color: #594b40; font: .74rem/1.35 var(--sans); }
.field-photo-spread .field-frame { margin: 0; }
.field-photo-spread .field-frame + .field-frame { margin-block-start: clamp(.5rem, 3vw, 1.9rem); }
.field-photo-spread--quiet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-photo-spread--quiet .field-frame + .field-frame { margin-block-start: 0; }
.field-photo-spread--quiet .field-frame figcaption { border-color: #8b7a68; }

@media (max-width: 640px) {
  .field-photo-spread { grid-template-columns: minmax(0, 1fr); row-gap: .7rem; }
  .field-photo-spread .field-frame + .field-frame { margin-block-start: 0; }
}

@media print {
  .field-frame,
  .field-photo-spread { display: none; }
}
