/* The wall (wall.html): every message, year by year, in masonry columns. Shares the portrait's ground, type, header
   and message cards (style.css); everything here is the wall's own. */
.wallpage .top::before { opacity: 1; }
.skip { position: fixed; left: 16px; top: 12px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #1a1718; font: 500 13px/1 var(--sans); text-decoration: none; transform: translateY(-160%); transition: transform .2s; }
.skip:focus { transform: none; }
.wallpage .top .link { text-decoration-color: var(--line); }

.mw { max-width: 1480px; margin: 0 auto; padding: calc(var(--hdr) + 26px) 40px 24px; }
/* the way back, the title and the years: held under the header while you read. Once held it folds to one slim bar
   (the way back and a smaller title on one line, the years under them); the greetings below take what it lost
   (--bar-shrink, measured by wall.js) as top padding, so they do not move as it folds. (Padding, not the bar's
   margin: a margin would collapse into the first year's own.) */
.mw__bar { position: sticky; top: var(--hdr); z-index: 20; margin: 0 -40px; padding: 0 40px; transition: background .3s, box-shadow .3s; }
.mw__bar.stuck + .mw__sections { padding-top: var(--bar-shrink, 0px); }
.mw__bar.stuck { background: linear-gradient(rgba(18, 17, 18, .97) 80%, rgba(18, 17, 18, .9)); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .7); }
.mw__head { margin-bottom: 18px; }
.mw__back { display: inline-block; margin-bottom: 18px; color: var(--ink-soft); text-decoration: none; }
.mw__bar.stuck .mw__head { display: flex; align-items: baseline; gap: 18px; margin: 0; padding-top: 12px; }
.mw__bar.stuck .mw__back { flex: none; margin: 0; }
.mw__bar.stuck .mw__head h1 { min-width: 0; margin: 0; font-size: 20px; letter-spacing: -0.02em; line-height: 1.3; padding-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* (room for the descenders: overflow hidden would clip the g at line-height 1) */
.mw__back:hover { color: var(--ink); }
.mw__head .eyebrow { margin-bottom: 10px; }
.mw__head h1 { font: 600 clamp(36px, 3.6vw, 52px)/1 var(--serif); letter-spacing: -0.04em; margin: 0 0 10px; }   /* set like the facet titles */
.mw__head .lede { margin: 0; max-width: 640px; color: var(--ink-soft); font: 400 16px/1.5 var(--serif); }

/* the years */
.mw__years { display: flex; gap: 8px; padding: 12px 0 14px; margin: 0 -40px; padding-inline: 40px; overflow-x: auto; scrollbar-width: none; }
.mw__years::-webkit-scrollbar { display: none; }
.mw__years:empty { display: none; }
.mw__years a { flex: none; display: inline-flex; align-items: baseline; gap: 8px; min-height: 38px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(22, 20, 21, .85);
  color: var(--ink-soft); text-decoration: none; font: 600 14px/1 var(--sans); letter-spacing: -.01em; transition: background .25s, color .25s, border-color .25s; }
.mw__years a:hover { color: var(--ink); border-color: rgba(242, 236, 226, .4); }
.mw__years a.cur { background: var(--ink); border-color: var(--ink); color: #1a1718; }
.mw__years a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a year: its greetings in columns */
.mw__year { margin-top: 30px; }
.mw__year[hidden] { display: none; }
/* changing year: the greetings fade out, the chosen year's fade in */
.mw__sections { transition: opacity .26s var(--ease); }
.mw__sections.fading { opacity: 0; }
.mw__yhead { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.mw__yhead h2 { margin: 0; font: 600 22px/1 var(--sans); letter-spacing: -.02em; color: var(--ink); }   /* small: the tab above already names the year */
.mw__ycount { margin: 0; font: 500 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mw__cols { display: flex; gap: 28px; align-items: flex-start; }
.mw__col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 28px; }

/* a message */
.mcard { transform: perspective(1600px) rotateY(0); transition: transform .5s cubic-bezier(.2, .7, .3, 1), opacity .7s var(--ease); }
.mcard.unseen { opacity: 0; transform: translateY(18px); transition: none; }   /* faded in the first time it comes on screen */
/* turning over to another greeting: a half turn away, the greeting changes, a half turn back */
.mcard.turning-out { transform: perspective(1600px) rotateY(90deg); transition: transform .42s cubic-bezier(.55, 0, .8, .4); }
.mcard.turning-in { transform: perspective(1600px) rotateY(-90deg); transition: none; }
.mcard.fading { opacity: 0; transition: opacity .35s; }
.mcard { position: relative; overflow: hidden; border-radius: 12px; background: rgba(32, 29, 30, .92); border: 1px solid rgba(242, 236, 226, .1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .04); }
.mcard__media { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: #0d0b0c; cursor: zoom-in; }
div.mcard__media { cursor: auto; }
.mcard__img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; object-position: 50% 30%; }   /* one shape for every photo (the whole picture opens in the reader) */
video.mcard__img { aspect-ratio: 16 / 9; object-fit: contain; }
.mcard__body { padding: 24px 26px 24px; }
.mcard__t { margin-top: 16px; max-height: calc(1.6em * 15); overflow: hidden; font: 400 16px/1.6 var(--sans); color: var(--ink-soft); text-wrap: pretty; overflow-wrap: anywhere; }
.mcard__t p { margin: 0 0 10px; }
.mcard__t p:last-child { margin-bottom: 0; }
.mcard.cut .mcard__t { -webkit-mask-image: linear-gradient(#000 calc(100% - 3em), transparent); mask-image: linear-gradient(#000 calc(100% - 3em), transparent); }
.mcard__more { margin-top: 12px; }

.mw__status { margin: 48px 0 0; text-align: center; font: 400 14px/1.5 var(--sans); color: var(--muted); }
.mw__status .link { margin-left: 6px; }


@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  .mw { padding: calc(var(--hdr) + 26px) 18px 20px; }
  .mw__back { margin-bottom: 24px; }
  .mw__head h1 { font-size: 34px; }
  .mw__bar { margin: 0 -18px; padding: 0 18px; }
  .mw__bar.stuck .mw__head { gap: 12px; padding-top: 10px; }
  .mw__bar.stuck .mw__back { font-size: 13px; }
  .mw__bar.stuck .mw__head h1 { font-size: 16px; }
  .mw__years { margin: 0 -18px; padding-inline: 18px; gap: 6px; }
  .mw__years a { padding: 9px 13px; font-size: 13px; }
  .mw__year { margin-top: 20px; }
  .mw__yhead { margin-bottom: 20px; }
  .mw__cols, .mw__col { gap: 16px; }
  .mcard__body { padding: 20px 20px 20px; }
  .mcard__name { font-size: 18px; }
}
