html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #222;
}

:root {
    /* Brand palette (defaults) - update these to match your brand */
    --brand-primary: #35424a;
    --brand-accent: #e8491d;
    /* Donate button color (can be set to the brand's donation accent) */
    --brand-donate: var(--brand-accent);
}

header {
    background: #35424a;
    color: #fff;
    padding: 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

header h1 {
    margin: 0;
    padding: 8px 0 4px 0; /* further reduced vertical padding */
    font-size: 1.9rem;
    letter-spacing: 0.4px;
    font-weight: 700;
}

.site-title {
    background: #2b3a3f;
    color: #fff;
    padding: 8px 0; /* slightly increased to fit larger title */
    text-align: center;
    font-size: 2.4rem; /* enlarged (>= 2x) */
    font-weight: 700;
    line-height: 1;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

nav {
    background: #263238;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

nav li {
    margin: 0;
    padding: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 14px 22px;
    display: block;
    font-size: 1.08rem;
    border-radius: 4px 4px 0 0;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    letter-spacing: 0.5px;
}

nav a:hover, nav a:focus {
    background: #e8491d;
    color: #fff;
}

main {
    /* Make the middle content area flexible and scrollable while keeping header/footer fixed */
    flex: 1 0 auto;
    overflow: auto;
    max-width: 900px;
    margin: 4px auto 0 auto; /* further reduced top margin to minimize gray gap */
    background: #fff;
    padding: 20px 18px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

footer {
    background: var(--brand-primary);
    color: #fff;
    padding: 14px 20px;
    width: 100%;
    font-size: 1rem;
    margin-top: 40px;
    /* Keep footer visible at the bottom. The body is a column flex container; footer naturally sits at the end. */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

footer p {
    margin: 0;
    grid-column: 1 / 2;
    justify-self: start;
}

.donate-btn {
    grid-column: 2 / 3;
    justify-self: center;
    background: var(--brand-donate);
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.18s ease, transform 0.08s ease;
}

.donate-btn:hover, .donate-btn:focus {
    /* fallback color for browsers without color-mix support */
    background: #c63b13;
    background: color-mix(in srgb, var(--brand-donate) 85%, black 15%);
    transform: translateY(-1px);
}

/* Stronger keyboard focus styling for accessibility */
.donate-btn:focus-visible {
    outline: 3px solid rgba(255,255,255,0.95);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(232,73,29,0.18);
}

/* Responsive footer: stack on narrow viewports so donate sits centered below the text */
@media (max-width: 600px) {
    footer {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        text-align: center;
    }

    footer p {
        grid-column: 1 / -1;
        justify-self: center;
        padding-bottom: 8px;
    }

    .donate-btn {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* Page-specific donate banner spacing */
.page-donate-banner {
    display: flex;
    justify-content: center;
    /* space between nav and banner, smaller space below */
    margin: 10px 0 6px 0;
    padding: 4px 0;
}

h1, h2, h3 {
    color: #35424a;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    margin-top: 0;
}

p {
    line-height: 1.7;
    font-size: 1.08rem;
}

/* Contact form styles */
.form-row {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

textarea {
    min-height: 180px; /* larger default message box */
    resize: vertical;
}

button#send-email {
    background: #1e88e5;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

button#send-email:hover {
    background: #166bb0;
}

/* Validation error state */
.input-error {
    border-color: #e74c3c !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.95rem;
    margin-top: 6px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 20px 22px;
    border-radius: 8px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-actions .confirm {
    background: #1e88e5;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
}

.modal-actions .cancel {
    background: transparent;
    border: 1px solid #d0d0d0;
    padding: 8px 12px;
    border-radius: 6px;
}

/* Team grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.team-member {
    text-align: center;
}

.team-member .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* Active state for current page - add 'active' class to nav links where needed */
.nav-active, nav a.active {
    background: #1e88e5;
}