/* ==========================================
   RESET & GLOBAL STYLES (DARK MODE)
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #c9d1d9;
    background-color: #0f1115;
    line-height: 1.6;
    overflow-x: hidden; /* Blocca definitivamente lo scorrimento laterale indesiderato su mobile */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow-wrap: break-word;
}

a:hover {
    color: #60a5fa;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.section {
    padding: 60px 0;
}

.bg-light {
    background-color: #161b22;
    border-top: 1px solid #21262d;
    border-bottom: 1px solid #21262d;
}

/* ==========================================
   HEADER & NAVBAR
   ========================================== */
.navbar {
    background-color: #161b22;
    border-bottom: 1px solid #21262d;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.nav-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-name {
    font-size: 0.95rem;
    line-height: 1.2;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-menu a {
    font-weight: 600;
    color: #c9d1d9;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: #3b82f6;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* ==========================================
   HERO SECTION
   ========================================== */
.main-title {
    font-size: 2.2rem;
    color: #ffffff;
    font-weight: 800;
}

.sub-title {
    font-size: 1.1rem;
    color: #8b949e;
    margin-bottom: 5px;
}

.role-title {
    font-size: 1.05rem;
    color: #60a5fa;
    margin-bottom: 20px;
    font-weight: 600;
}

.description {
    margin-bottom: 15px;
    color: #c9d1d9;
    overflow-wrap: break-word;
}

.services-box {
    background: #1c2128;
    padding: 20px;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    margin: 20px 0;
    border-top: 1px solid #30363d;
    border-right: 1px solid #30363d;
    border-bottom: 1px solid #30363d;
}

.services-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

.services-box li {
    margin-bottom: 6px;
}

.btn-primary {
    display: inline-block;
    background-color: #2563eb;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    color: #ffffff;
}

.hero-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-card img {
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #30363d;
    width: 100%;
}

.instagram-link-box {
    margin-top: 20px;
    font-size: 0.9rem;
    word-break: break-all; /* Forza l'URL lungo a spezzarsi dentro i margini dello schermo mobile */
}

/* ==========================================
   EXPERIENCE & SKILLS
   ========================================== */
.section-title {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 20px;
}

.lead-text {
    font-size: 1.1rem;
    color: #e0e6ed;
    margin-bottom: 15px;
}

.styled-list {
    margin-left: 20px;
    margin-bottom: 20px;
}

.styled-list li {
    margin-bottom: 8px;
}

.skills-box {
    background: #161b22;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #30363d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.skills-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.skills-list {
    list-style: none;
}

.skills-list li {
    padding: 10px 0;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
}

.skills-list li:last-child {
    border-bottom: none;
}

.highlight-text {
    background: #1c2d42;
    color: #93c5fd;
    padding: 15px;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 15px;
    border: 1px solid #2563eb;
}

/* ==========================================
   SHOWCASE / PORTFOLIO (GRIGLIA UNIFORME 3x3)
   ========================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.portfolio-item {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.portfolio-item img:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* ==========================================
   LIGHTBOX MODAL (OTTIMIZZATO MOBILE)
   ========================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    padding: 70px 15px 20px 15px;
    text-align: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s ease;
}

.lightbox-caption {
    margin: 15px auto 0 auto;
    display: block;
    width: 90%;
    max-width: 700px;
    text-align: center;
    color: #c9d1d9;
    font-size: 0.95rem;
}

.lightbox-close {
    position: fixed;
    top: 15px;
    right: 20px;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2100;
    background-color: rgba(0, 0, 0, 0.6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.lightbox-close:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact-title {
    font-size: 2rem;
    color: #ffffff;
}

.contact-subtitle {
    font-size: 1.8rem;
    color: #60a5fa;
    margin-bottom: 20px;
}

.direct-contacts-box {
    background-color: #1c2128;
    border: 1px solid #30363d;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    overflow-wrap: break-word;
}

.direct-contacts-box p {
    margin-bottom: 6px;
}

.form-separator-text {
    margin: 20px 0 12px 0;
    color: #60a5fa;
    font-size: 0.95rem;
    font-weight: 600;
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #c9d1d9;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    background-color: #0f1115;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.contact-image img {
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #30363d;
    width: 100%;
}

/* ==========================================
   FOOTER & WHATSAPP
   ========================================== */
.site-footer {
    background: #090a0f;
    color: #8b949e;
    padding: 25px 0;
    font-size: 0.85rem;
    border-top: 1px solid #21262d;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-right a {
    color: #c9d1d9;
    margin-left: 15px;
}

.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25d366;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 999;
}

.whatsapp-icon {
    width: 28px;
    height: 28px;
}

/* ==========================================
   RESPONSIVE (MOBILE)
   ========================================== */
@media (max-width: 768px) {
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #161b22;
        border-bottom: 1px solid #30363d;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        padding: 20px 0;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
/* Integrazioni editoriali: stesso stile grafico, migliore leggibilità */
.portfolio-intro { margin-bottom: 26px; max-width: 820px; }
.portfolio-intro .section-title { margin-bottom: 12px; }
.contact-form select { width: 100%; padding: 12px; background: #0d1117; color: #e6edf3; border: 1px solid #30363d; border-radius: 5px; font: inherit; }
.contact-form select:focus { outline: 2px solid #2f81f7; outline-offset: 1px; }
