/**
 * RDAIWM Grant Plugin Styles
 * Minimal structural styles - visual styling inherited from theme
 *
 * @package RDAIWM_Grant_Plugin
 * @author Jordan Hutley
 */

/* ==========================================================================
   Archive Layout
   ========================================================================== */

/* Hero Section (Header + Search) */
.grants-archive-hero {
    background-color: var(--theme-palette-color-6, #e2e3e4);
    padding: 48px 20px;
    margin-bottom: 40px;
}

.grants-archive-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.grants-archive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.grants-archive-header {
    text-align: center;
    margin-bottom: 32px;
}

.grants-archive-title {
    margin: 0 0 12px 0;
}

.grants-archive-subtitle {
    margin: 0;
    opacity: 0.8;
    font-size: 1.05em;
    line-height: 1.5;
}

/* ==========================================================================
   Inline Search
   ========================================================================== */
.grants-search-section {
    max-width: 500px;
    margin: 0 auto;
}

.grants-search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.grants-search-section .grants-search-input,
.grants-search-section .grants-search-btn {
    height: 48px;
    box-sizing: border-box;
    margin: 0;
}

.grants-search-section .grants-search-input {
    flex: 1;
    padding: 0 16px;
    min-width: 0;
}

.grants-search-section .grants-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    cursor: pointer;
    white-space: nowrap;
}

.grants-search-results-info {
    text-align: center;
    margin-top: 12px;
}

.grants-search-results-info .clear-search {
    margin-left: 8px;
}

/* ==========================================================================
   Archive Layout with Left Sidebar
   ========================================================================== */
.grants-archive-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

/* ==========================================================================
   Left Sidebar
   ========================================================================== */
.grants-sidebar {
    position: sticky;
    top: 20px;
}

