/* Eryn Wells <eryn@erynwells.me> */

:root {
    --card-drop-shadow-spread: 10px;
    --card-drop-shadow-color: rgb(var(--lt-gray));
    --gradient-full-opaque: var(--background);
}
@media (prefers-color-scheme: dark) {
    :root {
        --card-drop-shadow-color: rgb(var(--dk-gray));
    }
}

section.flashcards {
    position: relative;
}

section.flashcards > ul {
    align-items: stretch;
    display: flex;
    flex-flow: row nowrap;
    margin: 0;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    padding: 0;
}

section.flashcards > ul > li {
    padding: 0;
    margin: 0;
}

section.flashcards > ul::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

section.flashcards > .shadow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 5%;
    z-index: 10;
}

section.flashcards > .shadow.left {
    background: linear-gradient(
        to right,
        rgba(var(--gradient-full-opaque), 1),
        rgba(var(--gradient-full-opaque), 0));
    left: 0;
}

section.flashcards > .shadow.right {
    background: linear-gradient(
        to left,
        rgba(var(--gradient-full-opaque), 1),
        rgba(var(--gradient-full-opaque), 0));
    right: 0;
}

ruby>rt,
ruby>rp {
    visibility: hidden;
    opacity: 0;
    transition: 0.25s;
}

.card:hover ruby>rt,
.card:hover ruby>rp {
    visibility: visible;
    opacity: 0.8;
    transition: 0.4s;
}

section.flashcards > ul > li.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--content-width);
    flex-shrink: 0;
    padding-block: var(--card-drop-shadow-spread);
}

.card {
    box-sizing: border-box;
    border: 1px solid var(--separator-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    box-shadow: 4px 4px var(--card-drop-shadow-spread) var(--card-drop-shadow-color);
    scroll-snap-align: center;
    aspect-ratio: 4/3;
    width: calc(var(--content-width) / 2);
}

.vertical {
    text-orientation: upright;
    writing-mode: vertical-rl;
}

.card > [lang="jp"] { font-size: 300%; }
.card > [lang="en"] { font-size: 200%; }

.card > .front { display: block; }
.card > .back { display: none; }
.card.flipped > .front { display: none; }
.card.flipped > .back { display: block; }
