/* ==========================================================================
   Modal
   The native <dialog> that shows a collective member's bio. Opened by the
   bio dialog block in assets/js/about.js.
   ========================================================================== */

.modal {
  --modal-w: min(920px, calc(100vw - 2rem));
  --modal-h: min(86svh, 760px);
  width: var(--modal-w);
  max-width: none;
  max-height: var(--modal-h);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(20, 20, 20, 0.6);
}

.modal::backdrop {
  background: rgba(20, 20, 20, 0.44);
  backdrop-filter: blur(2px);
}

.modal[open] { animation: modal-in 0.28s var(--ease); }

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

.modal__scroll {
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__scroll:focus { outline: none; }

.modal__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-3);
}

.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 12px -4px rgba(20, 20, 20, 0.7);
  transition: background-color 0.25s var(--ease);
}

.modal__close:hover { background: #fff; }

.modal__body { padding: clamp(1.3rem, 3vw, 1.9rem); }

.modal__skill {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember-text);
  margin: 0 0 0.45rem;
}

.modal__name {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-variation-settings: "SOFT" 28, "WONK" 1, "opsz" 48;
  margin-bottom: 0.9rem;
}

/* The bio is cloned in from the card, where it is hidden */
.modal .person__detail { display: block; padding: 0; }

/* Wide screens: picture sticks on the left, bio scrolls on the right */
@media (min-width: 720px) {
  .modal {
    --media-w: min(calc(var(--modal-w) * 0.48), calc((var(--modal-h) - 2px) * 0.8));
    --media-h: calc(var(--media-w) * 1.25);
    height: calc(var(--media-h) + 2px);
  }

  .modal__scroll {
    display: grid;
    grid-template-columns: var(--media-w) minmax(0, 1fr);
    align-items: start;
    height: 100%;
    max-height: none;
  }

  .modal__media {
    position: sticky;
    top: 0;
    width: var(--media-w);
    height: var(--media-h);
    aspect-ratio: auto;
  }

  .modal__media[hidden] + .modal__body { grid-column: 1 / -1; }

  .modal__body { padding: clamp(1.8rem, 3.4vw, 2.6rem); padding-top: 3.4rem; }
}
