:root {
    --gg-purple: #782ee8;
    --gg-purple-dark: #6020c8;
    --gg-purple-soft: #f3ebff;
    --gg-ink: #171719;
    --gg-muted: #656575;
    --gg-line: #e3e3eb;
    --gg-surface: #ffffff;
    --gg-page: #f4f1f8;
}

.gg-directory,
.gg-directory * {
    box-sizing: border-box;
}

.gg-directory {
    position: relative;
    width: 100vw;
    max-width: none;
    margin: 0 calc(50% - 50vw) !important;
    overflow-x: clip;
    color: var(--gg-ink);
    background: var(--gg-page);
    font-family: "DM Sans", Arial, sans-serif;
}

/*
 * Astra normally reserves part of .ast-container for a sidebar. The directory
 * uses its own centered .gg-container, so reset only this page's outer Astra
 * shell and allow the banner/background to span the viewport.
 */
body.gg-resource-directory-page #content.site-content {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

body.gg-resource-directory-page #content > .ast-container,
body.gg-resource-directory-page .site-content > .ast-container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.gg-resource-directory-page #secondary {
    display: none !important;
}

body.gg-resource-directory-page #primary.gg-directory,
body.page-template-archive-resource #primary,
body.page-template-archive-resource-php #primary,
body.post-type-archive-resource #primary {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
}

body.gg-resource-directory-page .widget-area.secondary {
    display: none !important;
}

.gg-container {
    width: min(1200px, calc(100% - 48px));
    margin-inline: auto;
}

.gg-directory__hero {
    position: relative;
    display: grid;
    min-height: 270px;
    place-items: center;
    padding: 38px 20px;
    color: #fff;
    text-align: center;
    background-color: #1b1118;
    background-image:
        linear-gradient(rgba(14, 8, 13, .34), rgba(14, 8, 13, .34)),
        url("../images/resource-directory-hero.jpg");
    background-position: center 48%;
    background-repeat: no-repeat;
    background-size: cover;
}

.gg-directory__hero-title {
    width: min(720px, calc(100% - 40px));
    padding: 14px 28px 16px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .58);
}

.gg-directory__hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 3.8vw, 54px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .025em;
    white-space: nowrap;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .38);
}

.gg-directory__content {
    padding: 32px 0 64px;
}

.gg-directory__form {
    margin: 0;
}

.gg-search {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: 64px;
    border: 1px solid var(--gg-line);
    border-radius: 20px;
    background: var(--gg-surface);
    box-shadow: 0 8px 30px rgba(29, 24, 50, .04);
}

.gg-search svg {
    width: 23px;
    margin-left: 22px;
    fill: none;
    stroke: var(--gg-muted);
    stroke-linecap: round;
    stroke-width: 1.7;
}

.gg-search input {
    flex: 1;
    min-width: 0;
    height: 58px;
    padding: 0 18px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--gg-ink);
    font: inherit;
    font-size: 16px;
}

.gg-search button {
    align-self: stretch;
    min-width: 130px;
    border: 0;
    background: var(--gg-purple);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.gg-quick-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 20px 0 30px;
    scrollbar-width: none;
}

.gg-quick-filters::-webkit-scrollbar {
    display: none;
}

.gg-quick-filters a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--gg-line);
    border-radius: 999px;
    background: #fff;
    color: #4f4f5d;
    text-decoration: none;
    transition: .2s ease;
}

.gg-quick-filters a:hover,
.gg-quick-filters a.is-active {
    border-color: var(--gg-purple);
    background: var(--gg-purple);
    color: #fff;
}

.gg-directory__layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.gg-filters {
    position: sticky;
    top: 24px;
    padding: 24px 22px;
    border: 1px solid var(--gg-line);
    border-radius: 14px;
    background: #fff;
}

.gg-filter-checks {
    display: grid;
    gap: 10px;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.gg-filter-checks legend {
    margin-bottom: 10px;
    padding: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.gg-filter-checks label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #555665;
    cursor: pointer;
    font-size: 14px;
}

.gg-filter-checks input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--gg-purple);
}

.gg-filter-group {
    margin-bottom: 20px;
}

