/* =========================================================
   ANIMAZIONI GLOBALI
========================================================= */

/* Fade-in semplice */
.fade-in {
    opacity: 0;
    animation: fadeIn 1.2s forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 1.6s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Fade da sinistra */
.fade-left {
    opacity: 0;
    transform: translateX(-40px);
    animation: fadeLeft 0.8s ease-out forwards;
}

@keyframes fadeLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade da destra */
.fade-right {
    opacity: 0;
    transform: translateX(40px);
    animation: fadeRight 0.8s ease-out forwards;
}

@keyframes fadeRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade dal basso */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   CARD HOVER (per homepage o future card)
========================================================= */

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* =========================================================
   HERO SECTION
========================================================= */

.hero-banner {
    background: linear-gradient(135deg, #e8f0ff 0%, #ffffff 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-title {
    opacity: 0;
    transform: translateY(25px);
    animation: heroFadeUp 0.9s ease-out forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(25px);
    animation: heroFadeUp 1.3s ease-out forwards;
    font-size: 1.2rem;
    color: #444;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-logo {
    height: 200px;
    opacity: 0;
    transform: translateY(25px);
    animation: heroFadeUp 0.9s ease-out forwards;
}

/* =========================================================
   NAVBAR
========================================================= */

.nav-link:hover {
    color: #0d6efd;
    font-weight: 500;
}

.nav-link.active {
    color: #0d6efd !important;
    font-weight: 600;
    cursor: default;
}

.nav-link.active:hover {
    color: #0d6efd !important;
    text-decoration: none;
}

/* =========================================================
   CARD ESPANDIBILI (homepage)
========================================================= */

.expand-list {
    max-width: 800px;
    margin: 0 auto;
}

.expand-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.expand-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.expand-header {
    position: relative;
}

.expand-header img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.expand-card:hover img {
    transform: scale(1.03);
}

.expand-header h3 {
    position: absolute;
    bottom: 15px;
    left: 20px;
    color: white;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 1.6rem;
    font-weight: bold;
}

.expand-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.5s ease, padding 0.3s ease;
}

.expand-card.active .expand-content {
    max-height: 2000px;
    padding: 25px;
}

/* =========================================================
   TITOLI GENERALI
========================================================= */

h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* =========================================================
   SIDEBAR INDICE LATERALE (pagina servizi)
========================================================= */

#sidebar-index {
    position: fixed;
    top: 120px;
    left: 20px;
    width: 220px;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

#sidebar-index ul li {
    margin-bottom: 10px;
}

#sidebar-index a {
    text-decoration: none;
    color: #0d6efd;
    font-weight: 500;
}

#sidebar-index a:hover {
    text-decoration: underline;
}

#sidebar-index a.active {
    font-weight: 700;
    color: #084298;
}

/* Nascondi sidebar su mobile */
@media (max-width: 992px) {
    #sidebar-index {
        display: none;
    }
}

/* Offset per sidebar */
@media (min-width: 992px) {
    .content-with-sidebar {
        margin-left: 260px;
    }
}

/* Centra il contenuto interno */
.content-with-sidebar .col-lg-10 {
    max-width: 900px;
    margin: 0 auto;
}

/* =========================================================
   RESPONSIVE PER BLOCCHI A DUE COLONNE (pagina servizi)
========================================================= */

@media (max-width: 768px) {
    .col-md-4 {
        display: none;
    }
}

/* =========================================================
   IMMAGINE SERVIZI (stile homepage)
========================================================= */

.servizi-img-wrapper {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

.servizi-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.servizi-img-wrapper:hover .servizi-img {
    transform: scale(1.05);
}

.servizi-img-wrapper:hover {
    box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}