/* ============================================================
   Flying Fries — News
   Timeline agrégée : posts Discord + brèves back-office.
   La typo du contenu vient d'articles.css (.article-body) ;
   ici : cartes, en-têtes de source, grilles d'images, emojis.
   ============================================================ */

.news-intro {
    font-size: 14px;
    color: var(--ff-text-muted);
    margin-bottom: 28px;
}
.news-intro a {
    color: var(--ff-discord);
    font-weight: 600;
}
.news-intro a:hover {
    color: var(--ff-gold);
}

/* Grille contenu + nav latérale sticky (même logique que .article-layout) */
.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 860px) 220px;
    gap: 36px;
    align-items: start;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* La nav hérite du style .article-toc (sticky, liens à bordure gauche).
   Les libellés de news sont plus longs que des titres : on tronque proprement. */
.news-toc .article-toc-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ancrage sous le header fixe pour les accès directs par hash */
.news-card {
    scroll-margin-top: 90px;
}

.news-empty {
    color: var(--ff-text-muted);
    font-size: 14px;
}

/* ─── Carte ─────────────────────────────── */

.news-card {
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius-lg);
    background: var(--ff-bg);
    box-shadow: var(--ff-shadow-card);
    padding: 22px 26px;
    transition: border-color var(--ff-transition-mid), box-shadow var(--ff-transition-mid);
}

.news-card:hover {
    border-color: var(--ff-gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.news-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ff-border);
}

.news-source {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ff-gold);
}

.news-source-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.news-date {
    font-size: 11px;
    color: var(--ff-text-muted);
}

/* ─── Brèves ────────────────────────────── */

.news-brief-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ff-text);
    padding: 0;
    margin-bottom: 4px;
}

.news-brief-subtitle {
    font-size: 13px;
    color: var(--ff-text-muted);
    margin-bottom: 10px;
}

/* ─── Contenu (au-dessus de la typo article-body) ── */

.news-body {
    font-size: 14px;
}

/* Les titres Discord (h2/h3) sont plus discrets qu'en article : on reste dans une carte */
.news-body h2 {
    font-size: 17px;
    margin-top: 20px;
}
.news-body h3 {
    font-size: 15px;
    margin-top: 16px;
}
.news-body > .article-body h2:first-child,
.news-body h2:first-child,
.news-body h3:first-child {
    margin-top: 0;
}

/* Emojis custom Discord : inline, calés sur la hauteur de ligne */
.news-body img.d-emoji {
    display: inline-block;
    width: auto;
    height: 1.35em;
    margin: 0;
    vertical-align: -0.27em;
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
}

/* Sous-texte Discord (-# ...) */
.news-body .d-subtext {
    font-size: 12px;
    color: var(--ff-text-muted);
}

/* Spoiler Discord : masqué tant que non survolé/touché */
.news-body .d-spoiler {
    background: var(--ff-dark);
    color: transparent;
    border-radius: 3px;
    padding: 0 4px;
    cursor: pointer;
    transition: color var(--ff-transition-fast), background var(--ff-transition-fast);
}
.news-body .d-spoiler:hover,
.news-body .d-spoiler:active {
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}

/* Les URLs longues ne doivent jamais déborder de la carte */
.news-body a {
    overflow-wrap: anywhere;
}

/* Lien interne Discord : pastille au lieu de l'URL brute (blurple officiel) */
.news-body a.d-discord-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ff-discord);
    border: 1px solid var(--ff-discord);
    border-radius: var(--ff-radius-sm);
    padding: 2px 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--ff-transition-fast), color var(--ff-transition-fast);
}
.news-body a.d-discord-link::before {
    content: '';
    width: 14px;
    height: 14px;
    background: url('/res/gfx/discord_purple.png') center / contain no-repeat;
    flex-shrink: 0;
}
.news-body a.d-discord-link:hover {
    background: rgba(88, 101, 242, 0.1);
    color: var(--ff-discord);
}

/* Mention de channel (#hind, #roles…) : hashtag lisible, cliquable, blurple Discord */
.news-body a.d-channel-link {
    color: var(--ff-discord);
    font-weight: 600;
    text-decoration: none;
    background: rgba(88, 101, 242, 0.08);
    border-radius: 3px;
    padding: 0 4px;
    transition: background var(--ff-transition-fast);
}
.news-body a.d-channel-link:hover {
    background: rgba(88, 101, 242, 0.18);
}

/* Blocs de code Discord */
.news-body pre {
    background: rgba(0, 0, 0, 0.045);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius-md);
    padding: 12px 14px;
    margin: 14px 0;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.5;
}

/* ─── Grille d'images d'un post ─────────── */

.news-media {
    margin-top: 16px;
}

.news-media--single img,
.news-media--grid img {
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
    object-fit: cover;
    border-radius: var(--ff-radius-md);
    box-shadow: var(--ff-shadow-img);
}

.news-media--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ─── Responsive ────────────────────────── */

@media screen and (max-width: 768px) {
    .news-layout {
        grid-template-columns: 1fr;   /* la nav .article-toc est déjà masquée par articles.css */
    }
    .news-card {
        padding: 16px 18px;
    }
    .news-media--grid {
        grid-template-columns: 1fr;
    }
}
