/* Content blocks shared by every Statamic page built from Bard sets (blog articles today).
   Markup: one Antlers partial per block in resources/views/partials/blocks. Fields: the block_ fieldsets
   of resources/fieldsets.
   Colours, radii and spacing come from the design tokens of style.css, nothing is written by hand. */

/* ── PHOTO: landscape (full width), also the markup of the hand-written articles ── */
.article-img { border-radius: var(--r2e-radius); width: 100%; height: auto; margin: var(--r2e-space-8) 0 var(--r2e-space-2); display: block; }
.article-img-caption { text-align: center; font-size: var(--r2e-text-sm); color: var(--r2e-ink-muted); margin-bottom: var(--r2e-space-8); font-style: italic; }

/* ── PHOTO: vertical, centred ──
   The photo keeps its proportions and is never taller than 70% of the screen, so it cannot fill a whole phone or desktop
   screen. width:auto + max-height shrinks the width in proportion (the width and height attributes give the ratio). */
.content-photo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    max-height: 70svh;
    margin: var(--r2e-space-8) auto var(--r2e-space-2);
    border-radius: var(--r2e-radius);
}

/* ── PHOTO: vertical, on the right with the text flowing on its left ──
   From tablet width up. Below it the photo goes back to the normal flow, full width. */
@media (min-width: 768px) {
    .content-photo-aside {
        float: right;
        width: 38%;
        margin: var(--r2e-space-2) 0 var(--r2e-space-4) var(--r2e-space-8);
    }
    .content-photo-aside .content-photo-img { width: 100%; max-height: none; margin: 0 0 var(--r2e-space-2); }
    .content-photo-aside .article-img-caption { margin-bottom: 0; }

    /* A second photo on the side waits for the first one instead of sharing its line. */
    .content-photo-aside ~ .content-photo-aside { clear: right; }

    /* What must never wrap around a floated photo: it starts below it. */
    .content-photo-aside ~ :is(h2, h3, h4, table, .table-responsive, .info-box, .blog-infobox, .blog-cta-banner,
        .content-photo, .content-photo-pair, .share-bar, .author-card) { clear: both; }
}

/* ── TWO PHOTOS SIDE BY SIDE ──
   Each figure grows in proportion to its photo's width over height (set inline), so both photos are the same height
   with no cropping. On a phone they stack. */
.content-photo-pair { display: flex; gap: var(--r2e-space-4); margin: var(--r2e-space-8) 0; align-items: flex-start; }
.content-photo-pair figure { flex: 1 1 0; min-width: 0; margin: 0; }
.content-photo-pair .content-photo-img { width: 100%; max-height: none; margin: 0 0 var(--r2e-space-2); }
.content-photo-pair .article-img-caption { margin-bottom: 0; }
@media (max-width: 575px) {
    .content-photo-pair { flex-direction: column; gap: var(--r2e-space-6); }
    .content-photo-pair figure { flex-basis: auto; }
}
