.mmh-prints {
    --desktop-cols: 5;
    --tablet-cols: 3;
    --strength: 1;
    --extra: 6%;
    --row-overlap: -7px;
    position: relative;
    background: #fff;
    color: #302b25;
    container-type: inline-size;
    min-width: 0;
}
.mmh-prints[data-columns="2"] { --desktop-cols: 2; --tablet-cols: 2; }
.mmh-prints[data-columns="3"] { --desktop-cols: 3; }
.mmh-prints[data-columns="4"] { --desktop-cols: 4; }
.mmh-prints[data-columns="6"] { --desktop-cols: 6; }
.mmh-prints[data-scatter="light"] { --strength: .58; --extra: 2%; --row-overlap: -3px; }
.mmh-prints[data-scatter="loose"] { --strength: 1.27; --extra: 8%; --row-overlap: -11px; }

.mmh-prints .mmh-prints__wall {
    --cols: var(--desktop-cols);
    --device: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    isolation: isolate;
    box-sizing: border-box;
    gap: 0;
    margin: 0;
    padding: clamp(34px, 6%, 85px) clamp(29px, 5.5%, 80px);
    list-style: none;
    background: #fff;
}
.mmh-prints[data-columns="2"] .mmh-prints__wall { padding-inline: clamp(31px, 8.5%, 96px); }

.mmh-prints .mmh-prints__item {
    --angle: -6deg;
    --x: -1%;
    --y: 0%;
    display: flex;
    justify-content: center;
    flex: 0 0 calc(100% / var(--cols));
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    min-width: 0;
    padding: 0;
    margin: 0 0 var(--row-overlap);
    list-style: none;
    pointer-events: none;
}
/* Each row falls differently. The poses stay put on reload and need no script. */
.mmh-prints__item:nth-child(11n+2) { --angle: 5deg; --x: 2%; --y: 5%; z-index: 4; }
.mmh-prints__item:nth-child(11n+3) { --angle: -3deg; --x: -2%; --y: -3%; z-index: 3; }
.mmh-prints__item:nth-child(11n+4) { --angle: 9deg; --x: 0%; --y: 1%; z-index: 1; }
.mmh-prints__item:nth-child(11n+5) { --angle: -7deg; --x: 1%; --y: -2%; z-index: 5; }
.mmh-prints__item:nth-child(11n+6) { --angle: 4deg; --x: 3%; --y: 0%; z-index: 3; }
.mmh-prints__item:nth-child(11n+7) { --angle: -9deg; --x: -1%; --y: 3%; z-index: 6; }
.mmh-prints__item:nth-child(11n+8) { --angle: 7deg; --x: -2%; --y: 1%; z-index: 2; }
.mmh-prints__item:nth-child(11n+9) { --angle: -4deg; --x: 2%; --y: -3%; z-index: 5; }
.mmh-prints__item:nth-child(11n+10) { --angle: 3deg; --x: -1%; --y: 4%; z-index: 3; }
.mmh-prints__item:nth-child(11n) { --angle: -7deg; --x: 1%; --y: -1%; z-index: 4; }

