/* ==================== VARIABLES ==================== */
:root {
    --main-dark-color: #0085CB;
    --main-color: #0085CB;
    --light-color: #0085CB;
    --footer-text-color: #fff;
    --border-radius: 12px;
    --transition-standard: all 0.3s ease;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-base: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 3px rgba(0, 133, 203, 0.3);
}

/* ==================== GLOBAL IMPROVEMENTS ==================== */
* {
    /* Smooth scrolling per l'intera pagina */
    scroll-behavior: smooth;
}

/* ==================== UTILITIES ==================== */
.border-radius > * {
    border-radius: var(--border-radius);
}

.ms-hero-subtitle,
.post-meta-date,
.meta-date-sp {
    display: none !important;
}

.ms-rp__title {
    margin: 0 !important;
}

/* ==================== LINKS & BUTTONS ==================== */
.ms_fuw--wrapper .ms_fuw .ms_fuw--list a {
    color: var(--color-contrast-medium) !important;
    transition: var(--transition-smooth);
    position: relative;
}

/* Effetto underline animato */
.ms_fuw--wrapper .ms_fuw .ms_fuw--list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

.ms_fuw--wrapper .ms_fuw .ms_fuw--list a:hover {
    color: var(--main-color) !important;
}

.ms_fuw--wrapper .ms_fuw .ms_fuw--list a:hover::after {
    width: 100%;
}

.wp-social-link {
    transition: var(--transition-smooth);
}

.wp-social-link:hover {
    color: var(--footer-text-color) !important;
    transform: translateY(-3px) scale(1.1);
}

.footer a {
    color: white !important;
    transition: var(--transition-standard);
}

.footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.wp-block-button__link {
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Effetto ripple sui bottoni */
.wp-block-button__link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wp-block-button__link:hover {
    border-color: var(--main-dark-color) !important;
    color: var(--main-dark-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 133, 203, 0.2);
}

.wp-block-button__link:hover::before {
    width: 300px;
    height: 300px;
}

.wp-block-button__link:focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* ==================== HERO SECTION ==================== */
.parallax {
    position: relative;
    min-height: 75vh;
    overflow: hidden;
    background: url(https://muabz.it/wp-content/uploads/2025/09/Sfondo_Landing-Page_desktop.svg) center/cover no-repeat scroll;
    transform: translateZ(0);
    will-change: transform;
}

/* Animazione fade-in per l'overlay */
.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay h1 {
    font-size: clamp(2em, 7vw, 7em);
    line-height: 1.15;
    padding-bottom: 0.5rem;
    color: white !important;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay h2 {
    font-size: clamp(1.1rem, 3vw, 1.5em);
    color: white !important;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ==================== ABOUT US ==================== */
.about-us-container {
    padding-inline: 15px !important;
    margin-inline: auto !important;
}

/* ==================== SERVICES CAROUSEL ==================== */
.services-carousel-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: min(130%, 1400px);
    margin-inline: auto;
    position: relative;
    left: -15%;
}

.services-carousel-card {
    position: relative;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-base);
    cursor: pointer;
}

.services-carousel-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Focus accessibile per tastiera */
.services-carousel-card:focus {
    outline: none;
    box-shadow: var(--shadow-focus), var(--shadow-hover);
}

.services-carousel-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.9);
}

.services-carousel-card:hover .services-carousel-background {
    transform: scale(1.08);
    filter: brightness(1);
}

.services-carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
    transition: background 0.4s ease;
}

.services-carousel-card:hover .services-carousel-overlay {
    background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.7) 100%);
}

.services-carousel-title {
    position: absolute;
    bottom: 90px;
    inset-inline: 30px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.services-carousel-card:hover .services-carousel-title {
    transform: translateY(-5px);
}

.services-carousel-button {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background-color: var(--main-color);
    color: white;
    padding: 0.5rem 2rem;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 133, 203, 0.3);
}

.services-carousel-card:hover .services-carousel-button {
    margin-top: 1rem;
    background-color: white;
    color: var(--main-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 133, 203, 0.4);
}

/* Effetto shimmer al caricamento */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.services-carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent
    );
    transition: left 0.5s ease;
    z-index: 3;
    pointer-events: none;
}

.services-carousel-card:hover::before {
    left: 100%;
}

/* ==================== LOADING ANIMATIONS ==================== */
.services-carousel-card {
    animation: fadeInScale 0.5s ease-out backwards;
}

.services-carousel-card:nth-child(1) { animation-delay: 0.1s; }
.services-carousel-card:nth-child(2) { animation-delay: 0.2s; }
.services-carousel-card:nth-child(3) { animation-delay: 0.3s; }
.services-carousel-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== News Slider ==================== */

/* Container principale */
.news-slider-wrap {
    width: 130%;
    position: relative;
    left: -15%;
}

