/* ==========================
   STASH BOX PAGE
========================== */

.stashbox-page {
    padding: 24px;
    text-align: center;
}

.stashbox-title-panel {
    margin-bottom: 20px;
}

.stashbox-title-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.stashbox-title-panel p {
    margin: 8px 0 0;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* ==========================
   STASH FEED
========================== */

.stash-feed {
    max-width: 760px;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 28px;
}

.stash-item {
    background:
        radial-gradient(circle, rgba(0,0,0,.05) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.18), rgba(0,0,0,.04)),
        #fff0b8;

    background-size:
        6px 6px,
        100% 100%,
        100% 100%;

    border: 4px solid #111;
    padding: 10px;

    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
}

.stash-item img,
.stash-item video {
    display: block;
    width: 100%;
    height: auto;

    background: #fff;
}

.stash-item video {
    max-height: 620px;
}

/* ==========================
   MOBILE
========================== */

@media (max-width: 760px) {

    .stashbox-page {
        padding: 18px 10px;
    }

    .stashbox-title-panel {
        margin-bottom: 16px;
    }

    .stashbox-title-panel h1 {
        font-size: 2.2rem;
    }

    .stashbox-title-panel p {
        font-size: .85rem;
    }

    .stash-feed {
        max-width: 100%;
        gap: 18px;
    }

    .stash-item {
        padding: 6px;
    }
}
.stash-item video {
    width: 100%;
    min-height: 360px;
    background: #111;
}

@media (max-width: 760px) {
    .stash-item video {
        min-height: 220px;
    }
}

/* ==========================
   STASH ACTION BAR
========================== */

.stash-item {
    position: relative;
    overflow: visible;
}

.stash-action-bar {
    position: relative;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    padding: 12px 4px 2px;

    background: transparent;
}

.stash-action-bar button,
.stash-action-bar a {
    background: #f6d13d;
    color: #111;

    border: 3px solid #111;

    padding: 6px 10px;

    font-size: .85rem;
    font-weight: 900;

    text-transform: uppercase;
    text-decoration: none;

    cursor: pointer;

    box-shadow: 2px 2px 0 #111;

    transition:
        color .16s ease,
        background-color .16s ease,
        transform .16s ease,
        box-shadow .16s ease;
}

.stash-action-bar button:hover,
.stash-action-bar a:hover {
    background: #d92d1f;
    color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #111;
}

.stash-action-bar button:focus-visible,
.stash-action-bar a:focus-visible,
.stash-share-menu button:focus-visible,
.stash-share-menu a:focus-visible {
    outline: 4px solid #fff;
    outline-offset: 2px;
}

.stash-action-bar .love-button.is-loved {
    background: #d92d1f;
    color: #fff;
}

.action-count {
    display: inline-grid;
    min-width: 1.65em;
    min-height: 1.65em;
    margin-left: 3px;
    padding: 1px 5px;
    place-items: center;

    background: #111;
    color: #fff;
    border-radius: 999px;

    font-size: .75rem;
    line-height: 1;
}

.love-button {
    position: relative;
}

.love-burst-heart {
    --flurry-x: 0px;
    --flurry-y: -70px;
    --flurry-delay: 0ms;
    --flurry-rotate: 0deg;
    --flurry-size: 1rem;

    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;

    color: #e21d2e;
    font-size: var(--flurry-size);
    text-shadow: 1px 1px 0 #fff;
    pointer-events: none;

    opacity: 0;
    animation: love-flurry 1.45s ease-out var(--flurry-delay) forwards;
}

@keyframes love-flurry {
    0% {
        opacity: 0;
        transform: translate(-50%, -20%) scale(.35) rotate(0deg);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -25%) scale(1) rotate(0deg);
    }
    72% {
        opacity: .9;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--flurry-x)), calc(-20% + var(--flurry-y))) scale(.82) rotate(var(--flurry-rotate));
    }
}

.stash-share-menu {
    position: absolute;
    left: 50%;
    bottom: 62px;
    z-index: 20;

    width: min(92%, 420px);
    padding: 12px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

    background: #111;
    border: 4px solid #111;
    box-shadow: 7px 7px 0 rgba(0, 0, 0, .35);

    opacity: 0;
    transform: translate(-50%, 12px) scale(.96);
}

.stash-share-menu[hidden] {
    display: none;
}

.stash-share-menu.is-open {
    animation: share-menu-pop .2s ease-out forwards;
}

.stash-share-menu button,
.stash-share-menu a {
    padding: 9px 8px;

    background: #f6d13d;
    color: #111;
    border: 2px solid #fff;

    font: inherit;
    font-size: .78rem;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.stash-share-menu button:hover,
.stash-share-menu a:hover {
    background: #d92d1f;
    color: #fff;
}

@keyframes share-menu-pop {
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.stash-notice {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2000;

    max-width: min(90vw, 440px);
    padding: 12px 18px;

    background: #f6d13d;
    color: #111;
    border: 4px solid #111;
    box-shadow: 5px 5px 0 #111;

    font-weight: 900;
    text-align: center;
    text-transform: uppercase;

    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 18px) rotate(-1deg);
    transition: opacity .2s ease, transform .2s ease;
}

.stash-notice.show {
    opacity: 1;
    transform: translate(-50%, 0) rotate(-1deg);
}

.stash-item.shared-highlight {
    animation: shared-item-highlight 3.2s ease-out;
}

@keyframes shared-item-highlight {
    0%, 28% {
        border-color: #d92d1f;
        box-shadow: 0 0 0 8px #f6d13d, 0 0 28px 15px rgba(217, 45, 31, .65);
        transform: rotate(-.35deg) scale(1.01);
    }
    100% {
        border-color: #111;
        box-shadow: none;
        transform: none;
    }
}

/* MOBILE */

@media (max-width: 760px) {
    .stash-action-bar {
        gap: 7px;
        padding-top: 9px;
    }

    .stash-action-bar button,
    .stash-action-bar a {
        flex: 1 1 auto;
        padding: 8px 6px;
        font-size: .72rem;
    }

    .stash-share-menu {
        bottom: 66px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .love-burst-heart {
        display: none;
    }

    .stash-share-menu.is-open,
    .stash-item.shared-highlight {
        animation: none;
    }

    .stash-notice,
    .stash-action-bar button,
    .stash-action-bar a {
        transition: none;
    }
}

/* ==========================
   BACK TO TOP BUTTON
========================== */

.back-to-top-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;

    background: #f6d13d;
    color: #111;

    border: 4px solid #111;

    padding: 12px 16px;

    font-size: .9rem;
    font-weight: 900;

    text-transform: uppercase;

    box-shadow: 4px 4px 0 #111;

    cursor: pointer;

    opacity: 0;
    pointer-events: none;

    transform: translateY(12px);

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.back-to-top-button.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top-button:hover {
    background: #d92d1f;
    color: #fff;
}

/* MOBILE */

@media (max-width: 760px) {
    .back-to-top-button {
        right: 12px;
        bottom: 12px;

        padding: 10px 12px;

        font-size: .75rem;
    }
}
