/* =============================================================
   News Grid — FacetWP Custom Loop Layout
   The 4-col / 3-row grid 
   ============================================================= */

/* ------------------------------------------------------------------
   Grid container
------------------------------------------------------------------ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, minmax(140px, auto));
    gap: 30px;
}

/* ------------------------------------------------------------------
   Grid placement — items 1–4
   (Items 5+ fall outside the defined grid; adjust rows if needed)
------------------------------------------------------------------ */
.news-item-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 4;
}

.news-item-2 {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.news-item-3 {
    grid-column: 3 / 5;
    grid-row: 2 / 3;
}

.news-item-4 {
    grid-column: 3 / 5;
    grid-row: 3 / 4;
}

/* ------------------------------------------------------------------
   Base article card
------------------------------------------------------------------ */
.news-item {
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0,0,0,0.08); 
    transition: .2s ease all;
}
.news-item:hover{
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0,0,0,0.12);
}
/* ------------------------------------------------------------------
   Featured item (item-1) — image on top, content below
------------------------------------------------------------------ */
.news-item-1 {
    flex-direction: column;
}

.news-item__image-link--featured {
    display: block;
    flex: 0 0 auto;
    overflow: hidden;
    height: 55%; /* image takes ~55% of the card height */
}

.news-item__image--featured {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.news-item__image-link--featured:hover .news-item__image--featured {
    transform: scale(1.03);
}

.news-item__body--featured {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* ------------------------------------------------------------------
   Secondary items (items 2–4) — image left, content right
------------------------------------------------------------------ */
.news-item-2,
.news-item-3,
.news-item-4 {
    flex-direction: row;
    align-items: stretch;
}

.news-item-2 .news-item__image-link,
.news-item-3 .news-item__image-link,
.news-item-4 .news-item__image-link {
    display: block;
    flex: 0 0 200px;
    overflow: hidden;
}

.news-item-2 .news-item__image,
.news-item-3 .news-item__image,
.news-item-4 .news-item__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
    object-position: top;
}

.news-item-2 .news-item__image-link:hover .news-item__image,
.news-item-3 .news-item__image-link:hover .news-item__image,
.news-item-4 .news-item__image-link:hover .news-item__image {
    transform: scale(1.04);
}

.news-item-2 .news-item__body,
.news-item-3 .news-item__body,
.news-item-4 .news-item__body {
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

/* ------------------------------------------------------------------
   Date
------------------------------------------------------------------ */
.news-item__date {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2a9d8f; /* teal — adjust to your brand color */
    letter-spacing: 0.02em;
    text-transform: none;
}

/* ------------------------------------------------------------------
   Title
------------------------------------------------------------------ */
.news-item__title {
    margin: 0;
    line-height: 1.25;
}

.news-item__title--featured {
    /*font-size: 1.5rem;*/
    font-weight: 600;
}

.news-item__title:not(.news-item__title--featured) {
    /*font-size: 1rem;*/
    font-weight: 600;
}

.news-item__title a {
    color: #111111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-item__title a:hover {
    color: #2a9d8f;
}

/* ------------------------------------------------------------------
   Excerpt
------------------------------------------------------------------ */
.news-item__excerpt {
    margin: 0;
    font-size: 0.875rem;
    color: #555555;
    line-height: 1.55;

    /* Clamp to 2 lines for secondary items */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item__body--featured .news-item__excerpt {
    -webkit-line-clamp: 3; /* allow a bit more for featured */
}

/* ------------------------------------------------------------------
   Read More link
------------------------------------------------------------------ */
.news-item__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto; /* push to bottom of flex column */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2a9d8f;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
    align-self: flex-start;
}

.news-item__read-more:hover {
    gap: 8px;
    color: #1f7a6e;
}

.news-item__read-more-icon {
    font-size: 2rem;
    line-height: 1;
    margin-top:-10px;
}

/* =============================================================
   News Archive — FacetWP "conference_news_archive" template
   2-col grid; first item full-width featured; load-more safe.
   Uses :first-child so newly appended items are never featured.
   ============================================================= */

/* ------------------------------------------------------------------
   Archive grid — override the default 4-col .news-grid layout
------------------------------------------------------------------ */
.conference_news_archive .news-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    gap: 50px;
}

/* Reset numbered-class grid placements (set by base .news-item-N rules) */
.conference_news_archive .news-item-1,
.conference_news_archive .news-item-2,
.conference_news_archive .news-item-3,
.conference_news_archive .news-item-4 {
    grid-column: auto;
    grid-row: auto;
    flex-direction: row; /* override item-1's column default */
}

/* ------------------------------------------------------------------
   First item — full-width featured (image left, content right)
   :first-child never changes when FacetWP appends more items.
------------------------------------------------------------------ */
.conference_news_archive .news-grid .news-item:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    height: 340px;
}

