html {
    scroll-padding-top: 50px;
    scroll-behavior: smooth; 
}

body {
    background-color: #f8f9fa !important; /* Bianco sporco */
    color: #212529; /* Testo generale scuro */
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
}

.bg-primary { background-color: #ffc107 !important; }
.text-primary { color: #ffc107 !important; }
.bg-secondary { background-color: #2c3e50 !important; }
.text-secondary { color: #2c3e50 !important; }

.page-section {
    padding: 3rem 0;
}
.page-section .page-section-heading {
    font-size: 1rem;
    line-height: 2rem;
}
@media (min-width: 992px) {
    .page-section .page-section-heading {
        font-size: 3rem;
        line-height: 2.5rem;
    }
}

.masthead {
    padding-top: calc(6rem + 74px);
    padding-bottom: 6rem;
    background-color: #f0f0f0 !important; 
    color: #2c3e50 !important;            
}
.masthead .masthead-heading {
    font-size: 2.75rem;
    line-height: 2.75rem;
}
.masthead .masthead-subheading {
    font-size: 1.25rem;
}
.masthead .masthead-avatar {
    width: 15rem;
    border-radius: 100%;
}
@media (min-width: 992px) {
    .masthead {
        padding-top: calc(6rem + 104px);
        padding-bottom: 6rem;
    }
    .masthead .masthead-heading {
        font-size: 4rem;
        line-height: 3.5rem;
    }
    .masthead .masthead-subheading {
        font-size: 1.5rem;
    }
}

.divider-custom {
    margin: 1.25rem 0 1.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.divider-custom .divider-custom-line {
    width: 100%;
    max-width: 15rem;
    height: 0.05rem;
    background-color: #2c3e50;
    border-radius: 1rem;
}
.divider-custom .divider-custom-line:first-child { margin-right: 1rem; }
.divider-custom .divider-custom-line:last-child { margin-left: 1rem; }
.divider-custom .divider-custom-icon {
    color: #2c3e50;
    font-size: 2rem;
}
.divider-custom.divider-light .divider-custom-line { background-color: #fff; }
.divider-custom.divider-light .divider-custom-icon { color: #fff; }

.divider-custom.divider-dark .divider-custom-line { background-color: #2c3e50; }
.divider-custom.divider-dark .divider-custom-icon { color: #2c3e50; }

/* Navbar */
#mainNav {
    padding-top: 1rem;
    padding-bottom: 1rem;
    background-color: #2c3e50 !important;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
}
#mainNav .navbar-brand { color: #fff; }
#mainNav .navbar-brand:hover { color: #ffc107; }
#mainNav .navbar-nav .nav-item .nav-link { color: #fff; }
#mainNav .navbar-nav .nav-item .nav-link:hover, 
#mainNav .navbar-nav .nav-item .nav-link.active {
    color: #ffc107 !important;
}
#mainNav .navbar-toggler {
    font-size: 80%;
    padding: 0.8rem;
    background-color: #ffc107;
    color: #2c3e50;
    border: none;
}
#mainNav .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.5);
}
@media (min-width: 992px) {
    #mainNav {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        transition: padding-top 0.3s, padding-bottom 0.3s;
    }
    #mainNav.navbar-shrink {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Portfolio Hover Effects */
.portfolio .portfolio-item {
    cursor: pointer;
    position: relative;
    display: block;
    max-width: 25rem;
    border-radius: 0.5rem;
    overflow: hidden;
}
.portfolio .portfolio-item .portfolio-item-caption {
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s ease-in-out;
    opacity: 0;
}
.portfolio .portfolio-item:hover .portfolio-item-caption {
    opacity: 1;
}
.portfolio .portfolio-item .portfolio-item-caption .portfolio-item-caption-content {
    font-size: 1.5rem;
}
.portfolio-modal .btn-close {
    color: #ffc107;
    font-size: 2rem;
    padding: 1rem;
}
.portfolio-modal .portfolio-modal-title {
    font-size: 2.25rem;
    line-height: 2rem;
}

/* Pulsanti personalizzati */
.btn-xl {
    padding: 1rem 1rem;
    font-size: 1.25rem;
}
.btn-primary {
    background-color: #2c3e50 !important;
    border-color: #2c3e50 !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #1a252f !important;
    border-color: #1a252f !important;
}
.btn-social {
    border-radius: 100%;
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.25rem;
    justify-content: center;
    align-items: center;
}

/* Stile Form di Contatto */
.form-floating input.form-control,
.form-floating textarea.form-control {
    font-size: 1.5rem;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 0;
    border-width: 1px;
}
.form-floating input.form-control:focus,
.form-floating textarea.form-control:focus {
    box-shadow: none;
    border-color: #ffc107;
}
.form-floating label {
    font-size: 1.5rem;
    color: #6c757d;
}

/* Footer & Copyright */
.footer {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background-color: #2c3e50 !important;
    color: #fff !important;
}
.copyright {
    background-color: #1a252f !important;
    color: #fff !important;
}


.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
}

.timeline-item {
    display: flex;
    position: relative;
}

/* Colonna di sinistra: Contenuto */
.timeline-content {
    padding-right: 1.5rem; 
    flex: 1;
    padding-bottom: 3rem;
    text-align: right; 
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: #212529;
    margin-bottom: 0.2rem;
}

.timeline-content h4 {
    font-size: 1.15rem;
}

.timeline-content ul li {
    margin-bottom: 0.1rem;
    line-height: 1.4;
}

.timeline-marker {
    position: relative;
    flex: 0 0 20px;
    display: flex;
    justify-content: center;
}

.timeline-marker::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: -1rem;
    width: 4px;
    background-color: #6c757d;
    border-radius: 2px;
}

.timeline-item:last-child .timeline-marker::before {
    bottom: auto;
    height: 0;
}

.timeline-marker::after {
    content: '';
    position: absolute;
    top: 0;
    width: 20px;
    height: 20px;
    background-color: #6c757d;
    border-radius: 50%;
}

/* Colonna di destra: Date */
.timeline-date {
    flex: 0 0 100px;
    text-align: left; 
    padding-left: 1.5rem;
    font-weight: 700;
    color: #6c757d;
    font-size: 1.15rem;
    line-height: 1.3;
}

/* Adattamento mobile */
@media (max-width: 768px) {
    .timeline-item {
        flex-direction: column;
    }
    .timeline-date {
        text-align: right;
        padding-left: 0;
        padding-right: 1rem;
        margin-bottom: 0.5rem;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }
    .timeline-marker {
        display: none;
    }
    .timeline-content {
        padding-right: 1rem;
        border-right: 4px solid #6c757d; 
        text-align: right;
    }
} 

#mainNav {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.portfolio-item {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item .portfolio-link {
    border-radius: 0.75rem;
    display: block;
    position: relative;
}

.portfolio-item .portfolio-link .portfolio-hover {
    transition: opacity 0.3s ease-in-out;
    border-radius: 0.75rem;
}

@media (hover: hover) {
    .portfolio-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
    }
}

@media (max-width: 768px) {
    .page-section {
        padding: 4rem 0 !important; 
    }

    
    .masthead {
        padding-top: calc(4rem + 72px) !important;
        padding-bottom: 4rem !important;
    }

    
    .masthead-heading {
        font-size: 2.2rem !important;
    }
    
    .page-section-heading {
        font-size: 1.8rem !important;
    }

    
    .divider-custom {
        margin-bottom: 2rem !important;
    }

    
    .timeline-item {
        display: flex;
        flex-direction: column;
        border-left: 3px solid #6c757d; 
        padding-left: 1.5rem;
        position: relative;
        margin-bottom: 2.5rem !important; 
    }
    
    .timeline-item::before {
        content: '';
        position: absolute;
        left: -9px; 
        top: 0;
        width: 15px;
        height: 15px;
        background-color: #6c757d;
        border-radius: 50%;
    }
    
    .timeline-marker {
        display: none !important;
    }
    
    .timeline-date {
        order: 1; 
        padding: 0 !important;
        text-align: left !important;
        flex: auto !important;
        margin-bottom: 0.5rem;
    }
    
    
    .timeline-date span {
        display: inline-block !important; 
        margin-right: 0.5rem;
    }
    
    .timeline-content {
        order: 2; 
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }

    
}