/* news — the latest posts: a grid, a lead post over two, or a list of rows. */

.news-rows--two { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; border-top: 0; }

.news-rows--two .news-row:nth-child(-n+2) { border-top: 1px solid var(--line); }

.news-block--list .news-row__title { font-size: 1.1rem; }

@media (max-width: 899px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
  .news-grid.has-lead > .news-card--lead { grid-column: 1 / -1; grid-row: auto; }
  .news-grid.has-lead > .news-card:last-child:nth-child(even),
  .news-grid:not(.has-lead):not(.is-single) > .news-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .news-grid.has-lead > .news-card.has-photo:last-child:nth-child(even):not(.news-card--lead),
  .news-grid:not(.has-lead):not(.is-single) > .news-card.has-photo:last-child:nth-child(odd) { display: grid; grid-template-columns: 1fr 1fr; }
  .news-grid > .news-card.has-photo:last-child .news-card__media { aspect-ratio: auto; min-height: 12rem; }
  .news-rows--two { grid-template-columns: 1fr; }
  .news-rows--two .news-row:nth-child(2) { border-top: 0; }
}

@media (max-width: 559px) {
  .news-grid { grid-template-columns: 1fr; gap: 1rem; }
  .news-grid > .news-card.has-photo:last-child, .news-card--wide.has-photo { display: flex !important; }
  .news-grid > .news-card.has-photo:last-child .news-card__media, .news-card--wide .news-card__media { aspect-ratio: 3 / 2; min-height: 0; }
}

/* ---------- A post's card (_post_card.twig) — was the card_post component's; after the block's own, as it was linked. ---------- */
/* A day as a tile — the number and the month — shared by the account's lines and the news list. */
.date-tile { display: grid; place-items: center; align-content: center; gap: .1rem; width: 3.6rem; height: 3.6rem; flex: none; border: 1px solid var(--card-line); border-radius: var(--radius-small); background: var(--bg); line-height: 1; }

.date-tile strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--ink); }

.date-tile small { font-size: .72rem; text-transform: lowercase; color: var(--muted); }

.news-grid.has-lead > .news-card--lead { grid-column: span 2; grid-row: span 2; }

.news-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: var(--card-border, 1px solid var(--card-line)); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: transform .2s ease, border-color .2s ease; }

.news-card:hover { transform: translateY(-2px); border-color: var(--mark, var(--primary)); }

.news-card:has(.news-card__link:focus-visible) { outline: 2px solid var(--mark, var(--primary)); outline-offset: 2px; }

.news-card__media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--hover-wash); }

.news-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }

.news-card:hover .news-card__media img { transform: scale(1.03); }

.news-card__body { display: flex; flex-direction: column; gap: .55rem; padding: 1.2rem 1.35rem 1.4rem; flex: 1; }

.news-card__title { margin: 0; font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }

.news-card__link { color: inherit; }

.news-card__link::after { content: ''; position: absolute; inset: 0; }

.news-card__link:focus-visible { outline: none; }

.news-card:hover .news-card__title { color: var(--mark, var(--primary)); }

