/* ==========================================================
   BANNER / SLIDER RAW INSTOP - CSS ÚNIC
   Fitxer recomanat: /css/2026-raw-banner-rjs.css

   Inclou:
   - Slider RAW
   - Textos sobre imatge
   - Logos SVG
   - Fletxes
   - Suport vídeo
   ========================================================== */

/* Contenidor */
.rjs-banner,
.raw-banner-conjunt {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: #f2f2f2;
}

/* Slide */
.rjs-frame,
.raw-banner-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  z-index: 1;
}

.rjs-frame.rjs-on,
.raw-banner-frame.rjs-on,
.raw-banner-frame.raw-video-on {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Imatge */
.rjs-img,
.raw-banner-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Vídeo RAW */
.raw-banner-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

/* Quan un conjunt només mostra un element o és una seqüència de vídeo, amaguem fletxes */
.raw-banner-single .rjs-prev,
.raw-banner-single .rjs-next,
.raw-banner-video-sequence .rjs-prev,
.raw-banner-video-sequence .rjs-next {
  display: none !important;
}

.raw-banner-video-sequence .raw-banner-frame {
  opacity: 0;
  pointer-events: none;
}

.raw-banner-video-sequence .raw-banner-frame.raw-video-on {
  opacity: 1;
  pointer-events: auto;
}

/* Alternativa si algun banner arriba amb background CSS */
.rjs-frame[style*="--bg"] {
  background: center / cover no-repeat var(--bg);
}

/* Caption centrat sobre la imatge o vídeo */
.rjs-caption,
.rjs-content,
.raw-banner-text {
  pointer-events: none;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8em;
  max-width: 90%;
  margin-inline: auto;
  padding: 20px 40px;
  text-align: center;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
  transform: translateZ(0);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Títol */
.rjs-title,
.raw-banner-title {
  display: block;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: clamp(26px, 5vw, 56px);
}

/* Subtítol */
.rjs-sub,
.raw-banner-subtitle {
  display: block;
  font-weight: 600;
  opacity: 0.95;
  letter-spacing: 0.03em;
  font-size: clamp(18px, 2.8vw, 28px);
  margin-top: 0.6em;
}

/* Logo dins del caption, si alguna versió antiga el fa servir */
.rjs-logo {
  display: block;
  margin-top: 10px;
  text-align: left;
}

.rjs-logo img {
  width: 325px;
  height: auto;
  opacity: 0.9;
}

/* Logo flotant del mòdul RAW */
.raw-banner-logo {
  position: absolute;
  right: 42px;
  top: 42px;
  z-index: 6;
  display: block;
  width: 180px;
  max-width: 22vw;
  height: auto;
  opacity: 0.95;
}

/* Controls / fletxes */
.rjs-arrow,
.rjs-prev,
.rjs-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
}

.rjs-prev {
  left: 12px;
}

.rjs-next {
  right: 12px;
}

.rjs-arrow:hover,
.rjs-prev:hover,
.rjs-next:hover {
  background: rgba(0, 0, 0, 0.55);
}

.rjs-arrow:focus-visible,
.rjs-prev:focus-visible,
.rjs-next:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.rjs-banner:hover .rjs-frame {
  transition: opacity 0.7s ease;
}

/* ==========================================================
   POSICIONS OPCIONALS DEL LOGO SVG
   Pots aplicar-les per codi de banner.
   Exemple:
   .raw-banner-disto-x6 .raw-banner-logo { ... }
   ========================================================== */

/* Logo a baix centrat */
.raw-banner-logo-bottom-center .raw-banner-logo {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 320px;
  max-width: 70vw;
}

/* Logo a baix esquerra */
.raw-banner-logo-bottom-left .raw-banner-logo {
  top: auto;
  right: auto;
  left: 40px;
  bottom: 24px;
  transform: none;
  width: 260px;
  max-width: 60vw;
}

/* Logo a baix dreta */
.raw-banner-logo-bottom-right .raw-banner-logo {
  top: auto;
  left: auto;
  right: 40px;
  bottom: 24px;
  transform: none;
  width: 260px;
  max-width: 60vw;
}

/* Responsive */
@media (max-width: 768px) {
  .rjs-banner,
  .raw-banner-conjunt {
    height: 300px;
  }

  .rjs-caption,
  .rjs-content,
  .raw-banner-text {
    max-width: 94%;
    padding: 18px 22px;
  }

  .rjs-logo img {
    width: min(325px, 80vw);
  }

  .rjs-logo {
    text-align: center;
  }

  .raw-banner-logo {
    right: 16px;
    top: 16px;
    width: 90px;
    max-width: 26vw;
  }

  .raw-banner-logo-bottom-center .raw-banner-logo {
    top: auto;
    right: auto;
    left: 50%;
    bottom: 14px;
    width: 220px;
    max-width: 75vw;
  }

  .raw-banner-logo-bottom-left .raw-banner-logo {
    top: auto;
    right: auto;
    left: 16px;
    bottom: 14px;
    width: 170px;
    max-width: 65vw;
  }

  .raw-banner-logo-bottom-right .raw-banner-logo {
    top: auto;
    left: auto;
    right: 16px;
    bottom: 14px;
    width: 170px;
    max-width: 65vw;
  }

  .rjs-arrow,
  .rjs-prev,
  .rjs-next {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .rjs-banner,
  .raw-banner-conjunt {
    height: 260px;
  }

  .rjs-title,
  .raw-banner-title {
    letter-spacing: 0.04em;
  }

  .rjs-sub,
  .raw-banner-subtitle {
    margin-top: 0.35em;
  }
}


/* ==========================================================
   FIX ROBUST V11 - SEQUENCIES DE VIDEO
   Manté compatibilitat amb scripts antics .rjs-frame,
   però en conjunts de vídeo només mana .raw-video-on.
   ========================================================== */

.raw-banner-video-sequence .raw-banner-frame {
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.raw-banner-video-sequence .raw-banner-frame.rjs-on {
  opacity: 0;
  pointer-events: none;
}

.raw-banner-video-sequence .raw-banner-frame.raw-video-on,
.raw-banner-video-sequence .raw-banner-frame.raw-video-on.rjs-on {
  opacity: 1 !important;
  pointer-events: auto;
  z-index: 2;
}

.raw-banner-video-sequence .rjs-prev,
.raw-banner-video-sequence .rjs-next {
  display: none !important;
}

