/* ==========================================================================
   Modal Subcomponent: Header
   ========================================================================== */

.c-modal__header {
  align-items: flex-start;
  border-bottom: 1px solid var(--surface-ground);
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg);
}

.c-modal__title {
  color: var(--text-color);
  flex: 1;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.c-modal__close-button {
  background-color: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  height: 2rem;
  margin-left: var(--space-md);
  padding: 0;
  position: relative;
  transition: background-color var(--transition-fast);
  width: 2rem;
}

.c-modal__close-button::before {
  background: var(--text-color-secondary);
  content: '';
  inset: 0;
  position: absolute;
  transition: background var(--transition-fast);

  /* X icon as mask */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18'/%3E%3Cpath d='M6 6L18 18'/%3E%3C/svg%3E");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18'/%3E%3Cpath d='M6 6L18 18'/%3E%3C/svg%3E");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 20px 20px;
}

.c-modal__close-button:hover {
  background-color: var(--surface-hover);
}

.c-modal__close-button:hover::before {
  background: var(--text-color);
}

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