/* =============================================
   CSS FINAL – TODO CORREGIDO Y PERFECTO
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; height: 100%; }
body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    line-height: 1.6; 
    color: #333; 
    background: #f8f9fa;
    padding-top: 0 !important;   /* quitamos el padding para que no haya hueco blanco */
}

/* =============== HEADER FIJO SIN HUECO =============== */
.header-principal {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(26,26,26,0.97);
    backdrop-filter: blur(12px);
    padding: 0.8rem 5%;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.logo h2 { display: none; }
.logo-img { height: 34px; transition: transform 0.3s; }
.logo-img:hover { transform: scale(1.15); }

.nav-menu ul { display: flex; gap: 2.8rem; }
.nav-menu a {
    color: white; font-weight: 600; font-size: 1.1rem;
    padding: 0.7rem 1.5rem; border-radius: 10px;
    transition: all 0.3s;
}
.nav-menu a:hover { background: #e63946; }

/* =============== HERO – SIN MARGEN BLANCO =============== */
#hero {
    margin: 0;
    padding: 0;
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.74), rgba(0,0,0,0.74)),
                url('Fotos/hero.jpg') center/cover no-repeat fixed;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; color: white;
}
#hero h1 { font-size: 4.8rem; font-weight: 900; text-shadow: 0 5px 20px black; margin: 0; }
#hero p { font-size: 1.9rem; max-width: 900px; text-shadow: 0 4px 15px black; margin-top: 1rem; }

/* =============== LLOCS Y BARRIS =============== */
.seccio-llocs, .seccio-barris {
    padding: 6rem 2rem; text-align: center;
}
.seccio-llocs { background: white; }
.seccio-barris { background: #f1faee; }

.seccio-llocs h2, .seccio-barris h2 {
    font-size: 3.2rem; margin-bottom: 4.5rem; position: relative;
}
.seccio-llocs h2::after, .seccio-barris h2::after {
    content: ''; width: 120px; height: 6px; background: #e63946;
    display: block; margin: 1rem auto 0; border-radius: 4px;
}

.graella-llocs, .barris-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 3rem; max-width: 1600px; margin: 0 auto; justify-content: center;
}

.targeta, .descripcio-barri {
    background: white; border-radius: 20px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    transition: all 0.4s; display: flex; flex-direction: column;
}
.targeta:hover, .descripcio-barri:hover { transform: translateY(-20px); box-shadow: 0 30px 60px rgba(0,0,0,0.25); }

.targeta img, .descripcio-barri img { width: 100%; height: 300px; object-fit: cover; }
.targeta h3, .descripcio-barri h3 {
    background: #e63946; color: white; padding: 1.5rem;
    font-size: 1.6rem; font-weight: 700;
}
.targeta p, .descripcio-barri p { padding: 2rem; flex-grow: 1; font-size: 1.1rem; }

/* =============== GALERÍA – 3×2 PERFECTO =============== */
/* ==== TÍTULO DE LA GALERÍA – AHORA SÍ SE VE ==== */
.galeria-section {
    padding: 6rem 3%;
    background: white;
    text-align: center;
}

.galeria-section h2 {
    font-size: 3rem;
    margin-bottom: 4.5rem;
    color: #1a1a1a;
    position: relative;
}

.galeria-section h2::after {
    content: '';
    width: 120px;
    height: 6px;
    background: #e63946;
    display: block;
    margin: 1.5rem auto 0;
    border-radius: 4px;
}

/* ==== GALERÍA – 3 COLUMNAS × 2 FILAS PERFECTAS ==== */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);   /* 3 columnas */
    grid-template-rows: repeat(2, 320px);    /* exactamente 2 filas */
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    justify-content: center;
}

.galeria-item {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.18);
    transition: all 0.4s ease;
}

.galeria-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* RESPONSIVE DE LA GALERÍA */
@media (max-width: 768px) {
    .galeria-section h2 { font-size: 2.6rem; }
    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: none;
        grid-auto-rows: 280px;
        gap: 2.5rem;
    }
}

@media (max-width: 480px) {
    .galeria-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
        gap: 3rem;
    }
}

/* =============== CONTACTE – AHORA SÍ SE VE PERFECTO =============== */
.contacte {
    padding: 6rem 5%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    background: white;
    min-height: 80vh;
}
.contacte h1 {
    font-size: 3rem;
    margin-bottom: 3rem;
    color: #1a1a1a;
}
.formulari-contacte {
    background: white;
    padding: 3.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}
.formulari-contacte label {
    display: block; margin: 1.5rem 0 0.5rem; font-weight: 600; text-align: left;
}
.formulari-contacte input,
.formulari-contacte textarea {
    width: 100%; padding: 1rem; border: 2px solid #ddd; border-radius: 10px;
    font-size: 1rem; margin-bottom: 1.5rem;
}
.formulari-contacte input:focus,
.formulari-contacte textarea:focus {
    border-color: #e63946; outline: none;
}
.formulari-contacte button {
    background: #e63946; color: white; padding: 1rem 3rem;
    border: none; border-radius: 10px; font-size: 1.2rem; cursor: pointer;
    transition: 0.3s;
}
.formulari-contacte button:hover { background: #c1121f; }

/* =============== FOOTER =============== */
.footer-principal {
    background: #1a1a1a; color: white; text-align: center; padding: 3rem; margin-top: 4rem;
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
    .logo-img { height: 32px; }
    .galeria-grid { grid-auto-rows: 280px; }
    .targeta img, .descripcio-barri img { height: 240px; }
}

@media (max-width: 480px) {
    .header-principal { flex-direction: column; gap: 1rem; padding: 1rem; }
    .logo-img { height: 28px; }
    .nav-menu ul { flex-direction: column; gap: 1rem; }
    .nav-menu a { padding: 1rem; background: rgba(230,57,70,0.2); border-radius: 10px; }
    #hero h1 { font-size: 2.8rem; }
    #hero p { font-size: 1.3rem; }
    .graella-llocs, .barris-container, .galeria-grid { grid-template-columns: 1fr; }
    .galeria-grid { grid-auto-rows: 300px; }
    .targeta img, .descripcio-barri img { height: 260px; }
}