/* EdiNation's like button in the header, and the happy-Foxy toast after a like. See edination.like.js. */
.edn-like {
    --edn-like-orange: #e9681a;
    --edn-like-orange-soft: rgba(233, 104, 26, .1);
    display: inline-flex;
    align-items: center;
    height: 38px;
    margin-right: .5rem;
    padding: 0;
    border: 1.5px solid var(--edn-like-orange);
    border-radius: 19px;
    background: var(--edn-like-orange-soft);
    color: var(--edn-like-orange);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s;
}

.edn-like-main {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 100%;
    padding: 0 .75rem 0 .7rem;
}

.edn-like-icon {
    font-size: 1rem;
    transform-origin: 30% 80%;
}

/* The count, in its own part of the pill, so "Like" stays the call to action. */
.edn-like-count {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 .7rem 0 .6rem;
    border-left: 1.5px solid var(--edn-like-orange);
    font-weight: 600;
}

.edn-like-count:empty {
    display: none;
}

.edn-like:hover,
.edn-like:focus-visible {
    background: var(--edn-like-orange);
    color: #fff;
    box-shadow: 0 2px 10px rgba(233, 104, 26, .35);
    outline: none;
}

.edn-like:hover .edn-like-count,
.edn-like:focus-visible .edn-like-count {
    border-left-color: rgba(255, 255, 255, .6);
}

.edn-like:not(.edn-like-done):hover .edn-like-icon {
    animation: edn-like-tilt .5s ease-in-out;
}

/* Liked today: filled, with "Liked". */
.edn-like-done {
    background: var(--edn-like-orange);
    color: #fff;
}

.edn-like-done .edn-like-count {
    border-left-color: rgba(255, 255, 255, .6);
}

/* The like itself: the thumb bumps. */
.edn-like-cheer .edn-like-icon {
    animation: edn-like-bump .45s ease-out;
}

/* A nudge, once, a few seconds after the page opens, so the button is noticed. */
.edn-like-nudge .edn-like-icon {
    animation: edn-like-tilt .5s ease-in-out 2;
}

@keyframes edn-like-tilt {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-18deg) scale(1.15); }
    60% { transform: rotate(6deg); }
}

@keyframes edn-like-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.45) rotate(-12deg); }
    100% { transform: scale(1); }
}

/* The toast: happy Foxy, big, for a few seconds. */
.edn-like-toast {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: calc(100vw - 32px);
    padding: .85rem 1.4rem .85rem .85rem;
    border: 1px solid rgba(233, 104, 26, .35);
    border-radius: 16px;
    background: #fff;
    color: #1c273c;
    box-shadow: 0 12px 36px rgba(28, 39, 60, .22);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-12px) scale(.96);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}

.edn-like-toast.edn-like-toast-show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.edn-like-toast img {
    flex: none;
    width: 120px;
    height: 120px;
}

.edn-like-toast-show img {
    animation: edn-like-hop .7s ease-out .1s;
}

.edn-like-toast-text {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: .9375rem;
    line-height: 1.35;
}

.edn-like-toast-text strong {
    color: #e9681a;
    font-size: 1.125rem;
}

.edn-like-toast-text small {
    color: #6b7a99;
    font-size: .8125rem;
}

.edn-dark .edn-like-toast {
    border-color: rgba(233, 104, 26, .5);
    background: #24324d;
    color: #e3e7ef;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
}

.edn-dark .edn-like-toast-text small {
    color: #97a3b9;
}

@keyframes edn-like-hop {
    0% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-14px) rotate(-6deg); }
    65% { transform: translateY(0) rotate(3deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* On a phone the header is full: just the thumb, and the toast across the top. */
@media (max-width: 575.98px) {
    .edn-like {
        margin: 0 .25rem 0 .375rem;
    }

    .edn-like-main {
        padding: 0 .5rem;
    }

    .edn-like-label,
    .edn-like-count {
        display: none;
    }

    .edn-like-toast {
        top: 68px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .edn-like-toast img {
        width: 96px;
        height: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .edn-like,
    .edn-like-toast {
        transition: none;
    }

    .edn-like-icon,
    .edn-like-toast img {
        animation: none !important;
    }
}
