/* AquaLibs / Joomla 6 Smart Search (com_finder)
   Scoped to .aql-finder-page so it will not alter the header finder module. */

.aql-finder-page,
.aql-finder-page * {
    box-sizing: border-box;
}

.aql-finder-page {
    width: min(1120px, calc(100% - 32px));
    margin: 26px auto 64px;
    color: #20242a;
}

.aql-finder-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 28px 30px;
    border: 1px solid #e8ecef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(22, 31, 44, .055);
}

.aql-finder-hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #62c54a 0%, #d9ec24 100%);
}

.aql-finder-hero__eyebrow {
    margin-bottom: 8px;
    color: #79c948;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.aql-finder-hero__title {
    margin: 0;
    color: #20242a;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
}

.aql-finder-hero__desc {
    margin: 8px 0 0;
    color: #737982;
    font-size: 15px;
    line-height: 1.65;
}

.aql-finder-hero__desc strong {
    color: #20242a;
    font-weight: 700;
}

/* Main form card */
.aql-finder-form-card {
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid #e8ecef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(22, 31, 44, .045);
}

.aql-finder-page .com-finder__search.word {
    min-width: 0;
    margin: 0 !important;
    padding: 0;
    border: 0;
}

.aql-finder-page .com-finder__search .form-inline {
    display: block;
}

.aql-finder-page .com-finder__search label[for="q"] {
    display: block;
    margin: 0 0 8px !important;
    color: #333940;
    font-size: 13px;
    font-weight: 600;
}

.aql-finder-page .com-finder__search .input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    width: 100%;
}

.aql-finder-page #q,
.aql-finder-page .js-finder-search-query {
    display: block;
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 15px;
    border: 1px solid #d8dde3;
    border-radius: 10px !important;
    outline: 0;
    background: #fff !important;
    color: #24282d !important;
    -webkit-text-fill-color: #24282d !important;
    font: inherit;
    font-size: 15px;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.aql-finder-page #q:hover,
.aql-finder-page #q:focus,
.aql-finder-page .js-finder-search-query:hover,
.aql-finder-page .js-finder-search-query:focus {
    border-color: #72c94b;
    background: #fff !important;
    color: #24282d !important;
    -webkit-text-fill-color: #24282d !important;
    box-shadow: 0 0 0 3px rgba(114, 201, 75, .14);
}

.aql-finder-page .com-finder__search .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    height: 48px;
    margin: 0;
    padding: 0 18px;
    border-radius: 10px !important;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.aql-finder-page .com-finder__search .btn:hover {
    transform: translateY(-1px);
}

.aql-finder-page .com-finder__search .btn-primary {
    border: 1px solid #7acb48;
    background: linear-gradient(135deg, #65c64a 0%, #a8dc3c 100%);
    color: #fff;
}

.aql-finder-page .com-finder__search .btn-primary:hover,
.aql-finder-page .com-finder__search .btn-primary:focus {
    border-color: #69bd42;
    background: linear-gradient(135deg, #5cbd42 0%, #9fd536 100%);
    color: #fff;
}

.aql-finder-page .com-finder__search .btn-secondary {
    border: 1px solid #d8dde3;
    background: #fff;
    color: #3d444c;
}

.aql-finder-page .com-finder__search .btn-secondary:hover,
.aql-finder-page .com-finder__search .btn-secondary:focus {
    border-color: #79c948;
    background: #f8fcee;
    color: #62b83f;
}

/* Advanced search */
.aql-finder-page .com-finder__advanced {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #e8ecef;
    border-radius: 14px;
    background: #fafbfc;
}

.aql-finder-page .com-finder__advanced:not(.show) {
    display: none;
}

.aql-finder-page .com-finder__advanced.show {
    display: block;
}

.aql-finder-page .com-finder__tips.card {
    margin: 0 0 18px !important;
    border: 0;
    border-radius: 12px;
    background: #f4f9ed;
    box-shadow: none;
}

.aql-finder-page .com-finder__tips .card-body {
    padding: 15px 17px;
    color: #5c6357;
    font-size: 14px;
    line-height: 1.7;
}

.aql-finder-page .com-finder__tips p {
    margin-top: 0;
    margin-bottom: 7px;
}

.aql-finder-page #finder-filter-window {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
}

.aql-finder-page #finder-filter-window .control-group,
.aql-finder-page #finder-filter-window .filter-branch {
    min-width: 0;
    margin: 0;
}

.aql-finder-page #finder-filter-window label {
    display: block;
    margin: 0 0 7px;
    color: #464c53;
    font-size: 13px;
    font-weight: 600;
}

