/**
 * Luoghi Custom Carousel
 * Carousel autonomo per la sezione luoghi homepage
 * @version 1.0.0
 */

/* =========================================
   SEZIONE LUOGHI
   ========================================= */

.luoghi-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    padding: 3rem 0;
}

.luoghi-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #17324d;
    margin-bottom: 0.5rem;
}

.luoghi-subtitle {
    color: #5c6f82;
    font-size: 1.1rem;
    margin: 0;
}

/* =========================================
   CAROUSEL CONTAINER
   ========================================= */

.luoghi-custom-carousel {
    position: relative;
    padding: 0 50px;
    margin: 2rem 0;
}

.luoghi-carousel-container {
    overflow: hidden;
    width: 100%;
}

.luoghi-carousel-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* =========================================
   CAROUSEL ITEMS
   ========================================= */

.luoghi-carousel-item {
    flex: 0 0 calc((100% - 4rem) / 3);
    min-width: 0;
}

/* =========================================
   CARD STYLING
   ========================================= */

.luoghi-card-modern {
    height: 100%;
}

.luoghi-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.luoghi-card-link:hover,
.luoghi-card-link:focus {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* =========================================
   IMAGE CONTAINER - RATIO 4:3
   ========================================= */

.luoghi-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.luoghi-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}

.luoghi-card-link:hover .luoghi-img {
    transform: scale(1.08);
}

/* =========================================
   OVERLAY
   ========================================= */

.luoghi-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0.6;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.luoghi-card-link:hover .luoghi-overlay {
    opacity: 0.85;
    background: linear-gradient(
            to bottom,
            rgba(0, 102, 204, 0.1) 0%,
            rgba(0, 102, 204, 0.7) 100%
    );
}

/* =========================================
   CONTENT
   ========================================= */

.luoghi-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fff;
}

.luoghi-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #17324d;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.luoghi-card-link:hover .luoghi-title {
    color: #0066cc;
}

.luoghi-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #5c6f82;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.luoghi-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0066cc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    transition: gap 0.3s ease;
}

.luoghi-card-link:hover .luoghi-cta {
    gap: 0.75rem;
}

.luoghi-cta svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.luoghi-card-link:hover .luoghi-cta svg {
    transform: translateX(4px);
}

/* =========================================
   NAVIGATION BUTTONS
   ========================================= */

.luoghi-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #17324d;
    padding: 0;
}

.luoghi-nav-btn:hover:not(:disabled) {
    background: #0066cc;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.luoghi-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.luoghi-nav-btn:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.luoghi-nav-prev {
    left: 0;
}

.luoghi-nav-next {
    right: 0;
}

.luoghi-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* =========================================
   INDICATORS / DOTS
   ========================================= */

.luoghi-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
    padding: 0;
}

.luoghi-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.luoghi-dot:hover {
    background: #0066cc;
    opacity: 0.7;
}

.luoghi-dot.active {
    background: #0066cc;
    transform: scale(1.3);
}

.luoghi-dot:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 991px) {
    .luoghi-carousel-item {
        flex: 0 0 calc((100% - 2rem) / 2);
    }

    .luoghi-main-title {
        font-size: 2rem;
    }

    .luoghi-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 767px) {
    .luoghi-custom-carousel {
        padding: 0 45px;
    }

    .luoghi-carousel-item {
        flex: 0 0 100%;
    }

    .luoghi-carousel-track {
        gap: 1rem;
    }

    .luoghi-nav-btn {
        width: 40px;
        height: 40px;
    }

    .luoghi-nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .luoghi-main-title {
        font-size: 1.75rem;
    }

    .luoghi-subtitle {
        font-size: 1rem;
    }

    .luoghi-content {
        padding: 1.25rem;
    }

    .luoghi-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 575px) {
    .luoghi-custom-carousel {
        padding: 0 40px;
    }
}

/* =========================================
   AUTOPLAY INDICATOR (Opzionale)
   ========================================= */

.luoghi-custom-carousel[data-autoplay="true"] .luoghi-carousel-dots::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg,
    transparent 0%,
    #0066cc 50%,
    transparent 100%
    );
    opacity: 0.3;
}

/* Animazione progress bar per autoplay */
@keyframes autoplayProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.luoghi-carousel-dots .luoghi-dot.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #0066cc;
}

.luoghi-custom-carousel[data-autoplay="true"] .luoghi-carousel-dots .luoghi-dot.active::after {
    animation: autoplayProgress 5s linear;
}