/* =========================================
   Admin dashboard: блок новостей на дашборде
   ========================================= */

.admin-news-draft {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-news-draft > .admin-quick-actions__grid {
    margin: 0;
}

.project-news-admin-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(var(--white-rgb),0.10);
    background:
        radial-gradient(circle at top right, rgba(var(--green-state-rgb), 0.12), transparent 42%),
        rgba(25, 146, 65, 0.18);
}

.project-news-admin-panel .admin-section__head {
    margin: 0;
}

.project-news-admin-panel .admin-section__title {
    line-height: 1.2;
}

/* =========================================
   Admin: новости проекта
   ========================================= */

.admin-news-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.45fr);
    gap: 16px;
    align-items: start;
}

.admin-news-create,
.admin-news-list-card {
    padding: 18px;
}

.admin-news-create {
    position: sticky;
    top: 18px;
}

.admin-news-list {
    display: grid;
    gap: 12px;
}

.admin-news-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(var(--white-rgb),0.08);
    background: rgba(var(--white-rgb),0.04);
}

.admin-news-item__main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.admin-news-item__top,
.admin-news-item__meta,
.admin-news-item__reactions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-news-item__title {
    margin: 0;
    color: rgba(var(--white-rgb),0.96);
    font-size: 19px;
    line-height: 1.3;
}

.admin-news-item__body {
    color: rgba(var(--white-rgb),0.76);
    font-size: 14px;
    line-height: 1.55;
}

.admin-news-item__meta,
.admin-news-item__reactions {
    color: rgba(var(--white-rgb),0.70);
    font-size: 13px;
    line-height: 1.35;
}

.admin-news-item__meta strong,
.admin-news-item__reactions strong {
    color: rgba(var(--white-rgb),0.94);
    font-weight: 400;
}

.admin-news-item__actions {
    display: flex;
    justify-content: flex-end;
}

.admin-news-item__actions form {
    margin: 0;
}

/* =========================================
   Project news: форма быстрого объявления
   ========================================= */

.project-news-admin-form {
    display: grid;
    gap: 12px;
}

.project-news-admin-form__select-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.project-news-admin-form__field {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.project-news-admin-form__field input,
.project-news-admin-form__field select,
.project-news-admin-form__field textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(var(--white-rgb),0.10);
    border-radius: 12px;
    background: rgba(var(--white-rgb),0.04);
    color: inherit;
    outline: none;
}

.project-news-admin-form__field input:focus,
.project-news-admin-form__field select:focus,
.project-news-admin-form__field textarea:focus {
    border-color: rgba(var(--white-rgb),0.24);
    background: rgba(var(--white-rgb),0.06);
    box-shadow: 0 0 0 3px rgba(var(--white-rgb),0.05);
}

.project-news-admin-form__field select {
    color: rgba(var(--white-rgb),0.92);
    color-scheme: dark;
    cursor: pointer;
}

.project-news-admin-form__field select option {
    background: var(--slate-mid);
    color: var(--ink-50);
}

.project-news-admin-form__field select option:checked {
    background: #4056c9;
    color: var(--white);
}

.project-news-admin-form__field textarea {
    resize: vertical;
    min-height: 92px;
}

.project-news-admin-form__actions {
    display: grid;
    gap: 10px;
}

.project-news-admin-form__button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 42px;
    box-sizing: border-box;

    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(var(--white-rgb),0.10);

    font: inherit;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 400;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.project-news-admin-form__button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

/*
 * LE VERT DE LA FAMILLE, PAS UN VERT A LUI.
 *
 * C etait un aplat vif a texte sombre, seul de son espece dans le
 * produit : tous les autres boutons pleins descendent de leur couleur
 * vers son propre sombre, avec une lueur de la meme teinte. Sur un fond
 * sombre, cet aplat clair sautait aux yeux plus fort que « Demarrer la
 * consultation », alors qu il publie une breve.
 *
 * ET IL EST BLEU, PAS VERT. La couleur dit CE QUE FAIT le bouton : bleu
 * pour poster, publier, envoyer un message ; vert pour les resultats ; or
 * pour les programmes ; violet pour les consultations ; rouge pour
 * l irreversible. Publier une breve est un envoi, meme depuis une carte
 * d administration. Mon premier essai l avait mis au vert des resultats.
 */
