﻿/* 1. Force Sans-Serif on the card and all children */
.url-preview-card,
.url-preview-card * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    box-sizing: border-box;
}

/* 2. Fix the Card Height strictly to 125px */
.url-preview-card {
    height: 150px !important;
    max-height: 150px !important;
    overflow: hidden !important;

    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.08) !important;
}
    .url-preview-card:hover {
        transform: translateY(-5px); /* Gentle lift */
        box-shadow: 0 12px 24px rgba(0,0,0,0.12) !important;
        border-color: #0d6efd !important; /* Subtle primary color border */
    }

    .url-preview-card .text-primary {
        transition: all 0.2s ease;
    }

    .url-preview-card:hover .text-primary {
        letter-spacing: 0.03em; /* Slightly expands the text */
        color: #0a58ca !important; /* Darker blue on hover */
    }

    /* 3. The "Shrink-to-Fit" Image Container */
    .url-preview-card .img-container {
        height: 150px !important;
        width: 100%;
        background-color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding: 12px;
    }

        .url-preview-card .img-container img {
            transition: transform 0.4s ease;
        }

    .url-preview-card:hover .img-container img {
        transform: scale(1.05); /* Very subtle zoom on the book cover */
    }

        /* 4. The Image itself */
        .url-preview-card .img-container img.object-fit-contain {
            max-height: 100% !important;
            max-width: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            display: block;
            margin: auto; /* Final centering safety net */
        }

    /* 5. Text Protection & Layout */
    .url-preview-card .card-body {
        height: 150px !important;
        display: flex;
        flex-direction: column;
        padding: 12px 15px 12px 15px !important; /* Top, Right, Bottom, Left */
    }

    .url-preview-card .mt-auto {
        margin-top: auto !important;
        padding-top: 4px; /* Tiny bit of space above the link */
    }

        .url-preview-card .mt-auto span {
            font-size: 0.75rem !important;
            letter-spacing: 0.02em;
        }

    .url-preview-card .badge {
        padding: 3px 6px;
        font-size: 0.65rem !important; /* Slightly smaller for the 125px height */
    }

    .url-preview-card .card-title {
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
        margin-bottom: 4px !important;
    }

    .url-preview-card .card-text {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        color: #555;
    }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