.grants-sidebar-card {
    padding: 20px;
    background-color: var(--theme-palette-color-8, #ffffff);
    border: 2px solid var(--theme-palette-color-6, #e2e3e4);
    border-radius: 12px;
    margin-bottom: 16px;
}

.grants-sidebar-card:last-child {
    margin-bottom: 0;
}

.grants-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--theme-palette-color-6, #e2e3e4);
    font-size: 1em;
    font-weight: 600;
    color: var(--theme-palette-color-1, #002a59);
}

.grants-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grants-category-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    border-radius: 8px;
    color: var(--theme-palette-color-5, #081e3f);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.grants-category-item a:hover {
    background-color: var(--theme-palette-color-7, #FAFBFC);
}

.grants-category-item.active a {
    background-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--theme-palette-color-2, #377c2b);
}

.grants-category-item.active .category-icon {
    color: var(--theme-palette-color-8, #ffffff);
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-count {
    font-size: 0.75em;
    padding: 2px 8px;
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 50px;
}

.grants-category-item.active .category-count {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile sidebar - hidden on desktop */
.grants-sidebar-mobile {
    display: none;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.grants-main-content {
    min-width: 0;
}

/* Grants List Header */
.grants-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.grants-list-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--theme-palette-color-1, #002a59);
}

/* Search Results Header */
.grants-list-header-left {
    flex: 1;
    min-width: 200px;
}

.grants-list-header-left .grants-list-title {
    margin-bottom: 4px;
}

.grants-search-query {
    margin: 0;
    font-size: 0.95em;
    color: var(--theme-palette-color-5, #081e3f);
    opacity: 0.8;
}

.grants-list-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.grants-clear-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: transparent;
    color: var(--theme-palette-color-1, #002a59);
    border: 2px solid var(--theme-palette-color-6, #e2e3e4);
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.grants-clear-search:hover {
    border-color: var(--theme-palette-color-1, #002a59);
    background-color: var(--theme-palette-color-7, #FAFBFC);
}

.grants-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grants-list .grant-card {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--theme-palette-color-6, #e2e3e4);
}

.grants-list .grant-card:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* ==========================================================================
   Grant Cards - Clean Professional Design
   ========================================================================== */
.grant-card {
    padding: 0;
}

.grant-card-inner {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    padding: 28px;
}

/* Logo */
.grant-card-logo {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grant-card-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.grant-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.grant-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

/* Content */
.grant-card-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Header */
.grant-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.grant-card-header-left {
    flex: 1;
    min-width: 0;
}

.grant-card-header-right {
    flex-shrink: 0;
}

.grant-card-provider {
    display: block;
    font-size: 0.85em;
    margin-bottom: 4px;
    opacity: 0.7;
}

.grant-card-title {
    margin: 0;
    font-size: 1.25em;
    line-height: 1.3;
}

.grant-card-title a {
    text-decoration: none;
}

/* Status Badge */
.grant-status-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Description */
.grant-card-description {
    line-height: 1.6;
}

.grant-card-description p {
    margin: 0;
    opacity: 0.8;
}

/* Meta */
.grant-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding-top: 16px;
}

.grant-meta-item {
    min-width: 100px;
}

.grant-meta-label {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.grant-meta-value {
    font-weight: 600;
    font-size: 0.95em;
}

.grant-funding-value {
    font-size: 1.1em;
}

/* Actions */
.grant-card-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    margin-top: auto;
}

.grant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.grant-btn-primary,
.grant-btn-secondary {
    background-color: var(--theme-palette-color-6, #e2e3e4);
}

.grant-btn svg {
    width: 14px;
    height: 14px;
}

/* No Results */
.grant-no-results {
    text-align: center;
    padding: 80px 20px;
}

.grant-no-results .no-results-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.grant-no-results h3 {
    margin: 0 0 8px 0;
}

.grant-no-results p {
    margin: 0 0 24px 0;
    opacity: 0.7;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.grants-pagination {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--theme-palette-color-6, #e2e3e4);
}

.grants-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.grants-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    color: var(--theme-palette-color-5, #081e3f);
    background-color: var(--theme-palette-color-8, #ffffff);
    border: 2px solid var(--theme-palette-color-6, #e2e3e4);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.grants-pagination .page-numbers:hover {
    border-color: var(--theme-palette-color-1, #002a59);
    background-color: var(--theme-palette-color-7, #FAFBFC);
}

.grants-pagination .page-numbers.current {
    background-color: var(--theme-palette-color-1, #002a59);
    border-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
    font-weight: 600;
}

.grants-pagination .prev,
.grants-pagination .next {
    padding: 0 20px;
    gap: 8px;
    font-weight: 600;
    background-color: var(--theme-palette-color-6, #e2e3e4);
    border-color: var(--theme-palette-color-6, #e2e3e4);
}

.grants-pagination .prev:hover,
.grants-pagination .next:hover {
    background-color: var(--theme-palette-color-1, #002a59);
    border-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
}

.grants-pagination .dots {
    border: none;
    background: transparent;
    min-width: auto;
    padding: 0 8px;
    color: var(--theme-palette-color-5, #081e3f);
    opacity: 0.5;
}

.grants-pagination .dots:hover {
    background: transparent;
    border: none;
}

/* Pagination info text */
.grants-pagination-info {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9em;
    color: var(--theme-palette-color-5, #081e3f);
    opacity: 0.7;
}

/* Responsive pagination */
@media (max-width: 600px) {
    .grants-pagination .nav-links {
        gap: 6px;
    }

    .grants-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9em;
    }

    .grants-pagination .prev,
    .grants-pagination .next {
        padding: 0 14px;
    }
}

/* ==========================================================================
   Facebook Card (Sidebar)
   ========================================================================== */
.grants-facebook-card {
    background-color: #3b5998;
    border: none;
    color: #ffffff;
}

.facebook-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.facebook-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.facebook-card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.facebook-label {
    font-size: 1em;
    font-weight: 600;
    line-height: 1.3;
}

.facebook-subtitle {
    font-size: 0.85em;
    opacity: 0.85;
    line-height: 1.4;
}

.facebook-card-action {
    display: flex;
    align-items: center;
    min-height: 28px;
}

/* Facebook Follow Button (Single Grant Page) */
.single-grant-social a.facebook-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: #1877f2 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 0.9em !important;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.single-grant-social a.facebook-follow-btn:hover {
    background-color: #0d65d9 !important;
    color: #ffffff !important;
}

.single-grant-social .facebook-follow-btn svg {
    flex-shrink: 0;
    fill: #ffffff !important;
}

/* ==========================================================================
   Single Grant Page - Clean Single Column Layout
   ========================================================================== */
.single-grant-wrapper {
    padding: 40px 0;
}

.single-grant-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb */
.single-grant-breadcrumb {
    margin-bottom: 24px;
    font-size: 0.9em;
    opacity: 0.7;
}

.single-grant-breadcrumb a {
    text-decoration: none;
}

.breadcrumb-separator {
    margin: 0 8px;
    opacity: 0.5;
}

/* Hero Section */
.single-grant-hero {
    padding: 32px;
    margin-bottom: 24px;
}

.single-grant-hero-inner {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.single-grant-logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-grant-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.single-grant-title-wrap {
    flex: 1;
    min-width: 0;
}

.single-grant-provider {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.9em;
    opacity: 0.7;
}

.provider-name {
    font-weight: 500;
}

.provider-link {
    display: inline-flex;
    opacity: 0.7;
}

.provider-link:hover {
    opacity: 1;
}

.single-grant-title {
    margin: 0 0 12px 0;
    font-size: 1.75em;
    line-height: 1.3;
}

.single-grant-status {
    margin-top: 8px;
}

/* Quick Info Bar */
.single-grant-quickinfo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 28px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background-color: var(--theme-palette-color-6, #e2e3e4);
}

.quickinfo-items {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.quickinfo-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quickinfo-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

.quickinfo-value {
    font-weight: 600;
}

.quickinfo-funding {
    font-size: 1.1em;
}

.quickinfo-action {
    flex-shrink: 0;
}

/* Main Content */
.single-grant-content {
    margin-bottom: 32px;
}

.grant-section {
    padding: 28px;
    margin-bottom: 20px;
}

.grant-section:last-child {
    margin-bottom: 0;
}

.grant-section-title {
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    font-size: 1.15em;
}

.grant-section-content {
    line-height: 1.7;
}

.grant-section-content p {
    margin: 0 0 16px 0;
}

.grant-section-content p:last-child {
    margin-bottom: 0;
}

/* Benefits List */
.grant-benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.grant-benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.grant-benefits-list li:first-child {
    padding-top: 0;
}

.grant-benefits-list li:last-child {
    padding-bottom: 0;
}

.benefit-icon {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.7;
}

/* Tags Section */
.grant-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.grant-tag,
.grant-keyword {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 0.85em;
    background-color: var(--theme-palette-color-7, #FAFBFC);
    border-radius: 50px;
}

/* Single Grant Apply Now Buttons (Rounded Rectangle Style) */
.single-grant-quickinfo .grant-btn-primary,
.single-grant-cta .grant-btn-primary {
    border-radius: 8px;
    background-color: var(--theme-palette-color-2, #333333);
    color: var(--theme-palette-color-7, #ffffff);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.single-grant-quickinfo .grant-btn-primary:hover,
.single-grant-cta .grant-btn-primary:hover {
    background-color: var(--theme-palette-color-1, #222222);
    color: var(--theme-palette-color-7, #ffffff);
}

/* CTA Section */
.single-grant-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 24px;
    background-color: var(--theme-palette-color-6, #e2e3e4);
    border-radius: 8px;
}

.cta-content {
    flex: 1;
}

.cta-title {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

.cta-text {
    margin: 0;
    opacity: 0.8;
}

.grant-btn-large {
    padding: 14px 28px;
    font-size: 1em;
    flex-shrink: 0;
}

/* Social Section (Share & Follow) */
.single-grant-social {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background-color: var(--theme-palette-color-6, #e2e3e4);
    border-radius: 8px;
    flex-wrap: wrap;
}

.social-share,
.social-follow {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-label {
    font-size: 0.9em;
    opacity: 0.7;
    white-space: nowrap;
}

.grant-share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    background-color: var(--theme-palette-color-7, #FAFBFC);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 1;
}

/* Footer */
.single-grant-footer {
    padding: 20px 0;
    text-align: center;
}

.back-to-grants {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 500;
    background-color: var(--theme-palette-color-6, #e2e3e4);
    border-radius: 50px;
    font-size: 0.95em;
}

.back-to-grants:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .grants-archive-layout {
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }

    .grant-card-inner {
        grid-template-columns: 140px 1fr;
        gap: 24px;
        padding: 24px;
    }

    .grant-card-logo {
        width: 140px;
        height: 140px;
    }

    /* Single Grant */
    .single-grant-logo {
        width: 100px;
        height: 100px;
    }

    .single-grant-title {
        font-size: 1.5em;
    }

    .quickinfo-items {
        gap: 24px;
    }
}

@media (max-width: 900px) {
    .grants-archive-layout {
        grid-template-columns: 1fr;
    }

    .grants-sidebar {
        position: static;
        order: -1;
    }

    /* Hide desktop sidebar elements on mobile */
    .grants-sidebar-desktop,
    .grants-facebook-card {
        display: none;
    }

    /* Show mobile sidebar */
    .grants-sidebar-mobile {
        display: block;
    }

    /* Mobile Filter Button */
    .grants-mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 14px 18px;
        background-color: var(--theme-palette-color-8, #ffffff);
        border: 2px solid var(--theme-palette-color-6, #e2e3e4);
        border-radius: 10px;
        cursor: pointer;
        font-size: 0.95em;
        font-weight: 500;
        color: var(--theme-palette-color-1, #002a59);
        list-style: none;
        transition: border-color 0.2s ease, background-color 0.2s ease;
    }

    .grants-mobile-filter-btn::-webkit-details-marker {
        display: none;
    }

    .grants-mobile-filter-btn:hover,
    .grants-sidebar-mobile[open] .grants-mobile-filter-btn {
        border-color: var(--theme-palette-color-1, #002a59);
        background-color: var(--theme-palette-color-7, #FAFBFC);
    }

    .grants-mobile-filter-btn svg:first-child {
        color: var(--theme-palette-color-2, #377c2b);
    }

    .grants-mobile-filter-btn .chevron-icon {
        margin-left: auto;
        transition: transform 0.2s ease;
    }

    .grants-sidebar-mobile[open] .grants-mobile-filter-btn .chevron-icon {
        transform: rotate(180deg);
    }

    .mobile-filter-active {
        padding: 4px 10px;
        background-color: var(--theme-palette-color-2, #377c2b);
        color: var(--theme-palette-color-8, #ffffff);
        border-radius: 50px;
        font-size: 0.85em;
        font-weight: 600;
    }

    /* Mobile Category List */
    .grants-mobile-category-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px 0;
    }

    .mobile-category-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 14px;
        background-color: var(--theme-palette-color-7, #FAFBFC);
        border: 1px solid var(--theme-palette-color-6, #e2e3e4);
        border-radius: 8px;
        text-decoration: none;
        color: inherit;
        font-size: 0.9em;
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

    .mobile-category-item:hover {
        background-color: var(--theme-palette-color-8, #ffffff);
        border-color: var(--theme-palette-color-1, #002a59);
    }

    .mobile-category-item.active {
        background-color: var(--theme-palette-color-1, #002a59);
        border-color: var(--theme-palette-color-1, #002a59);
        color: var(--theme-palette-color-8, #ffffff);
    }

    .mobile-category-icon {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .mobile-category-icon svg {
        width: 16px;
        height: 16px;
    }

    .mobile-category-name {
        flex: 1;
        font-weight: 500;
    }

    .mobile-category-count {
        font-size: 0.8em;
        opacity: 0.7;
        background-color: rgba(0, 0, 0, 0.08);
        padding: 2px 8px;
        border-radius: 50px;
    }

    .mobile-category-item.active .mobile-category-count {
        background-color: rgba(255, 255, 255, 0.2);
        opacity: 1;
    }

    /* Single Grant */
    .single-grant-quickinfo {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .quickinfo-items {
        justify-content: center;
    }

    .quickinfo-action {
        width: 100%;
    }

    .quickinfo-action .grant-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* Single column on very small screens */
    .grants-mobile-category-list {
        grid-template-columns: 1fr;
    }

    /* Featured grants header stacked on mobile */
    .featured-grants-header {
        flex-direction: column;
        gap: 12px;
    }

    .featured-grants-header-right {
        align-self: flex-start;
    }

    /* Grants list header stacked on mobile */
    .grants-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .grants-list-header-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
    }

    .grants-clear-search {
        order: -1;
    }

    .grants-count-badge {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 768px) {
    .grants-archive-hero {
        padding: 32px 20px;
        margin-bottom: 24px;
    }

    /* Mobile Search Bar Redesign */
    .grants-search-section {
        max-width: 100%;
    }

    .grants-search-form {
        flex-direction: column;
        gap: 12px;
    }

    .grants-search-section .grants-search-input,
    .grants-search-section .grants-search-btn {
        height: auto;
        min-height: 56px;
    }

    .grants-search-section .grants-search-input {
        padding: 16px 20px;
        border: 2px solid var(--theme-palette-color-6, #e2e3e4);
        border-radius: 12px;
        font-size: 1.05em;
        background-color: var(--theme-palette-color-8, #ffffff);
        transition: border-color 0.2s ease;
    }

    .grants-search-section .grants-search-input:focus {
        border-color: var(--theme-palette-color-1, #002a59);
        outline: none;
    }

    .grants-search-section .grants-search-input::placeholder {
        color: var(--theme-palette-color-5, #081e3f);
        opacity: 0.5;
    }

    .grants-search-section .grants-search-btn {
        padding: 16px 24px;
        justify-content: center;
        background-color: var(--theme-palette-color-1, #002a59);
        color: var(--theme-palette-color-8, #ffffff);
        border: none;
        border-radius: 12px;
        font-size: 1.05em;
        font-weight: 600;
        transition: background-color 0.2s ease;
    }

    .grants-search-section .grants-search-btn:hover,
    .grants-search-section .grants-search-btn:active {
        background-color: var(--theme-palette-color-5, #081e3f);
    }

    .grants-search-section .grants-search-btn svg {
        width: 22px;
        height: 22px;
        color: var(--theme-palette-color-8, #ffffff);
    }

    .grant-card-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .grant-card-logo {
        width: 140px;
        height: 140px;
        margin: 0;
        padding: 12px;
        background-color: var(--theme-palette-color-7, #FAFBFC);
        border-radius: 12px;
    }

    .grant-card-logo .grant-logo-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .grant-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .grant-card-meta {
        gap: 20px;
    }

    .grant-card-actions {
        flex-wrap: wrap;
    }

    .grant-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    /* Single Grant */
    .single-grant-wrapper {
        padding: 20px 0;
    }

    .single-grant-hero {
        padding: 20px;
    }

    .single-grant-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .single-grant-logo {
        width: 80px;
        height: 80px;
    }

    .single-grant-title {
        font-size: 1.3em;
    }

    .single-grant-provider {
        justify-content: center;
    }

    .single-grant-quickinfo {
        padding: 16px 20px;
    }

    .quickinfo-items {
        gap: 16px;
    }

    .grant-section {
        padding: 20px;
    }

    .single-grant-cta {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .single-grant-social {
        flex-direction: column;
        text-align: center;
    }

    .social-share,
    .social-follow {
        flex-direction: column;
        gap: 8px;
    }

    .sidebar-follow-content {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .grants-archive-container,
    .single-grant-container {
        padding: 0 16px;
    }

    .grant-card-inner {
        padding: 16px;
    }

    .grant-card-logo {
        max-width: 160px;
        padding: 12px;
    }

    .grant-card-meta {
        gap: 16px;
    }

    .grant-meta-item {
        min-width: 80px;
    }

    /* Single Grant */
    .single-grant-hero,
    .single-grant-quickinfo,
    .grant-section,
    .single-grant-cta {
        padding: 16px;
    }

    .single-grant-title {
        font-size: 1.2em;
    }

    .single-grant-breadcrumb {
        font-size: 0.8em;
    }

    .quickinfo-items {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .quickinfo-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

/* ==========================================================================
   Email Subscription Section
   ========================================================================== */
.grants-subscribe-section {
    background-color: var(--theme-palette-color-6, #e2e3e4);
    border-radius: 8px;
    padding: 32px;
    margin-top: 32px;
    text-align: center;
}

.grants-subscribe-inner {
    max-width: 500px;
    margin: 0 auto;
}

.grants-subscribe-title {
    margin: 0 0 8px 0;
    font-size: 1.3em;
}

.grants-subscribe-text {
    margin: 0 0 20px 0;
    opacity: 0.8;
    font-size: 0.95em;
}

.grants-subscribe-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.grants-subscribe-form input[type="text"],
.grants-subscribe-form input[type="email"] {
    flex: 1;
    min-width: 140px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: var(--theme-palette-color-7, #ffffff);
    box-sizing: border-box;
    font-size: 0.95em;
}

.grants-subscribe-form input[type="text"]:focus,
.grants-subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: var(--theme-palette-color-2, #333333);
}

.grants-subscribe-form .grants-subscribe-btn {
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background-color: var(--theme-palette-color-2, #333333);
    color: var(--theme-palette-color-7, #ffffff);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.grants-subscribe-form .grants-subscribe-btn:hover {
    background-color: var(--theme-palette-color-1, #222222);
}

.grants-subscribe-message {
    display: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.9em;
}

.grants-subscribe-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.grants-subscribe-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Archive page subscribe section */
.grants-archive-subscribe {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--theme-palette-color-6, #e2e3e4);
}

/* ==========================================================================
   Shortcode Wrapper
   ========================================================================== */
.grants-shortcode-wrapper {
    padding: 20px 0;
}

/* ==========================================================================
   Featured Grants Section
   ========================================================================== */
.featured-grants-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--theme-palette-color-6, #e2e3e4);
}

.featured-grants-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.featured-grants-header-left {
    flex: 1;
}

.featured-grants-header-right {
    flex-shrink: 0;
}

.featured-grants-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: var(--theme-palette-color-1, #333333);
}

.featured-grants-title svg {
    color: var(--theme-palette-color-2, #377c2b);
}

.featured-grants-subtitle {
    margin: 0;
    opacity: 0.7;
    font-size: 0.95em;
}

.grants-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
}

.featured-grants-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Featured Grant Card */
.featured-grant-card {
    position: relative;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0f7 100%);
    border: 2px solid var(--theme-palette-color-1, #002a59);
    border-radius: 12px;
    overflow: hidden;
}

.featured-grant-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--theme-palette-color-2, #377c2b);
    color: #ffffff;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    z-index: 1;
}

.featured-grant-badge svg {
    width: 14px;
    height: 14px;
}

.featured-grant-inner {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    padding: 28px;
}

/* Featured Logo */
.featured-grant-logo {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 8px;
}

.featured-grant-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.featured-grant-logo .grant-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.featured-grant-logo .grant-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

/* Featured Content */
.featured-grant-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding-right: 100px; /* Space for the badge */
}

/* Featured Header */
.featured-grant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.featured-grant-header-left {
    flex: 1;
    min-width: 0;
}

.featured-grant-header-right {
    position: absolute;
    top: 52px;
    right: 16px;
}

.featured-grant-provider {
    display: block;
    font-size: 0.85em;
    margin-bottom: 4px;
    opacity: 0.7;
}

.featured-grant-title {
    margin: 0;
    font-size: 1.35em;
    line-height: 1.3;
}

.featured-grant-title a {
    text-decoration: none;
    color: inherit;
}

.featured-grant-title a:hover {
    text-decoration: underline;
}

/* Featured Description */
.featured-grant-description {
    line-height: 1.6;
}

.featured-grant-description p {
    margin: 0;
    opacity: 0.85;
}

/* Featured Meta */
.featured-grant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding-top: 16px;
}

/* Featured Actions */
.featured-grant-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    margin-top: auto;
}

/* Featured Grant Buttons - Better contrast on amber background */
.featured-grant-actions .grant-btn-primary {
    background-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
    border: none;
    transition: background-color 0.2s ease;
}

.featured-grant-actions .grant-btn-primary:hover {
    background-color: var(--theme-palette-color-5, #081e3f);
    color: var(--theme-palette-color-8, #ffffff);
}

.featured-grant-actions .grant-btn-secondary {
    background-color: var(--theme-palette-color-8, #ffffff);
    color: var(--theme-palette-color-1, #002a59);
    border: 2px solid var(--theme-palette-color-1, #002a59);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.featured-grant-actions .grant-btn-secondary:hover {
    background-color: var(--theme-palette-color-1, #002a59);
    color: var(--theme-palette-color-8, #ffffff);
}

.featured-grant-actions .grant-btn-disabled {
    background-color: var(--theme-palette-color-6, #e2e3e4);
    color: var(--theme-palette-color-5, #081e3f);
    border: none;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Responsive Featured Grants */
@media (max-width: 1024px) {
    .featured-grant-inner {
        grid-template-columns: 140px 1fr;
        gap: 24px;
        padding: 24px;
    }

    .featured-grant-logo {
        width: 140px;
        height: 140px;
    }

    .featured-grant-content {
        padding-right: 80px;
    }
}

@media (max-width: 768px) {
    .featured-grants-section {
        margin-bottom: 32px;
        padding-bottom: 32px;
    }

    .featured-grant-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
        padding-top: 80px;
    }

    .featured-grant-badge {
        top: 12px;
        right: 12px;
    }

    .featured-grant-header-right {
        top: 44px;
        right: 12px;
    }

    .featured-grant-logo {
        width: 160px;
        height: 160px;
        margin: 0;
        padding: 14px;
        background-color: rgba(255, 255, 255, 0.6);
        border-radius: 12px;
    }

    .featured-grant-content {
        padding-right: 0;
    }

    .featured-grant-header {
        flex-direction: column;
        gap: 12px;
    }

    .featured-grant-meta {
        gap: 20px;
    }

    .featured-grant-actions {
        flex-wrap: wrap;
    }

    .featured-grant-actions .grant-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .featured-grant-inner {
        padding: 16px;
        padding-top: 80px;
    }

    .featured-grant-header-right {
        top: 42px;
        right: 10px;
    }

    .featured-grant-badge {
        right: 10px;
    }

    .featured-grant-logo {
        width: 140px;
        height: 140px;
        padding: 12px;
    }

    .featured-grant-title {
        font-size: 1.15em;
    }

    .featured-grant-meta {
        gap: 16px;
    }
}

/* ==========================================================================
   Screen Reader Text
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
