
/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== BODY ===== */
html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #eef3ee;  /* Fondo general de la página */
    color: #333;
    line-height: 1.6;
}

/* ===== CONTENEDOR ===== */
#contenidor {
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* Ocupa toda la altura de la pantalla */
}

/* ===== HEADER CON LOGO LATERAL Y TÍTULO CENTRADO ===== */
.header-logo {
    display: flex;             
    align-items: center;       
    justify-content: flex-start; 
    gap: 25px;                 
    background-color: #4a7c59;
    color: white;
    padding: 20px 40px;
    position: relative; /* referencia para centrar el h1 */
}

.header-logo a {
    display: inline-block;
}

.logo {
    width: 110px;              
    height: auto;              
}

.header-logo h1 {
    font-size: 2.4em;          
    margin: 0;
    line-height: 1.2;
    position: absolute;       /* centrado horizontal */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* ===== NAV ===== */
nav {
    background-color: #6b9b7a;
    padding: 15px;
    text-align: center;
}

nav a.boto {
    background-color: white;
    color: #4a7c59;
    padding: 12px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
}

nav a.boto:hover {
    background-color: #4a7c59;
    color: white;
}

/* ===== FOOTER ===== */
footer {
    background-color: #4a7c59;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    flex-shrink: 0;
    margin-top: 40px;
}

/* ===== MAIN – BENEVINGUTS (index.html) ===== */
#benvinguts {
    width: 100%;                 
    color: #333;                 
    text-align: center;
    padding: 60px 20px;
}

#benvinguts h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color:#21603D;
}

#benvinguts p {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#benvinguts img {
    width: 1100px;                 
    max-height: 400px;           
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===== HISTORIA – BLOQUES ===== */
.historia-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 40px auto;
    width: 90%;
    max-width: 1200px;
    padding: 20px;
    background-color: #eef3ee;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.historia-block .texto {
    flex: 1;
    padding: 20px;
}

.historia-block .texto h2 {
    font-size: 2em;
    color: #4a7c59;
    margin-bottom: 15px;
}

.historia-block .texto p {
    font-size: 1.2em;
    line-height: 1.8;
    text-align: justify;
}

.historia-block .imagen {
    flex: 1;
    padding: 20px;
}

.historia-block .imagen img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===== MAIN ===== */
main {
    flex: 1;  
}

/* ===== SECCIÓN BIODIVERSITAT ===== */
#biodiversitat {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    text-align: center;
    min-height: calc(100vh - 160px); 
}

#biodiversitat h2 {
    font-size: 2.5em;
    color: #4a7c59;
    margin-bottom: 15px;
}

#biodiversitat p {
    font-size: 1.3em;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ===== GRID DE IMÁGENES ===== */
.grid-imatges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* ===== TARJETAS DE IMAGEN ===== */
.card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card img {
    width: 100%;
    height: 300px; 
    object-fit: cover;
    display: block;
}

.card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(74,124,89,0.7);
    color: white;
    padding: 15px;
    font-size: 1.1em;
    text-align: center;
    opacity: 0;
    transition: 0.3s;
}

.card:hover .overlay {
    opacity: 1;
}

/* ===== INFORMACIÓN EXTRA BIODIVERSITAT ===== */
.info-extra {
    margin-top: 50px;
    padding: 30px;
    background-color: rgba(74, 124, 89, 0.1);
    border-radius: 10px;
    text-align: center;
}

.info-extra h3 {
    font-size: 2em;
    color: #4a7c59;
    margin-bottom: 20px;
}

.info-extra p {
    font-size: 1.2em;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto 15px auto;
}

/* ===== PAISATGISME ===== */
#paisatgisme {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}

#paisatgisme .bloc {
    margin-bottom: 60px;
}

#paisatgisme h2 {
    font-size: 2.3em;
    color: #4a7c59;
    margin-bottom: 15px;
}

#paisatgisme p {
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: justify;
}

#paisatgisme img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===== GALERIA ===== */
#galeria {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    text-align: center;
}

#galeria h2 {
    font-size: 2.5em;
    color: #4a7c59;
    margin-bottom: 30px;
}

/* GRID Mosaico */
.grid-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* TARJETAS */
.grid-galeria .card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.grid-galeria .card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.grid-galeria .card:hover img {
    transform: scale(1.05);
}

/* OVERLAY */
.grid-galeria .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(74,124,89,0.7);
    color: white;
    padding: 12px;
    font-size: 1em;
    text-align: center;
    opacity: 0;
    transition: 0.3s;
}

.grid-galeria .card:hover .overlay {
    opacity: 1;
}

/* ===== INFORMACIÓ PRÀCTICA ===== */
#info-practica {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
    background-color: #f0f7f0;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#info-practica h2 {
    font-size: 2em;
    color: #4a7c59;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 8px;
}

#info-practica p {
    font-size: 1.2em;
    line-height: 1.7;
    margin-bottom: 25px;
    text-align: justify;
}