.mmh-prints .mmh-prints__print {
    display: block;
    flex: none;
    box-sizing: border-box;
    width: calc(100% + var(--extra) * var(--device));
    max-width: 440px;
    padding: 4.3% 4.3% 0;
    border: 1px solid rgba(42,35,25,.13);
    border-radius: 2px;
    background: linear-gradient(145deg, #fffefa, #fcfaf4 72%, #f5f2e9);
    box-shadow: 0 2px 3px rgba(36,23,13,.18), 0 7px 12px -5px rgba(36,22,10,.36);
    color: #302b25;
    text-decoration: none;
    transform-origin: 50% 50%;
    transform: translate(calc(var(--x) * var(--strength) * var(--device)), calc(var(--y) * var(--strength) * var(--device)))
               rotate(calc(var(--angle) * var(--strength) * var(--device)));
    pointer-events: auto;
}
.mmh-prints .mmh-prints__window {
    display: block;
    position: relative;
    overflow: hidden;
    background: #e9e6df;
}
/* The percentage spacer keeps the print square while images are still loading. */
.mmh-prints__window::before { content: ""; display: block; padding-top: 100%; }
.mmh-prints .mmh-prints__window img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    object-fit: cover;
}
.mmh-prints[data-fit="contain"] .mmh-prints__window img { object-fit: contain; }
.mmh-prints .mmh-prints__margin {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-sizing: border-box;
    padding: 4.5% 2% 5%;
    min-height: 31px;
}
.mmh-prints .mmh-prints__margin--blank { padding: 9% 0; }
.mmh-prints .mmh-prints__caption {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #38332d;
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
    font-size: clamp(13px, 1.5vw, 17px);
    font-weight: normal;
    line-height: 1.32;
    text-align: center;
    overflow-wrap: anywhere;
}
.mmh-prints .mmh-prints__margin time {
    display: block;
    color: #625c54;
    font: 12px/1.5 "Courier New", monospace;
}
.mmh-prints .mmh-prints__print:hover { color: #302b25; text-decoration: none; }
@media (hover: hover) {
    .mmh-prints .mmh-prints__item:hover { z-index: 12; }
}
.mmh-prints .mmh-prints__item:focus-within { z-index: 14; }
.mmh-prints .mmh-prints__print:focus-visible { outline: 3px solid #123e39; outline-offset: 3px; }
.mmh-prints .mmh-prints__footer { margin-top: 14px; text-align: right; }
.mmh-prints .mmh-prints__footer a {
    display: inline-block;
    padding: 5px 1px;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .23em;
}
.mmh-prints .mmh-prints__footer a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.mmh-prints[data-display="cork"] .mmh-prints__wall {
    border: clamp(7px, .85vw, 13px) solid #aa7c50;
    border-image: url("../images/frame.webp") 22 / 1 / 0 round;
    background-color: #c39463;
    background-image:
        linear-gradient(112deg, rgba(255, 237, 197, .10), transparent 49%, rgba(65, 37, 16, .08)),
        url("../images/cork.webp");
    background-size: 100% 100%, 420px 420px;
    background-clip: padding-box;
    box-shadow:
        inset 0 2px 6px rgba(69, 37, 13, .28),
        0 1px 2px rgba(48, 32, 17, .21),
        0 6px 15px -7px rgba(48, 32, 17, .36);
    row-gap: clamp(7px, 1vw, 14px);
}
.mmh-prints[data-display="cork"] .mmh-prints__print {
    position: relative;
    box-shadow: 1px 2px 2px rgba(46, 30, 17, .20), 2px 6px 8px -3px rgba(46, 30, 17, .36);
    --pin-x: 50%;
    --pin-light: #e67766;
    --pin-body: #b64738;
    --pin-dark: #792c25;
    --pin-size: clamp(11px, 1.1vw, 16px);
}
.mmh-prints[data-display="cork"] .mmh-prints__item:nth-child(3n+2) .mmh-prints__print {
    --pin-x: 47%;
    --pin-light: #8eb8ae;
    --pin-body: #467d76;
    --pin-dark: #2a514e;
}
.mmh-prints[data-display="cork"] .mmh-prints__item:nth-child(4n) .mmh-prints__print {
    --pin-x: 54%;
    --pin-light: #edcd87;
    --pin-body: #be9041;
    --pin-dark: #865e2c;
}
.mmh-prints[data-display="cork"] .mmh-prints__print::before,
.mmh-prints[data-display="cork"] .mmh-prints__print::after {
    content: "";
    position: absolute;
    display: block;
    box-sizing: border-box;
    pointer-events: none;
    left: var(--pin-x);
}
.mmh-prints[data-display="cork"] .mmh-prints__print::before {
    z-index: 1;
    top: 2px;
    width: 2px;
    height: calc(var(--pin-size) * .58);
    border-radius: 2px;
    background: linear-gradient(90deg, #686766, #dfd8cb 65%, #696155);
    box-shadow: 2px 1px 2px rgba(54, 36, 20, .34);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-18deg);
}
.mmh-prints[data-display="cork"] .mmh-prints__print::after {
    z-index: 2;
    top: calc(var(--pin-size) * -.45);
    width: var(--pin-size);
    height: var(--pin-size);
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 33% 24%, rgba(255, 250, 239, .95), transparent 18%),
        radial-gradient(circle at 33% 28%, var(--pin-light), var(--pin-body) 54%, var(--pin-dark) 92%);
    box-shadow: inset 0 -1px 1px rgba(30, 20, 12, .18), 1px 1px 1px rgba(50, 26, 12, .38), 3px 4px 3px rgba(40, 25, 13, .28);
    transform: translateX(-67%);
}

/* Viewport fallbacks also support browsers without container queries. */
@media (max-width: 939px) { .mmh-prints .mmh-prints__wall { --cols: var(--tablet-cols); } }
@media (max-width: 599px) {
    .mmh-prints .mmh-prints__wall { --cols: 2; --device: .52; --row-overlap: -2px; }
}
@media (max-width: 279px) {
    .mmh-prints .mmh-prints__wall { --cols: 1; --device: .42; --row-overlap: 0px; }
}
@container (max-width: 939px) { .mmh-prints .mmh-prints__wall { --cols: var(--tablet-cols); } }
@container (max-width: 599px) {
    .mmh-prints .mmh-prints__wall { --cols: 2; --device: .52; --row-overlap: -2px; }
}
@container (max-width: 279px) {
    .mmh-prints .mmh-prints__wall { --cols: 1; --device: .42; --row-overlap: 0px; }
}
