/*
Theme Name: MinibusTicket Blog
Theme URI: https://minibusticket.com/blog/
Author: MinibusTicket
Description: ธีมบล็อกที่หน้าตาเหมือนเว็บหลัก minibusticket.com ใช้เมนู ท้ายเว็บ สี ฟอนต์ ปุ่มแชร์ แถบคุกกี้ และโค้ดติดตามชุดเดียวกับเว็บหลัก (ตั้งค่าที่ /mbt-admin/) เปลี่ยนที่หลังบ้านเว็บหลักแล้วบล็อกเปลี่ยนตามทันที
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: minibusticket
*/

/* สไตล์หลักมาจาก /assets/mbt.css ของเว็บหลัก ไฟล์นี้เติมเฉพาะส่วนของ WordPress */
body.mbt-blog { background: var(--mbt-bg, #f4f8fc); }
.mbt-blog .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.mbt-blog .mbt-hero--sm .mbt-lead { margin-bottom: 0; }

/* เนื้อหาจากตัวแก้ไข WordPress (Gutenberg / Classic) */
.mbt-art-body > *:first-child { margin-top: 0; }
.mbt-art-body .alignleft { float: left; margin: .4rem 1.4rem 1rem 0; max-width: 50%; }
.mbt-art-body .alignright { float: right; margin: .4rem 0 1rem 1.4rem; max-width: 50%; }
.mbt-art-body .aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.mbt-art-body .alignwide, .mbt-art-body .alignfull { max-width: 100%; }
.mbt-art-body::after { content: ""; display: block; clear: both; }
.mbt-art-body .wp-caption, .mbt-art-body .wp-block-image { max-width: 100%; margin: 1.2rem auto; }
.mbt-art-body .wp-caption-text, .mbt-art-body .wp-element-caption, .mbt-art-body .wp-block-image figcaption { text-align: center; font-size: .88rem; color: var(--mbt-muted); margin-top: 6px; }
.mbt-art-body .wp-block-embed { margin: 1.4rem 0; }
.mbt-art-body .wp-block-embed__wrapper { position: relative; }
.mbt-art-body .wp-block-embed figcaption { text-align: center; font-size: .88rem; color: var(--mbt-muted); }
.mbt-art-body iframe[src*="google.com/maps"] { aspect-ratio: 4 / 3; }
.mbt-art-body video, .mbt-art-body audio { max-width: 100%; }
.mbt-art-body .wp-block-gallery, .mbt-art-body .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 1.2rem 0; padding: 0; }
.mbt-art-body .gallery img, .mbt-art-body .wp-block-gallery img { margin: 0; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.mbt-art-body .wp-block-button__link, .mbt-art-body .button { display: inline-block; background: var(--mbt-grad); color: #fff !important; padding: 10px 22px; border-radius: 12px; text-decoration: none !important; font-family: var(--mbt-font); font-weight: 600; }
.mbt-art-body .wp-block-separator, .mbt-art-body hr { border: 0; border-top: 1px solid var(--mbt-line); margin: 2rem 0; opacity: 1; }
.mbt-art-body .wp-block-table { overflow-x: auto; margin: 1.2rem 0; } .mbt-art-body .wp-block-table table { margin: 0; display: table; }
.mbt-art-body pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px 16px; overflow: auto; font-size: .9rem; }
.mbt-art-body .has-text-align-center { text-align: center; } .mbt-art-body .has-text-align-right { text-align: right; }
.mbt-art-body h4 { font-family: var(--mbt-font); font-size: 1.05rem; font-weight: 600; margin: 1.4rem 0 .5rem; }
.mbt-art-pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 20px 0; font-family: var(--mbt-font); }
.mbt-art-pages a, .mbt-art-pages > span > span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--mbt-line); }

/* หน้ารวม: การ์ดบทความ */
.mbt-blog .mbt-grid-3 { margin-bottom: 8px; }
.mbt-blog .mbt-read { margin-top: auto; display: inline-flex; gap: 6px; align-items: center; color: var(--mbt-c600); font-weight: 600; font-size: .86rem; }
.mbt-blog .mbt-read small { margin-left: auto; color: var(--mbt-muted); font-weight: 400; }
.mbt-pager span.is-active, .mbt-pager span.dots { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.mbt-pager span.is-active { background: var(--mbt-grad); color: #fff; }
.mbt-blog-empty { background: #fff; border-radius: 20px; box-shadow: var(--mbt-shadow); padding: 48px 24px; text-align: center; color: var(--mbt-muted); }
.mbt-blog-empty i { font-size: 2.6rem; color: var(--mbt-c300); display: block; margin-bottom: 10px; }
.mbt-blog-empty .mbt-art-find { max-width: 360px; margin: 18px auto 0; }

/* วิดเจ็ตในแถบข้าง */
.mbt-side-box ul { list-style: none; padding: 0; margin: 0; }
.mbt-side-box li { padding: 6px 0; border-top: 1px solid #eef4fa; font-size: .92rem; } .mbt-side-box li:first-child { border-top: 0; }
.mbt-side-box li a { color: var(--mbt-text, #334155) !important; text-decoration: none !important; } .mbt-side-box li a:hover { color: var(--mbt-c600) !important; }
.mbt-side-cat span { margin-left: auto; font-size: .8rem; color: var(--mbt-muted); }

/* ความคิดเห็น */
.mbt-comments { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--mbt-line); }
.mbt-comments h2, .mbt-comments h3 { font-size: 1.15rem; font-weight: 600; }
.mbt-comments ol { list-style: none; padding: 0; } .mbt-comments ol ol { padding-left: 24px; }
.mbt-comments .comment-body { background: var(--mbt-c50); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.mbt-comments .comment-meta { font-size: .82rem; color: var(--mbt-muted); } .mbt-comments .avatar { border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.mbt-comments textarea, .mbt-comments input[type=text], .mbt-comments input[type=email], .mbt-comments input[type=url] { width: 100%; border: 1px solid var(--mbt-line); border-radius: 12px; padding: 10px 12px; font: inherit; }
.mbt-comments .submit { background: var(--mbt-grad); color: #fff; border: 0; border-radius: 12px; padding: 10px 22px; font-weight: 600; }

@media (max-width: 991px) { .mbt-blog .mbt-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .mbt-blog .mbt-grid-3 { grid-template-columns: 1fr; }
  .mbt-art-body .alignleft, .mbt-art-body .alignright { float: none; margin: 1rem auto; max-width: 100%; }
}