#info-practica ul {
    list-style-type: disc;
    margin-left: 25px;
    font-size: 1.2em;
    line-height: 1.7;
}

#info-practica ul li {
    margin-bottom: 12px;
}

/* ===== FOTO DEL JARDÍ ===== */
.foto-jardi {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-top: 20px;
}

/* ============================= */
/*        ADREÇA I COM ARRIBAR  */
/* ============================= */

#adreca {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
    background-color: #f0f7f0;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* TÍTULOS */
#adreca h2 {
    font-size: 2em;
    color: #4a7c59;
    margin-bottom: 15px;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 8px;
}

/* PÁRRAFOS */
#adreca p {
    font-size: 1.2em;
    line-height: 1.7;
    margin-bottom: 25px;
    text-align: justify;
}

/* ============================= */
/*             MAPA              */
/* ============================= */

.map-container {
    width: 100%;
    height: 450px;
    margin-top: 25px;
    border-radius: 12px;
    overflow: hidden; /* Hace que el iframe respete el borde redondeado */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== GLOBAL RESPONSIVE ===== */

/* PARA TABLET Y TELÉFONOS PEQUEÑOS */
@media screen and (max-width: 768px) {

    /* Contenedor principal */
    #contenidor {
        padding: 0 10px;
    }

    /* HEADER */
    .header-logo {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px 10px;
    }

    .header-logo h1 {
        font-size: 1.8em;
        position: static;
        transform: none;
        margin-top: 10px;
    }

    .logo {
        width: 90px;
        margin-bottom: 10px;
    }

    /* NAV */
    nav {
        padding: 10px 0;
    }

    nav a.boto {
        padding: 10px 12px;
        margin: 5px 3px;
        font-size: 0.9em;
    }

    /* MAIN - Secciones */
    main {
        padding: 10px 0;
    }

    section {
        width: 95%;
        margin: 20px auto;
        padding: 15px;
    }

    section h2 {
        font-size: 1.8em;
    }

    section p {
        font-size: 1.05em;
        line-height: 1.5;
    }

    /* HISTORIA */
    .historia-block {
        flex-direction: column !important;
        text-align: center;
        padding: 10px;
    }

    .historia-block .texto, 
    .historia-block .imagen {
        padding: 10px 0;
    }

    .historia-block .texto h2 {
        font-size: 1.6em;
    }

    .historia-block .texto p {
        font-size: 1em;
    }

    /* BIODIVERSITAT / PAISATGISME */
    #biodiversitat, #paisatgisme {
        width: 95%;
    }

    #biodiversitat h2, #paisatgisme h2 {
        font-size: 1.8em;
    }

    #biodiversitat p, #paisatgisme p {
        font-size: 1em;
    }

    .grid-imatges, .grid-galeria {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 15px;
    }

    .card img {
        height: auto; /* Ajusta altura automáticamente */
    }

    .card .overlay {
        font-size: 0.95em;
    }

    /* GALERIA */
    #galeria h2 {
        font-size: 1.8em;
    }

    /* INFORMACIÓN PRÁCTICA */
    #info-practica {
        padding: 15px;
    }

    #info-practica h2 {
        font-size: 1.6em;
    }

    #info-practica p, #info-practica ul li {
        font-size: 1em;
    }

    /* ADREÇA Y MAPA */
    #adreca {
        padding: 15px;
    }

    #adreca h2 {
        font-size: 1.6em;
    }

    #adreca p {
        font-size: 1em;
    }

    .map-container {
        height: 250px;
    }

    /* Imágenes principales */
    #benvinguts img,
    .foto-jardi,
    #paisatgisme img {
        width: 100%;
        max-height: none;
        object-fit: cover;
    }
}

/* PARA MÓVILES PEQUEÑOS (<480px) */
@media screen and (max-width: 480px) {

    /* HEADER */
    .header-logo h1 {
        font-size: 1.4em;
    }

    .logo {
        width: 80px;
    }

    /* NAV */
    nav a.boto {
        display: block;
        width: 90%;
        margin: 5px auto;
        font-size: 0.9em;
    }

    /* MAIN */
    section {
        width: 98%;
        padding: 10px 5px;
    }

    section h2 {
        font-size: 1.4em;
    }

    section p {
        font-size: 0.95em;
    }

    /* HISTORIA */
    .historia-block .texto h2 {
        font-size: 1.4em;
    }

    .historia-block .texto p {
        font-size: 0.95em;
    }

    /* GALERIA Y GRID */
    .grid-imatges, .grid-galeria {
        grid-template-columns: 1fr;
    }

    .card img {
        height: auto;
    }

    .card .overlay {
        font-size: 0.9em;
    }

    /* INFO PRÁCTICA Y ADREÇA */
    #info-practica, #adreca {
        padding: 10px;
    }

    #info-practica h2, #adreca h2 {
        font-size: 1.4em;
    }

    #info-practica p, #info-practica ul li,
    #adreca p {
        font-size: 0.95em;
    }

    .map-container {
        height: 200px;
    }
}

