/*
 * Blog search: the search bar on the blog index and the search results page.
 * The theme stylesheet is purged, so these components carry their own styles instead of
 * relying on utility classes that may not exist in the build.
 */

.blog-search {
    --bs-search-primary: var(--bs-primary, #12715B);
    --bs-search-primary-600: var(--bs-primary-600, #0e5a49);
    --bs-search-primary-50: var(--bs-primary-50, #e7f1ef);
    --bs-search-beige: var(--bs-secondary, #f5eee9);
    --bs-search-border: var(--color-gray-50, #ececed);
    --bs-search-muted: var(--color-gray-400, #6a6a70);
    --bs-search-text: var(--color-gray-500, #45454c);
    --bs-search-heading: var(--color-gray-900, #0e0e0f);
}

/* ------------------------------------------------------------------ */
/* Search bar                                                          */
/* ------------------------------------------------------------------ */

.blog-searchbar {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--color-gray-100, #dadadb);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(14, 14, 15, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-searchbar:focus-within {
    border-color: var(--bs-search-primary);
    box-shadow: 0 0 0 4px rgba(18, 113, 91, 0.12), 0 10px 30px rgba(14, 14, 15, 0.06);
}

.blog-searchbar-icon {
    flex: none;
    margin-inline-start: 14px;
    font-size: 20px;
    line-height: 1;
    color: var(--bs-search-muted);
}

.blog-searchbar-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    color: var(--bs-search-heading);
}

.blog-searchbar-input::placeholder {
    color: var(--color-gray-300, #8f8f94);
}

.blog-searchbar-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--bs-search-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.blog-searchbar-button:hover,
.blog-searchbar-button:focus-visible {
    background: var(--bs-search-primary-600);
}

.blog-searchbar-button .unicon-search {
    display: none;
    font-size: 20px;
}

@media (max-width: 575.98px) {
    .blog-searchbar-icon {
        margin-inline-start: 10px;
    }

    .blog-searchbar-button {
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .blog-searchbar-button .unicon-search {
        display: inline-block;
    }

    .blog-searchbar-button-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ------------------------------------------------------------------ */
/* Blog index header                                                   */
/* ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
    .blog-index-header {
        padding-top: 32px;
    }
}

.blog-index-subtitle {
    max-width: 560px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.6;
    color: var(--bs-search-text);
}

/* ------------------------------------------------------------------ */
/* Search results page                                                 */
/* ------------------------------------------------------------------ */

.blog-search-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
}

.blog-search-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    /* The site navigation overlays the top of the page, so the header clears it. */
    padding: 104px 0 32px;
    text-align: center;
}

@media (min-width: 992px) {
    .blog-search-header {
        padding: 128px 0 40px;
    }
}

.blog-search-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--bs-search-muted);
}

.blog-search-breadcrumb a {
    color: var(--bs-search-primary);
    text-decoration: none;
    font-weight: 500;
}

.blog-search-breadcrumb a:hover {
    text-decoration: underline;
}

.blog-search-title {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    color: var(--bs-search-heading);
}

.blog-search-summary {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--bs-search-muted);
}

.blog-search-summary strong {
    color: var(--bs-search-heading);
    font-weight: 600;
}

.blog-search-section {
    padding-bottom: 64px;
}

/* Matching tags */

.blog-search-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--bs-search-border);
}

.blog-search-tags-label {
    margin-inline-end: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-search-muted);
}

.blog-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--bs-search-beige);
    color: var(--bs-search-heading);
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-tag-chip:hover {
    background: var(--bs-search-primary-50);
    color: var(--bs-search-primary);
}

.blog-tag-chip-count {
    font-size: 12px;
    color: var(--bs-search-muted);
}

/* Result cards */

.blog-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-result {
    position: relative;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--bs-search-border);
    border-radius: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-result:hover {
    border-color: var(--bs-primary-100, #d0e3de);
    box-shadow: 0 12px 32px rgba(14, 14, 15, 0.08);
    transform: translateY(-2px);
}

.blog-result-thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bs-search-beige);
}

.blog-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-result-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 32px;
    color: rgba(18, 113, 91, 0.35);
}

.blog-result-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-top: 2px;
}

.blog-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--bs-search-muted);
}

.blog-result-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.blog-result-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.blog-result-title a {
    color: var(--bs-search-heading);
    text-decoration: none;
}

/* The whole card is clickable through the title link. */
.blog-result-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.blog-result:hover .blog-result-title a,
.blog-result-title a:focus-visible {
    color: var(--bs-search-primary);
}

.blog-result-title a:focus-visible {
    outline: none;
}

.blog-result:focus-within {
    border-color: var(--bs-search-primary);
}

.blog-result-snippet {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--bs-search-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.blog-result-tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--color-gray-10, #f9f9fa);
    border: 1px solid var(--bs-search-border);
    font-size: 12px;
    color: var(--bs-search-text);
}

/* How the result was found. Only the informative cases get a badge. */
.blog-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.blog-result-badge--hybrid {
    background: var(--bs-search-primary-50);
    color: var(--bs-search-primary);
}

.blog-result-badge--semantic {
    background: var(--bs-search-beige);
    color: var(--bs-search-text);
}

@media (max-width: 767.98px) {
    .blog-result {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
        padding: 12px;
    }

    .blog-result-thumb {
        aspect-ratio: 1 / 1;
        border-radius: 10px;
    }

    .blog-result-title {
        font-size: 17px;
    }

    .blog-result-snippet {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .blog-result-tags {
        display: none;
    }
}

/* Highlighted search terms: a soft tint instead of solid green with white text. */
.blog-search mark,
.blog-search mark[class] {
    padding: 0 0.15em;
    border-radius: 4px;
    background-color: rgba(18, 113, 91, 0.12) !important;
    color: var(--bs-primary-700, #0b4437) !important;
    font-weight: inherit;
}

/* Empty state */

.blog-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 56px 24px;
    text-align: center;
    background: var(--bs-search-beige);
    border-radius: 24px;
}

.blog-search-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    font-size: 28px;
    color: var(--bs-search-primary);
}

.blog-search-empty h2 {
    margin: 8px 0 0;
    font-size: 24px;
}

.blog-search-empty p {
    max-width: 440px;
    margin: 0;
    color: var(--bs-search-text);
}

.blog-search-empty-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--bs-search-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.blog-search-empty-action:hover {
    background: var(--bs-search-primary-600);
    color: #fff;
}

.blog-search-pagination {
    margin-top: 40px;
}

/* Text for screen readers only. */
.blog-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
