/*
 * FontAwesome 5 @font-face override
 *
 * The bundled all.min.css declares each face with .eot/.eot?#iefix/.woff2/
 * .woff/.ttf/.svg sources, but FontAwesome 6 (which we actually ship) only
 * provides .woff2 and .ttf — the other URLs 404 in browser consoles.
 *
 * Per CSS cascade rules, identical @font-face descriptors declared later
 * override earlier ones. Loading this file AFTER all.min.css replaces the
 * source list with just the formats we have, eliminating the 404s while
 * keeping the same icon rendering.
 */
@font-face {
    font-family: "Font Awesome 5 Free";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("../webfonts/fa-solid-900.woff2") format("woff2"),
         url("../webfonts/fa-solid-900.ttf") format("truetype");
}

@font-face {
    font-family: "Font Awesome 5 Free";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../webfonts/fa-regular-400.woff2") format("woff2"),
         url("../webfonts/fa-regular-400.ttf") format("truetype");
}

@font-face {
    font-family: "Font Awesome 5 Brands";
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: url("../webfonts/fa-brands-400.woff2") format("woff2"),
         url("../webfonts/fa-brands-400.ttf") format("truetype");
}
/* 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-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; }
/*
 * Accessibility helpers used site-wide.
 */

/* Skip-to-content link: hidden off-screen until focused via keyboard. */
.skip-to-content {
    position: absolute;
    inset-inline-start: 50%;
    top: -200%;
    transform: translateX(-50%);
    background: #1a3a6c;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 0 0 10px 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 100000;
    transition: top .15s ease-out;
}
.skip-to-content:focus {
    top: 0;
    outline: 3px solid #ffd76c;
    outline-offset: 2px;
}

/* Make :focus-visible easy to see (improves keyboard navigation). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #1a3a6c;
    outline-offset: 2px;
}

/* Honour reduce-motion preference. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Visually-hidden helper for screen-reader-only labels. */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/*
 * Slider layout fix.
 *
 * main.min.css gives .main-slider__item an aspect-ratio shim via
 *     .main-slider__item:after { padding-top: 66% }
 * but never positions the <img> inside, so when we added explicit
 * width/height attributes to the <img> for CLS prevention the image
 * shrank to its intrinsic 420px height and left a tall whitespace
 * gap below it.
 *
 * Pin the picture/img to fill the slot with object-fit:cover so the
 * image now correctly covers the whole 66%-aspect slot.
 */
.main-slider__item {
    overflow: hidden;
}
.main-slider__picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.main-slider__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Cap absurd heights on very wide viewports so the slider doesn't
 * dominate the fold. 66% padding-top on a 2000px-wide screen would
 * give ~1300px — clamp to a reasonable max. */
@media (min-width: 1400px) {
    .main-slider__item:after { padding-top: 38%; }
}
@media (min-width: 1100px) and (max-width: 1399px) {
    .main-slider__item:after { padding-top: 42%; }
}