.conference_news_archive .news-grid .news-item:first-child .news-item__image-link {
    display: block;
    flex: 0 0 50%;
    overflow: hidden;
    height: 100%;
}

.conference_news_archive .news-grid .news-item:first-child .news-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.conference_news_archive .news-grid .news-item:first-child .news-item__image-link:hover .news-item__image {
    transform: scale(1.03);
}

.conference_news_archive .news-grid .news-item:first-child .news-item__body {
    padding: 30px 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

/* ------------------------------------------------------------------
   All other items — horizontal cards (image left ~200px, content right)
   This includes items loaded via FacetWP load-more.
------------------------------------------------------------------ */
.conference_news_archive .news-grid .news-item:not(:first-child) {
    flex-direction: row;
    align-items: stretch;
}

.conference_news_archive .news-grid .news-item:not(:first-child) .news-item__image-link {
    display: block;
    flex: 0 0 200px;
    overflow: hidden;
}

.conference_news_archive .news-grid .news-item:not(:first-child) .news-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease;
}

.conference_news_archive .news-grid .news-item:not(:first-child) .news-item__image-link:hover .news-item__image {
    transform: scale(1.04);
}

.conference_news_archive .news-grid .news-item:not(:first-child) .news-item__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

/* ------------------------------------------------------------------
   Responsive — stack to single column on small screens
------------------------------------------------------------------ */
@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .news-item-1,
    .news-item-2,
    .news-item-3,
    .news-item-4 {
        grid-column: auto;
        grid-row: auto;
    }

    /* All items become full-width column layout on mobile */
    .news-item-2,
    .news-item-3,
    .news-item-4 {
        flex-direction: column;
    }

    /* All images same height, cover (no contain), same as featured */
    .news-item__image-link--featured,
    .news-item-2 .news-item__image-link,
    .news-item-3 .news-item__image-link,
    .news-item-4 .news-item__image-link {
        flex: 0 0 220px;
        height: 220px;
        width: 100%;
    }

    /* Revert to cover on mobile — no contain */
    .news-item-2 .news-item__image,
    .news-item-3 .news-item__image,
    .news-item-4 .news-item__image {
        object-fit: cover;
        object-position: center;
    }

    /* Uniform font sizes across all cards on mobile */
    .news-item__title--featured,
    .news-item__title:not(.news-item__title--featured) {
        font-size: 1.1rem;
    }

    .news-item__date {
        font-size: 0.8rem;
    }

    .news-item__excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* Archive responsive overrides */
    .conference_news_archive .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .conference_news_archive .news-grid .news-item:first-child,
    .conference_news_archive .news-grid .news-item:not(:first-child) {
        flex-direction: column;
        height: auto;
    }

    .conference_news_archive .news-grid .news-item:first-child .news-item__image-link,
    .conference_news_archive .news-grid .news-item:not(:first-child) .news-item__image-link {
        flex: 0 0 220px;
        height: 220px;
        width: 100%;
    }

    .conference_news_archive .news-grid .news-item:first-child .news-item__body,
    .conference_news_archive .news-grid .news-item:not(:first-child) .news-item__body {
        padding: 20px;
    }
}