.gg-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.gg-filter-group select,
.gg-sort select {
    width: 100%;
    height: 45px;
    padding: 0 38px 0 13px;
    border: 1px solid var(--gg-line);
    border-radius: 8px;
    background-color: #fff;
    color: #565665;
    font: inherit;
}

.gg-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .2s ease, background .2s ease;
}

.gg-button:hover {
    transform: translateY(-1px);
}

.gg-button--primary {
    border: 1px solid var(--gg-purple);
    background: linear-gradient(135deg, var(--gg-purple), var(--gg-purple-dark));
    color: #fff;
}

.gg-button--outline {
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
}

.gg-filters > .gg-button {
    width: 100%;
}

.gg-clear-link {
    display: block;
    margin-top: 17px;
    color: var(--gg-purple);
    font-size: 14px;
    text-align: center;
    text-decoration: none;
}

.gg-results__toolbar {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.gg-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.gg-sort select {
    width: 165px;
}

.gg-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}

.gg-active-filters span {
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--gg-purple-soft);
    color: var(--gg-purple-dark);
    font-size: 13px;
}

.gg-active-filters a {
    margin-left: 5px;
    color: var(--gg-purple);
    font-size: 13px;
}

.gg-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.gg-resource-card {
    position: relative;
    display: flex;
    overflow: hidden;
    min-width: 0;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    padding: 12px;
    border: 1px solid #ddd7e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(49, 31, 74, .07);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.gg-resource-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(180deg, var(--gg-purple), #9a53f3);
    content: "";
    opacity: .9;
    transition: opacity .2s ease, height .2s ease;
}

.gg-resource-card:hover {
    border-color: #cfb3fa;
    box-shadow: 0 12px 28px rgba(64, 35, 105, .09);
    transform: translateY(-2px);
}

.gg-resource-card:hover::before {
    height: 5px;
    opacity: 1;
}

.gg-resource-card__logo {
    display: grid;
    width: 100%;
    height: 42px;
    align-items: center;
    justify-items: center;
    overflow: hidden;
    margin: 0 0 7px;
    border: 0;
    border-radius: 9px;
    background: #fff;
}

.gg-resource-card__logo img {
    display: block;
    width: auto;
    max-width: 72%;
    height: 38px;
    padding: 1px;
    object-fit: contain;
}

.gg-resource-card__logo > span {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 12px;
    background: var(--gg-purple-soft);
    color: var(--gg-purple);
    font-size: 21px;
    font-weight: 800;
}

.gg-resource-card__body {
    flex: 0 1 auto;
    min-width: 0;
}

.gg-resource-card__eyebrow {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    margin: 0 0 4px;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--gg-purple-soft);
    color: var(--gg-purple-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .045em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.gg-resource-card h2 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 42px;
    margin: 0 0 4px;
    font-size: 17px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gg-resource-card h2 a {
    color: var(--gg-ink);
    text-decoration: none;
}

.gg-resource-card__location {
    margin: 0 0 4px;
    color: #55566a;
    font-size: 13px;
    line-height: 1.45;
}

.gg-resource-card__location span {
    margin-right: 6px;
    color: var(--gg-purple);
    font-size: 15px;
    vertical-align: -1px;
}

.gg-resource-card__description {
    display: -webkit-box;
    overflow: hidden;
    min-height: 41px;
    margin: 0;
    color: var(--gg-muted);
    font-size: 14px;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gg-resource-card__footer {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #efedf3;
}

.gg-resource-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
    margin: 0;
}

.gg-resource-card__tags span {
    overflow: hidden;
    max-width: 130px;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--gg-purple-soft);
    color: var(--gg-purple-dark);
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gg-resource-card__button {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid var(--gg-purple);
    border-radius: 999px;
    background: var(--gg-purple);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.gg-resource-card__button:hover {
    background: var(--gg-purple-dark);
    color: #fff;
    box-shadow: 0 5px 12px rgba(96, 32, 200, .24);
    transform: translateY(-1px);
}

.gg-resource-card__button span {
    font-size: 14px;
    font-weight: 500;
}

.gg-pagination {
    margin-top: 34px;
}

.gg-pagination .page-numbers {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gg-pagination a,
.gg-pagination span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--gg-line);
    border-radius: 7px;
    background: #fff;
    color: #525260;
    text-decoration: none;
}

.gg-pagination .current {
    border-color: var(--gg-purple);
    background: var(--gg-purple);
    color: #fff;
}

.gg-directory-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
    margin-top: 58px;
    padding: 36px 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #101012, #242429);
    color: #fff;
}

