/* =============================================
   CETAF NEWS — WP Grid Builder news grid revamp
   Add class "cetaf-news" to the grid:
     • VC: "Extra class" on the shortcode element, OR
     • WP Grid Builder: grid "CSS class" field.
   All rules scoped under .cetaf-news so other grids
   (events, calendar) are untouched. Auto-enqueued
   after style.css via cetaf_enqueue_split_css.
   ============================================= */

/* ── 1. Card shell ── */
.cetaf-news .wpgb-card-wrapper {
    background: transparent !important;
    height: 100% !important;
}

.cetaf-news .wpgb-card-inner {
    background: #ffffff !important;
    border: 1px solid rgba(0, 50, 84, 0.07) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 14px rgba(0, 50, 84, 0.07) !important;
    transition: transform 0.28s ease, box-shadow 0.28s ease !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.cetaf-news .wpgb-card:hover .wpgb-card-inner {
    transform: translateY(-5px) !important;
    box-shadow: 0 14px 36px rgba(0, 50, 84, 0.14) !important;
}

/* ── 2. Media — normalize aspect ratio + zoom on hover ── */
.cetaf-news .wpgb-card-media {
    overflow: hidden !important;
}

/* Override the plugin's per-card inline SVG spacer (padding-top:XX%)
   to one uniform ratio so the grid reads as an even template */
.cetaf-news .wpgb-card-media svg {
    padding-top: 62% !important;
}

/* The background-image div fills via the plugin's absolute positioning */
.cetaf-news .wpgb-card-media-thumbnail a > div {
    transition: transform 0.4s ease !important;
}

.cetaf-news .wpgb-card:hover .wpgb-card-media-thumbnail a > div {
    transform: scale(1.05) !important;
}

/* ── 3. Content ── */
.cetaf-news .wpgb-card-content {
    padding: 16px 18px 0 !important;
    background: #ffffff !important;
}

.cetaf-news .wpgb-card-body {
    flex: 1 1 auto !important;
}

/* ── 4. Date eyebrow ── */
.cetaf-news .wpgb-block-1 {
    display: block !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #737373 !important;
    margin: 4px 0 8px !important;
    order: 1;
}

/* Title above date via flex order */
.cetaf-news .wpgb-card-body {
    display: flex !important;
    flex-direction: column !important;
}

.cetaf-news .wpgb-block-3 { order: 0; }
.cetaf-news .wpgb-block-6 { order: 2; }

/* ── 5. Title ── */
.cetaf-news .wpgb-block-3 {
    margin: 0 !important;
    line-height: 1.4 !important;
}

.cetaf-news .wpgb-block-3 a {
    color: #003254 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 2.8em !important;        /* reserve 2 lines so rows align */
    transition: color 0.2s ease !important;
}

.cetaf-news .wpgb-block-3 a:hover {
    color: #f96c31 !important;
}

/* ── 6. Excerpt ── */
.cetaf-news .wpgb-block-6 {
    color: #5a6a78 !important;
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
    margin: 0 0 14px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 4.08em !important;       /* reserve 3 lines so rows align */
}

/* ── 7. Footer + Read more (minimal text-link) ── */
.cetaf-news .wpgb-card-footer {
    padding: 0 18px 18px !important;
    background: #ffffff !important;
}

.cetaf-news .wpgb-card .wpgb-block-7 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #f96c31 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.cetaf-news .wpgb-card .wpgb-block-7::after {
    content: '\203A' !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    transform: translateY(-1px) !important;
    transition: transform 0.2s ease !important;
}

.cetaf-news .wpgb-card .wpgb-block-7:hover {
    color: #d1b24a !important;
}

.cetaf-news .wpgb-card .wpgb-block-7:hover::after {
    transform: translate(3px, -1px) !important;
}

/* ── 8. Top area layout — filter left · pagination right ── */
.cetaf-news .wpgb-area-top-1 {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
    margin-bottom: 22px !important;
}

.cetaf-news .wpgb-area-top-1 .wpgb-facet {
    margin: 0 !important;
}

/* pagination hugs the right edge */
.cetaf-news .wpgb-area-top-1 .wpgb-pagination-facet {
    margin-left: auto !important;
}

/* ── 9. Filter (News Filter label + dropdown) ── */
.cetaf-news .wpgb-facet-title {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #003254 !important;
    margin-bottom: 10px !important;
}

.cetaf-news .wpgb-select {
    border: 1px solid #dce5ed !important;
    border-radius: 4px !important;
    padding: 9px 12px !important;
    color: #003254 !important;
    font-size: 0.85rem !important;
    background: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.cetaf-news .wpgb-select:focus {
    outline: none !important;
    border-color: #f96c31 !important;
    box-shadow: 0 0 0 3px rgba(249, 108, 49, 0.12) !important;
}

.cetaf-news .wpgb-select-toggle {
    color: #003254 !important;
}

/* ── 9. Pagination (replace blue / blocky default) ── */
.cetaf-news .wpgb-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    align-items: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cetaf-news .wpgb-pagination li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 34px !important;
    padding: 6px 11px !important;
    background: transparent !important;
    color: #003254 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}

.cetaf-news .wpgb-pagination li a:hover {
    background: #fff8f5 !important;
    color: #f96c31 !important;
    border-color: rgba(249, 108, 49, 0.4) !important;
}

.cetaf-news .wpgb-pagination li a[aria-current] {
    background: #003254 !important;
    color: #ffffff !important;
    border-color: #003254 !important;
}

.cetaf-news .wpgb-dots-page {
    color: #aab0ba !important;
    padding: 0 4px !important;
}

/* ── 10. Responsive ── */
@media (max-width: 767px) {
    .cetaf-news .wpgb-card-content {
        padding: 14px 16px 0 !important;
    }

    .cetaf-news .wpgb-card-footer {
        padding: 0 16px 16px !important;
    }

    /* Top area stacks: filter on top, pagination below, left-aligned */
    .cetaf-news .wpgb-area-top-1 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .cetaf-news .wpgb-area-top-1 .wpgb-pagination-facet {
        margin-left: 0 !important;
    }

    .cetaf-news .wpgb-pagination {
        justify-content: flex-start !important;
    }
}
