/* ==========================================================================
   Featured post – jeden wyróżniony wpis (zdjęcie + meta, tytuł, excerpt)
   ========================================================================== */
.featured-post {
    width: 100%;
}

/* Image on the left – half minus 12px (half of the 24px slider gap), so its edge lines up with the 2nd post of the posts slider; content on the right */
.featured-post__card {
    position: relative; /* context for .post__card-label */
    display: grid;
    grid-template-columns: calc(50% - 12px) 1fr;
    gap: 24px;
    margin: 0;
}

/* No image – content takes the whole width */
.featured-post__card:not(:has(.featured-post__image)) {
    grid-template-columns: 1fr;
}

/* Image fills its column, cropped instead of stretched */
.featured-post__image {
    display: block;
    min-height: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.featured-post__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.featured-post__title {
    margin: 0 !important;
    font-size: 32px;
}

.featured-post__title a {
    color: inherit;
    text-decoration: none;
}

/* Excerpt cut to 6 lines */
.featured-post__excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    margin: 0;
    overflow: hidden;
}

/* Light mode (default) – as in HomeHero: default colours, line under the post */
.featured-post--light .featured-post__card {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--theme-palette-color-5);
}

/* Dark mode – for dark backgrounds: content on a black tile without lines, 32px padding, white meta, title and excerpt */
.featured-post--dark .featured-post__card {
    gap: 0;
}

.featured-post--dark .featured-post__content {
    padding: 32px;
    background: var(--theme-palette-color-4);
}

.featured-post--dark .featured-post__content .card__tag,
.featured-post--dark .featured-post__content .card__tag *,
.featured-post--dark .featured-post__title,
.featured-post--dark .featured-post__title a,
.featured-post--dark .featured-post__excerpt {
    color: var(--theme-palette-color-8) !important;
}

/* Editor placeholder - no post picked */
.featured-post__empty {
    padding: 16px;
    border: 1px dashed var(--theme-palette-color-5);
}

@media (max-width: 1024px) {
    /* Image above the content */
    .featured-post__card {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .featured-post--dark .featured-post__card {
        gap: 0;
    }
}

/* Tablet - lower, wide image and the excerpt cut to 3 lines */
@media (min-width: 768px) and (max-width: 1024px) {
    .featured-post__image {
        min-height: 0;
        aspect-ratio: 2 / 1;
    }

    .featured-post__excerpt {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

@media (max-width: 767px) {
    .featured-post--dark .featured-post__content {
        padding: 16px;
    }

    .featured-post__title {
        font-size: 20px;
    }

    /* Excerpt cut to 4 lines */
    .featured-post__excerpt {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
}
