/* ==========================================================================
   1. FONTS DECLARATION
   ========================================================================== */
@font-face { font-family: 'Chulabhorn Likit Text'; src: url('../fonts/chulabhornlikittext-light.eot'); src: url('../fonts/chulabhornlikittext-light.eot?#iefix') format('embedded-opentype'), url('../fonts/chulabhornlikittext-light.woff2') format('woff2'), url('../fonts/chulabhornlikittext-light.woff') format('woff'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Chulabhorn Likit Text'; src: url('../fonts/chulabhornlikittext-medium.eot'); src: url('../fonts/chulabhornlikittext-medium.eot?#iefix') format('embedded-opentype'), url('../fonts/chulabhornlikittext-medium.woff2') format('woff2'), url('../fonts/chulabhornlikittext-medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Chulabhorn Likit Text'; src: url('../fonts/chulabhornlikittext-bold.eot'); src: url('../fonts/chulabhornlikittext-bold.eot?#iefix') format('embedded-opentype'), url('../fonts/chulabhornlikittext-bold.woff2') format('woff2'), url('../fonts/chulabhornlikittext-bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }

/* ==========================================================================
   2. VARIABLES & RESET
   ========================================================================== */
:root {
    --primary-color: #C4314C; --primary-hover: #a9253d; --header-bg: #9a1f36;
    --text-color: #333; --text-light: #666; --bg-color: #f9f9f9; --border-color: #eee;
    --container-width: 1200px;
    --main-font: 'Chulabhorn Likit Text', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--main-font); font-weight: 300; font-size: 16px; line-height: 1.6; color: var(--text-color); background: var(--bg-color); }
strong, b { font-weight: 500; }
h1, h2, h3, h4, h5, h6, .site-branding a, .entry-title, .widget-title, .button { font-family: var(--main-font); font-weight: 700; }
h1, h2, h3, h4, h5, h6, .entry-title, .headline-title, .widget-title, .author-highlight a { overflow-wrap: break-word; word-wrap: break-word; hyphens: auto;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; } a:hover { color: var(--primary-hover); }
ul, li { list-style: none; padding: 0; margin: 0; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
.button { display: inline-block; background: var(--primary-color); color: #fff; padding: 10px 20px; border-radius: 4px; border: none; cursor: pointer; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.entry-meta i, .headline-meta i, .capsule-link i { margin-right: 5px; opacity: 0.8; }

/* ==========================================================================
   3. HEADER & NAVBAR
   ========================================================================== */
.site-header { background: var(--header-bg); padding: 20px 0; color: #fff; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.site-branding { flex: 0 0 auto; } .site-branding a { display: block; } .site-branding img { max-height: 80px; width: auto; }
.header-ad { flex: 0 0 auto; }

.main-navigation-bar { background: var(--primary-color); box-shadow: 0 4px 10px rgba(0,0,0,0.1); position: relative; z-index: 500; }
.navbar-inner { display: flex; justify-content: space-between; align-items: center; height: 60px; gap: 20px; }
.main-navigation { flex: 0 0 auto; height: 100%; }
.nav-menu { display: flex; height: 100%; align-items: center; }
.nav-menu li a { color: #fff; padding: 0 15px; font-weight: 500; height: 100%; display: flex; align-items: center; transition: background 0.2s; white-space: nowrap; }
.nav-menu li a:hover { background: rgba(0,0,0,0.15); }
.menu-toggle { display: none; }

/* Search Bar */
.header-search-wrapper { flex: 1; max-width: 600px; position: relative; margin-left: auto; }
.f0nt-search-container { width: 100%; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: box-shadow 0.2s; height: 40px; }
.header-search-wrapper.active .f0nt-search-container { box-shadow: 0 0 0 3px rgba(255,255,255,0.4); }
.f0nt-search-form { display: flex; width: 100%; height: 100%; margin: 0; padding: 0; border: none; align-items: stretch; }
input.f0nt-search-input { flex-grow: 1; width: 100%; border: none !important; background: transparent !important; margin: 0 !important; padding: 0 15px !important; height: 100% !important; box-shadow: none !important; border-radius: 0 !important; font-size: 1rem; color: #333; outline: none; }
button.f0nt-search-btn { flex: 0 0 50px; width: 50px; height: 100%; border: none; background: transparent; padding: 0; margin: 0; border-radius: 0; cursor: pointer; color: var(--primary-color); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
button.f0nt-search-btn:hover { background: #f5f5f5; }

/* Search Tags */
.search-quick-tags { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 20px; border-radius: 0 0 8px 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-top: 1px solid #eee; z-index: 10; }
.header-search-wrapper.active .search-quick-tags { display: block; animation: slideDown 0.2s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.tags-label { display: block; font-size: 0.85rem; color: #888; margin-bottom: 10px; font-weight: bold; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { display: inline-block; background: #f0f0f0; color: #555; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; transition: all 0.2s; }
.tag-pill:hover { background: var(--primary-color); color: #fff; }

/* ==========================================================================
   4. POST LISTS & GRID (Shared)
   ========================================================================== */
.site-grid { display: block; margin-top: 40px; margin-bottom: 60px; }
@media (min-width: 992px) { .site-grid.with-sidebar { display: grid; grid-template-columns: 1fr 340px; gap: 40px; } }

.post-list { column-count: 1; column-gap: 20px; }
@media (min-width: 600px) { .post-list { column-count: 2; } }
@media (min-width: 992px) { .post-list { column-count: 3; } }

.classic-post { display: inline-block; width: 100%; margin-bottom: 20px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; break-inside: avoid; }
.classic-post:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

/* In-feed Ads */
.classic-post.ad-card { background: #f9f9f9; border: 1px dashed #ddd; text-align: center; padding: 0; min-height: 250px; display: inline-block; width: 100%; break-inside: avoid; overflow: hidden; contain: content; }
.ad-card .f0nt-ad-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 10px; position: relative; box-sizing: border-box; }
.ad-card .f0nt-ad-container::before { content: "Advertisement"; color: #ccc; font-size: 0.7rem; position: absolute; top: 5px; right: 10px; text-transform: uppercase; }
.ad-card ins.adsbygoogle { display: block !important; width: 100% !important; max-width: 100% !important; overflow: hidden !important; }

.post-thumbnail { flex: none; width: 100%; max-width: 100%; } .post-thumbnail img { border-radius: 0; width: 100%; height: auto; display: block; }
.no-image { width: 100%; aspect-ratio: 1/1; border-radius: 0; background: #f0f0f0; display: flex; align-items: center; justify-content: center; color: #888; font-weight: bold; font-size: 1.4rem; padding: 20px; text-align: center; }
.no-image span { word-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.post-content { padding: 15px; }
.entry-title { font-size: 1.3rem; margin: 0 0 5px 0; line-height: 1.4; font-weight: bold; }
.entry-title a { color: var(--primary-color); } .entry-title a:hover { color: var(--primary-hover); }
.entry-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 5px; }
.entry-meta a { font-weight: bold; color: var(--text-light); } .entry-meta a:hover { color: var(--primary-color); }
.special-cat-link { display: inline-block; font-size: 0.8rem; color: #999; text-decoration: none; margin-top: 5px; font-weight: normal; } .special-cat-link:hover { color: var(--primary-color); } .special-cat-link i { font-size: 0.7rem; margin-right: 3px; }
.entry-summary { font-size: 0.95rem; color: #555; line-height: 1.6; margin-bottom: 0; margin-top: 10px; }
.read-more { display: none; }
.pagination-wrapper .nav-links { display: flex; justify-content: center; gap: 10px; margin: 40px 0; }
.pagination-wrapper .page-numbers { padding: 8px 16px; border: 1px solid #ddd; border-radius: 20px; }
.pagination-wrapper .page-numbers.current { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.site-footer { background: #222; color: #888; padding: 40px 0; margin-top: 60px; text-align: center; }
.footer-menu-list { display: flex; justify-content: center; gap: 20px; }
.footer-menu-list li a { color: #aaa; }

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .header-inner { flex-direction: column; gap: 15px; } .site-branding { margin-right: 0; } .header-ad { display: none; }
    .navbar-inner { height: auto; padding: 15px 20px; flex-direction: column; align-items: stretch; }
    .header-search-wrapper { margin-left: 0; } .f0nt-search-input { text-align: center; padding: 0; } .f0nt-search-input:focus { text-align: left; padding-left: 15px; }
    .menu-toggle { display: block; width: 100%; background: rgba(0,0,0,0.2); color: #fff; padding: 12px; margin-bottom: 10px; }
    .main-navigation { display: none; width: 100%; } .main-navigation.toggled { display: block; }
    .nav-menu { flex-direction: column; height: auto; } .nav-menu li { width: 100%; }
    
    .post-list { column-count: 1; }
    .widget { margin-top: 40px; }
    .footer-menu-list { flex-direction: column; gap: 10px; }
}