.gg-directory-cta h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 25px;
}

.gg-directory-cta p {
    max-width: 580px;
    margin: 0;
    color: rgba(255,255,255,.78);
}

.gg-directory-cta__actions {
    display: grid;
    min-width: 270px;
    gap: 10px;
}

.gg-no-results {
    padding: 70px 30px;
    border: 1px solid var(--gg-line);
    border-radius: 14px;
    background: #fff;
    text-align: center;
}

.gg-no-results h2 {
    margin-top: 0;
}

.gg-mobile-filter-button,
.gg-filter-overlay,
.gg-filters__mobile-header {
    display: none;
}

body.gg-filters-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gg-directory__layout {
        display: block;
    }

    .gg-mobile-filter-button {
        display: flex;
        width: 100%;
        min-height: 50px;
        align-items: center;
        justify-content: center;
        gap: 9px;
        margin-bottom: 20px;
        border: 1px solid var(--gg-purple);
        border-radius: 9px;
        background: #fff;
        color: var(--gg-purple);
        font: inherit;
        font-weight: 800;
    }

    .gg-mobile-filter-button span {
        display: grid;
        width: 23px;
        height: 23px;
        place-items: center;
        border-radius: 50%;
        background: var(--gg-purple);
        color: #fff;
        font-size: 12px;
    }

    .gg-filters {
        position: fixed;
        z-index: 10001;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(390px, 90vw);
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        box-shadow: -12px 0 40px rgba(0,0,0,.2);
        transform: translateX(105%);
        transition: transform .25s ease;
    }

    .gg-filters.is-open {
        transform: translateX(0);
    }

    .gg-filter-overlay {
        position: fixed;
        z-index: 10000;
        inset: 0;
        background: rgba(8, 8, 12, .6);
    }

    .gg-filter-overlay.is-open {
        display: block;
    }

    .gg-filters__mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
        font-size: 20px;
    }

    .gg-filters__mobile-header button {
        border: 0;
        background: transparent;
        color: var(--gg-ink);
        cursor: pointer;
        font-size: 32px;
        line-height: 1;
    }
}

@media (max-width: 680px) {
    .gg-container {
        width: min(100% - 28px, 1180px);
    }

    .gg-directory__hero {
        min-height: 205px;
        padding: 28px 14px;
        background-position: center center;
    }

    .gg-directory__hero h1 {
        font-size: clamp(27px, 9vw, 38px);
        white-space: normal;
    }

    .gg-directory__hero-title {
        width: min(440px, calc(100% - 20px));
        padding: 12px 16px 14px;
    }

    .gg-directory__content {
        padding-top: 24px;
    }

    .gg-search {
        min-height: 54px;
        border-radius: 12px;
    }

    .gg-search svg {
        margin-left: 16px;
    }

    .gg-search input {
        height: 52px;
        padding: 0 12px;
        font-size: 14px;
    }

    .gg-search button {
        min-width: 78px;
        font-size: 13px;
    }

    .gg-quick-filters {
        padding: 15px 0 20px;
    }

    .gg-results__toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .gg-sort {
        width: 100%;
        justify-content: space-between;
    }

    .gg-resource-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gg-resource-card {
        min-height: 0;
        padding: 14px;
    }

    .gg-resource-card__logo {
        width: 100%;
        height: 46px;
        margin-bottom: 8px;
    }

    .gg-resource-card__logo img {
        height: 42px;
    }

    .gg-resource-card__location,
    .gg-resource-card__description {
        margin-left: 0;
    }

    .gg-resource-card__footer {
        display: flex;
        flex-wrap: wrap;
    }

    .gg-resource-card__button {
        width: auto;
        margin-left: auto;
        justify-content: center;
    }

    .gg-directory-cta {
        grid-template-columns: 1fr;
        padding: 28px 22px;
        text-align: center;
    }

    .gg-directory-cta__actions {
        min-width: 0;
    }
}
