/* =========================================
   AfriCo — Page Annonces & Recrutements
   ========================================= */

/* ========================================
   HERO DE LA PAGE
   ======================================== */

.annonces-hero {
    background:
        linear-gradient(135deg, rgba(12,31,58,.94) 0%, rgba(12,31,58,.88) 55%, rgba(26,58,92,.85) 100%),
        url('../images/parallax-biblio.webp') center / cover no-repeat;
    padding: calc(var(--header-height) + 64px) 0 64px;
    text-align: center;
}

.annonces-hero__badge {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    background: rgba(200,169,78,.15);
    border: 1px solid rgba(200,169,78,.3);
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.annonces-hero__title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.annonces-hero__subtitle {
    font-size: clamp(.95rem, 2vw, 1.125rem);
    color: rgba(255,255,255,.75);
    max-width: 640px;
    margin: 0 auto 28px;
    line-height: 1.7;
    font-weight: 300;
}

.annonces-hero__actions {
    display: flex;
    justify-content: center;
}

/* ========================================
   BARRE D'OUTILS (recherche + filtres)
   ======================================== */

.annonce-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.annonce-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: border-color .3s ease, box-shadow .3s ease;
}

.annonce-search:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(200,169,78,.1);
}

.annonce-search svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.annonce-search input {
    border: none;
    outline: none;
    width: 100%;
    font-family: var(--font-family);
    font-size: .9375rem;
    color: var(--color-text);
    background: transparent;
}

.annonce-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.annonce-filter {
    padding: 8px 20px;
    font-family: var(--font-family);
    font-size: .8125rem;
    font-weight: 600;
    border: 2px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text-light);
    border-radius: 50px;
    cursor: pointer;
    transition: all .3s ease;
}

.annonce-filter:hover {
    border-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.annonce-filter.active {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    border-color: var(--color-accent);
    color: var(--color-primary-dark);
    box-shadow: 0 4px 15px rgba(200,169,78,.3);
}

.annonce-count {
    font-size: .875rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

/* ========================================
   GRILLE D'ANNONCES
   ======================================== */

.annonces__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.annonce-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .4s cubic-bezier(.4,0,.2,1);
    animation: fadeInUp .5s ease backwards;
}

.annonce-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(200,169,78,.3);
}

.annonce-card__body {
    padding: 26px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.annonce-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.annonce-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 50px;
    color: var(--color-white);
}

.annonce-badge--recrutement { background: var(--color-primary); }
.annonce-badge--consultant  { background: var(--color-accent-dark); color: var(--color-primary-dark); }
.annonce-badge--enqueteur   { background: #2e7d5b; }
.annonce-badge--appel       { background: #7a4a9e; }
.annonce-badge--formation   { background: #b3541e; }
.annonce-badge--autre       { background: #5b6472; }

.annonce-card__date {
    font-size: .75rem;
    color: var(--color-text-light);
}

.annonce-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.annonce-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
}

.annonce-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--color-text-light);
}

.annonce-card__meta svg {
    width: 15px;
    height: 15px;
    color: var(--color-accent-dark);
    flex-shrink: 0;
}

.annonce-card__desc {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.annonce-card.is-open .annonce-card__desc {
    display: block;
    -webkit-line-clamp: unset;
}

.annonce-card__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: .8rem;
    color: var(--color-text-light);
}

.annonce-stars {
    display: inline-flex;
    gap: 2px;
}

.annonce-stars svg {
    width: 16px;
    height: 16px;
    color: var(--color-border);
}

.annonce-stars svg.filled {
    color: var(--color-accent);
}

.annonce-card__actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.annonce-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    font-family: var(--font-family);
    font-size: .8125rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .3s ease;
    border: 2px solid transparent;
}

.annonce-btn svg {
    width: 16px;
    height: 16px;
}

.annonce-btn--apply {
    background: var(--color-accent);
    color: var(--color-primary-dark);
    border-color: var(--color-accent);
}

.annonce-btn--apply:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200,169,78,.3);
}

.annonce-btn--comments {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border);
}

