/* CSS Responsive i centrat per padelfuncionaris.com */

/* Container principal - ample complet per imatges */
#SITE_CONTAINER {
    max-width: 100% !important;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
    width: 100% !important;
}

.SITE_ROOT {
    max-width: 100% !important;
    margin: 0 auto !important;
    width: 100% !important;
}

/* Contingut de text centrat */
#masterPage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Menu responsive */
#menu {
    padding: 80px 30px 60px 200px !important;
    text-align: left;
    left: 0 !important;
    right: 0 !important;
}

#menu .s7itemsContainer {
    display: inline-block !important;
    text-align: center !important;
}

/* Logo a l'esquerra */
#lo {
    left: 30px !important;
    transform: none !important;
    margin-left: 0 !important;
}

/* IMPORTANT: Contenidors de fons a pantalla completa */
.s10 {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

.s10balata {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    clip: none !important;
}

/* Media containers - pantalla completa */
.bgMedia,
[id$="balatamedia"] {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    position: absolute !important;
}

/* Imatges de fons - pantalla completa */
.bgImage,
[id$="balatamediaimage"] {
    width: 100vw !important;
    max-width: 100vw !important;
}

/* Imatges dins bgImage - pantalla completa */
.bgImage img,
[id$="balatamediaimageimage"],
img[data-type="image"] {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 500px;
    object-fit: cover !important;
}

/* Sections amb ID específic */
div[id^="comp-ili"],
div[id^="mediaisygy"] {
    width: 100% !important;
    left: 0 !important;
}

/* Millores responsive per pantalles mitjanes (tablets) */
@media screen and (max-width: 1024px) {
    #SITE_CONTAINER {
        padding: 0 20px;
    }

    #menu {
        padding: 80px 20px 60px 20px !important;
    }

    #menu .s7repeaterButton {
        font-size: 14px;
    }

    h3, h3 span {
        font-size: 60px !important;
    }
    
    .bgImage img,
    [id$="balatamediaimageimage"],
    img[data-type="image"] {
        min-height: 400px;
    }
}

/* Responsive per tablets petits */
@media screen and (max-width: 768px) {
    #menu {
        padding: 120px 15px 40px 15px !important;
        height: auto !important;
    }

    #menu .s7itemsContainer {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    #menu .s7repeaterButton {
        width: auto !important;
        padding: 5px 10px !important;
        font-size: 13px;
        display: inline-block !important;
    }

    #lo {
        width: 100px !important;
        height: 100px !important;
        left: 20px !important;
    }

    #lo img {
        width: 100px !important;
        height: 100px !important;
    }

    h3, h3 span {
        font-size: 40px !important;
    }

    .SITE_ROOT {
        padding-top: 160px !important;
    }
    
    .bgImage img,
    [id$="balatamediaimageimage"],
    img[data-type="image"] {
        min-height: 300px;
    }
}

/* Mobile - pantalles petites */
@media screen and (max-width: 480px) {
    #SITE_CONTAINER {
        padding: 0 10px;
    }

    #menu {
        padding: 110px 10px 30px 10px !important;
        font-size: 12px;
    }

    #menu .s7repeaterButton {
        font-size: 11px;
        padding: 4px 8px !important;
    }

    #lo {
        width: 80px !important;
        height: 80px !important;
        top: 20px !important;
        left: 15px !important;
    }

    #lo img {
        width: 80px !important;
        height: 80px !important;
    }

    h3, h3 span {
        font-size: 28px !important;
        line-height: 1.2em !important;
    }

    .s13submit {
        font-size: 18px !important;
        min-height: 45px !important;
        line-height: 45px !important;
    }

    select, input {
        width: 100%;
        box-sizing: border-box;
    }

    .SITE_ROOT {
        padding-top: 140px !important;
    }

    /* Amagar xarxes socials en mòbil si ocupen massa espai */
    #social {
        display: none !important;
    }
    
    .bgImage img,
    [id$="balatamediaimageimage"],
    img[data-type="image"] {
        min-height: 250px;
    }
}

/* Container de contingut centrat - només per text, no per imatges de fons */
.s10inlineContent:not([id*="media"]) {
    max-width: 1200px;
    margin: 0 auto;
}

