/* Estils Generals */
body {
    font-family: sans-serif;
    margin: 0;
    padding-top: 60px; /* Espai per al header fix */
    background-color: #f4f4f4;
}

/* Estil de la Barra de Navegació */
.navbar {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: fixed; 
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s;
}

.nav-links li a:hover {
    background-color: #575757;
}

/* Amaga el botó del menú per defecte (per a pantalles grans) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

/* Estils de les Seccions (Exemple) */
main section {
    padding: 40px 20px;
    margin: 20px auto;
    max-width: 1000px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 400px; 
}

/* -------------------------------------- */
/* ESTILS PER A LA BIOGRAFIA */
/* -------------------------------------- */
.bio-content {
    display: flex; /* Flexbox per col·locar imatge i text costat a costat */
    flex-wrap: wrap; 
    align-items: flex-start; 
    gap: 25px; 
    margin-top: 20px;
}

.bio-image {
    width: 250px; 
    height: 250px; 
    /* CANVI CLAU: Ara és quadrat amb vores suaus */
    border-radius: 8px; 
    object-fit: cover; 

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0; 
}

.bio-content p {
    flex: 1; 
    line-height: 1.6;
    color: #555;
    text-align: justify; 
}


/* -------------------------------------- */
/* ESTILS DE LA GRAELLA DE PROJECTES */
/* -------------------------------------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
    text-align: center; 
}

.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.project-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s;
    border-radius: 8px 8px 0 0; 
}

.project-item:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.project-item:hover img {
    filter: brightness(50%); 
}

.project-name {
    margin: 0;
    padding: 8px 0;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    border-radius: 0 0 8px 8px; 
    font-size: 0.95em;
}

/* -------------------------------------- */
/* ESTILS DEL FOOTER */
/* -------------------------------------- */

footer {
    background-color: #222;
    color: white;
    padding: 40px 20px 10px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 40px; 
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.footer-content > div {
    flex: 1; 
    min-width: 250px; 
}

.footer-social h3 {
    margin-top: 0;
    color: #f0f0f0;
}

.social-icons a {
    color: white;
    font-size: 1.8em;
    margin: 0 10px;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #007bff; 
}

.footer-gallery {
    text-align: center;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
    max-width: 320px;
    margin: 10px auto;
}

.image-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.image-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
    filter: brightness(70%); 
}

.footer-contact {
    display: flex;
    align-items: flex-start; 
    text-align: left;
    gap: 15px;
    margin: auto;
}

.contact-image img {
    width: 100px;
    height: 100px;
    border-radius: 5px;
    object-fit: cover;
}

.contact-text h3 {
    margin-top: 0;
    color: #f0f0f0;
}

.contact-text p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #ccc;
}

.footer-copy {
    margin-top: 20px;
    padding-top: 10px;
    font-size: 0.8em;
    color: #888;
}



    
  @media (max-width: 768px) {
    
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none; /* Oculta por defecto en móvil */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: #444; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    .nav-links.active {
        display: flex; /* Muestra cuando se añade la clase 'active' con JS */
    }
    .nav-links li {
        text-align: center;
        border-bottom: 1px solid #555;
    }

    .bio-content {
        flex-direction: column; 
        align-items: center; 
        text-align: center;
    }

    .bio-image {
        width: 150px; 
        height: 150px;
        margin-bottom: 20px; 
        /* Manté el border-radius de 8px, el que és quadrat amb vores suaus */
    }
    
    .bio-content p {
        text-align: center; 
    }


    /* Footer Responsive */
    .footer-content > div {
        flex-basis: 100%; 
        text-align: center;
    }

    .footer-contact {
        flex-direction: column; 
        align-items: center;
        text-align: center;
    }
    
    .image-grid {
        margin-left: auto;
        margin-right: auto;
    }

    /* Estil per al botó */
.btn-style {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: background 0.3s;}
}

.btn-style:hover {
    background-color: #555;
}

/* Amagar la llista per defecte */
.project-list-hidden {
    display: none;
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid #333;}

    /* Estil base del submenú */
.submenu {
    display: none;       /* Amagat */
    position: absolute;
    background: white;
    list-style: none;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Mostrar quan toquem el pare (Projectes) */
.dropdown:hover .submenu {
    display: block;      /* Apareix */
}

/* Estil dels enllaços del submenú */
.submenu li a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
}

.submenu li a:hover {
    background: #f0f0f0;
}
