/* Search Styles */

/* Compact Search Box (Header) */
.custom-search-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 0;
}

.custom-search-container form {
    display: flex;
    max-width: 250px;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    height: 30px;
}

.custom-search-container input[type="text"] {
    padding: 10px;
    font-size: 11px;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 5px 0 0 5px;
    background-color: #333;
    color: #fff;
    outline: none;
    flex: 1;
    height: 25px;
    box-sizing: border-box;
}

.custom-search-container input[type="text"]::placeholder {
    color: #bbb;
}

.custom-search-container button {
    padding: 0;
    height: 25px;
    width: 40px;
    border: none;
    background-color: transparent;
    color: #fff;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.custom-search-container button:hover {
    background-color: #FF5100;
    color: #fff;
}

.custom-search-container button img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1); /* Force to white if it's black */
}

/* Search Results Page */
.search-results-container {
    font-family: 'Montserrat', sans-serif;
}

.search-header {
    font-size: 25px;
    margin-bottom: 20px;
    color: #333;
}

.search-header b {
    font-weight: bold;
}

.search-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 50px;
    flex-wrap: nowrap;
    width: 100%;
}

.search-filters select,
.search-filters input[type="text"] {
    flex-grow: 1;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    height: 42px;
    box-sizing: border-box;
}

.search-filters select {
    appearance: none;
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%23555' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px 8px;
    padding-right: 32px;
}

.search-filters button {
    background-color: #333;
    color: #fff;
    cursor: pointer;
    width: 110px;
    padding: 0 14px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid #333;
    border-radius: 8px;
    outline: none;
    height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-filters button:hover {
    background-color: #FF5100;
}

.result-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
    position: relative;
    background: transparent; /* Transparent as per 'Ultimas Noticias' */
    border: none;
    overflow: visible;
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-4px);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px; /* 8px rounding matching news block */
    margin-bottom: 12px;
}

.result-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.result-item:hover img {
    transform: scale(1.03);
}

.result-details {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    color: #111 !important; /* Set to black as requested */
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.result-meta-wrapper {
    margin-bottom: 2px;
}

.result-meta-wrapper .hatch-post-meta {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12.5px !important;
    color: #555 !important; /* Darkened for accessibility contrast */
    text-transform: uppercase;
    font-weight: 600;
}

.result-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 !important;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Adjustments */
@media (max-width: 820px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .search-filters form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }
    .search-filters select,
    .search-filters input[type="text"],
    .search-filters button {
        width: 100%;
        max-width: none;
    }
    .search-filters button {
        height: 44px;
    }
}

@media (max-width: 640px) {
    .result-item {
        flex-direction: column;
    }
    .result-item img {
        width: 100%;
        height: auto;
    }
    .result-categories {
        position: static;
        padding: 6px 0 0;
    }
    .result-details {
        gap: 6px;
    }
    .result-meta {
        font-size: 13px !important;
    }
    .result-meta img {
        width: 10px;
        height: 10px;
    }
}

.load-more {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #777;
    cursor: pointer;
}

.no-more-results {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #bbb;
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
