
/* --- 1. RESET Y ESTILOS GLOBALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #F5F3F0 !important; /* Arena suave */
    color: #4A4A4A !important;           /* Gris piedra */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-weight: 700;
}

h2, h3 {
    color: #4B5D43 !important;           /* Verde Cactus */
    margin-bottom: 20px;
}

/* --- 2. CABECERA (HERO SECTION) --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("imatges/historia/historia2.jpg");
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;
}

.logo {
    color: #FFFFFF;
    font-size: 26px;
    font-weight: bold;
}

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

.nav-links a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: #C28B71;                      /* Terracota */
    border-bottom: 2px solid #C28B71;
}

.hero-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-box {
    border: 5px solid #FFFFFF;
    padding: 60px 80px;
    max-width: 70%;
    text-align: center;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.hero-box h1 {
    color: #FFFFFF !important;
    font-size: 4.5rem;
    letter-spacing: 2px;
    margin: 0;
}

/* --- 3. CONTENEDORES Y ESTRUCTURA --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.row {
    display: flex;
    align-items: center;
    gap: 80px;
    padding: 80px 0;
}

.row.reverse {
    flex-direction: row-reverse;
}

.column {
    flex: 1;
}

.image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.separator {
    border: 0;
    border-top: 1px solid #C28B71 !important;
    opacity: 0.3;
    margin: 20px 0;
}

/* --- 4. SECCIONES DE CONTENIDO --- */
.introduccio {
    background-color: #FFFFFF;
    padding: 80px 20px;
    text-align: center;
}

.destacats {
    padding: 80px 0;
    background-color: #FFFFFF;
}

.destacats-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.destacat-card {
    flex: 1;
    min-width: 300px;
    padding: 40px;
    text-align: center;
    background-color: #F5F3F0;
    border-radius: 15px;
    transition: 0.3s;
}

.destacat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* --- 5. GALERÍA --- */
.galeria-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-small { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.col-large { flex: 2; }

.img-placeholder { height: 250px; background: #eee; border: 1px dashed #ccc; }
.img-placeholder-big { height: 520px; background: #eee; border: 1px dashed #ccc; }

.img-placeholder img, .img-placeholder-big img {
    width: 100%; height: 100%; object-fit: cover;
}

/* --- 6. FOOTER --- */
.main-footer {
    background-color: #EBE8E4 !important;
    width: 100%;
    padding: 0 0 60px 0;
    margin-top: 80px;
}

.footer-line {
    border: 0;
    border-top: 2px solid #C28B71 !important;
    width: 100%;
    margin-bottom: 40px;
    opacity: 0.4;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-logo img {
    max-width: 100px;
    height: auto;
}

.footer-address p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4A4A4A;
}


/* --- 8. MEDIA QUERIES (ADAPTACIÓ TOTAL A MÒBIL) --- */

@media (max-width: 768px) {
    /* 1. Ajuste del menú: se apila verticalmente */
    .navbar {
        padding: 20px !important;
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
        background-color: rgba(75, 93, 67, 0.9); /* Fondo verde para legibilidad */
        padding: 15px;
        border-radius: 10px;
    }

    /* 2. Ajuste del Hero: título más pequeño */
    .hero-section {
        height: 60vh;
    }

    .hero-box {
        padding: 30px 20px;
        max-width: 90%;
    }

    .hero-box h1 {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }

    /* 3. Estructura de filas: pasan a ser columnas */
    .row, .row.reverse {
        flex-direction: column !important;
        padding: 40px 20px;
        gap: 30px;
    }

    /* 4. Tarjetas de destacados: una debajo de otra */
    .destacats-grid {
        flex-direction: column !important;
        align-items: center;
    }

    .destacat-card {
        width: 100%;
        max-width: 350px;
        min-width: unset;
    }

    /* 5. Contenedores y Footer */
    .container {
        padding: 0 20px;
    }

    .footer-address p {
        font-size: 14px;
        text-align: center;
    }
/* Això evita que les imatges es deformin */
.img-placeholder img, 
.img-placeholder-big img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Aquesta és la clau: manté la proporció */
    display: block;

	@media (max-width: 768px) {
    /* ... (mantén el codi anterior del nav i les rows) ... */

    /* Reajustem les files de la galeria perquè es posin una sota l'altra */
    .galeria-row, .galeria-row.reverse {
        flex-direction: column !important;
        gap: 20px;
    }

    /* Reduïm l'altura de les imatges perquè no quedin desproporcionades al mòbil */
    .img-placeholder {
        height: 300px !important; /* Altura més natural per a mòbil */
    }

    .img-placeholder-big {
        height: 350px !important; /* Altura més natural per a mòbil */
    }
    
    .col-small, .col-large {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }


    /* Forzamos a que las filas de la galería se conviertan en columnas */
    .galeria-row, .galeria-row.reverse {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Hacemos que cada columna ocupe todo el ancho */
    .col-small, .col-large {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* Ajustamos las alturas para que dejen de verse estiradas */
    .img-placeholder, .img-placeholder-big {
        height: auto !important; /* Deja que la imagen mande */
        min-height: 250px;       /* Altura mínima para que no queden muy pequeñas */
    }

    .img-placeholder img, .img-placeholder-big img {
        height: 100%;
        object-fit: cover; /* Recorta la imagen para que encaje sin deformarse */
    }
}