.annonce-btn--comments:hover {
    border-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.annonce-card__deadline {
    font-size: .78rem;
    font-weight: 600;
    color: #b3541e;
    background: rgba(179,84,30,.08);
    padding: 4px 12px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 14px;
}

.annonce-card__deadline--passed {
    color: #6c7a8d;
    background: rgba(108,122,141,.08);
}

/* ========================================
   FIL DE COMMENTAIRES (dans la carte)
   ======================================== */

.annonce-comments {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 22px 28px 26px;
}

.annonce-comments__title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.comment {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.comment__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .72rem;
    flex-shrink: 0;
}

.comment__author {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--color-primary);
}

.comment__profile {
    font-size: .75rem;
    color: var(--color-text-light);
}

.comment__stars {
    margin-left: auto;
    display: inline-flex;
    gap: 2px;
}

.comment__stars svg {
    width: 14px;
    height: 14px;
    color: var(--color-border);
}

.comment__stars svg.filled {
    color: var(--color-accent);
}

.comment__text {
    font-size: .84rem;
    line-height: 1.65;
    color: var(--color-text);
}

.comment__date {
    display: block;
    font-size: .72rem;
    color: var(--color-text-light);
    margin-top: 6px;
}

.comment__reply-btn {
    background: none;
    border: none;
    color: var(--color-accent-dark);
    font-family: var(--font-family);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0 0;
    transition: color .2s ease;
}

.comment__reply-btn:hover {
    color: var(--color-primary);
}

.comment__replies {
    margin-top: 12px;
    padding-left: 18px;
    border-left: 2px solid rgba(200,169,78,.35);
}

.comment__replies .comment {
    margin-bottom: 10px;
}

/* Formulaire de commentaire / réponse */
.comment-form {
    margin-top: 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
}

.comment-form--reply {
    margin-top: 10px;
    padding: 12px;
    background: var(--color-bg-alt);
}

.comment-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-form__group {
    margin-bottom: 10px;
}

.comment-form__label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.comment-form__input,
.comment-form__textarea,
.comment-form__select {
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-family);
    font-size: .8125rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
    transition: border-color .3s ease;
}

.comment-form__input:focus,
.comment-form__textarea:focus,
.comment-form__select:focus {
    border-color: var(--color-accent);
    background: var(--color-white);
}

.comment-form__textarea {
    resize: vertical;
    min-height: 70px;
}

/* Sélecteur de note en étoiles */
.star-picker {
    display: inline-flex;
    gap: 4px;
}

.star-picker button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
}

.star-picker svg {
    width: 22px;
    height: 22px;
    color: var(--color-border);
    transition: color .15s ease, transform .15s ease;
}

.star-picker button:hover svg,
.star-picker button.lit svg,
.star-picker button.lit ~ button:hover svg {
    color: var(--color-accent);
}

.star-picker button:hover svg {
    transform: scale(1.15);
}

.star-picker button.lit svg {
    color: var(--color-accent);
}

.comment-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    font-family: var(--font-family);
    font-size: .8125rem;
    font-weight: 600;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .3s ease;
}

.comment-form__submit:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

.comment-form__cancel {
    display: inline-block;
    padding: 9px 16px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--color-text-light);
    background: none;
    border: none;
    cursor: pointer;
}

.comment-form__cancel:hover {
    color: var(--color-primary);
}

.comment-form__anon-note {
    font-size: .72rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.comment-form__status {
    font-size: .8125rem;
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: none;
    line-height: 1.5;
}

.comment-form__status--success {
    display: block;
    background: rgba(76,175,80,.1);
    color: #2e7d32;
    border: 1px solid rgba(76,175,80,.3);
}

.comment-form__status--error {
    display: block;
    background: rgba(244,67,54,.1);
    color: #c62828;
    border: 1px solid rgba(244,67,54,.3);
}

.annonce-comments__empty {
    font-size: .84rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 12px;
}

/* ========================================
   ETAT VIDE
   ======================================== */

.annonces__empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

.annonces__empty svg {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--color-border);
}

.annonces__empty p {
    margin-bottom: 20px;
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .annonces__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .annonces-hero {
        padding: calc(var(--header-height) + 48px) 0 48px;
    }

    .annonce-card__body,
    .annonce-comments {
        padding: 22px 20px;
    }

    .annonce-card__actions {
        flex-direction: column;
    }

    .modal__panel {
        padding: 26px 20px;
    }

    .modal__form .form__row,
    .comment-form__row {
        grid-template-columns: 1fr;
    }
}