/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal--on-top {
  z-index: 310;
}

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

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: backdropIn 0.25s ease;
}

.modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s ease;
}

.modal-body {
  overflow-y: auto;
  padding: 28px 32px 36px;
  flex: 1;
}

.modal-box--article {
  max-width: 720px;
}

.profile-photo {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 24px auto 20px;
  border: 3px solid var(--primary-light);
}

.modal-content h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  margin: 32px 0 14px;
  padding-top: 20px;
  border-top: 2px solid var(--primary-light);
}

.modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin: 22px 0 8px;
}

.modal-content p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 10px;
}

.modal-content strong {
  color: var(--accent-text);
  font-weight: inherit;
}

.modal-content em {
  font-style: italic;
  color: #666;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid var(--primary-light);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.modal-close {
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 22px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: var(--primary);
  color: #fff;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes backdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(16px); }
}

.modal.is-closing {
  display: flex;
}

.modal.is-closing .modal-box {
  animation: modalOut 0.22s ease forwards;
}

.modal.is-closing .modal-backdrop {
  animation: backdropOut 0.22s ease forwards;
}