.aql-finder-page #finder-filter-window select,
.aql-finder-page #finder-filter-window input {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d8dde3;
    border-radius: 9px;
    outline: 0;
    background: #fff;
    color: #2c3136;
    font: inherit;
}

.aql-finder-page #finder-filter-window select:focus,
.aql-finder-page #finder-filter-window input:focus {
    border-color: #72c94b;
    box-shadow: 0 0 0 3px rgba(114, 201, 75, .12);
}

/* Finder autocomplete on the full search page */
.aql-finder-page .awesomplete {
    display: block;
    width: 100%;
}

.aql-finder-page .awesomplete > ul {
    z-index: 1100;
    overflow: hidden;
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid #e0e5e9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(18, 28, 40, .13);
}

.aql-finder-page .awesomplete > ul > li {
    padding: 9px 11px;
    border-radius: 7px;
    background: #fff;
    color: #32373d;
    -webkit-text-fill-color: #32373d;
    font-size: 14px;
}

.aql-finder-page .awesomplete > ul > li:hover,
.aql-finder-page .awesomplete > ul > li[aria-selected="true"] {
    background: #f1f9e9;
    color: #4f9f34;
}

.aql-finder-page .awesomplete mark {
    padding: 0;
    background: transparent;
    color: #5ab33a;
    font-weight: 700;
    -webkit-text-fill-color: #5ab33a;
}

/* Results status / suggestion */
.aql-finder-page .com-finder__explained,
.aql-finder-page .com-finder__empty {
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid #e7ecdf;
    border-radius: 12px;
    background: #f8fcef;
    color: #596252;
    line-height: 1.65;
}

.aql-finder-page .com-finder__explained a {
    color: #62b83f;
    font-weight: 700;
}

.aql-finder-page .com-finder__empty h2 {
    margin: 0 0 7px;
    color: #30363b;
    font-size: 19px;
}

.aql-finder-page .com-finder__empty p {
    margin: 0;
}

