/* --- Force post image aspect ratio 3:2 with proper cropping --- */
.post-template .wp-post-image,
.wp-block-post-featured-image img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
    height: auto;
    display: block;
}

/* --- Make all post cards equal height --- */
.wp-block-post {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wp-block-post > * {
    flex-shrink: 0;
}

.wp-block-post .wp-block-group {
    margin-top: auto;
}

/* --- Limit excerpt to exactly 3 lines (Thai-friendly) --- */
.wp-block-post-excerpt,
.wp-block-post-excerpt__excerpt {
    font-size: 16px !important;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Title font 24px --- */
.wp-block-post-title a,
.wp-block-post-title {
    font-size: 22px !important;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Improve grid gap & layout --- */
.wp-block-query .wp-block-post-template {
    gap: 32px;
}

.blog-title { font-size : 30px !important}

.search-button {
    background: #ffffff;         /* พื้นหลังขาว */
    border: 1px solid #000000;   /* กรอบดำ */
    color: #000000;              /* สีไอคอนดำ */
    padding: 4px 10px;           /* ขนาดเล็กเท่าเมนู */
    border-radius: 6px;          /* มุมโค้งเล็กๆ */
    cursor: pointer;
    height: 28px;                /* ปรับให้สูงเท่าเมนู */
    line-height: 20px;           /* จัดไอคอนให้อยู่กลาง */
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-block-search__button.has-icon {
    background: #ffffff !important;       /* พื้นหลังขาว */
    border: 1px solid #000000 !important; /* กรอบดำ */
    border-radius: 6px !important;        /* มุมโค้งเล็กแบบเมนู */
    padding: 4px 8px !important;          /* ปรับขนาดให้เล็กลง */
    height: 32px;                         /* ความสูงเท่าเมนู */
    width: 32px;                          /* ทำให้เป็นปุ่มจตุรัส */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ไอคอนแว่นขยาย */
.wp-block-search__button.has-icon svg.search-icon {
    width: 16px;
    height: 16px;
    fill: #000000 !important;             /* แว่นขยายสีดำ */
}

/* Hover */
.wp-block-search__button.has-icon:hover {
    background: #f5f5f5 !important;       /* สี hover เบาๆ */
    border-color: #000;
}

/* ฟอนต์เนื้อหาแบบอ่านง่าย */
body,
.entry-content,
.wp-block-post-content {
    font-family: "IBM Plex Sans Thai Looped", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #111;
    letter-spacing: 0.1px;
    font-weight: 400;
}

/* ย่อหน้าให้ลื่นตา */
.entry-content p {
    margin-bottom: 1.3em;
}

/* หัวข้อในบทความ */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: "IBM Plex Sans Thai Looped", sans-serif;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

/* ตัวหนา */
.entry-content strong {
    font-weight: 600;
}

/* รายการ bullet ให้เว้นช่องนิดนึง */
.entry-content ul,
.entry-content ol {
    margin-left: 1.2em;
    line-height: 1.7;
}


@media (max-width: 768px) {
    body,
    .entry-content,
    .wp-block-post-content {
        font-size: 18px;
        line-height: 1.75;
    }
}

.gallery img {
    content-visibility: auto;
}