/* Donation-specific styles only (generic input styles moved to site.css) */

.donation-card{
    max-width: 520px; /* allow a bit wider card */
    min-width: 320px;
    background-color: white;
    margin: 3% auto 1% auto;
    /* remove absolute positioning to allow normal flow */
    border-radius: 10px;
    padding: 1.75rem 2rem; /* more vertical and horizontal padding */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    align-items:center;
    box-sizing: border-box;
}

/* Hero image container to hold the image and overlay label */
.donation-hero{
    position: relative;
    text-align: center;
    max-width: 100%;
}

.donation-hero-img{
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    max-width: 1100px; /* make the hero image larger */
}

/* Position the label centered over the hero image */
.donation-hero .donation-card{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: rgba(255,255,255,0.95);
    z-index: 2; /* ensure it sits above the image */
    /* allow card to scale a bit on narrower screens */
    width: min(88%, 520px);
}
.donation-title{
    text-align:center;
    font-family: Open Sans,'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
.paymentButton{
    width: 76%;
    margin-left: 10%;
}

/* Shared base for amount buttons */
.amount-btn,
.other-btn {
    margin: 1%;
    border-radius: 3px;
    border: 1px solid #B2D2CC;
    text-align: center;
    vertical-align: central;
    background: #EDF5F4;
    cursor: pointer;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Specific sizing for standard amount buttons */
.amount-btn {
    width: 80px;
    height: 57px;
}

/* Other amount button spans wider */
.other-btn {
    width: calc(100% - 2%);
    line-height: 35px;
    margin-bottom: 5%;
    height: 37px;
}

/* Selected modifier */
.selected {
    background: #198754;
    color: white;
}

.amount-text{
    font-family: Open Sans, 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    text-align: center;
    vertical-align: middle;
}

.textBoxAlign{
    width: 100%;
    margin-top: 0.75rem;
}

/* Responsive tweaks specific to donation component */
@media (max-width: 576px) {
    .donation-card {
        max-width: 320px;
        margin-top: 4%;
        padding: 1rem 1rem;
    }
    .donation-hero-img{
        max-width: 100%;
    }
}

/* Overrides to reduce overall vertical footprint so footer stays visible */
.donation-hero{
    overflow: hidden;
    max-height: 460px; /* cap container height */
}
.donation-hero-img{
    max-width: 1200px;
    max-height: 460px;
    object-fit: cover;
}
.donation-hero .donation-card{
    top: 48%; /* slightly lift card so it doesn't stick out of image */
}
.donation-card{
    margin: 1% auto 0.5% auto; /* reduce vertical margins */
    padding: 1.5rem 1.75rem; /* slightly reduce padding */
}
.sub-form-mt{
    margin-top: 0.9rem;
    margin-bottom: 0.6rem;
}

/* Ensure the donation form uses two columns on small+ screens even if other styles interfere */
@media (min-width: 576px) {
    #divDonationForm .row.g-3 {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }
    #divDonationForm .col-sm-6 {
        flex: 0 0 calc(50% - 0.375rem);
        max-width: calc(50% - 0.375rem);
    }
    /* keep full-width rows (buttons) spanning 100% */
    #divDonationForm .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Scoped overrides to prevent global CSS from breaking the donation form layout */
#divDonationForm .col-sm-6 {
  -ms-flex: 0 0 50% !important;
  flex: 0 0 50% !important;
  max-width: 50% !important;
}
#divDonationForm .col-12 {
  -ms-flex: 0 0 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
}
#divDonationForm .form-group {
  margin-bottom: 1rem;
  display: block !important;
}
#divDonationForm .textBoxAlign {
  text-align: left !important;
}
#divDonationForm .form-control {
  width: 100% !important;
  box-sizing: border-box !important;
}
#divDonationForm .col-6.text-end,
#divDonationForm .col-6.text-start {
  -ms-flex: 0 0 50% !important;
  flex: 0 0 50% !important;
  max-width: 50% !important;
}
#dvConfirmationResponse {
  padding: 30px !important;
}

/* Defensive: ensure controls fill their column but don't force a new row */
#divDonationForm .form-control {
    width: 100%;
    box-sizing: border-box;
}

/* Reduce big confirmation padding which can push content vertically */
#dvConfirmationResponse {
    padding: 24px !important;
}

/* Reset textBoxAlign inside donation form so it doesn't force full-width columns */
#divDonationForm .textBoxAlign {
    width: auto !important;
    margin-top: 0.5rem;
}

/* If any global rule forces display:block on .form-group, ensure column container can shrink */
#divDonationForm .form-group {
    display: block;
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
  /* stack on extra-small screens */
  #divDonationForm .col-sm-6 {
    -ms-flex: 0 0 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ======================================================================
     Strong, scoped enforcement for the donation form layout
     This block ensures the exact two-per-row pairing requested by the UX
     - Uses high-specificity selectors scoped to #divDonationForm
     - Uses flexbox to avoid interference from other global rules
     - Keeps responsive stacking for very small screens
     ====================================================================== */
#divDonationForm .row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
}

/* two-up columns (50% width) used for paired inputs */
#divDonationForm .row > .col-12.col-sm-6,
#divDonationForm .row > .col-6.text-start,
#divDonationForm .row > .col-6.text-end {
    -ms-flex: 0 0 50% !important;
    flex: 0 0 calc(50% - 0.5rem) !important;
    max-width: calc(50% - 0.5rem) !important;
    width: calc(50% - 0.5rem) !important;
    box-sizing: border-box !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