.project-news-admin-form__button--publish {
    background: linear-gradient(135deg, #244DAE, #132A52);
    background-clip: padding-box;
    border-color: rgba(var(--blue-light-rgb), 0.50);
    box-shadow: 0 8px 18px rgba(36, 77, 174, 0.28);
    color: var(--encre-sur-fond-fixe);
}

/* Le geste commun : un pixel et huit pour cent au survol, le retour au
   sol et les memes huit pour cent en moins a l appui. Son survol
   repeignait, ce qui obligeait a tenir deux paires de couleurs. */
.project-news-admin-form__button--publish:hover {
    border-color: rgba(var(--blue-light-rgb), 0.72);
    color: var(--white);
}

.project-news-admin-form__button:active {
    transform: translateY(0);
    filter: brightness(0.92);
}

.project-news-admin-form__button--link {
    background: rgba(var(--ink-600-rgb), 0.96);
    border-color: rgba(var(--white-rgb),0.08);
    color: rgba(var(--white-rgb),0.94);
}

.project-news-admin-form__button--link:hover {
    background: rgba(64, 79, 116, 0.98);
    border-color: rgba(var(--white-rgb),0.14);
    color: var(--white);
}

/* =========================================
   Admin dashboard: последние новости + реакции
   ========================================= */

/* --- 4. Le trait de separation respire ------------------------------------
   -------------------------------------------------------------------------
   Mesure : 2 px entre le bas du bouton « Publier » et le filet qui ouvre
   « Dernieres actualites ». Un trait de separation pose a 2 px ne separe rien,
   il souligne le bouton : l'oeil lit les deux comme un seul objet, et la liste
   qui suit parait appartenir au formulaire.

   24 px, le jeton `--espace-xl`. C'est l'ecart qu'on met deja entre deux
   groupes A L INTERIEUR d'un bloc, ce qui est exactement le cas : le
   formulaire d'un cote, ce qui a deja ete publie de l'autre. Les 12 px de
   rembourrage du titre s'y ajoutent, donc 36 px avant le libelle.
   ------------------------------------------------------------------------- */
.admin-news-draft__latest {
    display: grid;
    gap: 7px;
    margin-top: var(--espace-xl);
    padding-top: 12px;
    border-top: 1px solid rgba(var(--white-rgb),0.08);
}

.admin-news-draft__latest-title {
    color: rgba(var(--white-rgb),0.78);
    font-size: 13px;
    font-weight: 800;
}

.admin-news-draft__latest-item {
    display: grid;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(var(--white-rgb),0.04);
    border: 1px solid rgba(var(--white-rgb),0.045);
    font-size: 13px;
    line-height: 1.35;
    box-sizing: border-box;
}

.admin-news-draft__latest-item-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    min-width: 0;
}

.admin-news-draft__latest-name {
    min-width: 0;
    max-width: 100%;
    color: rgba(var(--white-rgb),0.88);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.admin-news-draft__latest-status {
    flex: 0 0 auto;
    white-space: nowrap;
    color: rgba(var(--white-rgb), var(--voile-mention, 0.56));
    font-size: 12px;
    line-height: 1.35;
}

.admin-news-draft__latest-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 7px;
    color: rgba(var(--white-rgb), var(--voile-mention, 0.58));
    font-size: 11px;
    line-height: 1.25;
}

.admin-news-draft__latest-stats span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 21px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(var(--white-rgb),0.04);
    border: 1px solid rgba(var(--white-rgb),0.055);
    white-space: nowrap;
}

.admin-news-draft__latest-stats strong {
    color: rgba(var(--white-rgb),0.88);
    font-weight: 400;
}

/* =========================================
   Project news: текущая новость и история
   ========================================= */

.project-news-card {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(var(--journey-accent-rgb, 99, 215, 196), 0.28);
    background:
        radial-gradient(circle at top right, rgba(var(--journey-accent-rgb, 99, 215, 196), 0.13), transparent 38%),
        rgba(var(--slate-mid-rgb), 0.54);
    box-shadow:
        0 16px 38px rgba(var(--black-rgb),0.18),
        inset 0 1px 0 rgba(var(--white-rgb),0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.project-news-card::before {
    content: "";
    position: absolute;
    inset: 14px auto 14px 0;
    width: 4px;
    border-radius: 0 8px 8px 0;
    background: rgba(var(--journey-accent-rgb, 99, 215, 196), 0.78);
}

.project-news-card--important {
    border-color: rgba(var(--amber-rgb), 0.34);
    background:
        radial-gradient(circle at top right, rgba(var(--amber-rgb), 0.16), transparent 38%),
        rgba(48, 39, 25, 0.66);
}

.project-news-card--feedback {
    border-color: rgba(var(--teinte-violette), 0.34);
    background:
        radial-gradient(circle at top right, rgba(var(--teinte-violette), 0.16), transparent 38%),
        rgba(34, 32, 54, 0.66);
}

.project-news-card__main {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}

.project-news-card__top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.project-news-card__type,
.project-news-card__pin,
.project-news-card__date,
.project-news-card__state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    font-weight: 400;
    background: rgba(var(--white-rgb),0.08);
    border: 1px solid rgba(var(--white-rgb),0.08);
    color: rgba(var(--white-rgb),0.78);
}

.project-news-card__type {
    color: rgba(var(--white-rgb),0.94);
    background: rgba(var(--journey-accent-rgb, 99, 215, 196), 0.16);
    border-color: rgba(var(--journey-accent-rgb, 99, 215, 196), 0.24);
}

.project-news-card__pin {
    color: var(--amber-soft);
    background: rgba(var(--amber-deep-rgb), 0.13);
    border-color: rgba(var(--amber-deep-rgb), 0.24);
}

.project-news-card__title {
    margin: 0;
    color: rgba(var(--white-rgb),0.98);
    font-size: 22px;
    line-height: 1.25;
}

.project-news-card__body {
    color: rgba(var(--white-rgb),0.82);
    font-size: 15px;
    line-height: 1.65;
}

.project-news-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.project-news-card__actions form {
    margin: 0;
}

.project-news-card__dismiss {
    margin-left: auto;
}

.project-news-card__dismiss button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(var(--white-rgb),0.06);
    color: rgba(var(--white-rgb),0.72);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.project-news-card__dismiss button:hover {
    background: rgba(var(--white-rgb),0.12);
    color: var(--white);
}

.project-news-history {
    display: grid;
    gap: 18px;
}

.project-news-history__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.project-news-history__list {
    display: grid;
    gap: 14px;
}

.project-news-card--history {
    margin: 0;
}

/* =========================================
   Project news: компактные реакции
   ========================================= */

.project-news-reactions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.project-news-reactions form {
    margin: 0;
    width: auto;
}

.project-news-reaction {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    width: auto;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--white-rgb),0.10);
    background: rgba(var(--white-rgb),0.06);
    color: rgba(var(--white-rgb),0.86);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        box-shadow .18s ease;
}

