/* AJAX Search Results Dropdown */
.search-form {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    margin-bottom: 0;
    flex: 1;
    padding: 0 5px;
    border: 1px solid #c8c7c3;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: #181818;
    outline: none;
    flex-direction: row-reverse;
}

.search-form button.search-submit {
    border: none;
    background-color: #fff;
    box-shadow: none;
    cursor: pointer;
}

.search-form button.search-submit svg {
    width: 20px;
    height: 20px;
    padding: 0;
}

/* Hide default webkit clear button */
.search-form input[type="search"]::-webkit-search-decoration,
.search-form input[type="search"]::-webkit-search-cancel-button,
.search-form input[type="search"]::-webkit-search-results-button,
.search-form input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.search-form label {
    flex: 1;
    position: relative;
    /* For absolute positioning of clear button */
    display: flex;
    /* Ensure input takes full width */
    align-items: center;
}

.search-form input.search-field {
    border: none;
    padding-right: 35px;
    /* Make space for the clear button */
    width: 100%;
    color: var(--ink);
    min-height: 45px;
}

.search-form input.search-field::placeholder {
    color: var(--rule);
}

/* Custom Clear Button */
.search-form button[data-testid="clear-button"] {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #999;
    /* display: none; Toggled via JS */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button[data-testid="clear-button"].visible {
    opacity: 1;
    pointer-events: auto;
}

.search-form button[data-testid="clear-button"]:hover {
    color: var(--ink);
}

/* Hide the text "Clear" inside the button if desire just the icon */
.search-form button[data-testid="clear-button"] .A7b5zq {
    display: none;
}

.cc-ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    /* Minimum width */
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 400px;
    display: none;
    border-radius: 4px;
    margin-top: 5px;
    overflow: auto;
}

.cc-search-category {
    padding: 10px 0;
}

.cc-search-category:last-child {
    border-bottom: none;
}

.cc-search-cat-title {
    margin: 0;
    padding: 0 20px 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-search-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cc-search-list li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
    line-height: 1.4;
    gap: 10px;
}

.cc-search-list li a:hover {
    background-color: #0000000d;
    color: var(--rule);
    opacity: 1;
}

.cc-search-list li a:hover .cc-search-item-title{
    opacity: 0.6;
}

.cc-search-item-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cc-search-item-content {
    flex: 1;
    min-width: 0;
    /* Enable truncation if needed */
}

.cc-search-item-title {
    font-weight: 400;
    display: block;
    color: var(--ink);
}

.cc-search-item-excerpt {
    display: block;
    font-size: 12px;
    color: var(--ink-light);
    margin-top: 3px;
    line-height: 1.3;
    /* Limit lines if supported, else just flows */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.6;
}

.cc-search-item-date {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.cc-search-no-results {
    padding: 15px;
    text-align: center;
    color: var(--ink-light);
    font-style: italic;
}