/*
 | EN Platform - Public media responsive system
 | Standard editorial media: 16:9 (recommended upload: 1600x900 WebP/JPG)
 | This stylesheet is loaded after public-portal.css so it safely overrides
 | previous fixed heights without changing the rest of the visual system.
 */

/* Shared image rendering */
.public-news-media,
.public-event-media,
.home-news-card > img,
.home-event-image {
    position: relative;
    width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-alt, #eef3f9);
}

.public-news-media img,
.public-event-media img,
.home-news-card > img,
.home-event-image img {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
}

/* News and event detail pages: same 16:9 frame as their cards. */
.public-detail-card > .public-detail-cover {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    background: var(--surface-alt, #eef3f9);
}

/* Prevent very wide editorial images from growing disproportionately. */
.public-detail-container {
    width: min(930px, 100%);
}

/* Optional future classes for images that must be shown completely. */
.public-media-contain,
.public-detail-card > .public-detail-cover.public-media-contain {
    object-fit: contain;
    background: var(--surface-alt, #eef3f9);
}

@media (max-width: 620px) {
    /* Remove fixed mobile heights inherited from older versions. */
    .public-news-media,
    .public-event-media,
    .home-news-card > img,
    .home-event-image,
    .public-detail-card > .public-detail-cover {
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    .public-content-section {
        padding-top: 24px;
    }

    .public-detail-container {
        width: min(100% - 20px, 930px);
    }

    .public-detail-card {
        border-radius: 18px;
    }

    .public-detail-body {
        padding: 20px 17px;
    }
}