.news-card__excerpt { margin: 0; font-size: .92rem; line-height: 1.6; color: var(--body-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.news-card__time { display: inline-flex; align-items: center; gap: .4rem; margin: auto 0 0; padding-top: .3rem; font-size: .82rem; color: var(--muted); }

.news-card__time svg { width: 1rem; height: 1rem; }

/* No photo: not a placeholder — a rule in the accent, a larger title, a longer excerpt. */
.news-card.is-text .news-card__rule { display: block; width: 2.25rem; height: 3px; border-radius: 2px; background: var(--mark, var(--primary)); margin-bottom: .4rem; }

.news-card.is-text .news-card__title { font-size: 1.42rem; -webkit-line-clamp: 4; }

.news-card.is-text .news-card__excerpt { -webkit-line-clamp: 5; }

/* The newest, large: the photo fills the height above the text; without one a typographic cover. */
.news-card--lead .news-card__media { flex: 1; min-height: 17rem; aspect-ratio: auto; }

.news-card--lead .news-card__title { font-size: clamp(1.55rem, 2.6vw, 2.15rem); line-height: 1.15; }

.news-card--lead .news-card__excerpt { -webkit-line-clamp: 2; font-size: 1rem; }

.news-card--lead .news-card__body { flex: none; padding: 1.5rem 1.6rem 1.6rem; }

.news-card--lead.is-text { background: linear-gradient(160deg, var(--tint), var(--surface) 70%); }

.news-card--lead.is-text .news-card__body { flex: 1; justify-content: flex-end; padding: 2rem; }

.news-card--lead.is-text .news-card__rule { width: 3rem; height: 4px; margin-bottom: auto; }

.news-card--lead.is-text .news-card__title { font-size: clamp(2rem, 3.6vw, 3rem); -webkit-line-clamp: 4; }

.news-card--lead.is-text .news-card__excerpt { font-size: 1.1rem; -webkit-line-clamp: 4; }

.news-card--lead .news-card__time { margin-top: .4rem; }

/* One alone: across the width, the photo beside the text. */
.news-card--wide.has-photo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.news-card--wide .news-card__media { aspect-ratio: auto; min-height: 16rem; }

.news-card--wide .news-card__body { justify-content: center; padding: 1.8rem 2rem; }

.news-card--wide .news-card__title { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }

.news-row { position: relative; display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 1.2rem; align-items: start; padding: 1.2rem .3rem; border-bottom: 1px solid var(--line); }

.news-row.has-photo { grid-template-columns: 3.6rem minmax(0, 1fr) 11rem; }

.news-row:hover { background: var(--hover-wash); }

.news-row:has(.news-card__link:focus-visible) { outline: 2px solid var(--mark, var(--primary)); outline-offset: -2px; }

.news-row__text { display: grid; gap: .35rem; min-width: 0; }

.news-row__title { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.news-row:hover .news-row__title { color: var(--mark, var(--primary)); }

.news-row__excerpt { margin: 0; max-width: 68ch; font-size: .92rem; color: var(--body-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.news-row__thumb { aspect-ratio: 3 / 2; border-radius: var(--radius-small); overflow: hidden; }

.news-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 899px) {
  .news-grid.has-lead > .news-card--lead { grid-column: 1 / -1; grid-row: auto; }

  /* A last card alone on two columns takes the width, the photo beside the text. */
  .news-grid.has-lead > .news-card:last-child:nth-child(even),
    .news-grid:not(.has-lead):not(.is-single) > .news-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .news-grid.has-lead > .news-card.has-photo:last-child:nth-child(even):not(.news-card--lead),
    .news-grid:not(.has-lead):not(.is-single) > .news-card.has-photo:last-child:nth-child(odd) { display: grid; grid-template-columns: 1fr 1fr; }

  .news-grid > .news-card.has-photo:last-child .news-card__media { aspect-ratio: auto; min-height: 12rem; }

  .news-card--wide.has-photo { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 559px) {
  .news-grid > .news-card.has-photo:last-child, .news-card--wide.has-photo { display: flex !important; }

  .news-grid > .news-card.has-photo:last-child .news-card__media, .news-card--wide .news-card__media { aspect-ratio: 3 / 2; min-height: 0; }

  .news-row.has-photo { grid-template-columns: 3.6rem minmax(0, 1fr); }
}

/* _post_card — one post as a card or a row: its photo, its date, its title and its first line. */

@media (max-width: 899px) {
  .news-card--lead .news-card__media { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .news-grid.has-lead > .news-card:last-child:nth-child(even),
  .news-grid:not(.has-lead):not(.is-single) > .news-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .news-grid.has-lead > .news-card.has-photo:last-child:nth-child(even):not(.news-card--lead),
  .news-grid:not(.has-lead):not(.is-single) > .news-card.has-photo:last-child:nth-child(odd) { display: grid; grid-template-columns: 1fr 1fr; }
  .news-grid > .news-card.has-photo:last-child .news-card__media { aspect-ratio: auto; min-height: 12rem; }
  .news-rows--two .news-row:nth-child(2) { border-top: 0; }
}

@media (max-width: 559px) {
  .news-grid > .news-card.has-photo:last-child, .news-card--wide.has-photo { display: flex !important; }
  .news-grid > .news-card.has-photo:last-child .news-card__media, .news-card--wide .news-card__media { aspect-ratio: 3 / 2; min-height: 0; }
  .news-row.has-photo { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .news-row__thumb { display: none; }
}
