/* ============================================================================
   HomeCard — CARD CHUẨN (.home-standard-card) DÙNG CHUNG trang chủ + thư viện.
   ĐÃ LÀM PHẲNG 2026-08-08: mỗi thuộc tính CHỈ 1 giá trị cuối, KHÔNG còn base+đè,
   KHÔNG còn selector .home-content-shell → trang chủ & thư viện GIỐNG HỆT.
   Khóa cứng, auto-version. JS chỉ dựng markup + đổ nội dung.
   ============================================================================ */

.home-standard-card {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 0;
    border-radius: 24px; 
    background: #ffffff; 
    box-shadow: none; 
    overflow: hidden; 
    transition: transform .18s ease,box-shadow .18s ease; 
    position: relative; 
    border: 1px solid rgba(18, 56, 91, .07);
}

.home-standard-card:hover {
    transform: translateY(-3px); 
    box-shadow: 0 22px 44px rgba(18,56,91,.12);
}

.home-standard-card__media-wrap {
    position: relative;
    aspect-ratio: 1 / 1;   /* CARD NHỎ: ảnh VUÔNG 1:1 (follow card nhỏ) */
    width: 100%;
    flex: none;
    min-height: 0;
    margin-bottom: 10px;
}

/* CARD LỚN (.item-wide): CÙNG CHIỀU CAO card nhỏ, chỉ RỘNG hơn → ảnh lấp đầy (landscape) */
.item-wide .home-standard-card { height: 100%; }
.item-wide .home-standard-card__media-wrap { aspect-ratio: auto; width: auto; flex: 1 1 auto; }

.home-standard-card__media {
    display: block;
    position: relative;
    height: 100%;
    min-height: 0;
    /* [2026-08-08] 28px -> 0: media PHẲNG, để card (overflow:hidden + border-radius)
       lo bo góc → media trùng bán kính bo góc + nét ngang đáy thẳng (khớp mọi khổ). */
    border-radius: 0;
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: cover; 
    background-color: #dfe8d2; 
    overflow: hidden;
}

.home-standard-card__media--question {
    display: flex; 
    flex-direction: column; 
    align-items: stretch; 
    justify-content: space-between; 
    padding: 16px; 
    background: #8f98a3; 
    background-image: none !important;
}

.home-standard-card__media-question-title {
    display: -webkit-box; 
    overflow: hidden; 
    max-width: 100%; 
    color: #ffffff; 
    font-family: 'Montserrat',sans-serif; 
    font-size: 21px; 
    font-weight: 700; 
    line-height: 1.2; 
    text-align: left; 
    text-decoration: none; 
    -webkit-line-clamp: 6; 
    -webkit-box-orient: vertical; 
    word-break: break-word;
}

.home-standard-card__media-question-title:hover {
    color: #ffffff; 
    text-decoration: none;
}

.home-standard-card__question-footer {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 10px; 
    min-height: 28px;
}

.home-standard-card__question-author {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    min-width: 0; 
    flex: 1 1 auto; 
    overflow: hidden;
}

.home-standard-card__question-author .home-standard-card__author-avatar {
    background-color: rgba(255,255,255,.35);
}

.home-standard-card__question-author .home-standard-card__meta {
    color: #ffffff; 
    font-size: 13px;
}

.home-standard-card__icons--question .home-standard-card__icon {
    color: #ffffff;
}

.home-standard-card__icons--question .home-standard-card__icon:hover {
    color: #ffffff; 
    opacity: .9;
}

.home-standard-card__body {
    display: flex; 
    flex: 0 0 88px; 
    flex-direction: column; 
    justify-content: flex-start; 
    gap: 10px; 
    min-height: 88px; 
    padding: 12px; 
    background: transparent; 
    overflow: hidden;
}

