/* Professionals' external content - result cards (info-center chat + smart search)
   and the video popup. Matches the article cards in article-ai.css. */

.nvm-ec-results {
    margin-top: 24px;
}

.nvm-ec-results-title {
    font-size: 16px;
    font-weight: 600;
    color: #444;
    margin: 0 0 12px;
}

.nvm-ec-results-grid {
    display: grid;
    /* Two per row in the 500px info-center chat, like the articles above */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.nvm-ec-result {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.nvm-ec-result:hover {
    border-color: #ce7929;
    box-shadow: 0 4px 16px rgba(206, 121, 41, 0.15);
}

/* Media: the thumbnail. The extra .nvm-ec-results
   in the selectors outranks Elementor's ".elementor img { height: auto }". */
.nvm-ec-results .nvm-ec-result-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f4f1ec;
}

.nvm-ec-results .nvm-ec-result-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
}

/* Cover also crops the black bars of YouTube's 4:3 hqdefault thumbnail */
.nvm-ec-results .nvm-ec-result-media img {
    object-fit: cover;
}

/* Podcast covers are square - show them whole */
.nvm-ec-results .nvm-ec-result--podcast .nvm-ec-result-media img {
    object-fit: contain;
}

.nvm-ec-results .nvm-ec-result-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nvm-ec-results .nvm-ec-result-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    transition: background 0.2s ease;
}

.nvm-ec-results .nvm-ec-result-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -6px;
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #ffffff;
}

/* The theme colors buttons on hover/focus - keep the overlay clear */
.nvm-ec-results .nvm-ec-result-play:hover,
.nvm-ec-results .nvm-ec-result-play:focus {
    background: transparent;
}

.nvm-ec-results .nvm-ec-result-play:hover::before,
.nvm-ec-results .nvm-ec-result-play:focus-visible::before {
    background: #ce7929;
}

/* Body */
.nvm-ec-result-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 14px 16px 16px;
}

.nvm-ec-result-type {
    font-size: 12px;
    font-weight: 600;
    color: #ce7929;
    margin-bottom: 4px;
}

.nvm-ec-result-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.nvm-ec-results .nvm-ec-result-title a {
    color: #333;
    text-decoration: none;
}

.nvm-ec-results .nvm-ec-result-title a:hover {
    color: #ce7929;
}

.nvm-ec-result-summary {
    margin: 0 0 10px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.nvm-ec-result-by {
    margin: 0 0 12px;
    font-size: 13px;
    color: #555;
}

.nvm-ec-results .nvm-ec-result-by a {
    color: #ce7929;
    font-weight: 600;
    text-decoration: none;
}

.nvm-ec-results .nvm-ec-result-by a:hover {
    text-decoration: underline;
}

.nvm-ec-results .nvm-ec-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: auto;
}

.nvm-ec-results .nvm-ec-result-action {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #ce7929;
    text-decoration: none;
    cursor: pointer;
}

.nvm-ec-results .nvm-ec-result-action:hover,
.nvm-ec-results .nvm-ec-result-action:focus {
    background: none;
    color: #a85f1c;
    text-decoration: underline;
}

.nvm-ec-result-also {
    font-size: 12px;
    color: #777;
    text-decoration: underline;
}

.nvm-ec-result-audio {
    width: 100%;
    height: 40px;
}

/* Cards behind "עוד" - the card's display: flex would show them anyway */
.nvm-ec-results .nvm-ec-result[hidden] {
    display: none;
}

.nvm-ec-results .nvm-ec-results-more {
    display: block;
    margin: 16px auto 0;
    padding: 10px 24px;
    border: 2px solid #ce7929;
    border-radius: 999px;
    background: #ffffff;
    color: #ce7929;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nvm-ec-results .nvm-ec-results-more:hover,
.nvm-ec-results .nvm-ec-results-more:focus {
    background: #ce7929;
    color: #ffffff;
}

@media (max-width: 768px) {
    .nvm-ec-results-grid {
        grid-template-columns: 1fr;
    }

    .nvm-ec-results .nvm-ec-results-more {
        width: 100%;
    }
}

/* Video popup */
html.nvm-ec-modal-open {
    overflow: hidden;
}

.nvm-ec-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.8);
}

.nvm-ec-modal-dialog {
    position: relative;
    /* Short laptop screens: the height decides, so close + caption fit */
    width: min(960px, 100%, calc((100vh - 140px) * 16 / 9));
    direction: rtl;
}

.nvm-ec-modal-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.nvm-ec-modal .nvm-ec-modal-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.nvm-ec-modal-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 10px;
    font-size: 15px;
    color: #fff;
    line-height: 1.5;
}

.nvm-ec-modal .nvm-ec-modal-caption a {
    color: #f3b36b;
    font-weight: 600;
    text-decoration: none;
}

.nvm-ec-modal .nvm-ec-modal-caption a:hover {
    text-decoration: underline;
}

.nvm-ec-modal .nvm-ec-modal-close {
    position: absolute;
    top: -44px;
    left: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 40px;
    cursor: pointer;
}

.nvm-ec-modal .nvm-ec-modal-close:hover,
.nvm-ec-modal .nvm-ec-modal-close:focus {
    background: #ce7929;
    color: #fff;
}
