/* Epica: doctor video — round play button over photo + on-site video modal */

/* ---------- Play button over a photo ---------- */
.epica-vplay-host {
  position: relative;
}

.epica-vplay {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(74, 122, 168, 0.92);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(36, 53, 72, 0.3);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.epica-vplay::before {
  /* soft pulse ring */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(74, 122, 168, 0.55);
  animation: epica-vplay-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.epica-vplay svg {
  width: 24px;
  height: 24px;
  margin: 0; /* triangle centroid sits exactly at the circle centre */
  display: block;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.epica-vplay:hover {
  transform: scale(1.08);
  background: #3a6288;
  box-shadow: 0 12px 28px rgba(36, 53, 72, 0.36);
}

.epica-vplay:active {
  transform: scale(0.97);
}

.epica-vplay:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(74, 122, 168, 0.75);
}

@keyframes epica-vplay-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .epica-vplay::before { animation: none; display: none; }
  .epica-vplay { transition: none; }
}

@media (max-width: 720px) {
  .epica-vplay {
    width: 54px;
    height: 54px;
    left: 12px;
    bottom: 12px;
  }
  .epica-vplay svg {
    width: 20px;
    height: 20px;
    margin: 0;
  }
}

/* ---------- Video modal ---------- */
.epica-video-modal {
  --epica-video-ar: 0.5472; /* width / height, overridden from JS */
  --epica-video-head: 58px;
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.epica-video-modal[hidden] {
  display: none !important;
}

.epica-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 32, 48, 0.62);
  cursor: pointer;
}

.epica-video-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  /* width follows the video's aspect ratio so that height stays within ~85vh */
  width: min(100%, 960px, calc((85vh - var(--epica-video-head)) * var(--epica-video-ar)));
  width: min(100%, 960px, calc((85dvh - var(--epica-video-head)) * var(--epica-video-ar)));
  min-width: min(300px, 100%);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(36, 53, 72, 0.28);
  overflow: hidden;
  color: #243548;
  animation: epica-video-in 0.22s ease-out;
}

@keyframes epica-video-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.epica-video-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  height: var(--epica-video-head);
  box-sizing: border-box;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid rgba(74, 122, 168, 0.18);
  background: #fbfcfe;
}

.epica-video-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #243548;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epica-video-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #3a6288;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.epica-video-modal__close:hover {
  background: rgba(74, 122, 168, 0.12);
  color: #243548;
}

.epica-video-modal__close:focus-visible {
  outline: 3px solid #4a7aa8;
  outline-offset: 2px;
}

.epica-video-modal__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--epica-video-ar);
  max-height: calc(85vh - var(--epica-video-head));
  max-height: calc(85dvh - var(--epica-video-head));
  background: #0f1a26;
  object-fit: contain;
}

body.epica-video-modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .epica-video-modal {
    --epica-video-head: 52px;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .epica-video-modal__dialog {
    border-radius: 12px;
  }
  .epica-video-modal__head {
    padding: 6px 6px 6px 14px;
  }
  .epica-video-modal__title {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .epica-video-modal__dialog { animation: none; }
}