.home-standard-card__title {
    display: -webkit-box; 
    overflow: hidden; 
    max-width: 100%; 
    width: 100%; 
    min-height: 2.5em; 
    max-height: 2.5em; 
    color: #111111; 
    font-family: 'Montserrat',sans-serif; 
    font-size: 15px; 
    font-weight: 500; 
    line-height: 1.25; 
    text-decoration: none; 
    text-transform: none; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    white-space: normal; 
    text-overflow: ellipsis; 
    word-break: break-word;
}

.home-standard-card__title:hover {
    color: #111111; 
    text-decoration: none;
}

.home-standard-card__meta-row {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    min-height: 28px; 
    margin-top: auto; 
    min-width: 0; 
    overflow: hidden;
}

.home-standard-card__author {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    min-width: 0; 
    max-width: calc(100% - 74px); 
    flex: 1 1 auto; 
    overflow: hidden;
}

.home-standard-card__author-avatar {
    display: block; 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: cover; 
    background-color: #e7ece5; 
    flex: 0 0 24px;
}

.home-standard-card__meta {
    display: block; 
    overflow: hidden; 
    white-space: nowrap; 
    text-overflow: ellipsis; 
    min-height: 16px; 
    color: #728598; 
    font-size: 12px; 
    font-weight: 600; 
    line-height: 1.25; 
    max-width: 100%;
}

.home-standard-card__icons {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 0 0 auto; 
    color: #4f6377; 
    margin-left: auto; 
    padding-right: 2px;
}

.home-standard-card__icon {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px; 
    color: #4f6377; 
    text-decoration: none; 
    font-size: 12px; 
    font-weight: 600;
}

.home-standard-card__icon:hover {
    color: #007b73; 
    text-decoration: none;
}

.home-standard-card__icon .far, .home-standard-card__icon .fas {
    font-size: 16px; 
    line-height: 1;
}

.home-standard-card__icon-count {
    display: inline-block; 
    min-width: 8px; 
    line-height: 1;
}

.item-4.card-type-question .home-standard-card {
    padding: 0; 
    background: transparent;
}

.item-4.card-type-question .home-standard-card__media-wrap {
    margin: 0;
}

.item-4.card-type-question .home-standard-card__media {
    height: 100%;
}

.item-4.card-type-question .home-standard-card__body {
    display: none;
}













.home-standard-host {
    margin-bottom: 22px;
}

.home-standard-host:empty {
    display: none;
}

.card-type-question .home-standard-card__media-wrap {
    aspect-ratio: 0.7;
}

.card-type-question .home-standard-card {
    border: 0;
}

.home-standard-card__author > .home-standard-card__meta:not(.home-standard-card__meta--short), .home-standard-card__question-author > .home-standard-card__meta:not(.home-standard-card__meta--short) {
    display: none;
}

.home-standard-card__meta--short {
    display: block; 
    max-width: 100%; 
    overflow: hidden; 
    color: #8b98a5; 
    font-size: 11px; 
    font-weight: 600; 
    letter-spacing: .06em; 
    text-transform: uppercase; 
    white-space: nowrap; 
    text-overflow: ellipsis;
}

.home-standard-card__question-author .home-standard-card__meta--short {
    color: rgba(255, 255, 255, .92);
}

.home-standard-card__ovb {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: absolute; 
    top: 8px; 
    z-index: 3; 
    width: 32px; 
    height: 32px; 
    margin: 0; 
    padding: 0; 
    border: 0; 
    border-radius: 50%; 
    background: rgba(15, 25, 35, .5); 
    -webkit-backdrop-filter: blur(8px); 
    backdrop-filter: blur(8px); 
    color: #fff; 
    font-size: 13px; 
    line-height: 1; 
    cursor: pointer; 
    opacity: 0; 
    transform: translateY(-4px); 
    transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
}

.home-standard-card:hover .home-standard-card__ovb, .home-standard-card.is-menu-open .home-standard-card__ovb {
    opacity: 1; 
    transform: none;
}

