/* =========================================================
   CWU Request Information (RFI) Modal
   ========================================================= */

/* ---------------------------------------------------------
   Overlay
   --------------------------------------------------------- */

.cwu-rfi-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;

  background-color: rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------
   Modal container
   --------------------------------------------------------- */

.cwu-rfi-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  z-index: 9999;

  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100vh - 32px);

  padding: 24px;

  background-color: #ffffff;
  border: none;
  border-radius: 4px;

  color: #171717;

  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Preserve the HTML hidden attribute */

.cwu-rfi-overlay[hidden],
.cwu-rfi-modal[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------
   Modal heading
   --------------------------------------------------------- */

.cwu-rfi-title {
  margin: 0 48px 28px 0;
  padding: 0;

  color: #171717;

  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
}

/* ---------------------------------------------------------
   Close button
   --------------------------------------------------------- */

.cwu-rfi-close {
  position: absolute;
  top: 16px;
  right: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;

  margin: 0;
  padding: 0;

  background: transparent;
  border: 1px solid #222222;
  border-radius: 50%;

  color: #222222;

  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;
  box-sizing: border-box;

  appearance: none;
  -webkit-appearance: none;
}

.cwu-rfi-close:hover {
  background-color: #f2f2f2;
}

.cwu-rfi-close:focus {
  outline: 3px solid #820028;
  outline-offset: 3px;
}

.cwu-rfi-close::before,
.cwu-rfi-close::after {
  content: none;
}

/* ---------------------------------------------------------
   Modal content
   --------------------------------------------------------- */

.cwu-rfi-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;

  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------
   Graduate and undergraduate fieldsets
   --------------------------------------------------------- */

.cwu-rfi-option {
  display: block;

  min-width: 0;
  margin: 0;
  padding: 16px 24px 24px;

  background-color: #ffffff;
  border: 1px solid #b8b8b8;
  border-radius: 0;

  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Fieldset legends
   --------------------------------------------------------- */

.cwu-rfi-option-title {
  display: table;

  width: auto;
  max-width: 100%;

  margin: 0 0 0 -6px;
  padding: 0 6px;

  color: #171717;
  background-color: #ffffff;

  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;

  white-space: normal;
}

/* ---------------------------------------------------------
   Descriptions
   --------------------------------------------------------- */

.cwu-rfi-description {
  margin: 0 0 20px;
  padding: 0;

  color: #171717;

  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

/* ---------------------------------------------------------
   Request Information links
   --------------------------------------------------------- */

.cwu-rfi-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;
  max-width: 100%;

  padding: 10px 28px;

  background-color: #f7d77b;
  border: 2px solid #171717;
  border-radius: 0;

  color: #000000;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;

  box-sizing: border-box;
  cursor: pointer;
}

.cwu-rfi-link:hover {
  background-color: #edc65b;
  color: #000000;
  text-decoration: none;
}

.cwu-rfi-link:focus-visible {
  outline: 3px solid #820028;
  outline-offset: 3px;
}

.cwu-rfi-link:active {
  background-color: #dfb64d;
}

/* ---------------------------------------------------------
   Responsive layout
   --------------------------------------------------------- */

@media (max-width: 600px) {
  .cwu-rfi-modal {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);

    padding: 20px 16px;
  }

  .cwu-rfi-title {
    margin-right: 44px;
    margin-bottom: 24px;

    font-size: 19px;
  }

  .cwu-rfi-close {
    top: 12px;
    right: 12px;
  }

  .cwu-rfi-content {
    gap: 24px;
  }

  .cwu-rfi-option {
    padding: 14px 16px 20px;
  }

  .cwu-rfi-option-title {
    font-size: 14px;
  }

  .cwu-rfi-description {
    font-size: 14px;
  }

  .cwu-rfi-link {
    width: 100%;
    padding: 12px 16px;
  }
}

/* ---------------------------------------------------------
   Reduced motion preference
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .cwu-rfi-modal,
  .cwu-rfi-close,
  .cwu-rfi-link {
    scroll-behavior: auto;
    transition: none;
    animation: none;
  }
}
