/* Iglesia Ríos de Agua Viva · galería, video y carrusel V12.14 */

.home-gallery-grid.home-gallery-carousel-host-v12-14 {
  display: block;
  min-height: 520px;
}

.home-gallery-carousel-v12-14 {
  position: relative;
  min-height: 520px;
  border-radius: 26px;
  overflow: hidden;
  background: #031522;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.home-gallery-carousel-stage-v12-14 {
  position: relative;
  min-height: 520px;
}

.home-gallery-slide-v12-14 {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.018);
  transition: opacity .7s ease, transform 1.1s ease, visibility 0s linear .7s;
  background: #031522;
  color: #fff;
}

.home-gallery-slide-v12-14.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 2;
  transition-delay: 0s;
}

.home-gallery-slide-v12-14 > img,
.home-gallery-slide-v12-14 > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #031522;
}

.home-gallery-slide-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(2, 17, 29, .86) 0%, rgba(2, 17, 29, .48) 45%, rgba(2, 17, 29, .12) 76%), linear-gradient(0deg, rgba(2, 17, 29, .55), transparent 55%);
}

.home-gallery-slide-copy {
  position: absolute;
  z-index: 2;
  left: clamp(28px, 5vw, 72px);
  bottom: clamp(42px, 7vw, 78px);
  width: min(650px, calc(100% - 120px));
  display: grid;
  gap: 8px;
  color: #fff;
}

.home-gallery-slide-copy small {
  color: #a7e4e5;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.home-gallery-slide-copy b {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: .98;
  text-wrap: balance;
}

.home-gallery-slide-copy em {
  font-style: normal;
  color: #e8f5f6;
  font-size: .88rem;
  font-weight: 750;
}

.home-gallery-video-badge {
  position: absolute;
  z-index: 3;
  right: clamp(26px, 5vw, 68px);
  bottom: clamp(40px, 6vw, 72px);
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding-left: 4px;
  background: rgba(4, 26, 42, .65);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

.home-gallery-carousel-nav-v12-14 {
  position: absolute;
  z-index: 5;
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(3, 21, 34, .58);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.home-gallery-carousel-nav-v12-14:hover,
.home-gallery-carousel-nav-v12-14:focus-visible {
  background: var(--teal);
  outline: 3px solid rgba(255,255,255,.45);
}

.home-gallery-carousel-nav-v12-14.prev { left: 18px; }
.home-gallery-carousel-nav-v12-14.next { right: 18px; }

.home-gallery-carousel-dots-v12-14 {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  display: flex;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(3, 21, 34, .56);
  backdrop-filter: blur(8px);
}

.home-gallery-carousel-dots-v12-14 button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}

.home-gallery-carousel-dots-v12-14 button.is-active {
  width: 28px;
  background: var(--gold);
}

.gallery-premium-card > .gallery-card-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #031522;
  pointer-events: none;
  transition: transform .45s ease;
}

.gallery-premium-card.gallery-video-live:hover .gallery-card-video-preview,
.gallery-premium-card.gallery-video-live:focus-visible .gallery-card-video-preview {
  transform: scale(1.035);
}

.gallery-premium-card.gallery-video-live::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2,17,29,.04), rgba(2,17,29,.5));
  pointer-events: none;
}

.gallery-lightbox-video {
  width: 100%;
  max-height: min(72vh, 780px);
  display: block;
  object-fit: contain;
  background: #000;
}

.gallery-auto-toggle-v12-14 {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(3,21,34,.75);
  color: #fff;
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.gallery-video-editor-v12-14 {
  grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
}

.gallery-video-editor-v12-14 .admin-editor-preview-media {
  min-height: 440px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(20,144,157,.18), transparent 44%), #031522;
}

.gallery-video-editor-v12-14 .admin-editor-preview-media video {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: 620px;
  object-fit: contain;
  background: #031522;
}

.gallery-featured-hint-v12-14 {
  display: none;
  margin-left: 3px;
  color: var(--teal);
  font-size: .62rem;
  font-weight: 800;
}

.gallery-video-editor-v12-14 .admin-check:has([data-check="featured"]:checked) {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
}

.gallery-video-editor-v12-14 .admin-check:has([data-check="featured"]:checked) .gallery-featured-hint-v12-14 {
  display: inline;
}

