/* === GRID LAYOUT (independent heights) === */
.youtube-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;   /* do NOT stretch: only hovered card can grow */
}

/* === CARD === */
.youtube-video-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 4px 4px 13px 5px rgba(0,0,0,0.15)!important;
    padding: 15px;
    border-radius: 10px;
    transition: 0.3s;
    position: relative;
    z-index: 1;

    /* baseline uniform look */
    min-height: 410px;
}

.youtube-video-card:hover {
    transform: scale(1.03);
    z-index: 10; /* overlay above siblings */
}

/* === THUMBNAIL (untouched) === */
.youtube-thumbnail {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.youtube-thumbnail img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

/* Play icon */
.youtube-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 64px;
    height: 64px;
}

.youtube-play-icon svg {
    width: 100%;
    height: 100%;
    transition: 0.3s;
    fill: var(--e-global-color-01dff2d);
}

.youtube-video-card:hover .youtube-play-icon svg {
    transform: scale(1.05);
    fill: #FF0000;
}

/* === META + TITLE (expands only on hovered card) === */
.youtube-meta {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    min-height: 100px;
    /* collapsed footprint so cards share the same baseline height */
    max-height: 100px;
    transition: max-height 0.3s ease;
}

/* Title clamped by default */
.youtube-meta h3.youtube-video-open {
    margin: 8px 0 4px;
    font-size: 20px;
    font-family: bpg_banner_extrasquare_caps;
    cursor: pointer;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: 2.8em;

    transition: max-height 0.3s ease, color 0.3s ease;
}

.youtube-meta h3.youtube-video-open:hover {
    color: var(--e-global-color-01dff2d);
}

/* Hover: only this card’s meta expands and title unclamps */
.youtube-video-card:hover .youtube-meta {
    max-height: 500px; /* expand smoothly */
}

.youtube-video-card:hover .youtube-meta h3.youtube-video-open {
    -webkit-line-clamp: unset;
    max-height: none;
    overflow: visible;
}

/* Meta row */
.youtube-meta-row {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.youtube-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e5e5;
    margin: 3px 0;
}

.youtube-d-s {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    flex-direction: row;
    height: 22px;
}

.youtube-share-icons {
    display: flex;
}

.youtube-share-icons a {
    width: 22px;
    height: 22px;
}

.youtube-share-icons a svg {
    width: 100%;
    height: 100%;
    fill: var(--e-global-color-01dff2d);
    transition: 0.3s;
}

.youtube-share-icons a svg:hover {
    fill: var(--e-global-color-104c556);
}

/* === Tablet: 2 columns === */
@media (max-width: 1024px) {
    .youtube-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 0 10px;
    }
    .youtube-video-card {
        min-height: 410px; /* keep baseline consistent */
    }
}

/* === Mobile: 1 column + always expanded meta === */
@media (max-width: 600px) {
    .youtube-videos-grid { grid-template-columns: 1fr; }
    .youtube-video-card { margin: 0 10px; }

    .youtube-meta {
        max-height: none;
        overflow: visible;
    }
    .youtube-meta h3.youtube-video-open {
        -webkit-line-clamp: unset;
        max-height: none;
        overflow: visible;
    }
}
