/**
 * Fichier  : /ott/library/assets/css/sections/carousel.css
 * Fonction : style des rangées de type 'carousel'
 */


/* ==================================================
   SECTION FIX
================================================== */

#library .row > section {
    position: relative;
    overflow: visible;
    min-width: 0;
}


/* ==================================================
   CAROUSEL
================================================== */

#library .carousel {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

#library .carousel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#library .carousel {
    box-sizing: border-box;
    padding: 0 clamp(2px, .6vw, 6px);
}

#library .carousel {
    display: flex;
    align-items: flex-start;
    gap: clamp(14px, 1.2vw, 20px);
}

#library .carousel {
    overscroll-behavior-inline: contain;
    scroll-behavior: auto;
    scroll-snap-type: none;
    scrollbar-width: none;
}

#library .carousel {
    cursor: grab;
    user-select: none;
}

#library .carousel::-webkit-scrollbar {
    display: none;
}


/* ==================================================
   ITEM
================================================== */

#library .carousel .item {
    position: relative;
    overflow: visible;
}

#library .carousel .item {
    flex: 0 0 auto;
    width: var(--item-width);
    min-width: 0;
    aspect-ratio: var(--item-ratio);
}

#library .carousel .item {
    box-sizing: border-box;
}

#library .carousel .item {
    transition:
        transform .25s ease,
        opacity .25s ease;
}

#library .carousel .item:hover {
    transform: translateY(-2px);
}


/* ==================================================
   VISUAL
================================================== */

#library .carousel .item .visual,
#library .carousel .item > a {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#library .carousel .item .visual,
#library .carousel .item > a {
    display: block;
    width: 100%;
    height: 100%;
}

#library .carousel .item .visual,
#library .carousel .item > a {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.05),
            rgba(255,255,255,.02)
        );

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
}

#library .carousel .item .visual,
#library .carousel .item > a {
    box-shadow:
        0 10px 30px rgba(0,0,0,.24);
}

#library .carousel .item .visual::before,
#library .carousel .item > a::before {
    content: "";
}

#library .carousel .item .visual::before,
#library .carousel .item > a::before {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#library .carousel .item .visual::before,
#library .carousel .item > a::before {
    pointer-events: none;
}

#library .carousel .item .visual::before,
#library .carousel .item > a::before {
    background:
        linear-gradient(
            180deg,
            transparent 55%,
            rgba(0,0,0,.45) 100%
        );
}

#library .carousel .item .visual::before,
#library .carousel .item > a::before {
    opacity: 0;
    transition: opacity .25s ease;
}

#library .carousel .item:hover .visual::before,
#library .carousel .item:hover > a::before {
    opacity: 1;
}


/* ==================================================
   IMAGE
================================================== */

#library .carousel .item img {
    display: block;
}

#library .carousel .item img {
    width: 100%;
    height: 100%;
}

#library .carousel .item img {
    object-fit: cover;
    object-position: center;
}

#library .carousel .item img {
    transform: scale(1);
}

#library .carousel .item img {
    transition:
        transform .55s ease,
        filter .35s ease;
}

#library .carousel .item:hover img {
    transform: scale(1.04);
    filter: brightness(1.04);
}


/* ==================================================
   META
================================================== */

#library .carousel .item .meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#library .carousel .item .meta {
    margin-top: 1.2em;
    padding-inline: 2px;
}

#library .carousel .item .meta span {
    margin-bottom: .6em;
}


/* ==================================================
   BADGE
================================================== */

#library .carousel .item .badge {
    width: fit-content;
}

#library .carousel .item .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#library .carousel .item .badge {
    padding: 5px 9px;
}

#library .carousel .item .badge {
    background:
        linear-gradient(
            135deg,
            rgba(255,120,0,.14),
            rgba(255,255,255,.04)
        );

    border: 1px solid rgba(255,120,0,.14);
    border-radius: 999px;

    backdrop-filter: blur(12px);
}

#library .carousel .item .badge {
    font-family: 'content-font';
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.82);
}

#library .carousel .item .badge::before {
    content: "";
}

#library .carousel .item .badge::before {
    width: 6px;
    height: 6px;
}

#library .carousel .item .badge::before {
    background:
        linear-gradient(
            135deg,
            #ff6a00,
            #ffb347
        );

    border-radius: 999px;
}

#library .carousel .item .badge::before {
    box-shadow:
        0 0 12px rgba(255,120,0,.45);
}


/* ==================================================
   TITLES
================================================== */

#library .carousel .item h4,
#library .carousel .item h5 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#library .carousel .item h4 {
    font-family: 'bold-font';
    font-size: clamp(14px, 1.05vw, 17px);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

#library .carousel .item h5 {
    font-family: 'content-font';
    font-size: clamp(11px, .9vw, 13px);
    font-weight: 400;
    line-height: 1.25;
    color: rgba(255,255,255,.62);
}


/* ==================================================
   CONTROLS
================================================== */

#library .controls {
    position: absolute;
    inset: 0;
    z-index: 50;
}

#library .controls {
    pointer-events: none;
}

#library .controls .prev,
#library .controls .next {
    position: absolute;
    top: calc(var(--item-visual-height, 100%) / 2);
}

#library .controls .prev,
#library .controls .next {
    transform: translateY(-50%);
}

#library .controls .prev,
#library .controls .next {
    pointer-events: auto;
}

#library .controls .prev {
    left: 12px;
}

#library .controls .next {
    right: 12px;
}

#library .controls button {
    width: 44px;
    height: 44px;
}

#library .controls button {
    display: flex;
    align-items: center;
    justify-content: center;
}

#library .controls button {
    cursor: pointer;
}

#library .controls button {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.12),
            rgba(255,255,255,.04)
        );

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;

    backdrop-filter: blur(18px);
}

#library .controls button {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 10px 30px rgba(0,0,0,.35);
}

#library .controls button {
    opacity: 0;
    visibility: hidden;
}

#library .controls button {
    transition:
        transform .2s ease,
        background .25s ease,
        border-color .25s ease,
        opacity .2s ease,
        visibility .2s ease;
}

#library .row > section:hover .controls button,
#library .row > section:focus-within .controls button {
    opacity: 1;
    visibility: visible;
}

#library .controls button svg {
    width: 22px;
    height: 22px;
}

#library .controls button svg path {
    fill: none;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#library .controls button:hover:not(:disabled) {
    transform: scale(1.04);
}

#library .controls button:hover:not(:disabled) {
    background:
        linear-gradient(
            135deg,
            #8e0e00,
            #e9401b 60%,
            #ff7b00
        );

    border-color: rgba(255,255,255,.16);
}

#library .controls button:hover:not(:disabled) {
    box-shadow:
        0 8px 24px rgba(233,64,27,.35),
        0 0 18px rgba(255,123,0,.18),
        inset 0 1px 0 rgba(255,255,255,.18);
}

#library .controls button:disabled,
#library .controls button.is-disabled {
    opacity: 0;
    pointer-events: none;
}


/* ==================================================
   RESPONSIVE
================================================== */

@media screen and (max-width: 768px) {

    #library .carousel {
        gap: 12px;
        padding: 0;
    }

    #library .carousel .item {
        width: var(--item-size-mobile, 72%) !important;
    }

    #library .carousel .item .meta {
        margin-top: 10px;
    }

    #library .carousel .item h4 {
        font-size: 14px;
    }

    #library .carousel .item h5 {
        font-size: 11px;
    }

    #library .controls {
        display: none;
    }

}