/* Sort */
.aql-finder-page .com-finder__sorting {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.aql-finder-page .sorting {
    display: flex;
    align-items: center;
    gap: 9px;
}

.aql-finder-page .sorting > label {
    margin: 0;
    color: #737982;
    font-size: 13px;
}

.aql-finder-page .sorting .btn {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid #d8dde3;
    border-radius: 9px;
    background: #fff;
    color: #3d444c;
    font-size: 13px;
}

/* Result list */
.aql-finder-page .com-finder__results-list {
    display: grid;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aql-finder-page .result__item.aql-finder-result-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    margin: 0;
    padding: 20px;
    border: 1px solid #e8ecef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 31, 44, .035);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.aql-finder-page .result__item.aql-finder-result-card.no-thumb {
    grid-template-columns: minmax(0, 1fr);
}

.aql-finder-page .result__item.aql-finder-result-card:hover {
    border-color: #dce9cf;
    box-shadow: 0 9px 23px rgba(22, 31, 44, .065);
    transform: translateY(-1px);
}

.aql-finder-page .aql-finder-result-card__image {
    overflow: hidden;
    width: 100%;
    min-height: 150px;
    border-radius: 12px;
    background: #f2f4f6;
}

.aql-finder-page .aql-finder-result-card__image a,
.aql-finder-page .aql-finder-result-card__image img {
    display: block;
    width: 100%;
    height: 100%;
}

.aql-finder-page .aql-finder-result-card__image img {
    min-height: 150px;
    object-fit: cover;
}

.aql-finder-page .aql-finder-result-card__body {
    min-width: 0;
}

.aql-finder-page .result__title.aql-finder-result-card__title {
    margin: 0 0 8px;
}

.aql-finder-page .result__title-link {
    display: block;
    color: #22272d;
    text-decoration: none;
}

.aql-finder-page .result__title-link:hover .result__title-text {
    color: #63b940;
}

.aql-finder-page .result__title-text {
    display: block;
    margin-bottom: 4px;
    color: #22272d;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.38;
    transition: color .16s ease;
}

.aql-finder-page .result__title-url {
    display: block;
    overflow: hidden;
    color: #8b929a;
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aql-finder-page .aql-finder-result-card__meta {
    margin: 0 0 10px;
}

.aql-finder-page .result__description {
    margin: 0;
    color: #626972;
    font-size: 14px;
    line-height: 1.7;
}

.aql-finder-page .result__date {
    display: inline-block;
    margin-right: 8px;
    color: #8a9198;
    font-size: 12px;
}

.aql-finder-page .result__taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.aql-finder-page .result__taxonomy-item {
    margin: 0;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f4f7f1;
    color: #65705f;
    font-size: 11px;
    line-height: 1.2;
}

.aql-finder-page .result__taxonomy-item span {
    font-weight: 700;
}

.aql-finder-page mark,
.aql-finder-page .highlight {
    padding: 0 .12em;
    border-radius: 3px;
    background: #eef8d5;
    color: inherit;
}

/* Pagination */
.aql-finder-page .com-finder__navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}

.aql-finder-page .com-finder__pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aql-finder-page .com-finder__pagination .page-link,
.aql-finder-page .com-finder__pagination a,
.aql-finder-page .com-finder__pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #dfe3e7;
    border-radius: 9px !important;
    background: #fff;
    color: #4b5259;
    text-decoration: none;
    font-size: 13px;
}

.aql-finder-page .com-finder__pagination .active .page-link,
.aql-finder-page .com-finder__pagination .page-link:hover,
.aql-finder-page .com-finder__pagination a:hover {
    border-color: #7bca4b;
    background: #f3fae9;
    color: #5daf39;
}

.aql-finder-page .com-finder__counter {
    color: #858c93;
    font-size: 12px;
}

/* Neutralise old fieldset / Bootstrap-era template rules inside com_finder */
.aql-finder-page fieldset {
    min-width: 0;
}

.aql-finder-page legend {
    width: auto;
    max-width: 100%;
    border: 0;
}

.aql-finder-page .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .aql-finder-page .result__item.aql-finder-result-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .aql-finder-page {
        width: min(100% - 20px, 1120px);
        margin-top: 16px;
        margin-bottom: 40px;
    }

    .aql-finder-hero,
    .aql-finder-form-card {
        padding: 18px;
        border-radius: 13px;
    }

    .aql-finder-hero__title {
        font-size: 24px;
    }

    .aql-finder-page .com-finder__search .input-group {
        grid-template-columns: 1fr;
    }

    .aql-finder-page .com-finder__search .btn {
        width: 100%;
    }

    .aql-finder-page #finder-filter-window {
        grid-template-columns: 1fr;
    }

    .aql-finder-page .result__item.aql-finder-result-card,
    .aql-finder-page .result__item.aql-finder-result-card.no-thumb {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .aql-finder-page .result__title-text {
        font-size: 17px;
    }

    .aql-finder-page .aql-finder-result-card__image {
        min-height: 180px;
    }

    .aql-finder-page .aql-finder-result-card__image img {
        min-height: 180px;
    }

    .aql-finder-page .com-finder__navigation {
        align-items: flex-start;
        flex-direction: column;
    }
}
