/* =========================================================
   Home — carousel premium « Derniers gins ajoutés »
   ========================================================= */

.home-latest-carousel-shell {
    --carousel-gap: 1rem;
    --carousel-slide-count: 4;
    margin-top: 0.15rem;
    padding: 1.05rem 0.65rem 1.15rem;
    border-radius: 22px;
    background:
        linear-gradient(
            168deg,
            rgba(24, 26, 34, 0.07) 0%,
            rgba(18, 20, 28, 0.11) 48%,
            rgba(24, 26, 34, 0.08) 100%
        );
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 14px 36px -28px rgba(0, 0, 0, 0.28);
}

.home-latest-carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.35rem;
}

.home-latest-carousel__viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.1rem 0.45rem;
}

.home-latest-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.home-latest-carousel__track {
    display: flex;
    gap: var(--carousel-gap);
    align-items: stretch;
}

.home-latest-carousel__slide {
    flex: 0 0 calc((100% - (var(--carousel-gap) * (var(--carousel-slide-count) - 1))) / var(--carousel-slide-count));
    min-width: calc((100% - (var(--carousel-gap) * (var(--carousel-slide-count) - 1))) / var(--carousel-slide-count));
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.home-latest-carousel__nav {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: rgba(0, 0, 0, 0.62);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
    box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.35);
}

.home-latest-carousel:hover .home-latest-carousel__nav,
.home-latest-carousel:focus-within .home-latest-carousel__nav,
.home-latest-carousel--scrollable .home-latest-carousel__nav {
    opacity: 0.92;
    transform: translateY(0);
}

.home-latest-carousel__nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.35);
    color: rgba(0, 0, 0, 0.78);
}

.home-latest-carousel__nav:disabled {
    opacity: 0.25 !important;
    cursor: default;
}

.home-latest-carousel--at-start .home-latest-carousel__nav--prev:not(:focus-visible),
.home-latest-carousel--at-end .home-latest-carousel__nav--next:not(:focus-visible) {
    opacity: 0.45;
}

.home-latest-carousel .gin-card-home {
    width: 100%;
    min-width: 0;
    min-height: 382px;
    height: 382px;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(
            168deg,
            rgba(var(--gin-primary-rgb, 188, 112, 164), 0.09) 0%,
            rgba(255, 255, 255, 0.96) 38%,
            rgba(var(--gin-secondary-rgb, 191, 214, 65), 0.06) 100%
        );
    border: 1px solid rgba(var(--gin-primary-rgb, 188, 112, 164), 0.26);
    box-shadow:
        0 12px 30px -20px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 0 48px -30px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.3);
    transition:
        transform 0.28s cubic-bezier(.16, .8, .3, 1),
        box-shadow 0.28s cubic-bezier(.16, .8, .3, 1),
        border-color 0.28s cubic-bezier(.16, .8, .3, 1);
}

.home-latest-carousel .gin-card-home__aura {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(130% 92% at 100% -10%, rgba(var(--gin-primary-rgb, 188, 112, 164), 0.2), transparent 58%),
        radial-gradient(105% 88% at -8% 108%, rgba(var(--gin-secondary-rgb, 191, 214, 65), 0.14), transparent 56%);
    opacity: 0.85;
}

.home-latest-carousel .gin-card-home::after {
    content: "";
    position: absolute;
    inset: auto -20% -42% auto;
    width: 62%;
    height: 48%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle, rgba(var(--gin-primary-rgb, 188, 112, 164), 0.14), transparent 68%);
    filter: blur(10px);
    opacity: 0.7;
}

.home-latest-carousel .gin-card-home:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.42);
    box-shadow:
        0 20px 40px -22px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.12),
        0 0 58px -24px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.38);
}

