/* Search v2 styles — used by /search/, /en/search/, /ar/search/ */

.search-page { padding: 24px 0 48px; }

.search-hero {
    background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 100%);
    padding: 28px 0 24px;
    border-block: 1px solid #ececec;
}
.search-hero h1 {
    margin: 0 0 14px;
    color: #1a3a6c;
    font-weight: 700;
    font-size: 1.8rem;
}

.search-form-v2 { position: relative; max-width: 720px; margin: 0; }
.search-form-v2 input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    padding-inline-end: 130px;
    border: 1px solid #d6dae2;
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    outline: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: border-color .15s, box-shadow .15s;
}
.search-form-v2 input[type="text"]:focus {
    border-color: #1a3a6c;
    box-shadow: 0 0 0 3px rgba(26,58,108,0.12);
}
.search-form-v2 button[type="submit"] {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a3a6c;
    color: #fff;
    border: 0;
    padding: 9px 18px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
    z-index: 2;
}
.search-form-v2 button[type="submit"]:hover { background: #15315a; }

.search-summary { color: #555; font-size: 0.95rem; margin-top: 10px; }

.search-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    margin-top: 24px;
}
@media (max-width: 991px) {
    .search-layout { grid-template-columns: 1fr; }
}

.search-side {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
}
.search-side h3 {
    font-size: 0.95rem;
    color: #1a3a6c;
    margin: 12px 0 8px;
    font-weight: 700;
}
.search-side h3:first-child { margin-top: 0; }
.search-side ul { list-style: none; margin: 0; padding: 0; }
.search-side label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: #333;
    font-size: 0.93rem;
    cursor: pointer;
}
.search-side label .cnt { color: #999; font-size: 0.8rem; }
.search-side select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d6dae2;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}
.search-side .apply-btn {
    width: 100%;
    margin-top: 14px;
    padding: 9px 12px;
    background: #1a3a6c;
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.search-side .apply-btn:hover { background: #15315a; }
.search-side .reset-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
}
.search-side .reset-btn:hover { background: #f6f8fb; color: #333; }

.result-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.result-card:hover {
    border-color: #c9d2e0;
    box-shadow: 0 4px 14px rgba(26,58,108,0.06);
}
.result-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.result-card h2 a { color: #1a3a6c; text-decoration: none; }
.result-card h2 a:hover { text-decoration: underline; }
.result-card .meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.result-card .meta .type-chip {
    background: #eef2f8;
    color: #1a3a6c;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}
.result-card .snippet {
    color: #444;
    font-size: 0.94rem;
    line-height: 1.8;
    margin: 0 0 12px;
}
.result-card__actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}
.result-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a3a6c;
    color: #fff !important;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    border: 1px solid #1a3a6c;
}
.result-card__cta:hover { background: #15315a; text-decoration: none; }
.result-card__cta::after {
    content: "←";
    font-size: 1rem;
    line-height: 1;
    transition: transform .15s;
}
.result-card__cta:hover::after { transform: translateX(-3px); }
[dir="ltr"] .result-card__cta::after { content: "→"; }
[dir="ltr"] .result-card__cta:hover::after { transform: translateX(3px); }

mark { background: #fff3a3; padding: 0 2px; border-radius: 3px; color: inherit; }

.pagination-v2 {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination-v2 a,
.pagination-v2 span {
    padding: 8px 12px;
    min-width: 38px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #e0e3e9;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}
.pagination-v2 a:hover { background: #f0f3f8; }
.pagination-v2 .current {
    background: #1a3a6c;
    color: #fff;
    border-color: #1a3a6c;
}
.pagination-v2 .ellipsis { border-color: transparent; color: #999; }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #666;
}
.empty-state .icon-search { font-size: 3rem; color: #c0c8d6; margin-bottom: 14px; display: inline-block; }
.empty-state h2 { color: #1a3a6c; font-size: 1.3rem; }

.no-results {
    background: #fff;
    border: 1px dashed #e0e3e9;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    color: #555;
}
.no-results h3 { color: #1a3a6c; margin-top: 0; }

/* Header search form: input-wrapper hosts the autocomplete dropdown.
 * The form keeps its original .header-search-form { position: absolute; width: 300px }
 * styles from main.min.css so it expands on toggle; the inner wrapper just
 * acts as the positioning context for the dropdown. */
.header-search-wrapper.active .header-search-form,
.header-search-wrapper.active .header-search-form-toggle {
    z-index: 9999;
}
.header-search-form .header-search-form__input-wrapper {
    position: relative;
    overflow: visible;  /* override main.min.css `overflow:hidden` so the ac-dropdown isn't clipped */
}
.header-search-form .ac-dropdown {
    top: calc(100% + 6px);
    inset-inline-start: 0;
    inset-inline-end: 0;
    border-top: 1px solid #d6dae2;
    border-radius: 12px;
    z-index: 9999;
}

/* Autocomplete dropdown */
.ac-dropdown {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: #fff;
    border: 1px solid #d6dae2;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    margin-top: -1px;
    max-height: 360px;
    overflow-y: auto;
    display: none;
    z-index: 999;
}
.ac-dropdown.open { display: block; }
.ac-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f7;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    display: block;
    text-decoration: none;
}
.ac-item:last-child { border-bottom: none; }
.ac-item.active,
.ac-item:hover { background: #eef2f8; color: #1a3a6c; }
.ac-item .ac-title { display: block; font-weight: 600; }
.ac-item .ac-url { display: block; font-size: 0.75rem; color: #999; direction: ltr; text-align: start; unicode-bidi: isolate; }
.ac-section-label {
    padding: 8px 16px;
    font-size: 0.75rem;
    color: #999;
    background: #fafbfd;
    letter-spacing: 0.05em;
}
.ac-empty { padding: 14px 16px; text-align: center; color: #999; font-size: 0.9rem; }
