/* Content produced by the page editor, shown on public pages and inside the editor. */

/* Photos are always shown whole: the width may shrink, the height follows the picture's own proportions (never cropped or stretched). */
:is(#home-content, .rf-block) img {
  max-width: 100%;
  height: auto !important;
  object-fit: contain;
}

/* Photo block inserted with the editor's "Photo" button: a picture with an optional caption. */
:is(#home-content, .rf-block) figure.rf-figure {
  display: block;
  box-sizing: border-box;
  width: 480px;
  max-width: 100%;
  margin: 1rem auto;
}

:is(#home-content, .rf-block) figure.rf-figure img {
  display: block;
  width: 100%;
  border-radius: 10px;
}

:is(#home-content, .rf-block) figure.rf-figure figcaption {
  margin-top: .5rem;
  color: #5d685f;
  font-size: .95rem;
  line-height: 1.4;
  text-align: center;
}

:is(#home-content, .rf-block) figure.rf-figure figcaption:empty {
  display: none;
}

:is(#home-content, .rf-block) figure.rf-figure.rf-size-s { width: 280px; }
:is(#home-content, .rf-block) figure.rf-figure.rf-size-m { width: 480px; }
:is(#home-content, .rf-block) figure.rf-figure.rf-size-l { width: 720px; }
:is(#home-content, .rf-block) figure.rf-figure.rf-size-full { width: 100%; }

:is(#home-content, .rf-block) figure.rf-figure.rf-align-center {
  float: none;
  margin-right: auto;
  margin-left: auto;
}

:is(#home-content, .rf-block) figure.rf-figure.rf-align-left {
  float: left;
  margin: .25rem 1.5rem 1rem 0;
}

:is(#home-content, .rf-block) figure.rf-figure.rf-align-right {
  float: right;
  margin: .25rem 0 1rem 1.5rem;
}

/* Full-width photos never float, and on phones text no longer wraps around photos. */
:is(#home-content, .rf-block) figure.rf-figure.rf-size-full.rf-align-left,
:is(#home-content, .rf-block) figure.rf-figure.rf-size-full.rf-align-right {
  float: none;
  margin-right: 0;
  margin-left: 0;
}

@media (max-width: 576px) {
  :is(#home-content, .rf-block) figure.rf-figure.rf-align-left,
  :is(#home-content, .rf-block) figure.rf-figure.rf-align-right {
    float: none;
    margin-right: auto;
    margin-left: auto;
  }
}

/* Keep floated photos inside the page content. */
:is(#home-content, .rf-block)::after,
:is(#home-content, .rf-block) .jodit-wysiwyg::after {
  content: "";
  display: table;
  clear: both;
}

:is(#home-content, .rf-block) hr {
  margin: 1.5rem 0;
}

:is(#home-content, .rf-block) table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

:is(#home-content, .rf-block) td,
:is(#home-content, .rf-block) th {
  padding: .5rem .75rem;
  border: 1px solid #b9b2a2;
  vertical-align: top;
}

:is(#home-content, .rf-block) th {
  background: rgba(47, 107, 70, .08);
  text-align: left;
}

/* Videos inside news posts: the editor shows a placeholder, public pages show the embedded player. */
:is(#home-content, .rf-block) .rf-video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

:is(#home-content, .rf-block) .rf-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