.home-latest-carousel .gin-card-header {
    order: 1;
    position: relative;
    z-index: 2;
    flex: 0 0 48px;
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    box-sizing: border-box;
    background: linear-gradient(
        98deg,
        rgba(var(--gin-primary-rgb, 188, 112, 164), 0.92) 0%,
        color-mix(in srgb, var(--gin-primary, #BC70A4) 72%, var(--gin-secondary, #BFD641) 28%) 58%,
        rgba(var(--gin-secondary-rgb, 191, 214, 65), 0.78) 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.home-latest-carousel .gin-card-badge {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.home-latest-carousel .gin-card-image {
    order: 2;
    position: relative !important;
    z-index: 2;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    flex: 1 1 auto;
    align-self: center;
    width: 142px;
    max-width: 142px;
    height: auto;
    max-height: 178px;
    min-height: 0;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #faf8fc 100%);
    border: 2px solid rgba(var(--gin-primary-rgb, 188, 112, 164), 0.38);
    box-shadow:
        0 10px 24px -10px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.85) inset;
}

.home-latest-carousel .gin-card-home:hover .gin-card-image {
    transform: none !important;
    filter: drop-shadow(0 12px 24px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.24));
}

.home-latest-carousel .gin-card-content {
    order: 3;
    position: relative;
    z-index: 2;
    flex: 0 0 108px;
    min-height: 108px;
    padding: 6px 12px 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.home-latest-carousel .gin-read-main {
    width: 100%;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

.home-latest-carousel .gin-card-title {
    width: 100%;
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.28;
    min-height: calc(2 * 1.28em);
    max-height: calc(2 * 1.28em);
    margin: 0;
    color: #1f2228;
}

.home-gin-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
}

.home-gin-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(31, 34, 40, 0.88);
    background: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.1);
    border: 1px solid rgba(var(--gin-primary-rgb, 188, 112, 164), 0.18);
}

.home-gin-meta-chip .fi {
    font-size: 0.82rem;
    border-radius: 2px;
    line-height: 1;
}

.home-gin-meta-chip--muted {
    color: rgba(31, 34, 40, 0.58);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.home-latest-carousel__nav i {
    font-family: var(--fa-style-family-classic, "Font Awesome 6 Free");
    font-weight: 900;
    font-size: 0.82rem;
    line-height: 1;
}

.home-gin-new-chip i,
.home-gin-meta-chip i.fa-star {
    font-family: var(--fa-style-family-classic, "Font Awesome 6 Free");
    font-weight: 900;
}

.home-gin-meta-chip i.fa-star {
    font-size: 0.62rem;
    color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.9);
}

.home-gin-meta-votes {
    font-weight: 600;
    opacity: 0.72;
}

.home-gin-new-chip {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(4px);
}

.home-gin-new-chip i {
    font-size: 0.62rem;
    opacity: 0.95;
}

@media (max-width: 1199px) {
    .home-latest-carousel-shell {
        --carousel-slide-count: 3;
    }
}

@media (max-width: 991px) {
    .home-latest-carousel-shell {
        --carousel-slide-count: 2;
    }
}

@media (max-width: 699px) {
    .home-latest-carousel-shell {
        --carousel-slide-count: 1.12;
        padding: 0.85rem 0.35rem 0.95rem;
    }

    .home-latest-carousel {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .home-latest-carousel__nav {
        display: none;
    }

    .home-latest-carousel__viewport {
        padding-bottom: 0.35rem;
    }

    .home-latest-carousel .gin-card-home {
        min-height: 368px;
        height: 368px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-latest-carousel__viewport {
        scroll-behavior: auto;
    }

    .home-latest-carousel .gin-card-home,
    .home-latest-carousel .gin-card-home:hover,
    .home-latest-carousel__nav {
        transition: none;
    }
}

[data-theme="dark"] .home-latest-carousel-shell {
    background:
        linear-gradient(
            168deg,
            rgba(14, 15, 22, 0.94) 0%,
            rgba(20, 22, 30, 0.9) 46%,
            rgba(16, 17, 24, 0.93) 100%
        );
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 16px 40px -28px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .home-latest-carousel__nav {
    background: rgba(36, 38, 48, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(232, 228, 240, 0.88);
}

[data-theme="dark"] .home-latest-carousel .gin-card-home {
    background:
        linear-gradient(
            168deg,
            rgba(var(--gin-primary-rgb, 188, 112, 164), 0.14) 0%,
            rgba(26, 28, 36, 0.98) 40%,
            rgba(var(--gin-secondary-rgb, 191, 214, 65), 0.08) 100%
        );
    border-color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.3);
    box-shadow:
        0 14px 34px -22px rgba(0, 0, 0, 0.72),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 52px -28px rgba(var(--gin-primary-rgb, 188, 112, 164), 0.24);
}

[data-theme="dark"] .home-latest-carousel .gin-card-home__aura {
    opacity: 0.68;
}

[data-theme="dark"] .home-latest-carousel .gin-card-title {
    color: var(--dk-text, #e8e4f0);
}

[data-theme="dark"] .home-latest-carousel .gin-card-image {
    background: linear-gradient(180deg, #ffffff 0%, #f2f4f8 100%);
    border-color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.44);
}

[data-theme="dark"] .home-gin-meta-chip {
    color: rgba(232, 228, 240, 0.9);
    background: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.14);
    border-color: rgba(var(--gin-primary-rgb, 188, 112, 164), 0.24);
}

[data-theme="dark"] .home-gin-meta-chip--muted {
    color: rgba(232, 228, 240, 0.55);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