/* =============================================================
   Conference Archive — [ecde_conference_archive] shortcode
   Grouped by year. Classes prefixed ca- to avoid conflicts.
   ============================================================= */

/* ------------------------------------------------------------------
   Outer wrapper
------------------------------------------------------------------ */
.ca-archive {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* ------------------------------------------------------------------
   Year heading
------------------------------------------------------------------ */
.ca-year-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #111111;
    margin: 0 0 20px 0;
    line-height: 1;
}

/* ------------------------------------------------------------------
   Cards stack — one per year group, full width, stacked vertically
------------------------------------------------------------------ */
.ca-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ------------------------------------------------------------------
   Single card — image left (~50%), content right
------------------------------------------------------------------ */
.ca-card {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    height: 340px;
}

.ca-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------
   Image
------------------------------------------------------------------ */
.ca-card__image-link {
    display: block;
    flex: 0 0 50%;
    overflow: hidden;
    height: 100%;
}

.ca-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ca-card__image-link:hover .ca-card__image {
    transform: scale(1.03);
}

/* ------------------------------------------------------------------
   Body
------------------------------------------------------------------ */
.ca-card__body {
    flex: 1;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.ca-card__title-link {
    text-decoration: none;
}

.ca-card__title {
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    color: #111111;
    line-height: 1.2;
    transition: color 0.2s ease;
}

.ca-card__title-link:hover .ca-card__title {
    color: #2a9d8f;
}

.ca-card__excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: #555555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ca-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2a9d8f;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
    align-self: flex-start;
}

.ca-card__read-more:hover {
    gap: 8px;
    color: #1f7a6e;
}

.ca-card__read-more-icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 900px) {
    .ca-card {
        flex-direction: column;
        height: auto;
    }

    .ca-card__image-link {
        flex: 0 0 240px;
        height: 240px;
        width: 100%;
    }

    .ca-card__body {
        padding: 24px;
    }

    .ca-year-heading {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ca-card__image-link {
        flex: 0 0 200px;
        height: 200px;
    }

    .ca-card__title {
        font-size: 1.15rem;
    }
}

/* =============================================================
   Share Icons — [share_icons] shortcode
   ============================================================= */

.ecde-share-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.ecde-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #111111;
    color: #111111;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.ecde-share-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ecde-share-facebook:hover {
    border-color: #1877f2;
    color: #1877f2;
}

.ecde-share-twitter:hover {
    border-color: #000000;
    color: #000000;
    background-color: #f5f5f5;
}

/* =============================================================
   Single Post — "More News" loop (.single_post_more_news)
   2-column equal grid, both cards horizontal (image left, content right)
   ============================================================= */

.single_post_more_news .news-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    gap: 30px;
}

/* Reset all numbered-item grid placements and make every card horizontal */
.single_post_more_news .news-item-1,
.single_post_more_news .news-item-2 {
    grid-column: auto;
    grid-row: auto;
    flex-direction: row;
    align-items: stretch;
    height: auto;
}

/* Image wrapper — fixed left column */
.single_post_more_news .news-item-1 .news-item__image-link,
.single_post_more_news .news-item-2 .news-item__image-link,
.single_post_more_news .news-item-1 .news-item__image-link--featured,
.single_post_more_news .news-item-2 .news-item__image-link--featured {
    display: block;
    flex: 0 0 180px;
    height: auto;
    overflow: hidden;
}

/* Images — cover, fill the left column */
.single_post_more_news .news-item-1 .news-item__image,
.single_post_more_news .news-item-2 .news-item__image,
.single_post_more_news .news-item-1 .news-item__image--featured,
.single_post_more_news .news-item-2 .news-item__image--featured {
    width: 100%;
    height: 60%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease;
}

.single_post_more_news .news-item-1 .news-item__image-link:hover .news-item__image,
.single_post_more_news .news-item-2 .news-item__image-link:hover .news-item__image,
.single_post_more_news .news-item-1 .news-item__image-link--featured:hover .news-item__image--featured,
.single_post_more_news .news-item-2 .news-item__image-link--featured:hover .news-item__image--featured {
    transform: scale(1.04);
}

