/* ==========================================================================
   1. CONTAINER ARCHIVIO & TIPOGRAFIA
   ========================================================================== */

.vanin-archive-container { 
    width: 100%;
    max-width: 100% !important;
    margin: 0 auto; 
    padding: 5vw 60px 5vw 150px; 
    box-sizing: border-box;
}

.case-single-row h1,
.vanin-single-container h1,
.vanin-archive-container h1.archive-title {
    font-weight: normal;
    text-decoration: underline;
    margin-bottom: 20px;
    font-family: "Moderat", sans-serif;
    line-height: 1.2;
}

.archive-divider {
    border: none;
    border-top: 1px solid #000;
    margin: 20px 0;
}

.archive-subtitle {
    font-family: "Moderat", sans-serif;
    font-weight: normal;
    margin-bottom: 40px;
}

/* ==========================================================================
   2. STILE SCHEDE CASE HISTORY
   ========================================================================== */

.case-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.case-line {
    height: 1px;
    width: 100%;
    margin-bottom: 15px;
    display: block;
}

.case-item h4 {
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. LAYOUT A COLONNE FLUIDO (DESKTOP)
   ========================================================================== */

@media (min-width: 768px) {
  .case-grid-container {
    column-count: 2 !important;
    column-gap: 40px !important;
    width: 100% !important;
  }

  .case-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    display: inline-block !important;
    width: 100% !important;
    margin-bottom: 50px !important;
    box-sizing: border-box !important;
  }

  /* Prima scheda sfalsata in basso */
  .case-item:first-child {
    margin-top: 100px !important;
  }
}

/* ==========================================================================
   4. LAYOUT SINGOLA CASE HISTORY (WITH STICKY LEFT COLUMN)
   ========================================================================== */

.vanin-single-wrapper {
    width: 100%;
    max-width: 100% !important;
    padding: 5vw 60px 5vw 150px;
    box-sizing: border-box;
}

.case-single-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.case-row-bottom {
    align-items: flex-start;
}

.case-single-col {
    flex: 0 0 calc(50% - 25px);
    width: calc(50% - 25px);
    box-sizing: border-box;
}

/* --- COLONNA SINISTRA STICKY --- */
.case-single-col.col-left.col-text-padded {
    padding-right: 0%;
    position: -webkit-sticky;
    position: sticky;
    top: 40px;
    height: auto;
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 25px;
    color: #000;
    text-decoration: none;
    font-weight: normal;
}

.case-body-text {
    line-height: 1.7;
    font-size: 1.05rem;
}

.case-intro-bold,
.case-intro-bold p {
    font-weight: bold !important;
    margin-bottom: 15px;
}

.case-extended-text,
.case-extended-text p {
    font-weight: normal;
    margin-bottom: 15px;
}

.case-single-col .img-wrapper {
    margin-bottom: 30px;
}

.case-single-col .img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   5. SHORTCODE MISSION - CAROSELLO OPPOSTO CON CORRISPONDENZA GARANTITA
   ========================================================================== */

.vm-carousel-wrapper {
    display: flex;
    width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    user-select: none;
}

/* INTESTAZIONE FISSA "Case History" CENTRATA IN ALTO */
.vm-header-fixed {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.vm-tag-text {
    font-size: 2.2rem;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.vm-tag-line {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* --- COLONNA SINISTRA COLORATA --- */
.vm-col-left {
    flex: 0 0 50%;
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: background-color 0.6s ease;
    z-index: 2;
}

.vm-slide-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 60px 80px 60px 100px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #ffffff;
    transition: none;
}

.vm-slide-active {
    transform: translateY(0%);
}

.vm-slide-incoming {
    transform: translateY(-100%);
}

.vm-bottom-box h4.vm-title {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 15px 0;
    line-height: 1.25;
}

.vm-intro {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 90%;
}

.vm-btn-scopri {
    display: inline-block;
    background-color: #ffffff;
    color: #000000 !important;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.vm-btn-scopri:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

/* --- COLONNA DESTRA IMMAGINE --- */
.vm-col-right {
    flex: 0 0 50%;
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.vm-img-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: none;
}

.vm-img-box img.vm-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.vm-img-active {
    transform: translateY(0%);
}

.vm-img-incoming {
    transform: translateY(100%);
}

/* --- ANIMAZIONE A FORBICE AL CLICK --- */
.vm-carousel-wrapper.is-animating .vm-slide-box,
.vm-carousel-wrapper.is-animating .vm-img-box {
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.vm-carousel-wrapper.is-animating .vm-slide-active {
    transform: translateY(100%);
}

.vm-carousel-wrapper.is-animating .vm-slide-incoming {
    transform: translateY(0%);
}

.vm-carousel-wrapper.is-animating .vm-img-active {
    transform: translateY(-100%);
}

.vm-carousel-wrapper.is-animating .vm-img-incoming {
    transform: translateY(0%);
}

/* ==========================================================================
   6. UNIFIED MOBILE RESPONSIVE (< 767px)
   ========================================================================== */

@media (max-width: 767px) {
    /* Layout Pagine e Container */
    .vanin-archive-container,
    .vanin-single-wrapper,
    .vanin-single-container {
        padding: 20px !important;
    }

    .case-grid-container {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .case-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .case-single-row,
    .vanin-single-container { 
        flex-direction: column; 
    }
    
    .case-single-col,
    .vanin-col-left, 
    .vanin-col-right { 
        flex: 0 0 100%; 
        width: 100%; 
    }
    
    .case-single-col.col-left.col-text-padded,
    .sticky-block { 
        position: static; 
        padding-right: 0 !important;
        margin-bottom: 30px;
    }

    /* SHORTCODE MISSION CAROSELLO MOBILE FIX */
    .vm-carousel-wrapper {
        flex-direction: column-reverse;
        height: 650px !important; /* Forza altezza visibile per gli absolute */
    }

    .vm-col-right {
        flex: 0 0 350px !important;
        width: 100% !important;
        height: 350px !important;
    }

    .vm-col-left {
        flex: 1 1 300px !important;
        width: 100% !important;
        height: 300px !important;
    }

    .vm-slide-box {
        padding: 40px 20px 25px 20px !important;
    }

    .vm-header-fixed {
        top: 15px;
    }

    .vm-tag-text {
        font-size: 1.4rem;
    }

    .vm-bottom-box h4.vm-title {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .vm-intro {
        font-size: 0.95rem;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .vm-btn-scopri {
        padding: 8px 20px;
        font-size: 0.75rem;
    }
}