/* EN Memory catalogue cards. Visual reference: FR jeu-de-memoire/cartes.css. */
.memory-games-container,
.memory-games-container * {
    box-sizing: border-box;
}

.memory-games-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 90%;
    max-width: 1100px;
    min-width: 0;
    margin: 24px auto 32px;
    padding: 0;
}

.memory-games-container > .memory-game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: none;
    max-width: none;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 16px 12px;
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    background: #fff9ec;
    color: #223348;
    box-shadow: 0 2px 5px rgba(63, 24, 24, .12);
    font: 600 15px/1.4 Arial, Helvetica, sans-serif;
    text-align: center;
    transform: none;
    transition: none;
}

.memory-games-container > .memory-game-item > br {
    display: none;
}

.memory-games-container > .memory-game-item figure {
    width: 100%;
    margin: 0;
    padding: 0;
}

.memory-games-container > .memory-game-item a,
.memory-games-container > .memory-game-item figcaption,
.memory-games-container > .memory-game-item figcaption span {
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
}

.memory-games-container > .memory-game-item > a:first-child,
.memory-games-container > .memory-game-item figure > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 96px;
}

.memory-games-container > .memory-game-item img {
    display: block;
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    margin: 0;
    object-fit: contain;
}

.memory-games-container > .memory-game-item > a:last-child:not(:first-child),
.memory-games-container > .memory-game-item figcaption {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8em;
    width: 100%;
}

.memory-games-container > .memory-game-item > a:last-child:not(:first-child) {
    margin-top: auto;
}

.memory-games-container > .memory-game-item:focus-within {
    border-color: #24558a;
    background: #ddebfa;
    color: #223348;
    box-shadow: 0 0 0 2px #24558a, 0 9px 18px rgba(63, 24, 24, .26);
}

.memory-games-container > .memory-game-item a:focus-visible {
    outline: 3px solid #24558a;
    outline-offset: 3px;
    border-radius: 3px;
    text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
    .memory-games-container > .memory-game-item:hover {
        border-color: #24558a;
        background: #ddebfa;
        color: #223348;
        box-shadow: 0 0 0 2px #24558a, 0 9px 18px rgba(63, 24, 24, .26);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .memory-games-container > .memory-game-item {
        transition: transform 160ms ease, background-color 160ms ease,
                    border-color 160ms ease, box-shadow 160ms ease;
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .memory-games-container > .memory-game-item:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 900px) {
    .memory-games-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .memory-games-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: calc(100% - 24px);
        gap: 12px;
    }
    .memory-games-container > .memory-game-item {
        padding: 12px 8px;
    }
}

@media (max-width: 300px) {
    .memory-games-container {
        grid-template-columns: minmax(0, 1fr);
    }
}