.gallery-video-linked-v12-14 .admin-media-field-help {
  border-left-color: #1a936f;
  background: color-mix(in srgb, #1a936f 9%, transparent);
}

.gallery-remove-thumbnail-v12-14 {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .home-gallery-grid.home-gallery-carousel-host-v12-14,
  .home-gallery-carousel-v12-14,
  .home-gallery-carousel-stage-v12-14 { min-height: 460px; }
  .gallery-video-editor-v12-14 { grid-template-columns: minmax(230px, 38%) minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .home-gallery-grid.home-gallery-carousel-host-v12-14,
  .home-gallery-carousel-v12-14,
  .home-gallery-carousel-stage-v12-14 { min-height: 430px; }
  .home-gallery-slide-shade { background: linear-gradient(0deg, rgba(2,17,29,.9) 0%, rgba(2,17,29,.36) 66%, rgba(2,17,29,.08)); }
  .home-gallery-slide-copy { left: 22px; right: 22px; bottom: 52px; width: auto; }
  .home-gallery-slide-copy b { font-size: clamp(2rem, 11vw, 3.15rem); }
  .home-gallery-video-badge { right: 20px; top: 20px; bottom: auto; width: 52px; height: 52px; }
  .home-gallery-carousel-nav-v12-14 { width: 42px; height: 42px; }
  .home-gallery-carousel-nav-v12-14.prev { left: 10px; }
  .home-gallery-carousel-nav-v12-14.next { right: 10px; }
  .gallery-video-editor-v12-14 { grid-template-columns: 1fr; }
  .gallery-video-editor-v12-14 .admin-editor-preview-media,
  .gallery-video-editor-v12-14 .admin-editor-preview-media video { min-height: 360px; max-height: 560px; }
  .gallery-featured-hint-v12-14 { display: block; width: 100%; margin: 2px 0 0 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-gallery-slide-v12-14,
  .gallery-card-video-preview { transition: none; }
}

/* V12.16 · corrección de especificidad del carrusel público.
   styles.css declara .home-gallery-grid a { position: relative; } con mayor
   especificidad que la clase del slide. Esta regla obliga a los slides a
   ocupar el escenario completo y evita el carrusel vacío. */
.home-gallery-grid .home-gallery-slide-v12-14 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}


/* V12.17 · refinamientos premium: eventos, controles de video y flechas */
.event-live-media,
.home-events-grid .event-live-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #082237 0%, #031522 100%);
}

.event-live-media > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #071f35;
}

.event-live-card:hover .event-live-media > img {
  transform: scale(1.01);
}

.home-gallery-slide-v12-14.is-video .home-gallery-slide-copy {
  bottom: clamp(110px, 14vw, 138px);
}

.home-gallery-slide-v12-14.is-video .home-gallery-slide-copy em {
  max-width: 34rem;
}

.home-gallery-slide-link-cover-v12-17 {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.home-gallery-slide-v12-14 .home-gallery-slide-copy {
  z-index: 4;
}

.home-gallery-slide-cta-v12-17 {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  margin-top: .35rem;
  padding: .8rem 1rem;
  border-radius: 999px;
  background: rgba(4, 26, 42, .72);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(10px);
}

.home-gallery-slide-cta-v12-17:hover,
.home-gallery-slide-cta-v12-17:focus-visible {
  background: var(--teal);
  outline: 3px solid rgba(255,255,255,.25);
}

.home-gallery-slide-v12-14.is-video > video {
  pointer-events: auto;
}

.home-gallery-slide-v12-14.is-video > video::-webkit-media-controls-panel {
  background: rgba(4, 26, 42, .78);
}

.home-gallery-video-badge { display: none; }

.home-gallery-carousel-nav-v12-14 {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(3, 21, 34, .74);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
  font-size: 0;
  line-height: 0;
}

.home-gallery-carousel-nav-v12-14::before {
  content: '';
  width: 14px;
  height: 14px;
  display: block;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
}

.home-gallery-carousel-nav-v12-14.prev::before {
  transform: rotate(-135deg);
  margin-left: 6px;
}

.home-gallery-carousel-nav-v12-14.next::before {
  transform: rotate(45deg);
  margin-right: 6px;
}

.home-gallery-carousel-nav-v12-14:hover,
.home-gallery-carousel-nav-v12-14:focus-visible {
  background: rgba(20, 144, 157, .92);
}

@media (max-width: 900px) {
  .home-gallery-slide-v12-14.is-video .home-gallery-slide-copy {
    bottom: 128px;
  }
}

@media (max-width: 620px) {
  .event-live-media,
  .home-events-grid .event-live-media {
    min-height: 220px;
  }

  .home-gallery-slide-v12-14.is-video .home-gallery-slide-copy {
    bottom: 132px;
    width: min(100%, calc(100% - 40px));
  }

  .home-gallery-slide-copy b {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .home-gallery-carousel-nav-v12-14 {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }
}


/* V12.18 · controles reales visibles, aviso heredado oculto y afiches completos */
.gallery-video-notice[hidden],
.gallery-video-notice[aria-hidden="true"] {
  display: none !important;
}

.gallery-lightbox-video {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.gallery-lightbox-video::-webkit-media-controls,
.home-gallery-slide-v12-14.is-video > video::-webkit-media-controls {
  opacity: 1 !important;
  visibility: visible !important;
}

.home-gallery-slide-shade {
  pointer-events: none;
}

.home-gallery-slide-v12-14.is-video .home-gallery-slide-shade {
  bottom: 58px;
}

.home-gallery-slide-copy {
  pointer-events: none;
}

.home-gallery-slide-copy a,
.home-gallery-slide-copy button {
  pointer-events: auto;
}

.home-gallery-slide-v12-14.is-video > video {
  z-index: 0;
  pointer-events: auto;
}

.home-gallery-slide-v12-14.is-video .home-gallery-slide-copy {
  bottom: clamp(116px, 15vw, 150px);
}

.home-gallery-carousel-dots-v12-14 {
  top: 18px;
  bottom: auto;
}

/* El afiche o fotografía del evento se muestra completo dentro del modal. */
.content-dialog .dialog-cover {
  height: clamp(360px, 58vw, 620px);
  max-height: 68vh;
  display: grid;
  place-items: center;
  background: #031522;
  overflow: hidden;
}

.content-dialog .dialog-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center center;
  background: #031522;
}

@media (max-width: 620px) {
  .content-dialog .dialog-cover {
    height: clamp(280px, 92vw, 520px);
    max-height: 62vh;
  }

  .home-gallery-slide-v12-14.is-video .home-gallery-slide-copy {
    bottom: 126px;
  }
}
