/* ==========================================================================
   Modal & Video Section — Edge Pharma
   Structural shells for the Company Video section (thumbnail + play
   trigger) and the modal overlay it opens. Paired with js/video-modal.js.
   Visual design is implemented in a later step.
   ========================================================================== */

/* ---------------------------------------------------------------------
   Video Section
   Section-specific content (label, heading, description, thumbnail
   sizing/colors) lives in css/pages/home.css — this file only holds the
   structural shell + play-button chrome shared by any future trigger.
   --------------------------------------------------------------------- */

.video-section {
  position: relative;
}

.video-section__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.video-section__thumbnail {
  position: relative;
  cursor: pointer;
}

.video-section__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: none;
  border-radius: var(--radius-full);
  background-color: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transition: transform 250ms var(--ease-default), box-shadow 250ms var(--ease-default);
}

.video-section__play-btn:hover,
.video-section__play-btn:focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: var(--shadow-xl);
}

.video-section__play-btn:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
}

.video-section__play-btn svg {
  margin-left: 3px; /* optically center the triangle within the circle */
}

@media (min-width: 768px) {
  .video-section__play-btn {
    width: 88px;
    height: 88px;
  }
}

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: var(--z-modal);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-default);
}

.modal.is-open {
  display: flex;
  opacity: 1;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(9, 20, 32, 0.85);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 960px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform var(--duration-base) var(--ease-default);
}

.modal.is-open .modal__dialog {
  transform: scale(1);
}

.modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  backdrop-filter: blur(8px);
  transition: background-color var(--duration-fast) var(--ease-default);
}

.modal__close:hover {
  background-color: rgba(255, 255, 255, 0.24);
}

.modal__close:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.modal__body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.modal__body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal__dialog,
  .video-section__play-btn {
    transition: none;
  }
}

body.is-modal-open {
  overflow: hidden;
}
