/**
 * Vimiss CMS - Reusable Post Card Component Stylesheet
 * BEM naming convention: .vm-post-card
 */

.vm-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    position: relative;
    background-color: #F2F7FB;
    border: 1px solid #C8DFEF !important;
    border-radius: 20px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s ease;
}

.vm-post-card:hover {
    border-color: #97c4e7 !important;
}

.vm-post-card:focus,
.vm-post-card:active,
.vm-post-card:focus-visible,
.vm-post-card:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

.vm-post-card:active {
    border-color: #97c4e7 !important;
}

/* Thumbnail wrapper */
.vm-post-card__thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f3f4f6;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Aspect ratio fallback via padding-top */
    padding-top: 56.25%; /* 16:9 default */
}

@supports (aspect-ratio: 16 / 9) {
    .vm-post-card__thumb {
        aspect-ratio: 16 / 9;
        padding-top: 0;
        height: auto;
    }
}

/* 4:3 Ratio variation */
.vm-post-card__thumb--4-3 {
    padding-top: 75%;
}

@supports (aspect-ratio: 4 / 3) {
    .vm-post-card__thumb--4-3 {
        aspect-ratio: 4 / 3;
        padding-top: 0;
    }
}

/* 1:1 Ratio variation */
.vm-post-card__thumb--1-1 {
    padding-top: 100%;
}

@supports (aspect-ratio: 1 / 1) {
    .vm-post-card__thumb--1-1 {
        aspect-ratio: 1 / 1;
        padding-top: 0;
    }
}

/* Image */
.vm-post-card__img,
.vm-post-card__thumb img {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    pointer-events: none;
    -webkit-user-drag: none;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fallback placeholder */
.vm-post-card__ph {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.vm-post-card__ph svg {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

/* Time Badge (Bottom-left of thumbnail) */
.vm-post-card__badge {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    background-color: #E1EEF7;
    color: #204360;
    border-top-right-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 10px 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
    pointer-events: none;
    box-sizing: border-box;
}

.vm-post-card__badge-icon {
    width: 12px;
    height: 12px;
    display: block;
    flex-shrink: 0;
    color: #204360;
}

/* Body & Typography */
.vm-post-card__body {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.vm-post-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.vm-post-card:hover .vm-post-card__title {
    color: #0D509C;
}

.vm-post-card__excerpt {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: #555555;
    margin: 0;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Optional Meta (Date / Author / Category) */
.vm-post-card__meta {
    margin-top: auto;
    padding-top: 6px;
    font-size: 12px;
    color: #888888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vm-post-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .vm-post-card__body {
        padding: 8px 10px 10px;
    }
    .vm-post-card__title {
        font-size: 14px;
        margin-bottom: 3px;
        line-height: 1.3;
    }
    .vm-post-card__excerpt {
        font-size: 12px;
        line-height: 1.4;
    }
}
