/* Public fundraiser page. */

.gfpro-p2p-fundraiser {
  max-width: 46rem;
  margin: 0 auto;
}

.gfpro-p2p-fundraiser__image {
  margin: 0 0 1.5rem;
}

.gfpro-p2p-fundraiser__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.gfpro-p2p-fundraiser__title {
  margin: 0 0 0.5rem;
}

.gfpro-p2p-fundraiser__byline,
.gfpro-p2p-fundraiser__parent {
  margin: 0 0 0.25rem;
  color: var(--wp--preset--color--foreground-2, #4b5563);
}

.gfpro-p2p-fundraiser__progress {
  margin: 1.5rem 0;
}

.gfpro-p2p-fundraiser__bar {
  height: 0.5rem;
  background: var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 999px;
  overflow: hidden;
}

.gfpro-p2p-fundraiser__bar span {
  display: block;
  height: 100%;
  background: var(--wp--preset--color--accent, #2563eb);
}

.gfpro-p2p-fundraiser__figures {
  margin: 0.75rem 0 0;
}

.gfpro-p2p-fundraiser__metric {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
}

.gfpro-p2p-fundraiser__story {
  margin: 1.5rem 0;
}

.gfpro-p2p-fundraiser__notice {
  padding: 1rem;
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 0.5rem;
  background: var(--wp--preset--color--accent-5, #f9fafb);
}

.gfpro-p2p-fundraiser__closed {
  font-size: 0.875rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
}

.gfpro-p2p-fundraiser__funds {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 1rem;
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 0.75rem;
  background: var(--wp--preset--color--accent-5, #f9fafb);
}

.gfpro-p2p-fundraiser__funds-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background: var(--wp--preset--color--base, #fff);
}

.gfpro-p2p-fundraiser__funds strong {
  display: block;
  line-height: 1.35;
}

.gfpro-p2p-fundraiser__funds p {
  margin: 0.25rem 0 0;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.875rem;
  line-height: 1.55;
}

.gfpro-p2p-fundraiser__share {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 0.75rem;
}

.gfpro-p2p-fundraiser__share-copy strong {
  display: block;
}

.gfpro-p2p-fundraiser__share-copy p {
  margin: 0.2rem 0 0;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.875rem;
}

.gfpro-p2p-fundraiser__share-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.gfpro-p2p-fundraiser__share-control input {
  min-width: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--wp--preset--color--accent-4, #d1d5db);
  border-radius: 0.5rem;
  background: var(--wp--preset--color--accent-5, #f9fafb);
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
}

.gfpro-p2p-fundraiser__share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.gfpro-p2p-fundraiser__share-button:hover {
  background: var(--wp--preset--color--accent-5, #f3f4f6);
}

.gfpro-p2p-fundraiser__share-button:focus-visible,
.gfpro-p2p-fundraiser__share-control input:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.gfpro-p2p-fundraiser__share-icon {
  display: inline-flex;
  line-height: 0;
}

.gfpro-p2p-fundraiser__share-status {
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.8125rem;
}

/* Story media: an authored image or embed must never widen the page. */

.gfpro-p2p-fundraiser__story img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 1rem;
  border-radius: 0.5rem;
}

.gfpro-p2p-fundraiser__story iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 1rem;
  border: 0;
  border-radius: 0.5rem;
}

/* Campaign Fundraisers tab. */

.gfpro-p2p-campaign-tab__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.gfpro-p2p-campaign-tab__item {
  padding: 1rem;
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 0.5rem;
}

.gfpro-p2p-campaign-tab__item a {
  display: block;
  text-decoration: none;
}

.gfpro-p2p-campaign-tab__name {
  display: block;
  font-size: 0.875rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
}

.gfpro-p2p-campaign-tab__title {
  display: block;
  font-weight: 600;
}

.gfpro-p2p-campaign-tab__figures {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.gfpro-p2p-campaign-tab__cta {
  margin-top: 1.5rem;
}

.gfpro-p2p-campaign-tab__button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  background: var(--wp--preset--color--accent, #2563eb);
  color: var(--wp--preset--color--base, #fff);
  text-decoration: none;
}

.gfpro-p2p-consent {
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

/* Donation action follows Core's Donation Button component contract. */

.gfpro-p2p-fundraiser__donation-button {
  margin: 0;
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  overflow: hidden;
  padding: var(--gf-btn-padding, 14px 32px);
  border: var(--gf-btn-border, none);
  border-radius: var(--gf-btn-radius, 8px);
  background-color: var(--gf-btn-bg, #1e1e1e);
  background-image: var(--gf-btn-bg-image, none);
  color: var(--gf-btn-fg, #fff);
  font-family: inherit;
  font-weight: 600;
  line-height: 1.5rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms ease;
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__btn::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(255 255 255 / 12%) 0%, transparent 60%);
  content: '';
  pointer-events: none;
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__btn--hover-lift:hover {
  transform: translateY(-2px);
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__btn:active {
  transform: translateY(0);
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__btn:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.gfpro-p2p-fundraiser__donation-button .giftflow-donation-button__label {
  position: relative;
  z-index: 1;
}

.gfpro-p2p-fundraiser__donate {
  min-height: 48px;
  font-size: 1rem;
}

.gfpro-p2p-fundraiser__donate[aria-disabled='true'] {
  cursor: default;
  opacity: 0.6;
  pointer-events: none;
}

.gfpro-p2p-fundraiser__donate[hidden],
.gfpro-p2p-fundraiser__donate-form[hidden] {
  display: none;
}

.gfpro-p2p-fundraiser__donate-form {
  margin: 1rem 0 0;
}

@media (max-width: 480px) {
  .gfpro-p2p-fundraiser__donation-button,
  .gfpro-p2p-fundraiser__donate {
    width: 100%;
  }

  .gfpro-p2p-fundraiser__share-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .gfpro-p2p-fundraiser__share-button {
    width: 100%;
  }
}

/* Public contribution list, rendered outside the layout wrapper. */

.gfpro-p2p-donors {
  box-sizing: border-box;
  max-width: 46rem;
  margin: 3rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 1rem;
  background: var(--wp--preset--color--base, #fff);
}

.gfpro-p2p-donors__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
}

.gfpro-p2p-donors__eyebrow {
  margin: 0 0 0.25rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gfpro-p2p-donors__title {
  margin: 0;
  text-wrap: balance;
}

.gfpro-p2p-donors__metric {
  max-width: 22rem;
  margin: 0;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: right;
}

.gfpro-p2p-donors__environment {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gfpro-p2p-donors__body {
  position: relative;
  transition: opacity 180ms ease;
}

.gfpro-p2p-donors.is-loading .gfpro-p2p-donors__body {
  opacity: 0.48;
  pointer-events: none;
}

.gfpro-p2p-donors.is-loading .gfpro-p2p-donors__body::after {
  position: absolute;
  top: 1.5rem;
  right: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: '';
  animation: gfpro-p2p-spin 700ms linear infinite;
}

@keyframes gfpro-p2p-spin {
  to {
    transform: rotate(360deg);
  }
}

.gfpro-p2p-donors__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gfpro-p2p-donors__item {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.875rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--wp--preset--color--accent-4, #e5e7eb);
}

.gfpro-p2p-donors__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--wp--preset--color--accent-5, #f3f4f6);
  color: var(--wp--preset--color--foreground, #111827);
  font-size: 0.875rem;
  font-weight: 700;
}

/* A donor avatar fills the same square as the initial, without distortion. */
.gfpro-p2p-donors__avatar--image {
  object-fit: cover;
}

/* An anonymous contribution keeps the row layout: its avatar is a neutral block,
   never a face, an initial or a hash. */
.gfpro-p2p-donors__avatar--skeleton {
  background: var(--wp--preset--color--accent-4, #e5e7eb);
}

.gfpro-p2p-donors__content {
  min-width: 0;
}

.gfpro-p2p-donors__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.gfpro-p2p-donors__name {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.gfpro-p2p-donors__amount {
  flex: none;
  /* An anonymous row has no name, so the amount holds the right edge itself. */
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.gfpro-p2p-donors__message {
  max-width: 62ch;
  margin: 0.625rem 0 0;
  padding: 0;
  border: 0;
  color: inherit;
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.gfpro-p2p-donors__date {
  display: block;
  margin-top: 0.35rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.8125rem;
}

.gfpro-p2p-donors__empty {
  display: grid;
  justify-items: center;
  gap: 0.625rem;
  padding: 2.5rem 1rem 1.5rem;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  text-align: center;
}

.gfpro-p2p-donors__empty p {
  margin: 0;
}

.gfpro-p2p-donors__empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--wp--preset--color--accent-5, #f3f4f6);
  font-size: 1rem;
}

.gfpro-p2p-donors__pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.gfpro-p2p-donors__page {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}

.gfpro-p2p-donors__page--previous {
  justify-self: start;
}

.gfpro-p2p-donors__page--next {
  grid-column: 3;
  justify-self: end;
}

.gfpro-p2p-donors__page-number {
  grid-column: 2;
  color: var(--wp--preset--color--foreground-2, #6b7280);
  font-size: 0.8125rem;
}

.gfpro-p2p-donors__error {
  margin: 1rem 0 0;
  color: #b42318;
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .gfpro-p2p-donors {
    padding: 1.125rem;
    border-radius: 0.75rem;
  }

  .gfpro-p2p-donors__header {
    display: block;
  }

  .gfpro-p2p-donors__metric {
    margin-top: 0.625rem;
    text-align: left;
  }

  .gfpro-p2p-donors__item {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .gfpro-p2p-donors__avatar {
    width: 2.5rem;
    height: 2.5rem;
  }

  .gfpro-p2p-donors__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gfpro-p2p-donors__body {
    transition: none;
  }
}
