/* The existing lace and gingham sidebar frame this page. */
.gif-gallery-page{position:absolute;inset:0;background:#fff2e7 url('/assets/blog/patterns/home-brush-stars.jpg') center/400px 400px repeat;overflow:hidden;color:#7b603a}
.gif-gallery-content,.gif-gallery-frame{height:100%;min-height:0}
.gif-gallery-paper{box-sizing:border-box;display:flex;flex-direction:column;height:100%;min-height:0;padding:24px 28px 28px}
.gif-gallery-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:0 3px 6px}.gif-gallery-heading h2{margin:0;font:inherit;font-size:25px;font-weight:normal;color:#8c6438}.gif-gallery-close{font:inherit;font-size:31px;line-height:1;border:0;background:#fff7dd;color:#8c6438;width:36px;height:36px;border-radius:50% 45% 48% 43%;cursor:pointer}
.gif-gallery-filters{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;padding:2px 0 13px;flex:none}.gif-gallery-filters button{font:inherit;font-size:13px;border:1px solid #d7b67d;border-radius:12px 10px 14px 11px;padding:5px 10px;color:#826139;background:#fff7dcdf;cursor:pointer}.gif-gallery-filters button[aria-pressed=true]{background:#f4ce75;color:#715331}
.gif-gallery-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c8a76a transparent;padding:13px 10px 24px}
.gif-gallery-grid{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:24px 25px}.gif-gallery-item{display:flex;align-items:center;justify-content:center;min-width:34px;min-height:34px;max-width:100%;padding:4px;text-decoration:none}.gif-gallery-item img{display:block;width:auto;height:auto;max-width:170px;max-height:145px;object-fit:contain;image-rendering:pixelated}.gif-gallery-item:focus-visible,.gif-gallery-close:focus-visible,.gif-gallery-filters button:focus-visible{outline:2px solid #9e733d;outline-offset:3px}.gif-gallery-more{height:3px}
.gif-gallery-sort{display:flex;align-items:center;gap:7px;font:inherit;font-size:13px;color:#826139}.gif-gallery-sort select{font:inherit;color:inherit;background:#fff7dcdf;border:1px solid #d7b67d;border-radius:10px;padding:5px 8px}.gif-gallery-sort select:focus-visible{outline:2px solid #9e733d;outline-offset:3px}
.gif-gallery-item[data-group="divider"]{flex-basis:100%;box-sizing:border-box}.gif-gallery-item[data-group="divider"] img{max-width:100%;max-height:160px}
.gif-gallery-error{font:inherit;font-size:15px;text-align:center;color:#826139;margin:28px 0}
/* Numbered pages occupy the available space without an inner scrolling area. */
.gif-gallery-scroll{display:flex;flex-direction:column;overflow:hidden;padding:5px 10px;min-height:0}
.gif-gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:1;min-height:0;align-items:stretch;gap:12px 18px}
.gif-gallery-item{box-sizing:border-box;min-width:0;min-height:0;width:100%;height:100%;padding:4px}
.gif-gallery-item img{width:min(100%,var(--gif-native-width,170px));height:min(100%,var(--gif-native-height,145px));max-width:170px;max-height:145px;object-fit:contain}
.gif-gallery-item[data-group="divider"]{grid-column:1/-1}.gif-gallery-item[data-group="divider"] img{max-width:100%;max-height:160px}
.gif-gallery-pagination{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px;flex:none;padding:12px 0 0}
.gif-gallery-pagination button{font:inherit;font-size:13px;min-width:28px;border:1px solid #d7b67d;border-radius:10px 8px 11px 9px;padding:4px 8px;color:#826139;background:#fff7dcdf;cursor:pointer}.gif-gallery-pagination button[aria-current="page"]{background:#f4ce75;color:#715331}.gif-gallery-pagination button:disabled{opacity:.45;cursor:default}.gif-gallery-pagination button:focus-visible{outline:2px solid #9e733d;outline-offset:3px}.gif-gallery-pagination span{font-size:13px;color:#826139}

/* Keep gallery controls below the shared lace overlap. */
.gif-gallery-paper{padding-top:50px}

/* Consistent stamp displays and full animated sticker silhouettes. */
.gif-gallery-stamp{display:block;flex:none;width:145px;height:95px;max-width:100%;max-height:100%}
.gif-gallery-stamp img{width:100%;height:100%;max-width:none;max-height:none;object-fit:contain}
.gif-gallery-sticker{display:block;flex:none;position:relative;overflow:hidden}
.gif-gallery-sticker img{position:absolute;display:block;max-width:none;max-height:none;object-fit:contain}

.gif-gallery-item[data-group="anime"] img,.gif-gallery-item[data-group="other"] img{image-rendering:auto}


/* Small playful wiggle on hover. Keep GIF colors and opacity unchanged. */
@keyframes gif-gallery-wiggle {
  0%,100% { transform: translateX(0) rotate(0deg); }
  28% { transform: translateX(-1px) rotate(-.6deg); }
  63% { transform: translateX(1px) rotate(.6deg); }
}
.gif-gallery-item:hover {
  animation: gif-gallery-wiggle .32s ease-in-out 1;
}
@media (prefers-reduced-motion: reduce) {
  .gif-gallery-item:hover { animation: none; }
}

/* Pressable pagination and filter chips, without brightening any GIFs. */
.gif-gallery-filters button:not(:disabled),.gif-gallery-pagination button:not(:disabled){
 transition:transform .14s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease
}
.gif-gallery-filters button:not(:disabled):hover,.gif-gallery-pagination button:not(:disabled):hover{
 background:#ffedcc;border-color:#c79b72;box-shadow:0 2px 0 #b98c6630
}
.gif-gallery-filters button:not(:disabled):active,.gif-gallery-pagination button:not(:disabled):active{
 transform:translateY(1px) scale(.97);background:#f6d99c;box-shadow:none
}
.gif-gallery-sort select{transition:background-color .16s ease,border-color .16s ease}
.gif-gallery-sort select:hover{background:#fff0d4;border-color:#c79b72}
.gif-gallery-page .gif-gallery-item:active{animation:none;transform:scale(.975)}
@media(prefers-reduced-motion:reduce){
 .gif-gallery-filters button,.gif-gallery-pagination button,.gif-gallery-sort select{transition:none}
 .gif-gallery-filters button:active,.gif-gallery-pagination button:active,.gif-gallery-page .gif-gallery-item:active{transform:none}
}


/* One cream-peach paper palette connects this room to the blog sidebar. */
.gif-gallery-page{background-blend-mode:multiply}
