/* ============================================================
   Donate page: the two ways to give, side by side.
   ============================================================ */

.uh-donate {
  --uh-donate-rule: color-mix(in srgb, var(--text-color) 25%, transparent);
  --uh-donate-edge: 42px;
  --uh-donate-pad: clamp(24px, 2.6vw, 48px);
}

/* Three shared rows - heading, dek, control - so both panels line up
   however long each one's text runs. */
.uh-donate-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  margin-left: var(--uh-donate-edge);
  margin-right: var(--uh-donate-edge);
  border: 1px solid var(--uh-donate-rule);
}

.uh-donate-panel {
  display: grid;
  grid-row: 1 / -1;
  grid-template-rows: subgrid;
  min-width: 0;
  padding: var(--uh-donate-pad);
}

.uh-donate-panel + .uh-donate-panel {
  border-left: 1px solid var(--uh-donate-rule);
}

.uh-donate-heading {
  font: var(--t-display-md);
  text-transform: uppercase;
  margin: 0;
}

.uh-donate-dek {
  font: var(--t-dek);
  opacity: var(--t-emph);
  max-width: 42ch;
  margin: clamp(6px, 0.8vw, 12px) 0 clamp(20px, 2.2vw, 36px);
}

/* ---- Card amounts ----------------------------------------- */

/* 1px gaps over the rule colour draw the grid's inner lines. */
.uh-donate-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-self: start;
  background-color: var(--uh-donate-rule);
  border: 1px solid var(--uh-donate-rule);
}

.uh-donate-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 1.5vw, 26px) 6px;
  font: var(--t-display-sm);
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.uh-donate-amount-wide {
  grid-column: 1 / -1;
}

.uh-donate-amount:hover,
.uh-donate-amount:focus-visible {
  color: var(--background-color);
  background-color: var(--text-color);
}

/* ---- Bitcoin form ----------------------------------------- */

.uh-donate-btc {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 1px;
}

.uh-donate-btc-fields {
  display: flex;
  gap: 1px;
}

.uh-donate-price,
.uh-donate-currency {
  font: var(--t-field);
  color: var(--text-color);
  background-color: transparent;
  border: 1px solid var(--uh-donate-rule);
  border-radius: 0;
  padding: clamp(14px, 1.5vw, 26px) clamp(12px, 1.2vw, 18px);
}

.uh-donate-price {
  flex: 1 1 auto;
  min-width: 0;
}

.uh-donate-currency {
  flex: 0 0 auto;
}

.uh-donate-price:focus-visible,
.uh-donate-currency:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: -2px;
}

/* The native menu paints black on black otherwise. */
.uh-donate-currency option {
  color: #000000;
  background-color: #ffffff;
}

.uh-donate-submit {
  padding: clamp(14px, 1.5vw, 26px) 32px;
  text-align: center;
}

/* ---- Notes ------------------------------------------------ */

/* Same two columns and inset as the panels, so each note starts under
   the heading it belongs to. Closer than a section gap: these belong to
   the box above, not to the page. */
.uh-donate-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-left: var(--uh-donate-edge);
  margin-right: var(--uh-donate-edge);
  margin-top: clamp(18px, 1.8vw, 32px);
}

.uh-donate-note {
  font: var(--t-dek);
  opacity: var(--t-emph);
  margin: 0;
  padding-left: var(--uh-donate-pad);
}

.uh-donate-note a {
  color: var(--text-color);
  font-weight: 600;
}

@media (max-width: 991px) {
  .uh-donate {
    --uh-donate-edge: 20px;
  }

  .uh-donate-options {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .uh-donate-panel {
    grid-row: auto;
    grid-template-rows: none;
  }

  .uh-donate-panel + .uh-donate-panel {
    border-left: 0;
    border-top: 1px solid var(--uh-donate-rule);
  }

  .uh-donate-notes {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 479px) {
  .uh-donate-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
