/* ---- RESET BÀSIC I GLOBALS ---- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

/* ---- 1. HEADER I NAVEGACIÓ ---- */
.header-principal {
    display: flex;              /* logo + menú */
    justify-content: space-between;
    align-items: center;
	margin-bottom: 0;
    background-color: #333;
    color: white;
	position: sticky; top: 0; z-index: 100;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
	margin: 1rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* ---- 2. SECCIÓ HERO ---- */
.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 400px;
    background: url("img/hero.jpg") no-repeat center/cover;
    color: white;
    text-align: center;

}

/* ---- 3. SECCIÓ LLOCS (TARGETES) ---- */
.graella-llocs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
	color: white;
	grid-auto-rows: 250px; /* keeps equal height */
}


.graella-llocs .targeta {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.targeta {
    position: relative;
    color: black;
    background-size: cover;
    background-position: center;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    border-radius: 8px;
    overflow: hidden;
}
.targeta::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255,255,255,0.5); /* opacidad de los imagines */
}
.targeta h3,
.targeta p {
    position: relative;
    z-index: 1;
}


.sagrada {
	background: url("img/sagrada.jpg") center/cover;
}

.parc-guell {
	background: url("img/parcguell.jpg") center/cover;
}

.camp-nou {
	background: url("img/campnou.jpg") center/cover;
}

.targeta.no-overlay::after {
    background: none; /* no whiteout */
}


/* ---- 4. SECCIÓ BARRIS ---- */
.seccio-barris {
    max-width: 1100px;
    margin: 50px auto;
    padding: 20px;
}

.seccio-barris h2 {
    text-align: center;
    margin-bottom: 35px;
}

.barri {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
}

.barri.invertit {
    flex-direction: row-reverse;
}

.barri-img img {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
    object-fit: cover;
}

.barri-text {
    flex: 1;
}

.barri-text h3 {
    margin-bottom: 10px;
}

.barri-text p {
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 800px) {
    .barri,
    .barri.invertit {
        flex-direction: column;
        text-align: center;
    }

    .barri-img img {
        max-width: 100%;
    }
}

/* ---- 5. FOOTER ---- */
.footer-principal {
    display: flex;              /* centrat */
    justify-content: center;
    align-items: center;
    background-color: #222;
    color: white;
    padding: 20px;
}

/* ---- 6. MEDIA QUERIES (RESPONSIVE INDEX) ---- */
@media (max-width: 768px) {
    .graella-llocs {
        grid-template-columns: repeat(2, 1fr);  /* graella 2 col */
    }
    .barris-container {
        flex-direction: column;                /* 1 col */
    }
}

@media (max-width: 480px) {
    .header-principal {
        flex-direction: column;               /* header apilat */
        text-align: center;
    }
    .graella-llocs {
        grid-template-columns: 1fr;           /* 1 col */
    }
}

/* ---- 7. NOVES REGLES PER A GALERIA.HTML ---- */
.gallery-section {
    max-width: 1100px;
    margin: 50px auto;
    padding: 20px;
}

.gallery-section h1 {
    text-align: center;
    margin-bottom: 25px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* exactly 3 per row */
    grid-auto-rows: auto;
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    transition: 0.3s;
}

.gallery-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.85);
    font-size: 18px;
    padding: 10px;
    opacity: 0;
    transition: 0.3s;
    text-align: center;
}

.gallery-item:hover img {
    filter: brightness(60%);
}

.gallery-item:hover .gallery-text {
    opacity: 1;
}


/* ---- 8. NOVES REGLES PER A CONTACTE.HTML ---- */
.formulari-contacte {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.formulari-contacte input,
.formulari-contacte textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.formulari-contacte button {
    padding: 10px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.contact-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
}

.contact-container h1,
.contact-info h2 {
    text-align: center;
    margin-bottom: 15px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.contact-form input,
.contact-form textarea {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 6px;
    font-size: 15px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #333;
}

.btn-send {
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #333;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
}

.btn-send:hover {
    background: #555;
}

.contact-info {
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
}


/* ---- 9. MEDIA QUERIES PER A NOVES PÀGINES ---- */
@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .galeria-grid {
        grid-template-columns: 1fr;
    }
}
