/*
  Banner lateral esquerre Microgamma (2026).
  Fitxer compartit per totes les plantilles amb banner lateral.

  Funcionament:
  - Per defecte el banner NO existeix i la pagina ocupa tot l'ample.
  - Nomes s'activa quan el PHP afegeix la classe mg-banner-actiu al <body>
    i imprimeix <aside class="mg-banner-vertical-escriptori"> amb mg_banner_conjunt().
  - Aquest fitxer es carrega al <head>, ABANS del CSS inline que imprimeix
    mg-banner-conjunt.php. Les regles critiques porten !important i selectors
    mes especifics perque guanyin igualment la cascada.
*/

:root{
  --mg-banner-left-width:420px;
}

@media (min-width:1500px) and (max-width:1699px){
  :root{ --mg-banner-left-width:340px; }
}
@media (min-width:1700px) and (max-width:2099px){
  :root{ --mg-banner-left-width:420px; }
}
@media (min-width:2100px){
  :root{ --mg-banner-left-width:500px; }
}

/* Per defecte (i a Dreamweaver Design View) el banner no existeix
   i la pagina no reserva cap espai lateral. */
.mg-banner-vertical-escriptori{
  display:none;
}
.mg-banner-vertical-escriptori:empty{
  display:none;
}
.mg-page-with-left-banner{
  width:100%;
  margin-left:0;
  min-height:0;
}

@media (max-width:1499px){
  .mg-banner-vertical-escriptori{
    display:none !important;
  }
  .mg-page-with-left-banner{
    width:100% !important;
    margin-left:0 !important;
  }
}

/* ===== LAYOUT AMB BANNER ACTIU (nomes escriptori ample) ===== */
@media (min-width:1500px){
  body.mg-banner-actiu{
    background:#fff;
    overflow-x:hidden;
  }

  /* Columna fixa a sang, de dalt a baix, a l'esquerra. */
  body.mg-banner-actiu .mg-banner-vertical-escriptori{
    display:block !important;
    position:fixed !important;
    left:0 !important;
    top:0 !important;
    bottom:0 !important;
    width:var(--mg-banner-left-width) !important;
    max-width:var(--mg-banner-left-width) !important;
    height:100vh !important;
    overflow:hidden !important;
    margin:0 !important;
    padding:0 !important;
    z-index:0 !important;
    background:#fff !important;
  }

  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-set,
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-slider,
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-viewport,
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-track,
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-item,
  body.mg-banner-actiu .mg-banner-vertical-escriptori picture{
    width:100% !important;
    max-width:100% !important;
    height:100% !important;
    margin:0 !important;
    padding:0 !important;
  }

  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-track{
    gap:0 !important;
  }

  /* El track del slider SEMPRE en fila: blindatge contra la regla
     display:block del format lateral apilat del modul. */
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-slider .mg-banner-track{
    display:flex !important;
    flex-direction:row !important;
  }

  body.mg-banner-actiu .mg-banner-vertical-escriptori img{
    width:100% !important;
    max-width:none !important;
    height:100% !important;
    display:block !important;
    object-fit:cover !important;
    object-position:center center !important;
  }

  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-slider .mg-banner-arrow{
    width:34px;
    height:54px;
    font-size:28px;
    line-height:50px;
    background:rgba(255,255,255,.65);
  }

  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-title,
  body.mg-banner-actiu .mg-banner-vertical-escriptori .mg-banner-text{
    display:none;
  }

  /* Tot el web queda desplacat a la dreta nomes quan hi ha banner actiu. */
  body.mg-banner-actiu .mg-page-with-left-banner{
    position:relative !important;
    z-index:2 !important;
    width:auto !important;
    max-width:none !important;
    margin-left:var(--mg-banner-left-width) !important;
    min-height:100vh;
    background:#fff !important;
  }

  /* Evita que el contingut quedi excessivament separat dins la columna dreta. */
  body.mg-banner-actiu .mg-page-with-left-banner .contenidor-pagina{
    margin-left:auto;
    margin-right:auto;
  }
}
