/* ============================================================================
   MODAL — person detail ("Ver trajetória")  (Figma node 2020:612 "overlay-modal")
   ========================================================================== */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);

  /* darken + blur what's behind — applied on the container so the dialog
     (its own child) is never sampled back into the blur */
  background-color: rgba(20, 25, 22, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: modal-overlay-in var(--transition-med) ease both;
}

.modal__dialog {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 840px;
  min-height: min(580px, 88dvh);
  max-height: min(88dvh, 620px);
  overflow: hidden;
  box-shadow: 0 24px 30px rgba(20, 25, 22, 0.2);
  animation: modal-dialog-in var(--transition-med) var(--ease-out) both;
}

.modal__media {
  flex: 1 1 240px;
  max-width: 320px;
  overflow: hidden;
  background-color: #fff;
}
.modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;   /* bias toward the top so portrait faces stay in frame */
}

.modal__panel {
  flex: 2 1 380px;
  max-width: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--color-surface-warm);
  padding: var(--space-12) var(--space-10) var(--space-10);   /* 48 / 40 / 40 */
  display: flex;
  flex-direction: column;
  gap: var(--space-8);            /* 32px */
}

/* Close ---------------------------------------------------------------------- */
.modal__close {
  position: absolute;
  top: var(--space-5);            /* 20px */
  right: var(--space-5);
  z-index: 2;
  display: grid;
  place-items: center;
  padding: var(--space-3);        /* 12px */
  background-color: var(--monarca-white);
  border: 1px solid rgba(20, 25, 22, 0.1);
  color: var(--monarca-ink);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.modal__close:hover { background-color: var(--monarca-gray); }
.modal__close .icon { --icon-size: 18px; }

/* Header ------------------------------------------------------------------- */
.modal__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);            /* 20px */
  padding-bottom: var(--space-6); /* 24px */
  padding-right: 3.25rem;         /* clear the close button */
  border-bottom: 1px solid var(--color-border-strong);
}
.modal__role {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--text-eyebrow-size);
  line-height: 1;
  letter-spacing: var(--text-eyebrow-tr);
  text-transform: uppercase;
  color: #6b5c49;                 /* AA on the warm panel */
}
.modal__name {
  font-family: var(--font-serif);
  font-size: 2.5rem;              /* 40px — this Figma's "h3" */
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-heading);
}

/* Body ------------------------------------------------------------------------ */
.modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);           /* 16px between paragraphs */
}
.modal__body p {
  font-size: var(--text-b3-size);
  line-height: var(--text-b3-lh);
  letter-spacing: var(--text-b3-tr);
  color: var(--color-text-secondary);
}

.modal__cta {
  width: 100%;
  margin-top: auto;   /* pin to the bottom so the min-height whitespace sits above it */
}

/* --------------------------------------------------------------- ANIMATION -- */
@keyframes modal-overlay-in { from { opacity: 0; } }
@keyframes modal-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

/* ================================================================ MOBILE === */
@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal__dialog {
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    max-height: none;
  }
  .modal__media {
    flex: 0 0 40vh;
    max-width: none;
    max-height: 240px;
  }
  .modal__panel {
    flex: 1 1 auto;
    max-width: none;
    padding: var(--space-8) var(--space-6) var(--space-10);
  }
  .modal__close {
    top: var(--space-4);
    right: var(--space-4);
  }
  .modal__header { padding-right: 3rem; }
  .modal__name { font-size: 2rem; }   /* 32px */
}