/* Titolo sezione */
.news-slider-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    font-weight: 600;
    color: #2c7cc6;
    margin: 4rem 0 2rem;
    text-align: center;
}

/* Contenitore scrollabile */
.news-slider-rail {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 8px 12px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Card notizia */
.news-card {
    flex: 0 0 auto;
    min-width: 380px;
    max-width: 480px;
    background: #fff;
    border: 1px solid #2c7cc6;
    border-radius: 24px;
    padding: 24px 24px 20px;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Data */
.news-date {
    font-weight: 700;
    color: #2c7cc6;
    font-size: 1.35rem;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* Meta informazioni */
.news-meta {
    color: #2c7cc6;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 2px 0 12px;
}

/* Titolo notizia */
.news-title {
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 700;
    color: #0c0c0c;
    margin: 0 0 16px;
    word-wrap: break-word;
    flex-grow: 1;
}

/* Badge categoria */
.news-badge {
    display: inline-block;
    background: #ee7d73;
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    width: fit-content;
}

/* Icona occhio - RIDOTTA */
.news-eye {
    position: absolute;
    right: 20px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2c7cc6;
    display: grid;
    place-items: center;
    border: 4px solid #b7d3ea;
}

.news-eye svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* Freccia navigazione - RIDOTTA */
.news-arrow {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e6ecef;
    display: grid;
    place-items: center;
    border: 4px solid #cfdde7;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10;
}

.news-arrow:hover {
    background: #d9e5eb;
}

.news-arrow:active {
    background: #cfdde7;
}

.news-arrow svg {
    width: 32px;
    height: 32px;
    stroke: #6b7f8f;
    stroke-width: 5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Pulsante CTA */
.news-btn {
    display: inline-block;
    margin: 18px auto 0;
    padding: 14px 24px;
    border-radius: 999px;
    background: #2c7cc6;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
}

.news-btn:hover {
    background: #115993;
    color: #fff !important;
}

/* Scrollbar personalizzata */
.news-slider-rail::-webkit-scrollbar {
    height: 8px;
}

.news-slider-rail::-webkit-scrollbar-track {
    background: #f0f4f7;
    border-radius: 999px;
}

.news-slider-rail::-webkit-scrollbar-thumb {
    background: #c9dceb;
    border-radius: 999px;
}

.news-slider-rail::-webkit-scrollbar-thumb:hover {
    background: #b0c9e0;
}

/* Freccia sinistra */
.news-arrow-left {
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e6ecef;
    display: grid;
    place-items: center;
    border: 4px solid #cfdde7;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
}

.news-arrow-left.visible {
    opacity: 1;
    visibility: visible;
}

.news-arrow-left:hover {
    background: #d9e5eb;
}

.news-arrow-left:active {
    background: #cfdde7;
}

.news-arrow-left svg {
    width: 32px;
    height: 32px;
    stroke: #6b7f8f;
    stroke-width: 5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 768px) {
    .news-arrow-left {
        display: none;
    }
}

/* ==================== Media Queries ==================== */

@media (max-width: 768px) {
    .news-slider-wrap {
        width: 100%;
        left: 0;
    }

    .news-arrow {
        display: none;
    }
}

@media (max-width: 640px) {
    .news-card {
        min-width: 88vw;
        max-width: 88vw;
        padding: 18px;
        border-radius: 18px;
    }

    .news-title {
        font-size: 1.5rem;
    }

    .news-meta {
        font-size: 1.1rem;
    }

    .news-date {
        font-size: 1.2rem;
    }

    .news-eye {
        width: 44px;
        height: 44px;
        right: 14px;
        bottom: 14px;
        border-width: 3px;
    }

    .news-eye svg {
        width: 20px;
        height: 20px;
    }

    .news-slider-rail {
        gap: 14px;
        padding: 8px 8px 20px;
    }
}

@media (max-width: 480px) {
    .news-slider-title {
        margin: 3rem 0 1.5rem;
    }

    .news-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 768px) {
    .services-carousel-container {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
        left: 0;
    }

    .services-carousel-card {
        height: 400px;
    }

    .services-carousel-card:hover {
        transform: translateY(-5px) scale(1.01);
    }

    .services-carousel-title {
        font-size: 28px;
        bottom: 70px;
        inset-inline: 20px;
    }

    .services-carousel-button {
        bottom: 20px;
        left: 20px;
        padding: 10px 20px;
        font-size: 14px;
    }

    .about-us-container {
        padding-inline: calc(3.2rem / 2) !important;
    }

    .overlay {
        width: 100%;
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    .about-us-container {
        width: 750px !important;
    }
}

@media (min-width: 992px) {
    .about-us-container {
        width: 970px !important;
    }
}

@media (min-width: 1200px) {
    .about-us-container {
        width: 992px !important;
    }

    .services-carousel-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}