/*
 * Article (Aixor redesign 2026-10-05): the figure runs inside the article body (single, landscape,
 * portrait, and the paired/tripled galleries autostatyba_article_figures() builds), carried over.
 */
.blog-detail-sec .rd-article__body > p:first-child + * { margin-top: 32px; }
/* Two articles are little more than a web address; a long one must wrap, not run off a phone. */
.blog-detail-sec .rd-article__body p { overflow-wrap: break-word; }
.blog-detail-sec .rd-article__body a { overflow-wrap: anywhere; }
.blog-detail-sec .rd-article__body blockquote { margin-inline: 0; padding-left: 24px; border-left: 1px solid var(--rd-line); }
.blog-detail-sec .rd-article__body blockquote p { font-size: var(--t-statement); line-height: var(--t-statement-lh); font-weight: 300; color: var(--rd-bone); }

/* Pictures and media take the whole column (to col 12) and a wider breath than a paragraph. */
.blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-embed, .wp-block-video, .wp-block-gallery) { max-width: none; margin-top: 48px; }
.blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-embed, .wp-block-video, .wp-block-gallery) + * { margin-top: 48px; }
.blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-gallery):first-child { margin-top: 0; }

/* The 0.5.0 .as-post__figure rules (10px corners, a 560/340px cap, centring) still match the class
   the importer put on these figures, hence the specificity. */
.blog-detail-sec .rd-article__body figure.wp-block-image { margin-inline: 0; margin-bottom: 0; border-radius: 0; overflow: visible; }
.blog-detail-sec .rd-artgal > figure.wp-block-image { margin: 0; }
.blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-gallery) + :is(figure, .rd-artgal, .wp-block-gallery) { margin-top: 24px; }
.blog-detail-sec .rd-article__body figure.wp-block-image img {
  display: block;
  margin: 0;
  border-radius: 0;
  filter: saturate(.72) contrast(1.05) brightness(.93); /* .rd-grade, the one grade for every photograph */
}
/* A lone picture keeps its own shape and its own size, never stretched past it: a landscape up to
   the column's full width, a portrait capped so it cannot outgrow the 730px window it is read in. */
.blog-detail-sec .rd-article__body > figure.wp-block-image img { width: auto; height: auto; max-width: 100%; max-height: none; }
.blog-detail-sec .rd-article__body > figure.wp-block-image.is-portrait img { max-height: 640px; }
.blog-detail-sec .rd-article__body figure.wp-block-image figcaption { max-width: 720px; }

/* Two or more in a row: one equal grid in full rows of pairs and threes, 4:3 frames, as the
   project gallery (a six-track grid: a half spans three tracks, a third two). */
.rd-artgal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.rd-artgal > figure.wp-block-image { grid-column: span 3; aspect-ratio: 4 / 3; background: var(--rd-night-2); }
.rd-artgal > figure.wp-block-image.is-third { grid-column: span 2; }
.blog-detail-sec .rd-artgal > figure.wp-block-image img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.rd-artgal > figure.wp-block-image figcaption { display: none; } /* a caption cannot sit inside a 4:3 frame */

/* A core gallery block an editor may add later: the same equal 4:3 frames, three across. */
.blog-detail-sec .rd-article__body .wp-block-gallery.has-nested-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.blog-detail-sec .rd-article__body .wp-block-gallery.has-nested-images figure.wp-block-image { width: auto !important; aspect-ratio: 4 / 3; } /* core sets the width inline per column count */
.blog-detail-sec .rd-article__body .wp-block-gallery.has-nested-images figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }

/* An editor's "align left / right / centre" on a lone picture: it keeps its own row. */
.blog-detail-sec .rd-article__body > figure.wp-block-image:is(.alignleft, .alignright) { float: none; margin-inline: 0; }
.blog-detail-sec .rd-article__body > figure.wp-block-image.alignright img { margin-left: auto; }
.blog-detail-sec .rd-article__body > figure.wp-block-image.aligncenter img { margin-inline: auto; }

@media (max-width: 767px) {
  .blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-embed, .wp-block-video, .wp-block-gallery) { margin-top: 32px; }
  .blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-embed, .wp-block-video, .wp-block-gallery) + * { margin-top: 32px; }
  .blog-detail-sec .rd-article__body > :is(figure, .rd-artgal, .wp-block-gallery) + :is(figure, .rd-artgal, .wp-block-gallery) { margin-top: 16px; }
  .blog-detail-sec .rd-article__body > figure.wp-block-image.is-portrait img { max-height: 520px; }
  /* Phones: two columns; an odd count opens with one full-width picture, as the project gallery. */
  .rd-artgal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .rd-artgal > figure.wp-block-image,
  .rd-artgal > figure.wp-block-image.is-third { grid-column: span 1; }
  .rd-artgal.is-odd > figure.wp-block-image:first-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
  .blog-detail-sec .rd-article__body .wp-block-gallery.has-nested-images { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