.home-standard-card__ovb:hover {
    background: rgba(15, 25, 35, .82); 
    color: #fff;
}

.home-standard-card__pin {
    left: 8px;
}

.home-standard-card__pin:hover {
    background: #E60023;
}

.home-standard-card__more {
    right: 8px;
}

.home-standard-card__ad {
    display: inline-flex; 
    align-items: center; 
    position: absolute; 
    top: 8px; 
    left: 8px; 
    z-index: 2; 
    height: 32px; 
    padding: 0 12px; 
    background: none; 
    color: #fff; 
    font-size: 10px; 
    font-weight: 600; 
    letter-spacing: .04em; 
    line-height: 1; 
    white-space: nowrap; 
    pointer-events: none; 
    opacity: 1; 
    transition: opacity .18s ease;
}

.home-standard-card:hover .home-standard-card__ad, .home-standard-card.is-menu-open .home-standard-card__ad {
    opacity: 0;
}

.home-standard-card__menu {
    position: absolute; 
    top: 47px; 
    right: 8px; 
    z-index: 30; 
    min-width: 200px; 
    padding: 5px 0; 
    border-radius: 12px; 
    background: #fff; 
    box-shadow: 0 12px 32px rgba(18, 56, 91, .2); 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-6px); 
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.home-standard-card.is-menu-open .home-standard-card__menu {
    opacity: 1; 
    visibility: visible; 
    transform: none;
}

.home-standard-card.is-menu-open {
    overflow: visible; 
    z-index: 20;
}

.home-standard-card__menu-label {
    padding: 8px 14px 4px; 
    color: #a6b2bd; 
    font-size: 10px; 
    font-weight: 600; 
    letter-spacing: .07em; 
    text-transform: uppercase;
}

.home-standard-card__menu-item {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 9px 14px; 
    color: #14212e; 
    font-size: 12.5px; 
    font-weight: 500; 
    line-height: 1.2; 
    text-decoration: none; 
    cursor: pointer;
}

.home-standard-card__menu-item:hover, .home-standard-card__menu-item:focus {
    background: #f3f6f8; 
    color: #14212e; 
    text-decoration: none;
}

.home-standard-card__menu-item i {
    width: 15px; 
    color: #7b8a97; 
    font-size: 13px; 
    text-align: center;
}

.home-standard-card__menu-sep {
    height: 1px; 
    margin: 5px 0; 
    background: #eef2f5;
}

.home-standard-card__menu-item--warn, .home-standard-card__menu-item--warn i {
    color: #b3402f;
}

.home-standard-card__media:not(.home-standard-card__media--question) {
    position: relative;
}

.home-standard-card__media:not(.home-standard-card__media--question)::before {
    content: ""; 
    position: absolute; 
    top: -10%; 
    right: -10%; 
    bottom: -10%; 
    left: -10%; 
    background-image: inherit; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-size: cover;
}

@media (min-width: 768px) {
    .item-wide {
        grid-column: span 2;
    }
}

