/* Skład osobowy — ORCID iD (wytyczne ORCID) + dostępne modale biogramów (WCAG 2.1 AA).
 * Arkusz poza cms-page CSS: position:fixed jest niedozwolone w sanitizerze podstron. */

.elementor-social-icon-orcid,
.elementor-social-icon-orcid:not(:hover),
.elementor-social-icon-orcid:hover,
.elementor-social-icon-orcid:focus,
.elementor-social-icon-orcid:focus-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Bufor ≥ 50% szerokości ikony (24px → 12px) wokół iD icon. */
  padding: 12px;
  line-height: 0;
  text-decoration: none;
  /* Elementor malował zielony kwadrat (#73AF00) pod FA — ikona SVG ma już własne koło. */
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.elementor-social-icon-orcid img,
.elementor-social-icon-orcid:not(:hover) img,
.elementor-social-icon-orcid:hover img {
  display: block;
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  background: transparent !important;
  background-color: transparent !important;
}

.elementor-social-icon-orcid:focus-visible {
  outline: 3px solid #5a00c9;
  outline-offset: 2px;
}

/* Modale: domyślnie ukryte; otwarte przez .uws-bio-open (JS).
 * Close jest rodzeństwem .uael-modal (UAEL) — też musi być schowany. */
.uael-modal-parent-wrapper:not(.uws-bio-open) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

.uael-modal-parent-wrapper .uael-modal,
.uael-modal-parent-wrapper .uael-overlay,
.uael-modal-parent-wrapper .uael-modal-close {
  display: none !important;
}

/* Goła etykieta po wycięciu <button> przez sanitizer — nie w flow treści. */
.uael-modal > .uws-bio-close-label {
  display: none !important;
}

.uael-modal-parent-wrapper.uws-bio-open {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 3vw, 2rem);
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  -webkit-overflow-scrolling: touch;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-overlay {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  background: rgba(17, 17, 17, 0.75) !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 0 !important;
  pointer-events: auto;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal {
  display: block !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  /* Szerzej niż 40rem; dopasowanie do oryginalnych 900px UAEL, z marginesem viewportu. */
  width: min(56.25rem, calc(100vw - 2.5rem)) !important;
  max-width: calc(100vw - 2.5rem) !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  margin: 0 auto 2rem !important;
  padding: 2rem 2.25rem 1.75rem;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 1 !important;
  pointer-events: auto;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal .uael-content {
  /* UAEL ustawia sztywne 900/500/300px — to psuło zawijanie i dawało poziomy suwak. */
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-title-wrap {
  padding-right: 6.5rem !important;
  text-align: left !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.35;
  color: #111;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-text,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-content-data,
.uael-modal-parent-wrapper.uws-bio-open .uael-text-editor,
.uael-modal-parent-wrapper.uws-bio-open .uael-text-editor * {
  max-width: 100% !important;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: normal;
  white-space: normal !important;
  hyphens: auto;
  line-height: 1.55;
  color: #111;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-content .uael-modal-content-data {
  padding: 0 !important;
  overflow: visible !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close.uws-bio-close {
  position: absolute !important;
  top: 0.65rem !important;
  right: 0.65rem !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 5 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0;
  width: auto !important;
  height: auto !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0.45rem 0.85rem !important;
  border: 2px solid #222 !important;
  border-radius: 4px !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #111 !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-indent: 0 !important;
  text-transform: none !important;
  cursor: pointer !important;
  visibility: visible !important;
  opacity: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* UAEL dokłada pusty ::before / ikonę FA — to był biały kwadrat na napisie. */
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close::before,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close::after,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close i,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close svg {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close .uws-bio-close-label {
  display: inline !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  color: inherit !important;
  font: inherit !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close:hover,
.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close:focus-visible {
  background: #f3f3f3 !important;
  color: #111 !important;
}

.uael-modal-parent-wrapper.uws-bio-open .uael-modal-close:focus-visible {
  outline: 3px solid #5a00c9 !important;
  outline-offset: 2px !important;
}

/* ORCID nad imieniem */
.uael-team-member-content .elementor-social-icons-wrapper {
  display: flex;
  justify-content: center;
  margin: 0 0 0.5rem;
}

.uael-team-member-content .uael-team-member-name {
  text-align: center;
}

/* Imię jako przycisk biogramu: outline, hover = odwrócenie. */
.uael-team-member-name a.uael-trigger.uws-bio-name-trigger {
  --uws-bio-btn: var(--ast-global-color-3, #3a3a3a);
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 0.4rem 0.75rem;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--uws-bio-btn) !important;
  border: 2px solid currentColor !important;
  border-radius: 12px;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.uael-team-member-name a.uael-trigger.uws-bio-name-trigger .uael-team-name {
  margin: 0;
  color: inherit !important;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.uael-team-member-name a.uael-trigger.uws-bio-name-trigger:hover,
.uael-team-member-name a.uael-trigger.uws-bio-name-trigger:focus-visible {
  background: var(--uws-bio-btn) !important;
  background-color: var(--uws-bio-btn) !important;
  color: #fff !important;
  border-color: var(--uws-bio-btn) !important;
}

.uael-team-member-name a.uael-trigger.uws-bio-name-trigger:focus-visible {
  outline: 3px solid #5a00c9;
  outline-offset: 2px;
}

body.uws-bio-modal-active {
  overflow: hidden;
}

@media (max-width: 640px) {
  .uael-modal-parent-wrapper.uws-bio-open .uael-modal {
    width: calc(100vw - 1.5rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
    padding: 1.5rem 1.15rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uael-modal-parent-wrapper.uws-bio-open,
  .uael-modal-parent-wrapper.uws-bio-open .uael-modal,
  .uael-modal-parent-wrapper.uws-bio-open .uael-content {
    transition: none !important;
  }
}
