/**
 * Background Media Styles
 * Styles voor paragraph achtergrond afbeeldingen en video's
 */

/* Base paragraph met achtergrond */
.paragraph--has-background {
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

.equal-height .paragraph--has-background {
  height: 100%;
}

/* Achtergrond afbeelding styles */
.paragraph--background-image {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Background video container */
.paragraph__background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.paragraph__background-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Remote video background */
.paragraph__background-video--remote {}

.paragraph__background-video-embed {
  width: 100%;
  height: 100%;
  position: relative;
}

.paragraph__background-video--remote .paragraph__background-video-embed {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;

}

.paragraph__background-video--remote .paragraph__background-video-embed iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  --aspect-ratio: 16 / 9;

  aspect-ratio: var(--aspect-ratio);
  min-width: max(calc(100cqh * var(--aspect-ratio)), 100vw);
}

/* Content overlay */
.paragraph__content-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  min-height: inherit;
}

.paragraph--has-background .paragraph__column {
  width: 100%;
  padding: 2rem;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Donkere overlay voor betere leesbaarheid */
.paragraph--has-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.paragraph__content-overlay {
  z-index: 2;
}

/* Responsive aanpassingen */
@media (max-width: 768px) {
  .paragraph--has-background {
    min-height: 200px;
  }

  .paragraph--has-background .paragraph__column {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .paragraph--has-background {
    min-height: 150px;
  }

  .paragraph--has-background .paragraph__column {
    padding: 1rem;
  }
}

/* Toegankelijkheid - verminder motion voor gebruikers die dit prefereren */
@media (prefers-reduced-motion: reduce) {
  .paragraph__background-video video {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles - verberg video's bij printen */
@media print {
  .paragraph__background-video {
    display: none;
  }

  .paragraph--has-background {
    background: #f8f9fa !important;
    color: #212529 !important;
  }

  .paragraph--has-background .paragraph__column {
    color: #212529 !important;
    text-shadow: none !important;
  }
}

/* High contrast mode ondersteuning */
@media (prefers-contrast: high) {
  .paragraph--has-background::before {
    background: rgba(0, 0, 0, 0.7);
  }

  .paragraph--has-background .paragraph__column {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  }
}
