/* ================================================================
   Switch-Actu — Recherche Ajax
   Couleur principale : #fa3931
   Font : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ...
   ================================================================ */

:root {
    --sa-red:        #fa3931;
    --sa-red-dark:   #d62e27;
    --sa-red-light:  #fff0ef;
    --sa-text:       #1a1a1a;
    --sa-text-muted: #777;
    --sa-border:     #e8e8e8;
    --sa-bg:         #ffffff;
    --sa-hover:      #fafafa;
    --sa-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* -- Wrapper ----------------------------------------------------- */
.sas-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* -- Dropdown ---------------------------------------------------- */
.sas-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 9999;

    font-family: var(--sa-font);
    background: var(--sa-bg);
    border: 1px solid var(--sa-border);
    border-top: 3px solid var(--sa-red); /* liseré rouge en haut */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .13);
    overflow: hidden;
    max-height: 440px;
    overflow-y: auto;
}

.sas-dropdown.sas-open {
    display: block;
    animation: sasSlideIn .15s ease-out;
}

@keyframes sasSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Item -------------------------------------------------------- */
.sas-item a {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--sa-text);
    transition: background .1s;
}

.sas-item:hover a,
.sas-item.sas-active a {
    background: var(--sa-hover);
}

/* Barre rouge à gauche au survol */
.sas-item {
    border-left: 3px solid transparent;
    transition: border-color .1s;
}

.sas-item:hover,
.sas-item.sas-active {
    border-left-color: var(--sa-red);
}

/* -- Vignette ---------------------------------------------------- */
.sas-thumb {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--sa-border);
}

.sas-thumb-placeholder {
    width: 72px;
    height: 48px;
    border-radius: 4px;
    background: #f0f0f0;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .sas-thumb,
    .sas-thumb-placeholder {
        width: 54px;
        height: 38px;
    }
}

/* Shimmer sur le placeholder */
.sas-thumb-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.6) 50%, transparent 100%);
    animation: sasShimmer 1.4s infinite;
}

@keyframes sasShimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* -- Infos textuelles -------------------------------------------- */
.sas-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
}

.sas-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--sa-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Mise en surbrillance du terme recherché */
.sas-title mark {
    background: transparent;
    color: var(--sa-red);
    font-weight: 700;
    padding: 0;
}

.sas-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: var(--sa-text-muted);
}

/* Badge catégorie — style Switch-Actu */
.sas-category {
    background: var(--sa-red);
    color: #fff;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.sas-date {
    color: var(--sa-text-muted);
}

/* -- Séparateurs ------------------------------------------------- */
.sas-item + .sas-item {
    border-top: 1px solid var(--sa-border);
}

/* -- Aucun résultat ---------------------------------------------- */
.sas-no-results {
    padding: 18px 16px;
    font-size: .85rem;
    color: var(--sa-text-muted);
    font-family: var(--sa-font);
    text-align: center;
}

/* -- Footer "Voir tous les résultats" ---------------------------- */
.sas-footer {
    border-top: 1px solid var(--sa-border);
    padding: 0;
    background: var(--sa-hover);
}

.sas-footer a {
    display: block !important;
    font-size: .9rem  !important;
    font-family: var(--sa-font)  !important;
    font-weight: 700  !important;
    text-decoration: none  !important;
    text-align: center  !important;
    transition: background .1s, color .1s !important;
    color: initial !important;
}

.sas-footer a:hover {
    background: var(--sa-red);
    color: #fff;
}

/* -- Loader (3 points animés couleur rouge) ---------------------- */
.sas-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 18px;
}

.sas-loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sa-red);
    opacity: .3;
    animation: sasBounce .8s infinite ease-in-out both;
}

.sas-loading span:nth-child(1) { animation-delay: -.32s; }
.sas-loading span:nth-child(2) { animation-delay: -.16s; }

@keyframes sasBounce {
    0%, 80%, 100% { transform: scale(0); opacity: .3; }
    40%           { transform: scale(1); opacity: 1;  }
}

/* -- Scrollbar discrète ------------------------------------------ */
.sas-dropdown::-webkit-scrollbar       { width: 4px; }
.sas-dropdown::-webkit-scrollbar-track { background: transparent; }
.sas-dropdown::-webkit-scrollbar-thumb { background: var(--sa-border); border-radius: 4px; }
.sas-dropdown::-webkit-scrollbar-thumb:hover { background: var(--sa-red); }