/* =====================================================
   AVST Top 10 — Frontend Styles (Light Theme)
   ===================================================== */

.avst-article-content {
    margin-bottom: 2rem;
    line-height: 1.8;
    color: #1a1a1a;
}

/* ---- SHARED BUTTON ---- */
.avst-btn {
    display: inline-block;
    padding: .45rem 1.2rem;
    background: #e63946;
    color: #fff !important;
    border-radius: 4px;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none !important;
    transition: background .2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.avst-btn:hover { background: #c1121f; color: #fff !important; }

.avst-stars  { color: #f4a261; letter-spacing: 1px; }
.avst-note   { color: #c77800; font-style: italic; font-size: .85rem; margin: .25rem 0; }
.avst-empty  { color: #888; }

/* =====================================================
   CARD LAYOUT  (แนวนอน — รูปซ้าย เนื้อหาขวา)
   ===================================================== */
.avst-layout-card .avst-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.avst-layout-card .avst-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fafaf8;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .2s;
    position: relative;
    color: #1a1a1a;
}
.avst-layout-card .avst-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

/* อันดับ badge */
.avst-layout-card .avst-card-rank {
    position: absolute;
    top: .6rem;
    left: .6rem;
    background: #e63946;
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    padding: .1rem .55rem;
    border-radius: 50px;
    z-index: 2;
    line-height: 1.6;
}

/* รูปภาพ — ซ้ายมือ แนวตั้ง 2:3 */
.avst-layout-card .avst-card-img {
    flex-shrink: 0;
    width: 180px;
    aspect-ratio: 2/3;
    background: #e8e8e8;
    overflow: hidden;
}
.avst-layout-card .avst-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* เนื้อหา — ขวามือ */
.avst-layout-card .avst-card-body {
    flex: 1;
    padding: .9rem 1rem .9rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .3rem;
    background: #fafaf8;
}

.avst-layout-card .avst-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    margin: 0 0 .2rem;
}

.avst-layout-card .avst-actors {
    font-size: .82rem;
    color: #444;
    margin: 0;
}
.avst-layout-card .avst-actors span { margin-right: .25rem; }

.avst-layout-card .avst-rating {
    font-size: .82rem;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.avst-layout-card .avst-excerpt {
    font-size: .85rem;
    color: #555;
    line-height: 1.55;
    margin: .15rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avst-layout-card .avst-note {
    font-size: .8rem;
    color: #c77800;
    font-style: italic;
    margin: 0;
}

.avst-layout-card .avst-btn {
    align-self: flex-start;
    margin-top: .4rem;
}

/* =====================================================
   GRID LAYOUT  (หลายคอลัมน์ — พื้นขาว ตัวหนังสือเทาเข้ม)
   ===================================================== */
.avst-layout-grid .avst-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.1rem;
    margin: 1.5rem 0;
}

.avst-layout-grid .avst-grid-card {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.avst-layout-grid .avst-grid-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.avst-layout-grid .avst-grid-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background: #ececec;
    overflow: hidden;
}
.avst-layout-grid .avst-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.avst-layout-grid .avst-grid-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #bbb;
}

.avst-layout-grid .avst-grid-rank {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: #e63946;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    padding: .1rem .5rem;
    border-radius: 50px;
    z-index: 2;
}

.avst-layout-grid .avst-grid-body {
    background: #ffffff;
    padding: .75rem .8rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1;
}

.avst-layout-grid .avst-grid-title {
    font-size: .9rem;
    font-weight: 700;
    color: #333333;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avst-layout-grid .avst-grid-rating {
    font-size: .8rem;
    color: #555555;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.avst-layout-grid .avst-grid-excerpt {
    font-size: .78rem;
    color: #666666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avst-layout-grid .avst-grid-note {
    font-size: .76rem;
    color: #c77800;
    font-style: italic;
    margin: 0;
}

.avst-layout-grid .avst-grid-btn {
    margin-top: auto;
    text-align: center;
    font-size: .82rem;
    padding: .4rem 0;
}

@media (max-width: 480px) {
    .avst-layout-grid .avst-grid-cards { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .avst-layout-grid .avst-grid-title { font-size: .82rem; }
}

/* =====================================================
   TABLE LAYOUT
   ===================================================== */
.avst-table-wrap { overflow-x: auto; margin: 1.5rem 0; }

.avst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    background: #fafaf8;
    color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.avst-table th {
    background: #1d3557;
    color: #fff;
    padding: .7rem .9rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.avst-table td {
    padding: .65rem .9rem;
    border-bottom: 1px solid #ebebeb;
    vertical-align: middle;
    color: #1a1a1a;
}
.avst-table tr:last-child td { border-bottom: none; }
.avst-table tr:hover td { background: #f3f3f0; }

.avst-t-rank { font-size: 1.1rem; font-weight: 800; color: #e63946; width: 50px; text-align: center; }
.avst-t-img  { width: 75px; }
.avst-t-img img { width: 65px; border-radius: 4px; display: block; }
.avst-t-info strong { font-size: .95rem; color: #1a1a1a; }
.avst-t-excerpt { color: #666; font-size: .8rem; }
.avst-t-rating { text-align: center; width: 90px; white-space: nowrap; color: #333; }
.avst-t-btn { width: 110px; text-align: center; }

/* =====================================================
   LIST LAYOUT
   ===================================================== */
.avst-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.avst-list-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e5e5;
    align-items: flex-start;
    background: transparent;
}
.avst-list-img { width: 80px; flex-shrink: 0; border-radius: 4px; object-fit: cover; }
.avst-list-body { flex: 1; color: #1a1a1a; }
.avst-list-rank { font-size: 1rem; font-weight: 800; color: #e63946; }
.avst-list-body h3 { margin: .2rem 0; font-size: .95rem; color: #1a1a1a; }
.avst-list-body p  { font-size: .83rem; margin: .15rem 0; color: #444; }

/* =====================================================
   RESPONSIVE — มือถือ: เหลือแค่ อันดับ รูป คะแนน ปุ่ม
   ===================================================== */
@media (max-width: 600px) {

    /* Card layout — แนวนอน ยังคง */
    .avst-layout-card .avst-card-img {
        width: 110px;
        flex-shrink: 0;
    }

    /* ซ่อนชื่อ นักแสดง เรื่องย่อ บรรณาธิการ */
    .avst-layout-card .avst-card-title,
    .avst-layout-card .avst-actors,
    .avst-layout-card .avst-excerpt,
    .avst-layout-card .avst-note { display: none; }

    /* body แคบลง จัดกลาง */
    .avst-layout-card .avst-card-body {
        padding: .6rem .75rem;
        justify-content: center;
        gap: .5rem;
    }

    /* คะแนน ใหญ่หน่อย */
    .avst-layout-card .avst-rating {
        font-size: .95rem;
        font-weight: 700;
    }

    /* ปุ่มดูหนัง เต็มความกว้าง */
    .avst-layout-card .avst-btn {
        display: block;
        text-align: center;
        width: 100%;
        padding: .5rem 0;
        font-size: .9rem;
    }

    /* Table / List */
    .avst-t-img, .avst-t-excerpt { display: none; }
    .avst-list-img { width: 70px; }
    .avst-list-body h3,
    .avst-list-body .avst-note { display: none; }
}

@media (max-width: 380px) {
    .avst-layout-card .avst-card-img { width: 90px; }
}
