/* Modal overlay + content */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

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

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal--wide .modal__content {
  max-width: 1200px;
}

.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.modal__close:hover,
.modal__close:focus-visible {
  background: var(--bg-secondary);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
}

.modal__body iframe {
  width: 100%;
  height: 90vh;
  min-height: 600px;
  border: 0;
  display: block;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .modal {
    padding: 0;
  }
  .modal__content {
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }
  .modal__body iframe {
    height: 100vh;
  }
  .modal__close {
    top: var(--space-2);
    right: var(--space-2);
  }
}
