/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* VARIABLES DE COLOR */
:root {
    --marron-fosc: #4B3621;
    --marron-suau: #7A5C3E;
    --pistatxo-clar: #D2E3B3;
    --pistatxo-mitja: #8FAF5A;
    --blanc: #F5F5F0;
}

/* BODY FLEX PARA FOOTER PEGADO ABAJO */
body {
    font-family: Arial, sans-serif;
    background: var(--blanc);
    color: var(--marron-fosc);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* altura mínima de la ventana */
}

/* NAV LATERAL */
nav {
    background: var(--pistatxo-mitja);
    width: 240px;
    padding-top: 40px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: 0.3s;
    z-index: 1000;
}

/* LOGO EN EL NAV CENTRADO */
nav .logo {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

nav .logo img {
    max-width: 120px;
    width: 80%;
    height: auto;
    display: inline-block;
    border-radius: 50%;
}

/* LISTA DEL NAV */
nav ul {
    list-style: none;
    width: 100%;
}

nav ul li {
    padding: 15px;
    text-align: center;
}

nav ul li a {
    color: var(--marron-fosc);
    text-decoration: none;
    font-weight: bold;
    display: block;
}

nav ul li:hover {
    background: var(--marron-suau);
}

/* BOTÓN MENÚ RESPONSIVE */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--pistatxo-mitja);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1100;
}

/* CONTENIDO PRINCIPAL */
.main-content {
    margin-left: 240px; /* siempre al lado del nav */
    padding: 40px;
    transition: 0.3s;
    max-width: 1200px;
    flex: 1; /* empuja el footer hacia abajo */
}

/* SECCIONES */
section {
    margin-bottom: 50px;
    padding: 25px;
    background: var(--pistatxo-clar);
    border-radius: 8px;
}

section h1 {
    margin-bottom: 15px;
    color: var(--marron-fosc);
}

section h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--marron-suau);
}

section p {
    line-height: 1.6;
}

/* DIVS PARA TEXTO E IMÁGENES */
.texto-seccio {
    margin-bottom: 20px;
}

.imagenes-seccio {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.imagenes-seccio img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s;
}

.imagenes-seccio img:hover {
    transform: scale(1.05);
}

/* PRESENTACIÓN */
.presentacio {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.presentacio img {
    width: 100%;
    max-width: 500px;
    flex: 1 1 300px;
    border-radius: 10px;
}

.presentacio .text {
    flex: 1 1 300px;
}

/* IMÁGENES INDEX */
.index-img {
    display: block;
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 10px;
}

/* IMÁGENES HISTORIA */
.historia-seccio img {
    display: block;
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 15px auto;
    border-radius: 10px;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 15px;
    background: var(--marron-fosc);
    color: white;
    margin-top: auto;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .main-content {
        padding: 30px;
    }
}

@media (max-width: 900px) {
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    nav {
        width: 0;
    }

    nav.collapsed {
        width: 200px;
    }

    .main-content {
        margin-left: 0;
        padding: 25px;
    }

    .menu-toggle {
        display: block;
    }

    .presentacio {
        flex-direction: column;
        align-items: flex-start;
    }

    .imagenes-seccio img {
        width: 100%;
        height: auto;
    }
}