/* ------------------------------------------------------------------
 * blog.css — หน้ารวมบทความ และหน้าอ่านบทความ
 * ------------------------------------------------------------------ */

/* ================= หัวหน้า ================= */
.mhs-blog-hero {
    background-size: cover;
    background-position: center center;
}

.mhs-blog-hero-veil {
    padding: 54px 0;
    background: linear-gradient(180deg, rgba(161, 0, 0, .84), rgba(120, 0, 0, .93));
}

.mhs-blog-hero h1 {
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.mhs-blog-hero p {
    font-size: 16px;
    color: #fff;
    opacity: .92;
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ================= ช่องค้นหา ================= */
.mhs-blog-search {
    display: flex;
    gap: 8px;
    max-width: 520px;
    margin: 0 auto 28px;
}

.mhs-blog-search input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 15px;
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.mhs-blog-search input:focus {
    border-color: #a10000;
    box-shadow: 0 0 0 3px rgba(161, 0, 0, .12);
}

.mhs-blog-search button {
    border: 0;
    border-radius: 30px;
    padding: 12px 22px;
    color: #fff;
    background: linear-gradient(135deg, #d94b00, #a10000);
    cursor: pointer;
    white-space: nowrap;
}

.mhs-blog-search button:hover {
    filter: brightness(.94);
}

.mhs-blog-result {
    text-align: center;
    color: #777;
    font-size: 15px;
    margin: -14px 0 24px;
}

.mhs-blog-result a {
    color: #a10000;
    text-decoration: underline;
}

/* ================= ตารางบทความ ================= */
.mhs-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
}

.mhs-blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.mhs-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .13);
}

.mhs-blog-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eee;
}

.mhs-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.mhs-blog-card:hover .mhs-blog-thumb img {
    transform: scale(1.07);
}

.mhs-blog-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
}

.mhs-blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: #999;
    margin-bottom: 8px;
}

.mhs-blog-meta i {
    margin-right: 3px;
}

.mhs-blog-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 8px;
}

.mhs-blog-title a {
    color: #222;
    text-decoration: none !important;
    transition: color .18s ease;
}

.mhs-blog-card:hover .mhs-blog-title a {
    color: #a10000;
}

.mhs-blog-excerpt {
    font-size: 14.5px;
    line-height: 1.75;
    color: #777;
    margin: 0 0 14px;
    /* ตัดให้เหลือ 3 บรรทัดพอดี การ์ดจะได้สูงเท่ากัน */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mhs-blog-more {
    margin-top: auto;
    font-size: 14.5px;
    font-weight: 600;
    color: #a10000;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mhs-blog-more i {
    transition: transform .18s ease;
}

.mhs-blog-card:hover .mhs-blog-more i {
    transform: translateX(4px);
}

/* ---------- บทความเด่น (ใบแรก) ---------- */
.mhs-blog-feature {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    margin-bottom: 26px;
    transition: box-shadow .2s ease;
}

.mhs-blog-feature:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
}

.mhs-blog-feature .mhs-blog-thumb {
    aspect-ratio: auto;
    height: 100%;
    min-height: 260px;
}

.mhs-blog-feature .mhs-blog-body {
    padding: 26px 28px;
    justify-content: center;
}

.mhs-blog-feature .mhs-blog-title {
    font-size: 24px;
}

.mhs-blog-feature .mhs-blog-excerpt {
    -webkit-line-clamp: 4;
    font-size: 15.5px;
}

