/* Image turntable ("Bilder-Drehteller", app/templates.php render_coverflow(), assets/coverflow.js). */
.coverflow {
    --cf-height: 380px;
    --cf-ratio: 1.3333;
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    text-align: center;
}
.coverflow-stage {
    position: relative;
    height: var(--cf-height);
    /* Real 3D: the browser decides per pixel which image is in front, so two images passing each other
       in the middle meet along a moving edge instead of one jumping in front of the other. Clipping is
       done by .coverflow, since overflow here would flatten the 3D. */
    transform-style: preserve-3d;
    perspective: 900px;
    /* In 3D the stage would lie in front of the images further back and catch their clicks. */
    pointer-events: none;
    perspective-origin: 50% 40%;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.coverflow-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(calc(var(--cf-height) * .84 * var(--cf-ratio)), 62%);
    aspect-ratio: var(--cf-ratio);
    max-height: 90%;
    margin: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #dfe6e2;
    box-shadow: 0 18px 38px rgba(16, 36, 30, .28);
    transform: translate(-50%, -50%);
    backface-visibility: hidden;
    pointer-events: auto;
    touch-action: pan-y;
    cursor: pointer;
}
/* Darker towards the back (opacity set by assets/coverflow.js). */
.coverflow-item::after { content: ''; position: absolute; inset: 0; background: #08130f; opacity: var(--cf-shade, 0); pointer-events: none; }
.coverflow-item img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: auto; -webkit-user-drag: none; }
.coverflow-item.is-current { cursor: zoom-in; }
.coverflow-item.is-current img:focus-visible { outline: 3px solid var(--green, #245c4e); outline-offset: -3px; }
.coverflow.is-dragging .coverflow-item { cursor: grabbing; }
/* The texts of each image are shown below the disc for the front image only. */
.coverflow-text { display: none; }
/* Without the script only the first image is shown. */
.coverflow:not([data-ready]) .coverflow-item:not(:first-child) { display: none; }

.coverflow-prev,
.coverflow-next {
    position: absolute;
    top: calc(var(--cf-height) / 2);
    z-index: 300;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 14px rgba(16, 36, 30, .2);
    color: var(--green-dark, #18392f);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}
.coverflow-prev { left: 8px; }
.coverflow-next { right: 8px; }
.coverflow-prev:hover,
.coverflow-next:hover { background: #fff; }

.coverflow-caption { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 640px; margin: 14px auto 0; }
.coverflow-caption:empty { display: none; }
.coverflow-caption strong { font-size: 1.15em; line-height: 1.25; }
.coverflow-caption span { color: var(--muted, #5d6b66); font-size: .95em; line-height: 1.55; }
.coverflow-caption a { margin-top: 4px; }

@media (max-width: 700px) {
    .coverflow-stage { height: min(var(--cf-height), 72vw); min-height: 200px; }
    .coverflow-item { width: min(calc(min(var(--cf-height), 72vw) * .84 * var(--cf-ratio)), 70%); }
    .coverflow-prev, .coverflow-next { top: calc(min(var(--cf-height), 72vw) / 2); width: 34px; height: 34px; font-size: 20px; }
}