@media (max-width: 1279px) {
    .item-wide {
        grid-column: span 1;
    }
    .home-standard-card, .item-wide .home-standard-card {
        display: flex; 
        flex-direction: column; 
        height: 100%; 
        padding: 0; 
        border: 1px solid var(--cq-hairline); 
        border-radius: var(--cq-r-card); 
        background: var(--cq-surface); 
        box-shadow: none; 
        overflow: hidden;
    }
    .home-standard-card__media-wrap, .item-wide .home-standard-card__media-wrap {
        display: block; 
        position: relative; 
        flex: 0 0 auto; 
        min-height: 0; 
        margin: 0;
    }
    .home-standard-card__media, .item-wide .home-standard-card__media {
        display: block; 
        position: relative; 
        height: auto; 
        min-height: 0; 
        aspect-ratio: 1 / 1; 
        background-color: var(--cq-placeholder); 
        background-position: center; 
        background-repeat: no-repeat; 
        background-size: cover;
    }
    .home-standard-card__media:after {
        content: ""; 
        position: absolute; 
        top: 0; 
        right: 0; 
        bottom: 0; 
        left: 0; 
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); 
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .16) 100%); 
        pointer-events: none;
    }
    .home-standard-card__icons {
        display: flex; 
        align-items: center; 
        gap: var(--cq-2); 
        flex: 0 0 auto; 
        margin-left: auto; 
        padding: 0; 
        color: var(--cq-text-3);
    }
    .home-standard-card__icon, .home-standard-card__icon:hover {
        gap: 3px; 
        color: var(--cq-text-3); 
        font-size: 11px; 
        font-weight: 500; 
        text-decoration: none;
    }
    .home-standard-card__icon .far, .home-standard-card__icon .fas {
        font-size: 12px;
    }
    .home-standard-card__body, .item-wide .home-standard-card__body {
        display: flex; 
        flex: 1 1 auto; 
        flex-direction: column; 
        gap: var(--cq-2); 
        min-height: 0; 
        padding: var(--cq-3); 
        background: transparent;
    }
    .home-standard-card__title, .item-wide .home-standard-card__title {
        display: -webkit-box; 
        max-height: 2.7em; 
        color: var(--cq-text); 
        font-family: 'Montserrat', sans-serif; 
        font-size: 13px; 
        font-weight: 600; 
        line-height: 1.35; 
        text-transform: none; 
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical; 
        overflow: hidden; 
        overflow-wrap: break-word;
    }
    .home-standard-card__meta-row {
        gap: var(--cq-2); 
        min-height: 0; 
        margin: 0;
    }
    .home-standard-card__author {
        gap: 6px; 
        max-width: 100%;
    }
    .home-standard-card__author-avatar {
        width: 18px; 
        height: 18px; 
        flex: 0 0 18px; 
        background-color: var(--cq-placeholder);
    }
    .home-standard-card__meta {
        color: var(--cq-text-3); 
        font-size: 11px; 
        font-weight: 400;
    }
    .home-standard-card__author > .home-standard-card__meta:not(.home-standard-card__meta--short), .home-standard-card__question-author > .home-standard-card__meta:not(.home-standard-card__meta--short) {
        display: none;
    }
    .home-standard-card__meta--short {
        display: block; 
        max-width: 100%; 
        overflow: hidden; 
        white-space: nowrap; 
        text-overflow: ellipsis;
    }
    .item-4.card-type-question .home-standard-card {
        height: 100%; 
        padding: 0; 
        border-color: rgba(0, 0, 0, .06); 
        background: var(--cq-surface);
    }
    .item-4.card-type-question .home-standard-card__media-wrap {
        display: flex; 
        flex: 1 1 auto; 
        min-height: 0; 
        margin: 0;
    }
    .item-4.card-type-question .home-standard-card__media {
        width: 100%; 
        height: 100%; 
        min-height: 0; 
        aspect-ratio: auto; 
        border-radius: 0;
    }
    .home-standard-card__media--question {
        display: flex; 
        flex: 1 1 auto; 
        flex-direction: column; 
        align-items: stretch; 
        justify-content: space-between; 
        width: 100%; 
        height: auto; 
        min-height: 0; 
        padding: var(--cq-3); 
        background-image: none;
    }
    .home-standard-card__media--question .home-standard-card__media-question-title {
        flex: 0 1 auto; 
        min-height: 0;
    }
    .home-standard-card__question-footer {
        flex: 0 0 auto; 
        margin-top: auto; 
        position: relative; 
        z-index: 2; 
        gap: var(--cq-2); 
        min-height: 0;
    }
    .home-standard-card__media--question:after {
        box-shadow: none; 
        background: linear-gradient(to bottom, rgba(255, 255, 255, .06) 0%, rgba(0, 0, 0, .10) 100%);
    }
    .home-standard-card__media-question-title {
        color: #ffffff; 
        font-family: 'Montserrat', sans-serif; 
        font-size: 14px; 
        font-weight: 600; 
        line-height: 1.35; 
        -webkit-line-clamp: 5; 
        word-break: normal; 
        overflow-wrap: break-word;
    }
    .home-standard-card__question-author {
        gap: 6px;
    }
    .home-standard-card__question-author .home-standard-card__author-avatar {
        width: 18px; 
        height: 18px; 
        flex: 0 0 18px; 
        background-color: rgba(255, 255, 255, .3);
    }
    .home-standard-card__question-author .home-standard-card__meta {
        color: rgba(255, 255, 255, .92); 
        font-size: 11px;
    }
    .item-4.card-type-question .home-standard-card__icons {
        position: static; 
        padding: 0; 
        border-radius: 0; 
        background: none; 
        -webkit-backdrop-filter: none; 
        backdrop-filter: none;
    }
    .item-4.card-type-question .home-standard-card__body {
        display: none;
    }
}

