/* Reset e stili di base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4; /* Increased from 1.3 for better spacing */
    font-size: 0.9rem; /* Base font size for consistency */
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
}

ul {
    list-style-position: inside;
    margin-bottom: 0.4rem; /* Slightly increased */
}

/* Container principale - Ottimizzato per A4 */
.cv-container {
    display: flex;
    width: 100%;
    max-width: 210mm; /* Esatta larghezza A4 */
    min-height: auto;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    background-color: white;
    padding: 0; /* Rimosso padding esterno */
}

/* Colonna sinistra */
.left-column {
    width: 30%; /* Ridotto da 33% per sfruttare meglio lo spazio orizzontale */
    background-color: #0A2647;
    color: white;
    padding: 1rem 0.8rem; /* Ridotto ulteriormente */
}

/* Sezione foto */
.photo-container {
    text-align: center;
    margin-bottom: 0.6rem; /* Ulteriormente ridotto */
}

.photo {
    width: 110px; /* Ridotto ulteriormente */
    height: 110px;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid white; /* Ridotto da 3px */
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sezioni generali */
.section {
    margin-bottom: 0.5rem; /* Increased from 0.3rem */
    padding-bottom: 0.25rem; /* Increased from 0.15rem */
}

.right-column .section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.left-column .section:last-child,
.right-column .section:last-child {
    border-bottom: none;
}

.left-column h2, .right-column h2 {
    margin-bottom: 0.4rem; /* Increased */
    font-size: 1.2rem; /* Standardized and slightly increased */
    padding-bottom: 0.3rem; /* Increased */
    letter-spacing: 0.5px;
}

.left-column h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: white;
}

/* Contatti */
.contact-info {
    margin-top: 0.4rem; /* Increased */
}

.contact-item {
    margin-bottom: 0.3rem; /* Increased */
    font-size: 0.9rem; /* Standardized size */
}

.contact-item i {
    width: 25px;
    margin-right: 10px;
}

/* Istruzione */
.education-item {
    margin-bottom: 0.4rem; /* Increased */
}

.education-item h3 {
    font-size: 0.9rem; /* Increased for consistency */
}

.education-item h4 {
    font-size: 0.9rem; /* Standardized size */
}

.education-item p {
    font-weight: normal;
    font-size: 0.9rem; /* Standardized size */
    margin-bottom: 0.1rem; /* Increased */
}

.cert-issuer {
    font-weight: normal;
    font-size: 0.9rem; /* Standardized size */
}

/* Colonna destra */
.right-column {
    width: 70%; /* Aumentato da 67% per bilanciare la colonna sinistra */
    padding: 1rem 1rem; /* Ridotto ulteriormente */
}

/* Header */
.header {
   margin-top: 0;
   padding-bottom: 0.5rem; /* Increased */
}

.header h1 {
    font-size: 1.7rem; /* Slightly increased */
    line-height: 1.2; /* Increased */
    margin-bottom: 0.2rem;
}

.profession {
    font-size: 1.0rem; /* Increased */
    margin-bottom: 0.4rem; /* Increased */
}

/* Sezione destra */
.right-column h2 {
    margin-bottom: 0.5rem; /* Increased */
    padding-bottom: 0.4rem; /* Increased */
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.right-column h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: #0A2647;
}

.right-column h3 {
    font-size: 1.1rem; /* Increased */
    color: #0A2647;
}

/* Esperienze */
.experience-item {
    margin-bottom: 0.9rem; /* Increased */
    position: relative;
}

.date-location {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem; /* Increased */
    font-size: 0.9rem; /* Standardized size */
    color: #666;
}

.experience-item h3 {
    margin-bottom: 0.3rem; /* Increased */
}

.experience-item h4 {
    color: #555;
    font-weight: 500;
    margin-bottom: 0.6rem; /* Increased */
}

.experience-item ul {
    padding-left: m;
}

.experience-item li {
    margin-bottom: 0.3rem; /* Increased */
    font-size: 0.9rem; /* Standardized size */
}

/* Skills */
.skills {
    margin-bottom: 1.5rem;
}

.skills-list {
    margin-bottom: 0.6rem; /* Increased */
    padding-left: 0.7rem; /* Increased */
}

.skills-list li {
    margin-bottom: 0.25rem; /* Increased */
    font-size: 0.9rem; /* Standardized size */
}

