/* Correct the displayed calendar cover without rewriting uploaded media. SPDX-License-Identifier: MIT */
.folio-cover--rotated {
    --cover-max-height: 235px;
    display: block;
    position: relative;
    flex: none;
    width: min(100%, calc(var(--cover-max-height) / var(--cover-source-ratio)));
    aspect-ratio: 1 / var(--cover-source-ratio);
    margin-inline: auto;
    box-shadow: var(--cover-shadow);
    transition: transform .25s ease;
}
.folio-cover--rotated > img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% * var(--cover-source-ratio)) !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    box-shadow: none !important;
}
.book-detail__cover .folio-cover--rotated { --cover-max-height: 480px; }
.editor-pick__cover .folio-cover--rotated { --cover-max-height: 270px; }
.book-display__book .folio-cover--rotated { --cover-max-height: 290px; }
.book-card__cover:hover .folio-cover--rotated { transform: translateY(-6px); }
@media (max-width: 560px) {
    .book-card__cover .folio-cover--rotated { --cover-max-height: 190px; }
    .book-detail__cover .folio-cover--rotated { --cover-max-height: 330px; }
    .book-display__book .folio-cover--rotated { --cover-max-height: 215px; }
}
@media (prefers-reduced-motion: reduce) { .folio-cover--rotated { transition: none; } }
