/* ============================================================
   Стилі для карток "Новини"/"Афіші" на головній сторінці,
   згенерованих інструментом Інструменти → "Зібрати головну
   в Elementor". Дизайн один-в-один з картками категорій
   (.bib-card-grid, див. archive.php): квадратна картка,
   фото не обрізається, бейдж категорії, дата замість кнопки.
   ============================================================ */

.bib-elementor-card-row {
    align-items: stretch;
}

.bib-elementor-card-row .elementor-container {
    justify-content: center;
}

.bib-elementor-card {
    box-sizing: border-box;
}

.bib-elementor-card > .elementor-widget-wrap {
    aspect-ratio: 1 / 1;
    display: flex !important;
    flex-direction: column;
    height: auto;
    width: calc(100% - 24px) !important;
    margin: 0 12px !important;
    background: var(--bib-amber-bg, #FAEEDA);
    border-radius: var(--bib-radius, 20px);
    overflow: hidden;
    box-shadow: var(--bib-shadow-sm, 0 2px 10px rgba(0,0,0,0.06));
    transition: transform .2s, box-shadow .2s;
    padding: 0 !important;
}

.bib-elementor-card:hover > .elementor-widget-wrap {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

/* --- Фото: 55% висоти картки, не обрізається --- */
.bib-elementor-card .elementor-widget-image {
    flex: 0 0 55%;
    max-height: 55%;
    margin: 0 0 18px 0 !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F2F1EC;
}

.bib-elementor-card .elementor-widget-image .elementor-widget-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bib-elementor-card .elementor-widget-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* --- Текстовий блок --- */
.bib-elementor-card .elementor-widget-text-editor,
.bib-elementor-card .elementor-widget-heading {
    padding: 0 22px;
    margin: 0 !important;
}

.bib-elementor-card-badge {
    margin-top: 0 !important;
}

.bib-elementor-card-badge .elementor-post__badge,
.bib-elementor-card-badge a {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 30px;
    background: var(--bib-green-bg, #F7E7F4);
    color: var(--bib-green, #93268F);
    text-decoration: none;
}

.bib-elementor-card-title {
    margin-top: 8px !important;
    margin-bottom: 6px !important;
}

.bib-elementor-card-title .elementor-heading-title {
    font-family: var(--bib-font-heading) !important;
    font-size: 17px !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-height: 2.7em !important;
}

.bib-elementor-card-title .elementor-heading-title a {
    color: var(--bib-text, #2C2C2A);
    text-decoration: none;
    transition: color .2s;
}

.bib-elementor-card-title .elementor-heading-title a:hover {
    color: var(--bib-green, #93268F);
}

.bib-elementor-card-excerpt {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: hidden !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
}

.bib-elementor-card-excerpt .elementor-widget-container {
    width: 100%;
}

.bib-elementor-card-excerpt p {
    font-size: 14px !important;
    color: var(--bib-muted, #888780) !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-height: 2.8em !important;
    line-height: 1.4 !important;
}

.bib-elementor-card-date {
    margin-top: auto !important;
    margin-bottom: 20px !important;
}

.bib-elementor-card-date p {
    font-size: 12px !important;
    color: var(--bib-muted, #888780) !important;
    margin: 0;
}

@media (max-width: 767px) {
    .bib-elementor-card {
        aspect-ratio: auto;
    }
    .bib-elementor-card .elementor-widget-image {
        flex-basis: 200px;
        max-height: 200px;
    }
}
