/* homepage animations load */

@keyframes homeAnimation {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.homeAnimation {
    animation: homeAnimation 0.6s ease-out both;
}

.secondCards.homeAnimation {
    animation: homeAnimation 0.7s ease-in both;
}

.mostRead .homeAnimation {
    animation: homeAnimation 0.7s ease-in both;
}

.newsFeatured.homeAnimation {
    animation: homeAnimation 0.8s ease-in both;
}

@media (prefers-reduced-motion: reduce) {
    .homeAnimation {
        animation: none;
        opacity: 1;
        transform: none;
    }
}


@keyframes moreNewsEntrance {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes archiveEntrance {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.homepageMoreNews {
    animation: moreNewsEntrance 0.5s ease-out 0.55s both;
}

.homepageArchive {
    animation: archiveEntrance 0.45s ease-out 0.7s both;
}

/* carousel buttons on guides page */

@keyframes carouselLeftEntrance {
    0% {
        opacity: 0;
        transform: translateX(-35px) scale(0.8);
    }

    75% {
        opacity: 1;
        transform: translateX(1px) scale(1.05);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes carouselRightEntrance {
    0% {
        opacity: 0;
        transform: translateX(35px) scale(0.8);
    }

    75% {
        opacity: 1;
        transform: translateX(-1px) scale(1.05);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.carouselBtn.left {
    animation: carouselLeftEntrance 0.5s ease-out 0.60s both;
}

.carouselBtn.right {
    animation: carouselRightEntrance 0.5s ease-out 0.70s both;
}


/* dialog appear and backdrop animations */

dialog {
    opacity: 0;
    transform: translateY(15px) scale(0.96);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        display 0.25s ease allow-discrete,
        overlay 0.25s ease allow-discrete;

    transition-behavior: allow-discrete;
}

dialog[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@starting-style {
    dialog[open] {
        opacity: 0;
        transform: translateY(15px) scale(0.96);
    }
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0);

    transition:
        background 0.25s ease,
        display 0.25s ease allow-discrete,
        overlay 0.25s ease allow-discrete;

    transition-behavior: allow-discrete;
}

dialog[open]::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

@starting-style {
    dialog[open]::backdrop {
        background: rgba(0, 0, 0, 0);
    }
}

/* Product Library load animations */

@keyframes productCardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.productCardEntrance {
    opacity: 0;
    animation: productCardEntrance 0.5s ease forwards;
}

.productCardEntrance:nth-child(1) {
    animation-delay: 0.05s;
}

.productCardEntrance:nth-child(2) {
    animation-delay: 0.1s;
}

.productCardEntrance:nth-child(3) {
    animation-delay: 0.15s;
}

.productCardEntrance:nth-child(4) {
    animation-delay: 0.2s;
}

.productCardEntrance:nth-child(5) {
    animation-delay: 0.25s;
}

.productCardEntrance:nth-child(6) {
    animation-delay: 0.3s;
}

.productCardEntrance:nth-child(n+7) {
    animation-delay: 0.35s;
}

@media (prefers-reduced-motion: reduce) {
    .productCardEntrance {
        animation: none;
        opacity: 1;
        transform: none;
    }
}


/* PL filters */

/* Filter bar entrance */

@keyframes filterBarEntrance {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filterBarEntrance {
    animation: filterBarEntrance 0.5s ease both;
}


/* Individual filter controls */

@keyframes filterItemEntrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filterItemEntrance {
    animation: filterItemEntrance 0.6s ease both;
}

.filterItemEntrance:nth-child(1) {
    animation-delay: 0.1s;
}

.filterItemEntrance:nth-child(2) {
    animation-delay: 0.15s;
}

.filterItemEntrance:nth-child(3) {
    animation-delay: 0.2s;
}

.filterItemEntrance:nth-child(4) {
    animation-delay: 0.25s;
}

.filterItemEntrance:nth-child(5) {
    animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    .filterBarEntrance,
    .filterItemEntrance {
        animation: none;
        opacity: 1;
        transform: none;
    }
}