/* The original homepage search treatment, scoped to the shared form on this page. */
.home-hero .calculator-search {
    --search-results-gap: 1.5rem;
    width: min(calc(100% - 1rem), 860px);
    margin: 2rem auto 0;
}

.home-hero .calculator-search__form {
    padding: .5rem;
    gap: .75rem;
    border-color: #bbefcf;
    border-radius: 999px;
    box-shadow: 0 0 0 12px rgb(187 247 208 / 35%), 0 18px 40px rgb(34 197 94 / 12%);
}

.home-hero .calculator-search__icon {
    margin-inline-start: .8rem;
}

.home-hero .calculator-search__form input {
    border-radius: 2rem;
}

.home-hero .calculator-search__form button {
    min-height: 60px;
    min-width: 7rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #bbf7d0, #86efac);
    color: #14532d;
}

.home-hero .calculator-search__form button:hover {
    background: #86efac;
}

.home-hero .hero__description {
    margin: 1.375rem auto 0;
}

.home-hero .quick-links {
    justify-content: center;
    margin-top: 1.5rem;
}

.home-content-layout {
    --home-border: #dce5e4;
    --home-muted: #475569;
    --home-link: #14623d;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    width: min(calc(100% - 2rem), 1120px);
    margin: 1rem auto 3rem;
}

.home-content-layout > [id] {
    scroll-margin-top: 5rem;
}

.home-content-layout h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.375rem, 2vw, 1.625rem);
    line-height: 1.2;
}

.home-section-header {
    margin-bottom: .85rem;
}

.home-section-header p {
    margin: .35rem 0 0;
}

.home-section-header .eyebrow {
    margin: 0 0 .4rem;
}

.home-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.home-directory-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    font-weight: 650;
}

.home-content-layout :is(.home-directory-link, .home-guide a) {
    color: var(--home-link);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.home-content-layout :is(a, summary):focus-visible {
    outline: 2px solid var(--home-link);
    outline-offset: 3px;
}

.home-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .5rem;
}

.home-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: .1rem .55rem;
    min-height: 44px;
    padding: .55rem .65rem;
    border: 1px solid var(--home-border);
    border-radius: .5rem;
    background: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.home-card:hover {
    border-color: var(--category-color);
}

.home-card__icon {
    grid-row: 1 / -1;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .55rem;
    background: color-mix(in srgb, var(--category-color) 8%, #fff);
    color: var(--category-color);
}

.home-card__icon svg {
    width: 1rem;
    height: 1rem;
}

.home-card__title,
.home-card__description,
.home-card__category {
    display: block;
    line-height: 1.4;
}

.home-card__title {
    color: #172033;
    font-weight: 700;
}

.home-card__description {
    color: var(--home-muted);
    font-size: .875rem;
}

.home-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    column-gap: 1rem;
}

.home-selection-link {
    display: block;
    min-height: 44px;
    padding: .45rem .25rem;
    border-top: 1px solid var(--home-border);
    overflow-wrap: anywhere;
}

.home-selection-link:hover .home-card__title {
    text-decoration: underline;
    text-underline-offset: .15em;
}

.home-card__category {
    margin-bottom: .15rem;
    color: var(--category-color);
    font-size: .8125rem;
    font-weight: 650;
}

.home-shortcuts {
    padding: .75rem .875rem;
    border: 1px solid var(--home-border);
    border-radius: .5rem;
    background: #fff;
}

.home-shortcuts h2 {
    margin-bottom: .6rem;
    font-size: 1.125rem;
}

.home-shortcuts__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 44px;
    padding: .45rem .125rem;
    border-top: 1px solid var(--home-border);
    color: var(--home-link);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.home-shortcuts__link:hover {
    background: #f5f8f6;
}

.home-shortcuts__link > span:first-child {
    text-decoration: underline;
    text-underline-offset: .15em;
}

.home-guide > :is(p, ul) {
    max-width: 72ch;
}

.home-guide {
    padding-top: 1.25rem;
    border-top: 1px solid var(--home-border);
    line-height: 1.6;
}

.home-guide h3 {
    margin: 1.25rem 0 .5rem;
    font-size: 1.125rem;
    line-height: 1.35;
}

.home-guide p,
.home-guide ul {
    margin: .65rem 0;
}

.home-guide ul {
    padding-inline-start: 1.3rem;
}

.home-guide li + li {
    margin-top: .5rem;
}

@media (max-width: 720px) {
    .home-hero {
        text-align: center;
    }

    .home-hero .calculator-search {
        --search-results-gap: 1.125rem;
        margin-top: 1.125rem;
    }

    .home-hero .calculator-search__form {
        gap: .3rem;
        padding: .3rem;
        box-shadow: 0 0 0 7px rgb(187 247 208 / 40%);
    }

    .home-hero .calculator-search__icon {
        margin-inline-start: .45rem;
    }

    .home-hero .calculator-search__form button {
        min-width: auto;
        min-height: 44px;
    }

    .home-hero .hero__description {
        margin-top: 1rem;
    }

    .home-hero .quick-links {
        margin-top: .875rem;
    }
}

@media (min-width: 960px) {
    .home-hero h1 {
        max-width: none;
        font-size: 4.1rem;
    }

    .home-content-layout {
        grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 286px);
        grid-template-areas:
            "categories shortcuts"
            "selection shortcuts"
            "guide shortcuts";
        column-gap: 1.5rem;
    }

    .home-categories { grid-area: categories; }
    .home-selection { grid-area: selection; }
    .home-shortcuts {
        grid-area: shortcuts;
        position: sticky;
        margin-top: 6rem;
        top: calc(70px + 1rem);
        max-height: calc(100dvh - 70px - 2rem);
        overflow: auto;
        scroll-padding: .5rem;
        scrollbar-gutter: stable;
    }
    .home-guide { grid-area: guide; }
}
