/**
 * Flexible Content Blocks Styles
 * 
 * Estilos para los bloques de contenido flexible de ACF.
 * Consulta README.md para documentación de clases CSS.
 * 
 * @package Medusa
 */

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */

.flexible-content-blocks {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==========================================================================
   TEXT BLOCK
   Clase: .content-block--text
   ========================================================================== */

.content-block--text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-block--text p {
  font-family: var(--font-primary);
  font-size: var(--font-size-body-03);
  line-height: var(--line-height-body-03);
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-05);
}

.content-block--text h2 {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-secondary);
  color: var(--color-brand-primary);
  margin-top: 2rem;
  margin-bottom: 16px;
}

.content-block--text h3,
.content-block--text h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.content-block--text ul,
.content-block--text ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.content-block--text li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   IMAGE BLOCK
   Clase: .content-block--image
   ========================================================================== */

/* .content-block--image {
  margin: 2.5rem 0;
} */

.content-image {
  margin: 0;
  /* max-width: 85%; */
}

.content-image__img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/7;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.content-image__caption {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-brand-primary-03);
  color: var(--color-neutral-05);
  font-style: normal;
  text-align: left;
  font-family: var(--font-primary);
  font-size: var(--font-size-body-04);
  line-height: var(--line-height-body-04);
  font-weight: var(--font-weight-medium);
}

/* ==========================================================================
   GALLERY / CAROUSEL BLOCK
   Clase: .content-block--gallery
   ========================================================================== */

.content-block--gallery {
  margin: 2.5rem 0;
}

.content-gallery {
  position: relative;
}

/* Track del carrusel */
.gallery-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 15%;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

/* Slides */
.gallery-slide {
  flex: 0 0 85%;
  scroll-snap-align: start;
}

.gallery-slide__image {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
}

/* Controles */
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 0 0;
}

/* Dots de navegación */
.gallery-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(105, 25, 63, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.gallery-dot.active {
  background: rgba(105, 25, 63, 1);
}

/* Flechas de navegación */
.gallery-arrows {
  display: flex;
  gap: 12px;
}

.gallery-arrow {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-brand-secondary);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gallery-arrow:hover:not(:disabled) {
  border-color: var(--color-brand-secondary, #3d31ab);
  background: #fff;
}

.gallery-arrow:hover:not(:disabled) img {
  filter: none;
}

/* .gallery-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
} */

/* .gallery-arrow img {
  width: 20px;
  height: 20px;
} */

/* ==========================================================================
   VIDEO BLOCK (enlace externo - sin cookies)
   Clase: .content-block--video
   ========================================================================== */

.content-block--video {
  margin: 2.5rem 0;
}

.content-video {
  /* max-width: 80%; */
  margin: 0 auto;
}

.content-video__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.content-video__preview {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-neutral-100, #f5f5f5);
}

.content-video__thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.content-video__link:hover .content-video__thumbnail {
  transform: scale(1.03);
}

.content-video__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--color-neutral-200, #e5e5e5) 0%,
    var(--color-neutral-100, #f5f5f5) 100%
  );
}

.content-video__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease;
}

.content-video__link:hover .content-video__overlay {
  background: rgba(0, 0, 0, 0.4);
}

.content-video__play {
  transition: transform 0.2s ease;
}

.content-video__link:hover .content-video__play {
  transform: scale(1.1);
}

.content-video__play svg circle {
  transition: fill 0.2s ease;
}

.content-video__link:hover .content-video__play svg circle {
  fill: rgba(61, 49, 171, 1);
}

.content-video__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-brand-secondary, #3d31ab);
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.content-video__link:hover .content-video__cta {
  background: var(--color-brand-secondary-dark, #2d2480);
  transform: translateY(-2px);
}

.content-video__cta svg {
  flex-shrink: 0;
  stroke: #fff;
}

.content-video__caption {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid #3d31ab;
  font-size: 0.9375rem;
  color: var(--color-neutral-600, #666);
  font-style: normal;
  text-align: left;
}

/* ==========================================================================
   QUOTE BLOCK
   Clase: .content-block--quote
   ========================================================================== */

.content-block--quote {
  margin: 2.5rem 0;
}

.content-quote {
  margin: 0;
  padding: 1rem 0 1rem 1.5rem;
  border-left: 3px solid var(--color-brand-primary-03);
}

.content-quote__text {
  font-size: 1.0625rem;
  line-height: 1.7;
  font-style: normal;
  font-weight: 500;
  color: var(--color-neutral-700, #444);
  margin: 0;
}

.content-quote__author {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-style: normal;
  font-weight: 500;
  color: var(--color-neutral-500, #888);
}

.content-quote__author::before {
  content: "— ";
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .flexible-content-blocks {
    gap: 1.5rem;
  }

  .content-block--text {
    font-size: 1rem;
  }

  .gallery-arrow {
    width: 36px;
    height: 36px;
  }
  /* 
  .gallery-arrow img {
    width: 16px;
    height: 16px;
  }
 */
  .content-quote {
    padding: 1.5rem 2rem;
  }

  .content-quote__text {
    font-size: 1.125rem;
  }
}