/* Assegurar que contenidors amb imatges de fons no tinguin límits */
div[id*="media"].s10inlineContent,
div[id*="balata"] {
    max-width: 100% !important;
    width: 100% !important;
}

/* Imatges responsive generals */
img:not([id$="balatamediaimageimage"]):not([data-type="image"]) {
    max-width: 100%;
    height: auto;
}

/* Taules de patrocinadors responsive */
table#logos_patrocinadors {
    width: 100%;
    margin: 50px auto;
}

table#logos_patrocinadors img {
    max-width: 150px;
    width: 100%;
}

@media screen and (max-width: 768px) {
    table#logos_patrocinadors img {
        max-width: 100px;
    }

    table#logos_patrocinadors tr,
    table#logos_patrocinadors td {
        height: 150px;
    }
}

/* Contenidors de logos responsive */
.logoContainer {
    display: inline-block;
    margin: 20px;
    text-align: center;
}

@media screen and (max-width: 768px) {
    .logoContainer {
        margin: 10px;
        width: calc(50% - 20px);
    }
}

@media screen and (max-width: 480px) {
    .logoContainer {
        width: calc(100% - 20px);
    }
}

/* Millores de contingut */
.content-container {
    padding: 20px;
}

.content-container h4 {
    font-size: 46px;
    margin-bottom: 20px;
}

@media screen and (max-width: 768px) {
    .content-container h4 {
        font-size: 32px !important;
    }
    
    .content-container {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .content-container h4 {
        font-size: 24px !important;
    }
    
    .content-container {
        padding: 10px;
    }
}

/* Millores generals de text */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Assegurar scroll suau */
html {
    scroll-behavior: smooth;
}

/* FORÇAR amplada completa per contenidors inline amb width fixes */
div[id*="inlineContent"][style*="1000px"],
div[id*="inlineContent"][style*="1200px"] {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Contenidors específics de media amb inline width */
[id$="inlineContent"][id*="media"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Override de tots els inline styles que limiten amplada */
.s10 > div[style*="width"],
.s10 div[id*="inline"][style*="1000"],
div[style*="width:1000px"],
div[style*="margin:auto;width:1000px"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Augmentar espai vertical del SITE_ROOT per evitar tall del contingut */
.SITE_ROOT,
#SITE_ROOT {
    min-height: 100vh !important;
    padding-bottom: 100px !important;
    height: auto !important;
}

/* Assegurar que el masterPage també té espai suficient */
#masterPage {
    min-height: 80vh;
    padding-bottom: 60px;
}

/* ===================================================

/* ===================================================
   REFACTORITZACIÓ: Estils que abans eren inline
   =================================================== */

/* SITE_ROOT - eliminar inline styles */
.SITE_ROOT,
#SITE_ROOT {
    padding-bottom: 40px;
    padding-top: 190px;
    font-size: 16px;
}

/* masterPage - eliminar inline styles */
#masterPage {
    width: 100%;
    position: static;
    top: 0;
    height: auto;
    text-align: center;
}

/* Millorar accessibilitat i SEO */
img:not([alt]) {
    outline: 2px solid red; /* Debug: imatges sense alt */
}

/* Performance: lazy loading hint */
img[loading="lazy"] {
    content-visibility: auto;
}

/* ===================================================
   SEPARACIÓ ENTRE IMATGES DE FONS
   =================================================== */

/* Afegir marge entre seccions amb imatges */
.s10 {
    margin-bottom: 40px !important;
}

/* Més espai en desktop */
@media screen and (min-width: 1024px) {
    .s10 {
        margin-bottom: 60px !important;
    }
}

/* Espai entre seccions del PAGES_CONTAINER */
#PAGES_CONTAINER .s10:not(:last-child) {
    margin-bottom: 50px !important;
}

/* Padding adicional per als contenidors interns */
.s10inlineContent {
    padding: 30px 0;
}

@media screen and (max-width: 768px) {
    .s10 {
        margin-bottom: 30px !important;
    }
    
    .s10inlineContent {
        padding: 20px 0;
    }
}

@media screen and (max-width: 480px) {
    .s10 {
        margin-bottom: 20px !important;
    }
    
    .s10inlineContent {
        padding: 15px 0;
    }
}
