/* GrantReporting.aspx - page styles. Sizes are in px because Bootstrap 3 sets html { font-size: 10px } site-wide.
   Colors come from the active theme variables
   (css/root-colors/*.css) so every site theme applies. Everything is scoped to .gr-page. */

.gr-page { max-width: 1140px; margin: 0 auto; }
.gr-page *, .gr-page *::before, .gr-page *::after { box-sizing: border-box; }
.gr-page [hidden] { display: none !important; }

/* ---------- breadcrumb ---------- */
.gr-crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0 0 18px;
    font-size: 14.7px;
    color: var(--text, #1a2535);
}

    .gr-crumbs li + li::before {
        content: "\203A";
        margin-right: 6px;
        color: var(--border, #8ba8ae);
    }

    .gr-crumbs a {
        color: var(--green, #266447);
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

/* ---------- intro ---------- */
.gr-intro { text-align: center; margin-bottom: 26px; }

    .gr-intro h2 { margin: 0 0 10px; }

.gr-lede {
    max-width: 62ch;
    margin: 0 auto;
    color: var(--text, #1a2535);
    line-height: 1.6;
}

/* ---------- stats ---------- */
.gr-stats {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 18px;
    overflow: hidden;
    background: var(--green-dark, #113b28);
    color: var(--sand, #f8f7f2);
    box-shadow: 0 14px 40px rgba(15, 61, 72, .12);
}

    .gr-stats li {
        padding: 22px 20px;
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

        .gr-stats li + li { border-left: 1px solid rgba(255, 255, 255, .15); }

.gr-stat-value {
    font-size: clamp(25.6px, 19.2px + 1.4vw, 36.8px);
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.gr-stat-label {
    font-size: 12.8px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .9;
}

/* ---------- toolbar ---------- */
.gr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-bottom: 18px;
}

.gr-search {
    position: relative;
    flex: 1 1 280px;
    min-width: 0;
}

    .gr-search i {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--green, #266447);
        pointer-events: none;
    }

    .gr-search input {
        width: 100%;
        height: 46px;
        padding: 0 16px 0 42px;
        border: 2px solid var(--border, #8ba8ae);
        border-radius: 30px;
        background: #fff;
        color: var(--text, #1a2535);
        font-size: 16px;
    }

.gr-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .gr-sort label {
        margin: 0;
        font-weight: 600;
        color: var(--text, #1a2535);
        white-space: nowrap;
    }

    .gr-sort select {
        height: 46px;
        padding: 0 14px;
        border: 2px solid var(--border, #8ba8ae);
        border-radius: 30px;
        background: #fff;
        color: var(--text, #1a2535);
        font-size: 16px;
    }

    .gr-search input:focus,
    .gr-sort select:focus {
        outline: 3px solid var(--gold, #946F00);
        outline-offset: 1px;
        border-color: var(--green, #266447);
    }

.gr-result-count {
    flex-basis: 100%;
    margin: 0;
    font-size: 14.7px;
    color: var(--text, #1a2535);
}

    .gr-result-count:empty { display: none; }

/* ---------- card grid ---------- */
.gr-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.gr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border, #8ba8ae);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 10px 30px rgba(15, 61, 72, .06);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    min-width: 0;
}


    .gr-card:hover,
    .gr-card:focus-within {
        border-color: var(--green, #266447);
        box-shadow: 0 16px 36px rgba(15, 61, 72, .14);
    }

    .gr-card:hover { transform: translateY(-2px); }

.gr-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gr-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 30px;
    background: var(--gray-light, #eef3f4);
    color: var(--green-dark, #113b28);
}

    .gr-status i { font-size: 8px; }
    .gr-status--active i { color: var(--green-light, #42946e); }
    .gr-status--reporting i { color: var(--gold, #946F00); }

.gr-amount {
    font-size: 21.6px;
    font-weight: 800;
    color: var(--green-dark, #113b28);
    font-variant-numeric: tabular-nums;
}

.gr-page .gr-title {
    font-weight: 700;
    font-size: 18.4px;
    line-height: 1.3;
    margin: 2px 0 0;
    text-align: left;
    overflow-wrap: anywhere;
}

    .gr-title a {
        color: var(--green-dark, #113b28);
        text-decoration: none;
    }

        /* Stretch the title link over the whole card so any click opens the grant (no script needed). */
        .gr-title a::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 18px;
        }

        .gr-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

        .gr-title a:focus-visible {
            outline: 3px solid var(--gold, #946F00);
            outline-offset: 3px;
            border-radius: 4px;
        }

.gr-grantor {
    margin: 0;
    color: var(--text, #1a2535);
    font-size: 15.2px;
}

    .gr-grantor i,
    .gr-dates i {
        margin-right: 8px;
        color: var(--green, #266447);
    }

.gr-period {
    margin-top: auto;
    padding-top: 6px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    font-size: 14.1px;
    color: var(--text, #1a2535);
}

.gr-dates { grid-column: 1 / -1; }

.gr-bar {
    height: 8px;
    align-self: center;
    border-radius: 20px;
    background: var(--gray-light, #eef3f4);
    overflow: hidden;
}

    .gr-bar > span {
        display: block;
        height: 100%;
        border-radius: 20px;
        background: linear-gradient(90deg, var(--green, #266447), var(--green-light, #42946e));
    }

.gr-period-note {
    white-space: nowrap;
    font-weight: 600;
}

.gr-page .gr-more {
    position: relative;
    z-index: 1;
    display: block;
    text-decoration: none;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-light, #eef3f4);
    color: var(--green, #266447);
    font-weight: 700;
    font-size: 15.2px;
}

    .gr-page .gr-more:hover { text-decoration: underline; text-underline-offset: 3px; }
    .gr-more i { margin-left: 6px; transition: transform .15s ease; }
    .gr-card:hover .gr-more i { transform: translateX(3px); }

/* ---------- empty / no match ---------- */
.gr-nomatch,
.gr-empty {
    text-align: center;
    padding: 32px 24px;
    border-radius: 18px;
    background: var(--gray-light, #eef3f4);
    color: var(--text, #1a2535);
    margin: 0;
}

    .gr-empty > i {
        font-size: 38.4px;
        color: var(--green, #266447);
        margin-bottom: 10px;
    }

    .gr-empty h3 { margin: 0 0 8px; }
    .gr-empty p { margin: 0; }

/* ---------- back link ---------- */
.gr-back { text-align: center; margin: 32px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .gr-stats { grid-template-columns: minmax(0, 1fr); }
        .gr-stats li + li { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .15); }
        .gr-stats li { padding: 14px 18px; flex-direction: row; justify-content: space-between; align-items: baseline; }
    .gr-grid { grid-template-columns: minmax(0, 1fr); }
    .gr-sort { flex: 1 1 100%; }
        .gr-sort select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .gr-card, .gr-more i { transition: none; }
    .gr-card:hover { transform: none; }
}

@media print {
    .gr-crumbs, .gr-toolbar, .gr-back, .gr-more { display: none !important; }
    .gr-stats { background: none; color: #000; box-shadow: none; border: 1px solid #999; }
    .gr-card { box-shadow: none; break-inside: avoid; }
}