.mhs-blog-badge {
    display: inline-block;
    align-self: flex-start;
    background: linear-gradient(135deg, #d94b00, #a10000);
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* ---------- ปุ่มจัดการของแอดมิน ---------- */
.mhs-blog-admin {
    display: flex;
    gap: 6px;
    padding: 0 18px 16px;
}

.mhs-blog-admin form {
    margin: 0;
}

.mhs-blog-admin .btn {
    font-size: 13px;
    padding: 5px 12px;
}

/* ---------- ไม่มีข้อมูล ---------- */
.mhs-blog-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.mhs-blog-empty i {
    font-size: 44px;
    color: #ddd;
    display: block;
    margin-bottom: 12px;
}

/* ================= แบ่งหน้า ================= */
.mhs-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 34px;
}

.mhs-pager a,
.mhs-pager span {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-decoration: none !important;
    background: #fff;
    color: #555;
    border: 1px solid #e6e6e6;
    transition: all .16s ease;
}

.mhs-pager a:hover {
    border-color: #a10000;
    color: #a10000;
}

.mhs-pager .is-current {
    background: linear-gradient(135deg, #d94b00, #a10000);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.mhs-pager .is-gap {
    border: 0;
    background: none;
    min-width: 20px;
}

/* ================= หน้าอ่านบทความ ================= */
.mhs-post-head {
    max-width: 820px;
    margin: 0 auto 22px;
    text-align: center;
}

.mhs-post-head h1 {
    font-size: 30px;
    font-weight: 700;
    color: #222;
    line-height: 1.45;
    margin: 0 0 12px;
}

.mhs-post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #888;
}

.mhs-post-cover {
    max-width: 900px;
    margin: 0 auto 26px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}

.mhs-post-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.mhs-post-body {
    max-width: 820px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.9;
    color: #333;
}

.mhs-post-body h2 {
    font-size: 23px;
    font-weight: 600;
    color: #a10000;
    margin: 34px 0 12px;
}

.mhs-post-body h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 26px 0 10px;
}

.mhs-post-body p {
    margin-bottom: 18px !important;
}

.mhs-post-body img {
    border-radius: 10px;
    margin: 10px 0;
}

/* แถบแชร์ */
.mhs-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 820px;
    margin: 30px auto 0;
    padding-top: 22px;
    border-top: 1px solid #eee;
}

.mhs-share span {
    color: #888;
    font-size: 14px;
    margin-right: 4px;
}

.mhs-share a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 16px;
    text-decoration: none !important;
    transition: transform .18s ease, filter .18s ease;
}

.mhs-share a:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
}

.mhs-share .is-fb   { background: #1877f2; }
.mhs-share .is-line  { background: #06c755; }
.mhs-share .is-x     { background: #111; }
.mhs-share .is-copy  { background: #888; cursor: pointer; }

/* ================= จอเล็ก ================= */
@media (max-width: 767px) {
    .mhs-blog-hero-veil { padding: 38px 0; }
    .mhs-blog-hero h1 { font-size: 25px; }
    .mhs-blog-hero p { font-size: 14.5px; }

    .mhs-blog-feature {
        grid-template-columns: 1fr;
    }

    .mhs-blog-feature .mhs-blog-thumb {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .mhs-blog-feature .mhs-blog-body { padding: 18px; }
    .mhs-blog-feature .mhs-blog-title { font-size: 20px; }

    .mhs-blog-grid { gap: 16px; }
    .mhs-post-head h1 { font-size: 23px; }
    .mhs-post-body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .mhs-blog-card,
    .mhs-blog-thumb img,
    .mhs-blog-more i,
    .mhs-share a {
        transition: none !important;
    }
}

/* ================= คำค้น (Tag) ท้ายบทความ ================= */
.mhs-taglist {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 820px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mhs-taglist-label {
    font-size: 14px;
    color: #888;
    margin-right: 4px;
}

.mhs-taglist-label i {
    color: #a10000;
    margin-right: 4px;
}

.mhs-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 30px;
    font-size: 14px;
    color: #a10000 !important;
    text-decoration: none !important;
    background: #fdf3f3;
    border: 1px solid #f3dede;
    transition: background .16s ease, transform .16s ease, border-color .16s ease;
}

.mhs-tag::before {
    content: '#';
    opacity: .5;
    margin-right: 3px;
}

.mhs-tag:hover {
    background: linear-gradient(135deg, #d94b00, #a10000);
    border-color: transparent;
    color: #fff !important;
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .mhs-tag { transition: none !important; }
}
