/*
 * Donation page (product "donation"). Loaded only there, by
 * tergar_enqueue_donation_styles() in functions.php.
 *
 * Colours match the site header: gold buttons, near-black text.
 */

.tergar-donation {
    --donation-gold: #e39f24;
    --donation-gold-dark: #c7861a;
    --donation-line: #e2ddd3;
    --donation-muted: #636363;
}

/* ---- Layout ---------------------------------------------------------- */

.tergar-donation main .wp-block-columns {
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: flex-start;
}

/* The template fixes the image column at 512px, which squeezes the form
   on narrower screens. Split the two evenly instead (phones still stack). */
@media (min-width: 782px) {
    .tergar-donation main .wp-block-columns > .wp-block-column {
        flex: 1 1 0 !important;
        min-width: 0;
    }
}

/* The story column (where a product photo would normally be) */
.donation-story {
    font-size: 1.05rem;
    line-height: 1.7;
    padding-top: 0.5rem;
}

.donation-story p:first-child {
    font-family: "Source Serif Pro", serif;
    font-size: 1.45rem;
    line-height: 1.45;
    margin-top: 0;
}

.donation-story ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.donation-story li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.donation-story li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--donation-gold);
}

/* ---- Form card ------------------------------------------------------- */

.tergar-donation .wp-block-post-title {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.tergar-donation form.cart {
    display: block !important;
    background: #fff;
    border: 1px solid var(--donation-line);
    border-radius: 12px;
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.donation-field {
    border: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    min-width: 0;
}

.donation-field legend,
.donation-field > label {
    display: block;
    padding: 0;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
}

.donation-field .optional {
    font-weight: 400;
    color: var(--donation-muted);
}

.donation-sublabel {
    display: block;
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--donation-muted);
}

.donation-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--donation-muted);
}

/* Preset amounts */
.donation-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.donation-preset-btn {
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7rem 0.5rem;
    white-space: nowrap;
    border: 1px solid var(--donation-line);
    border-radius: 6px;
    background: #fff;
    color: #111;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.donation-preset-btn:hover {
    border-color: var(--donation-gold);
}

.donation-preset-btn.selected {
    background: var(--donation-gold);
    border-color: var(--donation-gold);
    color: #fff;
}

/* Inputs */
.amount-input-wrapper {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--donation-muted);
    font-weight: 600;
    pointer-events: none;
}

#donation_amount,
#donation_purpose,
#donation_note {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 1rem;
    color: #111;
    background: #fff;
    border: 1px solid var(--donation-line);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
}

#donation_amount {
    padding-left: 2rem;
    font-weight: 600;
}

#donation_note {
    resize: vertical;
}

#donation_amount:focus,
#donation_purpose:focus,
#donation_note:focus,
.donation-preset-btn:focus-visible {
    outline: 2px solid var(--donation-gold);
    outline-offset: 1px;
    border-color: var(--donation-gold);
}

/* Donate button, matching the header's "Support our Mission" */
.tergar-donation .single_add_to_cart_button {
    display: block;
    width: 100%;
    margin: 0.5rem 0 0 !important;
    padding: 0.95rem 1rem !important;
    font-size: 1.05rem !important;
    font-weight: 600;
    background: var(--donation-gold) !important;
    color: #fff !important;
    border: 0;
    border-radius: 6px;
}

.tergar-donation .single_add_to_cart_button:hover {
    background: var(--donation-gold-dark) !important;
}

/* Shop leftovers: quantity box, and the skip-cart plugin's "Checkout"
   link, which would add the donation without the chosen amount or cause */
.tergar-donation form.cart .quantity,
.tergar-donation .ascdcw-checkout-button {
    display: none !important;
}

/* Monthly giving, under the card */
.donation-monthly {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--donation-muted);
}

.donation-monthly a {
    color: #111;
    font-weight: 600;
    text-decoration-color: var(--donation-gold);
    text-underline-offset: 3px;
    white-space: nowrap;
}

/* ---- Phones ---------------------------------------------------------- */

/* Columns stack below 782px; put the form first, the story after */
@media (max-width: 781px) {
    .tergar-donation main .wp-block-columns > .wp-block-column:last-child {
        order: -1;
    }
}