/* Attitudini - Convertito in elenco */
.soft-skills {
    padding-left: 0.7rem;
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.soft-skills li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: white;
}

/* Rimuoviamo lo stile vecchio delle soft-skills che non useremo più */
.soft-skill {
    display: none;
}

/* Hobby e interessi */
.hobbies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px; /* Increased */
    justify-content: space-between; /* Distribuisce gli hobby orizzontalmente */
}

.hobby {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 5px; /* Increased */
    background-color: #f9f9f9;
    padding: 4px 9px; /* Increased */
    border-radius: 15px;
    width: auto;
    flex: 0 0 calc(33% - 5px); /* Organizza in 3 colonne */
}

.hobby i {
    font-size: 1rem;
    color: #0A2647;
    margin-right: 6px;
}

.hobby span {
    font-size: 0.9rem; /* Standardized size */
}

/* Sezione privacy */
.privacy-disclaimer {
    width: 100%;
    max-width: 210mm; /* Larghezza A4 */
    margin: 0 auto;
    padding: 7px; /* Increased */
    text-align: center;
    font-size: 0.8rem; /* Increased */
    color: #666;
    font-style: italic;
}

/* Languages */
.language-level-text {
    font-weight: normal;
    font-size: 0.9rem; /* Standardized size */
}

.language-item h3 {
    font-size: 0.9rem; /* Standardized size */
}

/* Print specific styles - Ottimizzati per A4 */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html, body {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 0;
        overflow: hidden;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .cv-container {
        width: 210mm;
        max-height: 400mm;
        padding: 0;
        min-height: 0;
        box-shadow: none;
        margin: 0;
        page-break-inside: avoid;
        overflow: hidden;
    }

    /* Forza colori colonna sinistra */
    .left-column {
        background-color: #0A2647 !important;
        color: white !important;
        padding: 1rem 0.8rem;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .left-column h2,
    .left-column h3,
    .left-column li,
    .left-column span,
    .left-column strong,
    .left-column .language-level-text,
    .left-column .language-item h3 {
        color: white !important;
    }

    .soft-skills li {
        color: white !important;
    }

    .left-column h2::after {
        background-color: white !important;
    }

    .right-column {
        padding: 1rem 1rem;
    }

    .photo-container {
        margin-bottom: 0.6rem;
    }

    .photo {
        width: 105px;
        height: 105px;
    }

    /* Spaziature sezioni */
    .section {
        margin-bottom: 0.5rem;
        padding-bottom: 0.25rem;
    }

    .left-column h2 {
        font-size: 1.15rem;
        margin-bottom: 0.4rem;
        padding-bottom: 0.3rem;
    }

    .right-column h2 {
        font-size: 1.45rem;
        margin-bottom: 0.45rem;
        padding-bottom: 0.35rem;
    }

    .header {
        padding-bottom: 0.5rem;
    }

    .header h1 {
        font-size: 1.65rem;
        margin-bottom: 0.2rem;
    }

    .profession {
        font-size: 1rem;
        margin-bottom: 0.35rem;
    }

    .right-column h3 {
        font-size: 1.05rem;
    }

    .education-item {
        margin-bottom: 0.4rem;
    }

    .education-item h3 {
        font-size: 0.9rem;
    }

    .education-item h4 {
        font-size: 0.9rem;
    }

    .education-item p {
        font-size: 0.9rem;
    }

    .cert-issuer {
        font-size: 0.9rem;
    }

    .skills-list li {
        font-size: 0.88rem;
        margin-bottom: 0.25rem;
    }

    .soft-skills li {
        font-size: 0.88rem;
        margin-bottom: 0.25rem;
    }

    .contact-item {
        font-size: 0.88rem;
        margin-bottom: 0.3rem;
    }

    .language-item h3 {
        font-size: 0.88rem;
    }

    ul {
        margin-bottom: 0.3rem;
    }

    .skills-list {
        margin-bottom: 0.5rem;
        padding-left: 0.7rem;
    }

    .soft-skills {
        padding-left: 0.7rem;
        margin-bottom: 0.4rem;
    }

    .privacy-disclaimer {
        font-size: 0.78rem;
        padding: 5px 5px;
        margin: 0;
    }

    .contact-info {
        margin-top: 0.35rem;
    }
}