/* Search form wrapper */
.custom-search-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    margin-bottom: 40px;
    padding: 0 15px; /* Add padding for smaller screens */
}

/* Search form */
.custom-search-form {
    display: flex;
    align-items: center;
}

/* Input wrapper */
.custom-search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

/* Search icon */
.live-search-icon {
    padding: 10px;
    display: flex;
    align-items: center;
}

/* Input field */
.custom-search-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: none;
    outline: none;
    width: 100%;
}

.custom-search-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Submit button */
.custom-search-button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    background-color: #28a745;
    color: white;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

.custom-search-button:hover {
    background-color: #218838;
}

.custom-search-button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}

/* Suggestions dropdown */
.custom-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: beige;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1;
    margin-top: 5px;
    width: 100%; /* Ensure full width on mobile */
}

.custom-search-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-search-suggestion {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f1f1;
}

.custom-search-suggestion:last-child {
    border-bottom: none;
}

.custom-search-suggestion a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    display: block;
}

.custom-search-suggestion a:hover {
    color: #c70100;
}

.custom-search-suggestion:hover {
    background: #f7fafc;
}


/* Modern Search Results Layout */
.search-results-container {
    max-width: 900px;
    margin: 120px auto;
    padding: 20px;
}

.search-results-container h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

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

.search-result-item {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 5px 5px 0 rgba(19, 64, 79, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px 0 rgba(19, 64, 79, 0.1);
}

.result-image {
    flex: 0 0 300px; /* Restore fixed width for desktop layout */
    overflow: hidden;
    margin: 30px 10px 10px 20px;
    border-radius: 15px 0px 15px 0px;
}

.result-image img {
    width: 100%; /* Scale to container width */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove inline spacing */
    max-width: none; /* Allow full resolution within 300px */
}

.result-content {
    flex: 1;
    padding: 20px;
}

.result-category {
    font-size: 1.1em;
    text-transform: none;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.result-category a {
    letter-spacing: normal;
    color: #c70000;
    font-weight: 500;
}

.result-category a:hover {
    color: #009803;
}

.result-title {
    margin: 0 0 15px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.result-title a {
    font-family: 'Roboto Flex';
    text-decoration: none;
    color: #000000;
    transition: color 0.3s;
}

.result-title a:hover {
    color: #128f00;
}

.result-excerpt {
    line-height: 1.4;
    margin: 0 0 15px;
    color: #495057;
}

.read-more-search-button {
    display: inline-block;
    padding: 5px 10px;
    background: #ad0303;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.read-more-search-button:hover {
    background: #02a004;
    color: #ffffff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination .nav-links a, .pagination .nav-links span {
    padding: 10px 15px;
    color: #000000;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.pagination .nav-links a:hover {
    background: #009f0e;
    color: white;
}

.pagination .nav-links .current {
    background: #a70505;
    color: white;
}

/* No results */
.search-results-container p {
    line-height: 1.4;
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 1.1em;
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 768px) {
    .custom-search-wrapper {
        padding: 0 10px; /* Reduced padding on tablets */
        margin-bottom: 30px;
    }

    .custom-search-input {
        padding: 8px;
        font-size: 14px;
    }

    .custom-search-button {
        padding: 8px 15px;
        font-size: 14px;
    }

    .search-results-container {
		margin-top: 70px;
        padding: 15px;
        max-width: 100%;
    }

    .search-results-container h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .search-result-item {
        flex-direction: column;
        align-items: stretch;
    }

    .result-image {
        flex: 0 0 100%; /* Full width on mobile */
        margin: 15px 0;
        min-width: 0; /* Override min-width for stacking */
    }

    .result-image img {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .result-content {
        padding: 15px;
    }

    .result-category {
        font-size: 1em;
    }

    .result-title {
        font-size: 1.2rem;
    }

    .read-more-button {
        padding: 5px 10px;
    }

    .pagination .nav-links a, .pagination .nav-links span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .custom-search-wrapper {
        padding: 0 5px; /* Minimal padding on phones */
        margin-bottom: 20px;
    }

    .custom-search-input {
        font-size: 12px;
        padding: 6px;
    }

    .custom-search-button {
        font-size: 12px;
        padding: 6px 12px;
    }

    .search-results-container h1 {
        font-size: 1.2rem;
    }

    .result-title {
        font-size: 1.3rem;
    }

    .result-excerpt {
        font-size: 0.9em;
    }

    .read-more-button {
        padding: 4px 8px;
        font-size: 0.9em;
    }
	.search-results-container p {
		line-height: 1.4;
		font-size: 0.9em;
}

    .pagination .nav-links a, .pagination .nav-links span {
        padding: 6px 10px;
        font-size: 15px;
    }
}