/* =========================================================
   Le Café des Mots - NEWS PAGE (pages/news.html + js/news.js)
   Needs only css/header.css (menu, fonts, title band).

   One block per news item, most recent first (the admin keeps them sorted):
     <article class="news-item" id="news-…">            photo on the left, text on the right
     <article class="news-item news-item--text" id="…">  no photo: the text takes the whole width
   The text is cut after a few lines; js/news.js shows "Lire la suite" only when it is longer.
   Written with start/end (not left/right) so it also works in Arabic.
   ========================================================= */

.news-page {
    --n-paper: #fffdf9;
    --n-cream: #f7f3ec;
    --n-ink: #18201d;
    --n-terra: #b9482d;
    --n-line: #dde3df;                         /* soft grey-green edges (same colours as Ateliers / Qui sommes-nous) */
    --n-muted: #66645e;
    --n-serif: 'Playfair Display', Georgia, serif;
    --n-sans: 'DM Sans', Arial, sans-serif;
    --n-lines: 6;                              /* lines of text shown before "Lire la suite" */
    background: #eef1ee;
    color: var(--n-ink);
    font-family: var(--n-sans);
}

.news-wrap {
    width: min(1180px, calc(100% - 40px));           /* same width as the title band */
    margin: 0 auto;
    padding: clamp(30px, 5vw, 56px) 0 clamp(50px, 7vw, 90px);
}

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

/* ---------- one news item ---------- */

.news-item {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--n-line);
    scroll-margin-top: 110px;                  /* news.html#news-… lands below the menu */
}

.news-item--text {
    grid-template-columns: minmax(0, 1fr);
    border-inline-start: 4px solid var(--n-terra);
}

.news-item__photo {
    min-height: 100%;
    max-height: 340px;
    overflow: hidden;
    background: var(--n-cream);
}

.news-item.is-open .news-item__photo {
    max-height: none;
}

.news-item__photo img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
}

.news-item__body {
    display: flex;
    flex-direction: column;
    padding: clamp(22px, 3vw, 32px);
}

.news-item__date {
    margin-bottom: 8px;
    color: var(--n-terra);
    font: 700 12px/1.3 var(--n-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.news-item h2 {
    margin: 0 0 12px;
    font: 600 clamp(22px, 2.4vw, 28px)/1.2 var(--n-serif);
}

/* the text: fixed height with a soft fade, until "Lire la suite" */
.news-item__text {
    position: relative;
    max-height: calc(var(--n-lines) * 1.7em);
    overflow: hidden;
    color: var(--n-muted);
    font-size: 15px;
    line-height: 1.7;
}

.news-item__text p {
    margin: 0 0 .8em;
}

.news-item__text p:last-child {
    margin-bottom: 0;
}

.news-item.is-long .news-item__text::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3.4em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}

.news-item.is-open .news-item__text {
    max-height: none;
}

.news-item.is-open .news-item__text::after {
    display: none;
}

/* "Lire la suite" / "Réduire", and the optional link */
.news-item__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    margin-top: 16px;
}

.news-item__more {
    padding: 0;
    border: 0;
    background: none;
    color: var(--n-terra);
    font: 700 14px var(--n-sans);
    cursor: pointer;
}

.news-item__more:hover,
.news-item__link:hover {
    text-decoration: underline;
}

.news-item__link {
    color: var(--n-ink);
    font: 600 14px var(--n-sans);
    text-decoration: none;
}

.news-empty {
    margin: 0;
    padding: 50px 20px;
    border: 1px dashed var(--n-line);
    color: var(--n-muted);
    text-align: center;
}

/* ---------- phones: photo on top, text below ---------- */

@media (max-width: 700px) {
    .news-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .news-item__photo,
    .news-item.is-open .news-item__photo {
        max-height: none;
        aspect-ratio: 16 / 10;
    }

    .news-item__photo img {
        min-height: 0;
    }

    .news-item {
        --n-lines: 5;
    }
}
