/*
 * Keskustelut (list) and Keskustelu (single). Loaded on those two templates only.
 * Values follow mockups/desktop|mobile/keskustelut.html and keskustelu.html; breakpoint 782px as in shell.css.
 */

.rv-keskustelut .rv-title,
.rv-keskustelut .rv-intro,
.rv-keskustelut .rv-list,
.rv-keskustelu__article {
  margin: 0;
}

.rv-keskustelut .rv-title {
  font-size: 32px;
  line-height: 38px;
}

.rv-keskustelut .rv-intro {
  max-width: 62ch;
  font-size: 17px;
  line-height: 26px;
}

.rv-keskustelut .rv-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

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

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

.rv-item .rv-meta {
  font-size: 15px;
}

.rv-item .wp-block-post-title {
  margin: 0;
  font-size: 23px;
  line-height: 29px;
}

.rv-item .wp-block-post-excerpt {
  margin: 0;
}

.rv-item .wp-block-post-excerpt__excerpt {
  margin: 0;
  font-size: 17px;
  line-height: 25px;
}

.rv-meta {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--wp--preset--color--muted);
}

/* "Lue lisää →", "← Takaisin keskusteluihin" and the pagination links share one link style. */
.rv-keskustelut .wp-block-read-more,
.rv-keskustelut .wp-block-query-pagination a,
.rv-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
}

/* The design underlines every link here (titles included). */
.rv-item .wp-block-post-title a,
.rv-keskustelut .wp-block-read-more,
.rv-keskustelut .wp-block-query-pagination a,
.rv-back a,
.rv-source a {
  text-decoration: underline;
}

.rv-back {
  margin: 0;
}

.rv-keskustelut .wp-block-query-pagination {
  margin: 0;
  gap: 16px;
  border-top: 1px solid var(--wp--preset--color--divider);
  padding-top: 8px;
}

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

/* ---- Single ---- */

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

.rv-keskustelu h1.wp-block-post-title {
  max-width: 26ch;
  font-size: 30px;
  line-height: 36px;
}

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

.rv-keskustelu__body > * {
  margin: 0;
  max-width: 68ch;
}

.rv-keskustelu__body > p,
.rv-keskustelu__body > ul,
.rv-keskustelu__body > ol {
  font-size: 18px;
  line-height: 28px;
}

.rv-keskustelu__body > h2,
.rv-keskustelu__body > h3 {
  font-size: 22px;
  line-height: 28px;
}

.rv-keskustelu__body blockquote {
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--wp--preset--color--primary);
  font-family: var(--wp--preset--font-family--newsreader);
  font-style: italic;
  font-size: 18px;
  line-height: 27px;
  color: var(--wp--preset--color--quote);
}

/* Blocks left empty from the pattern take no space (and an empty quote shows no accent line). */
.rv-keskustelu__body p:empty,
.rv-keskustelu__body blockquote:not(:has(p:not(:empty))) {
  display: none;
}

.rv-keskustelu__body blockquote > * {
  margin: 0;
}

.rv-keskustelu__body blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--wp--preset--font-family--roboto);
  font-style: normal;
  font-size: 15px;
  color: var(--wp--preset--color--muted);
}

.rv-source {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

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

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

  .rv-keskustelut .rv-intro {
    font-size: 18px;
    line-height: 27px;
  }

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

  .rv-item .wp-block-post-title {
    font-size: 26px;
    line-height: 32px;
  }

  .rv-item .wp-block-post-excerpt__excerpt {
    line-height: 26px;
  }

  .rv-keskustelu__article {
    gap: 18px;
  }

  .rv-keskustelu h1.wp-block-post-title {
    font-size: 38px;
    line-height: 44px;
  }

  .rv-keskustelu__body {
    gap: 18px;
  }

  .rv-keskustelu__body > p,
  .rv-keskustelu__body > ul,
  .rv-keskustelu__body > ol {
    font-size: 19px;
    line-height: 30px;
  }

  .rv-keskustelu__body blockquote {
    padding: 4px 0 4px 24px;
    font-size: 19px;
    line-height: 29px;
  }

  .rv-source {
    margin-top: 4px;
  }
}
