/* Home — partnership, eventi (carousel orizzontale) */

.home-news-section {
    padding: clamp(3.5rem, 7vw, 5rem) 0;
    background: #ffffff;
}

.home-news-section .section-title {
    margin-bottom: 0.5rem;
}

.home-news-section .section-subtitle {
    max-width: 640px;
    margin: 0 auto;
}

.home-news-scroll-wrap {
    position: relative;
    max-width: min(1100px, 100%);
    margin: 0 auto;
    padding: 0.5rem clamp(1rem, 3vw, 3rem) 1.5rem;
    perspective: 1400px;
    overflow-x: clip;
    box-sizing: border-box;
}

.home-news-scroll {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 55, 49, 0.35) transparent;
    transform-style: preserve-3d;
}

.home-news-scroll::-webkit-scrollbar {
    height: 6px;
}

.home-news-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 55, 49, 0.25);
    border-radius: 99px;
}

.home-news-card {
    position: relative;
    flex: 0 0 min(100%, 480px);
    scroll-snap-align: start;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 55, 49, 0.1);
    overflow: visible;
    transform: translateZ(0) rotateX(0deg);
    transform-style: preserve-3d;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 12px 28px rgba(0, 31, 28, 0.1),
        0 4px 10px rgba(0, 31, 28, 0.06);
    transition:
        transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.45s ease;
}

.home-news-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 8%;
    right: 8%;
    bottom: -14px;
    height: 55%;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(13, 143, 127, 0.45) 0%,
        rgba(0, 55, 49, 0.28) 45%,
        rgba(0, 31, 28, 0.12) 100%
    );
    filter: blur(22px);
    opacity: 0.55;
    transform: translateZ(-24px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
    pointer-events: none;
}

.home-news-card:hover {
    transform: translateY(-10px) translateZ(12px) rotateX(3deg);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 28px 50px rgba(0, 31, 28, 0.16),
        0 8px 20px rgba(0, 55, 49, 0.1);
}

.home-news-card:hover::before {
    opacity: 0.9;
    filter: blur(28px);
    transform: translateZ(-32px) scale(1.02);
    bottom: -18px;
}

.home-news-card-link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
}

.home-news-card-thumb {
    flex: none;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(145deg, #eef6f3, #dcebe6);
}

.home-news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.home-news-card:hover .home-news-card-thumb img {
    transform: scale(1.05);
}

.home-news-card-body {
    padding: 1.35rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.home-news-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin-bottom: 0.65rem;
}

.home-news-card-badge {
    background: linear-gradient(135deg, #003731, #0d8f7f);
    color: #fff;
    padding: 0.28rem 0.7rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.home-news-card-tag {
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 500;
}

.home-news-card-date {
    margin-left: auto;
    color: #888;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.home-news-card-body h3 {
    margin: 0 0 0.55rem;
    font-size: 1.12rem;
    line-height: 1.35;
    color: var(--primary-color);
}

.home-news-card-body p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-light);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-news-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0d8f7f;
}

.home-news-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(0, 55, 49, 0.12);
    border-radius: 50%;
    background: #ffffff;
    color: #003731;
    box-shadow: 0 6px 20px rgba(0, 31, 28, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.home-news-scroll-btn svg {
    width: 22px;
    height: 22px;
}

.home-news-scroll-btn:hover {
    background: #f4faf8;
    border-color: rgba(44, 158, 142, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.home-news-scroll-btn.prev {
    left: 0;
}

.home-news-scroll-btn.next {
    right: 0;
}

.home-news-section .home-news-all {
    text-align: center;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .home-news-scroll-wrap {
        padding: 0;
    }

    .home-news-scroll-btn {
        display: none;
    }

    .home-news-card {
        flex: 0 0 min(88vw, 400px);
    }

    .home-news-card-thumb {
        height: 180px;
    }
}

@media (min-width: 900px) {
    .home-news-card {
        flex: 0 0 calc(50% - 0.625rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-news-card,
    .home-news-card-thumb img,
    .home-news-scroll-btn {
        transition: none;
    }

    .home-news-card::before {
        transition: none;
    }

    .home-news-card:hover {
        transform: translateY(-4px);
    }

    .home-news-scroll {
        scroll-behavior: auto;
    }
}