/* keep true full-width rows (address, notes, buttons container) */
#divDonationForm .row > .col-12 {
    -ms-flex: 0 0 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* ensure any .w-100 wrapper inside uses full width */
#divDonationForm .w-100 {
    width: 100% !important;
}

@media (max-width: 575.98px) {
    /* mobile: force stacking for two-up columns */
    #divDonationForm .row > .col-12.col-sm-6,
    #divDonationForm .row > .col-6.text-start,
    #divDonationForm .row > .col-6.text-end {
        -ms-flex: 0 0 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Mobile (phone) UX improvements: make hero just large enough to hold the card */
@media (max-width: 575.98px) {
    /* approximate card height for small phones; this keeps the image from oversizing */
    :root {
        /* smaller default to avoid covering too much of small phone screens */
        --donation-card-height: 280px; /* adjust if card content grows */
    }

    /* cap the visible hero area to avoid >~48vh on very short phones */
    .donation-hero {
        min-height: calc(min(var(--donation-card-height), 48vh) + 1.5rem) !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    .donation-hero-img {
        width: 100% !important;
        height: min(var(--donation-card-height), 48vh) !important; /* cap height */
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    /* keep the donation card overlayed and centered */
    .donation-hero .donation-card {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    width: 92% !important;
    max-width: 420px !important; /* smaller max so card fits on phones */
    padding: 1rem 0.85rem !important; /* slightly reduced padding */
        border-radius: 8px !important;
        background: rgba(255,255,255,0.98) !important;
        z-index: 5 !important;
    }

    .donation-title {
    font-size: 26px !important;
        line-height: 1.15 !important;
    }

    /* slightly larger touch targets for amount buttons */
    .amount-btn {
    width: 60px !important; /* smaller so more fit on one row inside the card */
    height: 44px !important;
    font-size: 0.95rem !important;
    }

    .other-btn {
    width: 86% !important;
    height: 40px !important;
    margin-bottom: 6% !important;
        line-height: 1.8 !important;
    }

    /* center the Other Amount control and tighten amount-btn spacing inside the card */
    .donation-card .other-btn {
        display: block !important;
        margin: 0.5rem auto !important; /* center */
        text-align: center !important;
    }

    .donation-card .amount-btn {
        margin: 0.25rem !important; /* reduce left offset applied inline */
    }

    /* make form controls easier to tap */
    #divDonationForm .form-control {
        padding: 0.6rem 0.75rem !important;
        font-size: 1.05rem !important;
    }

    /* increase spacing around the sub form so it doesn't feel comfortable */
    .sub-form-mt {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Ensure bottom payment buttons center and are easier to tap on phones */
    #divDonationForm .row > .col-6.text-end,
    #divDonationForm .row > .col-6.text-start {
        text-align: center !important;
        -ms-flex: 0 0 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    #divDonationForm .row > .col-6.text-end .btn,
    #divDonationForm .row > .col-6.text-start .btn {
        width: 86% !important;
        display: block !important;
        margin: 0.5rem auto !important; /* center the buttons */
        padding: 0.6rem 0.75rem !important;
        font-size: 1rem !important;
    }
}

/* Tablets: overlay the donation card on the hero for tablet sizes (576px - 992px)
    keep mobile (<576px) rules separate so the mobile height cap applies */
@media (min-width: 576px) and (max-width: 991.98px) {
    /* Force all paired columns to full width (one element per row) */
    #divDonationForm .row > .col-12.col-sm-6,
    #divDonationForm .row > .col-6.text-start,
    #divDonationForm .row > .col-6.text-end,
    #divDonationForm .row > .col-sm-6 {
        -ms-flex: 0 0 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Make hero taller so the overlayed card fits comfortably */
    .donation-hero {
        min-height: 65vh !important;
        max-height: none !important;
        overflow: hidden !important;
    }

    .donation-hero-img {
        width: 100% !important;
        /* prevent extremely tall hero on narrow-but-tall devices (e.g., phones in landscape)
           use clamp: minimum is the mobile card height, preferred is 65vh, maximum is 520px */
        height: clamp(var(--donation-card-height, 280px), 65vh, 520px) !important;
        max-height: 520px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    /* Overlay the donation card centered over the image */
    .donation-hero .donation-card {
        position: absolute !important;
        z-index: 5 !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 92% !important;
        max-width: 720px !important;
        padding: 1.25rem 1rem !important;
        border-radius: 8px !important;
        background: rgba(255,255,255,0.98) !important;
        box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
    }

    .donation-title {
        font-size: 26px !important;
    }

    /* Buttons at the bottom should be stacked, full-width, and touch-friendly */
    #divDonationForm .row > .col-6.text-end,
    #divDonationForm .row > .col-6.text-start {
        -ms-flex: 0 0 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #divDonationForm .row > .col-6.text-end .btn,
    #divDonationForm .row > .col-6.text-start .btn {
        width: 100% !important;
        display: block !important;
        margin-top: 0.5rem !important;
        padding: 0.65rem 0.75rem !important;
        font-size: 1rem !important;
    }

    /* Small reductions to vertical spacing so footer stays visible */
    .sub-form-mt {
        margin-bottom: 0.6rem !important;
    }

    #dvConfirmationResponse {
        padding: 18px !important;
    }
}

