/*
 * Blogi: the listing at /blogi/ (templates/home.html, parts/blogi-list.html) and the Artikkeli
 * (templates/single-post.html). Tokens come from theme.json; the shell's breakpoint is 782px.
 * The `.rv-entry` pieces are the list entry the Keskustelut list is meant to reuse.
 */

/* The page heading of a list ("Blogi"); same scale as the shell's post title. */
h1.rv-page-title {
  margin: 0;
  font-size: 32px;
  line-height: 38px;
}

/* ---- Listing ---- */

.rv-blogi-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.rv-blogi-list .wp-block-post-template {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rv-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 3px solid var(--wp--preset--color--primary);
}

.rv-entry > * {
  margin: 0;
}

.rv-entry__date {
  font-size: 15px;
  color: var(--wp--preset--color--muted);
}

.rv-entry__title {
  font-size: 23px;
  line-height: 29px;
}

/* The design leaves entry links underlined (core's read-more block removes it). */
.rv-entry__title a,
.rv-entry__more {
  text-decoration: underline;
}

.rv-entry__excerpt {
  font-size: 17px;
  line-height: 25px;
}

.rv-entry__excerpt p {
  margin: 0;
}

.rv-entry__more {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
}

.rv-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--wp--preset--color--divider);
  padding-top: 8px;
}

.rv-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
}

/* With only "Vanhemmat →" (the first page) it still sits on the right, as in the design. */
.rv-pagination .wp-block-query-pagination-next {
  margin-left: auto;
}

.rv-empty {
  margin: 0;
  font-size: 17px;
  line-height: 25px;
}

/* ---- Artikkeli ---- */

.rv-article {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rv-article > * {
  margin: 0;
}

.rv-article__date {
  font-size: 16px;
  color: var(--wp--preset--color--muted);
}

.rv-article__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

.rv-article__body {
  max-width: 68ch;
  font-size: 18px;
  line-height: 28px;
}

.rv-article__body > * {
  margin-top: 0;
  margin-bottom: 0;
}

.rv-article__body > * + * {
  margin-top: 20px;
}

.rv-article__body a {
  font-weight: 600;
}

.rv-article__body img {
  max-width: 100%;
  height: auto;
}

@media (min-width: 782px) {
  h1.rv-page-title {
    font-size: 42px;
    line-height: 48px;
  }

  .rv-blogi-list .wp-block-post-template {
    gap: 28px;
  }

  .rv-entry__title {
    font-size: 26px;
    line-height: 32px;
  }

  .rv-entry__excerpt {
    line-height: 26px;
  }

  .rv-article {
    gap: 20px;
  }

  .rv-article h1.wp-block-post-title {
    max-width: 26ch;
  }

  .rv-article__image img {
    max-height: 380px;
  }

  .rv-article__body {
    font-size: 19px;
    line-height: 31px;
  }

  .rv-article__body > * + * {
    margin-top: 22px;
  }
}