@media (min-width: 1280px) {
    .item-wide {
        grid-column: span 2;
    }
    
    
    
    .home-standard-card, .item-wide .home-standard-card {
        height: 100%;
    }
    .home-standard-card__media-wrap {
        flex: 0 0 auto; 
        min-height: 0; 
        margin: 0;
    }
    .home-standard-card__media {
        height: auto; 
        min-height: 0; 
        aspect-ratio: 1 / 1;
    }
    .home-standard-card__body {
        flex: 1 1 auto; 
        min-height: 0;
    }
    .item-4.card-type-question .home-standard-card__media-wrap {
        display: flex; 
        flex: 1 1 auto; 
        min-height: 0;
    }
    .item-4.card-type-question .home-standard-card__media {
        width: 100%; 
        height: 100%; 
        min-height: 0; 
        aspect-ratio: auto;
    }
    .home-standard-card__media--question {
        display: flex; 
        flex: 1 1 auto; 
        flex-direction: column; 
        justify-content: space-between; 
        height: auto; 
        min-height: 0;
    }
    .home-standard-card__question-footer {
        margin-top: auto;
    }
}

@media (min-width: 1280px) {
    .home-standard-card {
        border-radius: 24px;
    }
    .home-standard-card__title {
        font-size: 16px;
    }
    .home-standard-card__meta {
        font-size: 13px;
    }
}

@media (max-width: 1279px) {
    .home-standard-card {
        border-radius: 16px;
    }
    .home-standard-card__title {
        font-size: 13px;
    }
    .home-standard-card__meta {
        font-size: 11px;
    }
}

@media (min-width: 1280px) {
    .home-standard-card__body, .item-wide .home-standard-card__body {
        flex: 0 0 auto; 
        min-height: 0; 
        padding: 12px; 
        justify-content: flex-start;
    }
    .home-standard-card__meta-row, .item-wide .home-standard-card__meta-row {
        margin-top: 0;
    }
    .home-standard-card__media-wrap {
        flex: 1 1 auto; 
        min-height: 0; 
        aspect-ratio: 1 / 1;
    }
    
    .card-type-question .home-standard-card__media-wrap {
        aspect-ratio: 0.72;
    }
    .home-standard-card__media {
        aspect-ratio: auto; 
        height: 100%;
    }
}

@media (min-width: 1280px) {
    .home-standard-card__media-wrap, .home-standard-card__media {
        border-radius: 0;
    }
}

@media (min-width: 1280px) {
    .home-standard-card__media::after {
        content: ""; 
        position: absolute; 
        top: 0; 
        right: 0; 
        bottom: 0; 
        left: 0; 
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); 
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .16) 100%); 
        pointer-events: none;
    }
    .home-standard-card__meta {
        color: var(--cq-text-3); 
        font-weight: 400;
    }
}