.project-news-reaction:hover {
    transform: translateY(-1px);
    color: var(--white);
    box-shadow: 0 8px 18px rgba(var(--black-rgb),0.16);
}

.project-news-reaction--read {
    color: var(--couleur-succes-doux);
    background: rgba(var(--share-bright-rgb), 0.13);
    border-color: rgba(var(--share-bright-rgb), 0.26);
}

.project-news-reaction--read:hover {
    background: rgba(var(--share-bright-rgb), 0.20);
    border-color: rgba(var(--share-bright-rgb), 0.38);
}

.project-news-reaction--useful {
    color: #fae950;
    background: rgba(247, 148, 56, 0.13);
    border-color: rgba(190, 151, 80, 0.28);
}

.project-news-reaction--useful:hover {
    background: rgba(190, 179, 80, 0.20);
    border-color: rgba(190, 179, 80, 0.40);
}

.project-news-reaction--details {
    color: var(--blue-pale);
    background: rgba(var(--blue-rgb), 0.13);
    border-color: rgba(var(--blue-rgb), 0.28);
}

.project-news-reaction--details:hover {
    background: rgba(var(--blue-rgb), 0.20);
    border-color: rgba(var(--blue-rgb), 0.40);
}

.project-news-reaction--question {
    color: var(--amber-soft);
    background: rgba(var(--amber-deep-rgb), 0.13);
    border-color: rgba(var(--amber-deep-rgb), 0.28);
}

.project-news-reaction--question:hover {
    background: rgba(var(--amber-deep-rgb), 0.20);
    border-color: rgba(var(--amber-deep-rgb), 0.40);
}

.project-news-reaction--muted {
    color: rgba(var(--white-rgb),0.66);
    background: rgba(var(--white-rgb),0.06);
    border-color: rgba(var(--white-rgb),0.08);
}

.project-news-reaction--muted:hover {
    color: rgba(var(--white-rgb),0.88);
    background: rgba(var(--white-rgb),0.09);
    border-color: rgba(var(--white-rgb),0.14);
}

.project-news-reaction--all {
    color: rgba(var(--white-rgb),0.82);
    background: rgba(109, 93, 252, 0.13);
    border-color: rgba(109, 93, 252, 0.28);
}

.project-news-reaction--all:hover {
    background: rgba(109, 93, 252, 0.20);
    border-color: rgba(109, 93, 252, 0.40);
}

/* =========================================
   Адаптация
   ========================================= */

@media (max-width: 1180px) {
    .admin-news-layout {
        grid-template-columns: 1fr;
    }

    .admin-news-create {
        position: static;
    }
}

@media (max-width: 760px) {
    .project-news-card {
        padding: 16px;
        border-radius: 18px;
    }

    .project-news-card__title {
        font-size: 19px;
    }

    .project-news-card__actions {
        align-items: center;
        flex-direction: row;
        gap: 8px;
    }

    .project-news-reactions {
        width: auto;
        flex: 1 1 auto;
    }

    .project-news-card__actions .project-news-reactions form {
        width: auto;
    }

    .project-news-card__actions .project-news-reaction {
        width: auto;
    }

    .project-news-card__dismiss {
        width: auto;
        margin-left: 0;
    }

    .project-news-card__dismiss button {
        width: 34px;
        border-radius: 999px;
    }
}

@media (max-width: 520px) {
    .project-news-admin-form__select-row {
        grid-template-columns: 1fr;
    }
}