/* ==========================================================================
   DEVOSO 4.8 — one frame for post images (inc/cover48.php, devoso_cover_frame()).
   The box is always 16:9; the image is shown whole (contain) over a blurred,
   darkened copy of itself. Posts without an image keep .dv-ph46 untouched.
   Author: Maks Odintsov
   ========================================================================== */

.is-cf48 { position: relative !important; display: block; aspect-ratio: 16 / 9 !important; height: auto !important; min-height: 0 !important; overflow: hidden !important; background: #121718 !important; }
.dv-cf48 { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; background: #121718; }
.dv-cf48__bg { position: absolute; inset: -10%; display: block; background-position: center; background-size: cover; background-repeat: no-repeat; filter: blur(1.4rem) brightness(.5) saturate(1.15); transform: scale(1.04); }
.dv-cf48__img { position: absolute !important; inset: 0; z-index: 1; display: block; width: 100% !important; height: 100% !important; max-width: none !important; margin: 0 !important; object-fit: contain !important; border-radius: 0 !important; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
:is(.b43-card, .dv-card):hover .dv-cf48__img { transform: scale(1.025); }

/* article hero */
.dv-ah46__media.is-cf48 { max-width: 56rem; border-radius: 1.25rem; box-shadow: 0 1.5rem 3rem -1.5rem rgba(18, 23, 24, .45); }
.dv-ah46__media.is-cf48 img { object-fit: contain !important; }

/* cards: the card clips the corners; the lead card stands alone */
.dv-card__media.is-cf48, .b43-card__media.is-cf48 { border-radius: 0 !important; }
.b43-card--lead .b43-card__media.is-cf48 { border-radius: 1.25rem !important; }
.dv-card--featured .dv-card__media.is-cf48 { min-height: 0 !important; }
/* placeholder cards get the same 16:9 box, so a row of cards lines up */
.dv-card:not(.dv-card--featured) .dv-card__media { aspect-ratio: 16 / 9 !important; height: auto !important; }

/* list view of the insights feed: a 16:9 thumbnail instead of a stretched column */
.b43-grid.is-list .b43-card { align-items: center; }
.b43-grid.is-list .b43-card__media { align-self: center; aspect-ratio: 16 / 9 !important; min-height: 0 !important; margin: 1rem 0 1rem 1rem; border-radius: .75rem !important; }

/* Telegram block: same frame, smaller corners */
.dvh-tg46__thumb { flex: none; width: 100%; border-radius: .6rem; }
.dvh-tg46__msg .dvh-tg46__thumb img { aspect-ratio: auto; border-radius: 0; }

@media (max-width: 767.98px) {
    .dv-ah46__media.is-cf48 { border-radius: 1rem; }
    .b43-card--lead .b43-card__media.is-cf48 { border-radius: 1rem !important; }
    /* compact list cards on phones: 16:9 thumbnail on the left */
    .b43-main .b43-grid .b43-card { grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; }
    .b43-main .b43-grid .b43-card__media { align-self: center; aspect-ratio: 16 / 9 !important; min-height: 0 !important; height: auto !important; margin: .75rem 0 .75rem .75rem; border-radius: .5rem !important; }
}

@media (prefers-reduced-motion: reduce) {
    .dv-cf48__img { transition: none; }
    :is(.b43-card, .dv-card):hover .dv-cf48__img { transform: none; }
}