/* Body */
.single_post_more_news .news-item__title--featured {
    font-size: revert;
    font-weight: 600;
}

.single_post_more_news .news-item-1 .news-item__body,
.single_post_more_news .news-item-2 .news-item__body,
.single_post_more_news .news-item-1 .news-item__body--featured,
.single_post_more_news .news-item-2 .news-item__body--featured {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Responsive — stack at narrow viewports */
@media (max-width: 900px) {
    .single_post_more_news .news-grid {
        grid-template-columns: 1fr;
    }

    .single_post_more_news .news-item-1,
    .single_post_more_news .news-item-2 {
        flex-direction: column;
    }

    .single_post_more_news .news-item-1 .news-item__image-link,
    .single_post_more_news .news-item-2 .news-item__image-link,
    .single_post_more_news .news-item-1 .news-item__image-link--featured,
    .single_post_more_news .news-item-2 .news-item__image-link--featured {
        flex: 0 0 220px;
        height: 220px;
        width: 100%;
    }

    .single_post_more_news .news-item-1 .news-item__image,
    .single_post_more_news .news-item-2 .news-item__image,
    .single_post_more_news .news-item-1 .news-item__image--featured,
    .single_post_more_news .news-item-2 .news-item__image--featured {
        height: 100%;
    }
}

/* =============================================================
   Material Bank — [ecde_material_bank] shortcode
   ============================================================= */

.material-bank {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* ------------------------------------------------------------------
   Conference block
------------------------------------------------------------------ */
.mb-conference {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mb-conference__title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #111111;
    margin: 0 0 24px 0;
    line-height: 1.2;
}

/* ------------------------------------------------------------------
   Tab buttons — pill style matching screenshot
------------------------------------------------------------------ */
.mb-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mb-tabs .conference-program-tab {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: #333333;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.mb-tabs .conference-program-tab:hover {
    background: #e0f2ef;
    color: #2a9d8f;
}

.mb-tabs .conference-program-tab.active {
    background: #2a9d8f;
    color: #ffffff;
}

/* ------------------------------------------------------------------
   Tab panels
------------------------------------------------------------------ */
.mb-tab-panels {
    margin-top: 0;
}

.mb-tab-panel {
    display: none;
}

.mb-tab-panel.active {
    display: block;
}

/* ------------------------------------------------------------------
   Section (title + downloads within a tab)
------------------------------------------------------------------ */
.mb-section {
    padding: 24px 0;
    border-left: 4px solid #2a9d8f;
    padding-left: 20px;
    margin-bottom: 2px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.mb-section:last-child {
    border-bottom: none;
}

.mb-section__title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111111;
    line-height: 1.3;
}

/* ------------------------------------------------------------------
   Download links
------------------------------------------------------------------ */
.mb-downloads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mb-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2a9d8f;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-style: italic;
    transition: color 0.2s ease;
    padding: 6px 0;
}

.mb-download:hover {
    color: #1f7a6e;
}

.mb-download__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 34px;
}

.mb-download__icon svg {
    width: 28px;
    height: 34px;
    display: block;
}

.mb-download__name {
    flex: none;
}

.mb-download__arrow {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #2a9d8f;
    transition: transform 0.2s ease;
}

.mb-download:hover .mb-download__arrow {
    transform: translateY(2px);
}

/* ------------------------------------------------------------------
   General materials (post-level downloads)
------------------------------------------------------------------ */
.mb-general {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #eeeeee;
}

.mb-general__title {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2a9d8f;
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 900px) {
    .mb-conference__title {
        font-size: 1.4rem;
    }

    .mb-tabs .conference-program-tab {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .mb-section {
        padding: 16px 0 16px 14px;
    }
}

@media (max-width: 480px) {
    .material-bank {
        gap: 40px;
    }

    .mb-tabs {
        gap: 6px;
    }

    .mb-tabs .conference-program-tab {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .mb-download {
        font-size: 0.8rem;
    }
}