/* /widgets/you-may-like/ymal.css
   External styles for the "You May Also Like" injector.
   Small, horizontal, professional cards — responsive and accessible.
*/

.ymal-wrapper {
    max-width: 980px;
    margin: 28px auto;
    padding: 10px 14px;
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.ymal-heading {
    margin: 0 0 12px 8px;
    font-size: 20px;
    line-height: 1.2;
    color: #222;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* Grid that holds the three cards horizontally */
.ymal-grid {
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Each card */
.ymal-card {
    flex: 0 0 calc((100% - 28px) / 3); /* three cards with gap accounted for */
    max-width: 320px;
    min-width: 210px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(22, 28, 37, 0.08);
    transition: transform 220ms ease, box-shadow 220ms ease;
    overflow: hidden;
    display: block;
}

/* Make cards slightly smaller overall */
.ymal-card .ymal-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Image area */
.ymal-image {
    width: 100%;
    padding-top: 56%; /* 16:9-ish box using padding trick */
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f6f7f9 0%, #ffffff 100%);
}

.ymal-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110%;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    display: block;
}

/* Content */
.ymal-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 110px;
}

.ymal-title {
    margin: 0;
    font-size: 15px !important;
    color: #db074f !important; /* any colour you like */
    font-weight: bold !important;
    line-height: 1.25;
    font-weight: 700;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ymal-excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #db9807 !important;
    flex: 1 1 auto;
    display: block;
    overflow: hidden;
    max-height: 3.6em; /* roughly 2 lines */
}

/* Read more link inline style */
.ymal-readmore {
    color: #0a66c2;
    text-decoration: none;
    margin-left: 6px;
    font-weight: 600;
    font-size: 13px;
}

/* Hover / focus states */
.ymal-card:hover,
.ymal-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(22, 28, 37, 0.12);
}

.ymal-item:focus {
    outline: 3px solid rgba(10, 102, 194, 0.12);
    outline-offset: 2px;
}

/* Responsive: stack to fewer columns on small screens */
@media (max-width: 920px) {
    .ymal-grid {
        gap: 12px;
        justify-content: center;
    }
    .ymal-card {
        flex: 0 0 calc((100% - 24px) / 2);
        max-width: 48%;
    }
}

@media (max-width: 580px) {
    .ymal-grid {
        flex-wrap: wrap;
    }
    .ymal-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .ymal-image {
        padding-top: 56%;
    }
    .ymal-wrapper {
        padding: 10px;
    }
}
