/* =========================================================
   CENTLEC article cards: one look for every CMS article on the website
   (News, Bulletins, Videos, Campaigns, Projects) on the Home page and their own pages.
   The title is cut at 3 lines and the summary at 2 lines, cards in the same row line up
   (same height, footer at the bottom), and short titles or an empty summary leave no gap.
   - .cl-grid  + .cl-card : picture on top (grid of cards)
   - .cl-list  + .cl-row  : picture on the left (compact list, like the Home "Latest News" side list)
========================================================= */

.cl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
}

.cl-grid.cl-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cl-grid.cl-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.cl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 107, 53, 0.18);
}

/* Picture */
.cl-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef0f3;
    flex-shrink: 0;
    cursor: pointer;
}

.cl-card-media.cl-media-banner {
    aspect-ratio: 16 / 6;
}

.cl-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.cl-card-media img.pdf-cover {
    object-position: top center;
    background: #ffffff;
}

.cl-card:hover .cl-card-media img,
.cl-row:hover .cl-row-media img {
    transform: scale(1.05);
}

.cl-card-media .cl-media-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: #ff6b35;
    opacity: 0.5;
}

.cl-card-media.no-thumb .cl-media-fallback {
    display: flex;
}

.cl-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #ff6b35;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.cl-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.18);
    transition: background 0.3s ease;
    pointer-events: none;
}

.cl-card-play span {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.92);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.cl-card:hover .cl-card-play {
    background: rgba(0, 0, 0, 0.3);
}

/* Text */
.cl-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 16px 18px 18px;
    min-width: 0;
}

.cl-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: #6c757d;
    min-height: 22px;
}

.cl-card-meta .cl-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.cl-card-meta .cl-date i {
    color: #ff6b35;
    opacity: 0.8;
}

.cl-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #343434;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.cl-card-title a {
    color: inherit;
    text-decoration: none;
}

.cl-card:hover .cl-card-title,
.cl-row:hover .cl-card-title {
    color: #ff6b35;
}

.cl-card-text {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.cl-card-text {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.cl-card-text strong,
.cl-card-text b {
    font-weight: 600;
    color: #343434;
}

.cl-card-text:empty {
    display: none;
}

.cl-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    color: #6c757d;
}

.cl-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ff6b35;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: gap 0.25s ease, color 0.25s ease;
}

.cl-card-link:hover {
    color: #e55a2b;
    gap: 12px;
    text-decoration: none;
}

/* Featured story on the left, compact list on the right (Home "Latest News", News page) */
.cl-split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.cl-split .cl-card.cl-card-featured .cl-card-title {
    font-size: 1.25rem;
}

.cl-split .cl-card.cl-card-featured .cl-card-text {
    -webkit-line-clamp: 3;
    font-size: 0.9rem;
}

.cl-split .cl-list {
    justify-content: flex-start;
    align-self: start;
}

/* Status pills (projects) */
.cl-pill.cl-pill-ongoing {
    border-color: rgba(255, 107, 53, 0.3);
    color: #ff6b35;
}

.cl-pill.cl-pill-completed {
    border-color: rgba(140, 198, 63, 0.45);
    color: #5a8f1e;
}

.cl-pill.cl-pill-planned {
    color: #6c757d;
}

/* Compact list (picture on the left) */
.cl-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cl-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.cl-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
    border-color: rgba(255, 107, 53, 0.18);
    text-decoration: none;
    color: inherit;
}

.cl-row-media {
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef0f3;
}

.cl-row-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cl-row-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    justify-content: flex-start;
}

.cl-row .cl-card-title {
    font-size: 0.92rem;
    -webkit-line-clamp: 2;
    min-height: 0;
}

.cl-row .cl-card-text {
    text-align: left;
    -webkit-line-clamp: 1;
    min-height: 0;
    font-size: 0.8rem;
}

.cl-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cl-empty i {
    display: block;
    font-size: 2.6rem;
    opacity: 0.3;
    margin-bottom: 12px;
}

@media (max-width: 992px) {
    .cl-grid,
    .cl-grid.cl-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cl-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .cl-grid,
    .cl-grid.cl-grid-2,
    .cl-grid.cl-grid-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cl-row-media {
        flex-basis: 88px;
        width: 88px;
        height: 88px;
    }

    .cl-card-title {
        font-size: 0.95rem;
    }
}

/* Video cards: the picture is a play button; the video plays inside the card (centlec-videos.js) */
.cl-card-media .video-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.cl-card-media iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cl-card-media.is-playing {
    background: #000;
}

.cl-card[data-toggle="modal"],
.cl-card.cl-card-clickable {
    cursor: pointer;
}
