.insta-album {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 9%;
  width: min(100%, 1120px);
  margin: clamp(2rem, 6vw, 5rem) auto;
  padding: clamp(2rem, 5vw, 4.5rem) 6%;
  background: #ddc69d url("images/instagram-album.webp") center / 100% 100% no-repeat;
  color: #3d2a20;
  box-shadow: 0 9px 18px -8px #31211770;
}
.album-intro, .album-feed { min-width: 0; text-align: center; }
.album-intro h2 { font-size: clamp(1.5rem, 3.2vw, 2.85rem); letter-spacing: .1em; line-height: 1.45; }
.album-print {
  --corner: #4d3b30;
  position: relative;
  background: #fff9ec;
  box-shadow: 1px 3px 8px #38201455;
  padding: clamp(.4rem, 1vw, .85rem);
}
.album-print::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--corner) 46%, #a18c69 48%, transparent 54%) top left,
    linear-gradient(225deg, var(--corner) 46%, #a18c69 48%, transparent 54%) top right,
    linear-gradient(45deg, var(--corner) 46%, #a18c69 48%, transparent 54%) bottom left,
    linear-gradient(315deg, var(--corner) 46%, #a18c69 48%, transparent 54%) bottom right;
  background-size: 19px 19px;
  background-repeat: no-repeat;
}
.album-portrait { transform: rotate(-3deg); margin: 1.65rem auto 2rem; max-width: 340px; }
.album-portrait img { display: block; width: 100%; aspect-ratio: 1.49; object-fit: cover; filter: sepia(.22); }
.album-portrait figcaption { font: .875rem/1.5 "Yu Mincho",serif; margin: .4rem 0 .1rem; letter-spacing: .14em; }
.album-follow {
  display: inline-block;
  padding: .58rem 1.45rem;
  background: #53332f;
  color: #fff8e8;
  border: 3px double #d4bd9c;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
}
.album-follow:hover, .album-follow:focus-visible { background: #713f36; }
.album-handle { display: block; margin-top: .3rem; font-size: .875rem; }
.album-posts { max-width: 390px; margin: auto; transform: rotate(1deg); }
.album-embed { display: block; width: 100%; height: 425px; border: 0; background: white; }
.album-original { display: inline-block; margin-top: .75rem; font-size: .875rem; }
@media (max-width: 800px) {
  .insta-album { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: 2.5rem 5.5%; background-size: 200% 100%; background-position: right; }
  .album-portrait { width: 74%; max-width: 285px; margin: 1.2rem auto 1.6rem; }
  .album-posts { transform: none; }
}

.album-modal-open { overflow: hidden; }
#room-album-dialog {
  width: min(1020px, 95vw);
  max-width: 95vw;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid #624631;
  background: transparent;
  color: #39291c;
  box-shadow: 0 16px 90px #180f0ac9;
}
#room-album-dialog::backdrop { background: #20160ed9; }
#room-album-dialog .insta-album { width: 100%; margin: 0; box-shadow: none; }
.album-dialog-pages {
  max-height: calc(90dvh - 2px);
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.album-close {
  position: absolute;
  z-index: 1;
  inset: .35rem .35rem auto auto;
  margin: 0;
}
.album-close button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dbc5a0;
  border-radius: 50%;
  background: #493327;
  color: #fff7e7;
  font: normal 1.85rem/1 sans-serif;
  box-shadow: 0 2px 5px #28180e59;
}
.album-close button:hover { background: #664532; }
.album-close button:focus-visible { outline: 2px solid #fff6de; outline-offset: -5px; }

#room-album-dialog, #room-album-dialog * { box-sizing: border-box; }
#room-album-dialog .album-original { color: #4c3027; }
#room-album-dialog .album-placeholder {
  margin: 0; padding: 3.5rem 2rem 2rem; background: #fbf3df; color: #39291c;
  font: 1rem/1.7 'Yu Mincho', serif;
}
.album-placeholder a { color: inherit; text-underline-offset: .2em; }

@media (max-width:800px) {
  .insta-album, #room-album-dialog .insta-album {
    box-sizing:border-box; grid-template-columns:minmax(0,1fr);gap:1.15rem;
    padding:1.35rem clamp(.65rem,3vw,1.25rem) 1rem;
    background:linear-gradient(105deg,#f0e5d0,#fff9eb 52%,#f4ead6);
    border:1px solid #b5a080;border-top:5px solid #385347;border-radius:5px;
  }
  .album-intro {display:grid;grid-template-columns:clamp(4.1rem,21vw,7rem) minmax(0,1fr);
    grid-template-areas:"portrait title" "portrait handle" "portrait follow";column-gap:.85rem;align-items:center;text-align:left;}
  .album-intro h2 {grid-area:title;font-size:clamp(1.14rem,4.6vw,1.65rem);letter-spacing:.045em;margin:0;}
  .album-portrait {grid-area:portrait;width:100%;margin:0;transform:rotate(-2deg);padding:.22rem;}
  .album-portrait img {height:auto;aspect-ratio:1;object-fit:cover;}
  .album-portrait figcaption {font-size:.68rem;letter-spacing:0;text-align:center;}
  .album-handle {grid-area:handle;font-size:.85rem;margin:0;overflow-wrap:anywhere;}
  .album-follow {grid-area:follow;justify-self:start;margin-top:.35rem;padding:.35rem .65rem;font-size:.875rem;}
  .album-feed {border-top:1px solid #c6b393;padding-top:1rem;}
  .album-posts {width:100%;max-width:32rem;transform:none;padding:.25rem;}
  .album-embed {width:100%;max-width:100%;height:clamp(16rem,48dvh,26.5rem);}
  #room-album-dialog {width:min(34rem,calc(100vw - 1rem));max-width:calc(100vw - 1rem);border:0;border-radius:6px;}
  #room-album-dialog .album-intro {padding-right:1.9rem;}
  .album-close {inset:.35rem .35rem auto auto;}
  .album-close button {width:36px;height:36px;}
}
