/* ===========================
   MODAL OVERLAY
   =========================== */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

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

/* ===========================
   MODAL BOX
   =========================== */
.modal-content {
  background: var(--wp--preset--color--background, #ffffff); /* usa colore tema, fallback bianco */
  color: var(--wp--preset--color--foreground, #333333);      /* colore testo tema */
  max-width: 400px;           /* larghezza massima della modal */
  min-width: 300px;           /* evita modal troppo stretta */
  width: 90%;                 /* larghezza responsive */
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transition: transform 0.25s ease, opacity 0.25s ease; /* animazione apertura */
  transform: translateY(-20px);
  opacity: 0;
}

.custom-modal.is-open .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* ===========================
   CLOSE BUTTON
   =========================== */
.close-modal {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 1.5rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--wp--preset--color--foreground, #333);
}

/* ===========================
   PERSON LAYOUT
   =========================== */
.person-layout {
    display: flex;
    gap: 1rem;
}

.person-photo img,
.person-photo svg {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}

.person-info {
    flex: 1;
}

.person-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.person-link-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    text-decoration: none;
    color: inherit;
}

.person-link-icon svg {
    width: 20px;
    height: 20px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 500px) {

  .modal-content {
    padding: 1rem;
  }

  .person-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .person-photo {
    max-width: 120px;
  }

  .person-info {
    width: 100%;
  }
}
