/*
Theme Name: f0nt2026 (ฟอนต์.คอม v.5.1)
Theme URI: https://www.f0nt.com
Description: ขอบคุณ เไ จมน ที่ช่วยทำให้ตาลุงที่ลืมวิธีเขียนเว็บไปนานแล้วกลับมาสนุกอีกครั้ง
Version: 5.1.2025
Author: iannnnn
Text Domain: f0nt2026
*/

/* ==========================================================================
   1. 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;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px; line-height: 1.6;
    color: var(--text-color); background: var(--bg-color);
}

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; word-wrap: normal !important; }

/* Font Awesome Spacing */
.entry-meta i, .headline-meta i, .capsule-link i { margin-right: 5px; opacity: 0.8; }

/* ==========================================================================
   2. 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 (ROBUST LAYOUT) */
.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; flex-shrink: 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; -webkit-appearance: none; }
input.f0nt-search-input::placeholder { color: #aaa; opacity: 1; }
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; }

/* Popup 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. FEATURED HEADLINE
   ========================================================================== */
.featured-headline { background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); padding: 0; margin-top: 40px; margin-bottom: 50px; display: flex; gap: 0; align-items: stretch; border: 1px solid #eee; position: relative; overflow: hidden; }
.headline-image { flex: 0 0 450px; width: 450px; height: 450px; background: #f4f4f4; position: relative; }
.headline-image img { width: 100%; height: 100%; object-fit: cover; display: block; box-shadow: none; border-radius: 0; }
.headline-content { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.headline-ribbon { position: absolute; top: 25px; right: -40px; background: var(--primary-color); color: #fff; padding: 8px 50px; font-size: 0.85rem; font-weight: bold; text-transform: uppercase; transform: rotate(45deg); box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10; }
.headline-title { font-size: 2.8rem; margin: 0 0 15px 0; line-height: 1.1; font-weight: 800; }
.headline-title a { color: var(--primary-color); } .headline-title a:hover { color: var(--primary-hover); }
.headline-meta { font-size: 0.95rem; color: #888; margin-bottom: 20px; }
.headline-meta a { font-weight: bold; color: var(--text-color); } .headline-meta a:hover { color: var(--primary-color); }
.headline-excerpt { font-size: 1.15rem; color: #555; line-height: 1.8; margin-bottom: 30px; }
.headline-download-btn { display: inline-block; background: var(--text-color); color: #fff; padding: 10px 25px; border-radius: 30px; font-weight: bold; font-size: 1rem; align-self: flex-start; transition: all 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.headline-download-btn:hover { background: var(--primary-color); color: #fff; transform: translateY(-2px); }
.headline-download-btn i { margin-right: 8px; }
.headline-readmore { display: none; }

/* ==========================================================================
   5. POST LISTS & MASONRY GRID
   ========================================================================== */
.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; letter-spacing: 1px; z-index: 1; }
.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: #e0e0e0; display: flex; align-items: center; justify-content: center; color: #888; font-weight: bold; font-size: 1.4rem; padding: 20px; text-align: center; word-wrap: break-word; line-height: 1.3; }
.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 8px 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: 10px; }
.entry-meta a { font-weight: bold; color: var(--text-light); } .entry-meta a:hover { color: var(--primary-color); }
.entry-summary { font-size: 0.95rem; color: #555; line-height: 1.6; margin-bottom: 0; }
.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; color: var(--text-light); }
.pagination-wrapper .page-numbers.current { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* ==========================================================================
   6. SPECIAL PAGE HEADERS
   ========================================================================== */
.author-header-zone, .search-header-zone { background-color: #fff; padding: 60px 0 80px; text-align: center; border-bottom: 1px solid #eee; margin-bottom: 40px; }
.author-avatar-large img { border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 20px; width: 120px; height: 120px; border: 4px solid #fff; display: inline-block; }
.author-page-title, .search-page-title { font-size: 3.5rem; font-weight: 800; color: var(--text-color); margin: 0 0 10px 0; line-height: 1.1; letter-spacing: -1px; }
.search-page-title span { color: var(--primary-color); border-bottom: 3px solid var(--primary-color); }
.author-stats, .search-stats { font-size: 1.2rem; color: #888; font-weight: 300; margin: 0; }
.author-stats strong, .search-stats strong { color: var(--primary-color); font-weight: 700; font-size: 1.4rem; }
.author-bio { max-width: 600px; margin: 20px auto 0; color: #555; line-height: 1.6; font-size: 1rem; }
.search-icon-large { font-size: 4rem; color: var(--primary-color); margin-bottom: 20px; opacity: 0.2; }

/* ==========================================================================
   7. CREATORS PAGE
   ========================================================================== */
#content-creators { width: 100%; margin: 0 auto; padding: 20px 0; }
#content-creators ul { counter-reset: index; padding: 40px 0; max-width: 800px; margin: 0 auto; }
#content-creators li { counter-increment: index; display: flex; align-items: center; padding: 20px 0; box-sizing: border-box; border-bottom: 1px solid #e7e8e9; }
#content-creators li::before { content: counters(index, ".", decimal-leading-zero); font-size: 5.5em; line-height: 1.5em; text-align: right; font-weight: bold; min-width: 200px; padding-right: 30px; font-variant-numeric: tabular-nums; align-self: flex-start; background-image: linear-gradient(to bottom, #a7a8a9, #f7f8f9); background-attachment: fixed; -webkit-background-clip: text; -webkit-text-fill-color: transparent; color: #ccc; }
#content-creators li a { font-size: 2em; line-height: 1.2em; font-weight: bold; color: #333; } #content-creators li a:hover { color: var(--primary-color); }
#content-creators li span { font-size: 0.9rem; line-height: 1.4em; display: block; color: #888; margin-top: 5px; }

/* ==========================================================================
   8. SINGLE POST & DOWNLOAD
   ========================================================================== */
.single-post-view .entry-header, .single-page-view .entry-header { margin-bottom: 30px; text-align: center; }
.single-post-view .entry-title { font-size: 2.5rem; margin-bottom: 15px; color: #222; }
.entry-content { font-size: 1.125rem; line-height: 1.8; color: #2c2c2c; }
.entry-content p { margin-bottom: 1.5em; }
.entry-content blockquote { border-left: 4px solid var(--primary-color); margin: 2em 0; padding: 1em 2em; background: #fff; font-style: italic; color: #555; }
.entry-footer { margin-top: 50px; padding-top: 20px; border-top: 1px solid var(--border-color); color: var(--text-light); }

.single-capsule-container { text-align: center; margin: 20px 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.single-capsule-container.top { margin-bottom: 30px; }
.single-capsule-container.bottom { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.capsule-link { display: inline-block; background: var(--primary-color); color: #fff; padding: 6px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 500; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.capsule-link:hover { background: var(--primary-hover); color: #fff; transform: translateY(-2px); }
.capsule-link.tag-style { background: #f0f0f0; color: #555; } .capsule-link.tag-style:hover { background: var(--primary-color); color: #fff; }

#download { background: #1a1a1a; color: #fff; border-radius: 16px; padding: 60px 20px; margin: 50px auto; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: 2px solid #333; transition: all 0.3s; max-width: 900px; }
#download:hover { transform: translateY(-5px); box-shadow: 0 20px 50px rgba(196, 49, 76, 0.15); border-color: var(--primary-color); }
#download a { display: inline-flex; align-items: center; justify-content: center; gap: 15px; font-family: sans-serif; font-weight: 900; font-size: clamp(2rem, 6vw, 4.5rem); color: var(--primary-color); text-decoration: none; line-height: 1.1; transition: all 0.3s; text-shadow: 2px 2px 0px rgba(0,0,0,0.5); max-width: 100%; }
#download:hover a { color: #caf200; letter-spacing: 2px; text-shadow: 4px 4px 0px rgba(0,0,0,0.8); transform: scale(1.05); }
#download a img { margin: 0 !important; max-height: 1em; width: auto; vertical-align: middle; transition: transform 0.3s; display: block; }
#download:hover a img { transform: rotate(-10deg) scale(1.1); }
.downloaddesc { display: block; margin-top: 25px; color: #aaa; font-size: 1.1rem; max-width: 80%; margin-left: auto; margin-right: auto; }

/* Social Share */
.f0nt-share-zone { text-align: center; margin-top: 40px; padding: 20px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; background: #fdfdfd; border-radius: 8px; }
.share-label { display: block; font-size: 0.9rem; color: #888; margin-bottom: 15px; font-weight: bold; }
.share-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 1.2rem; transition: transform 0.2s, opacity 0.2s; text-decoration: none; }
.share-btn:hover { transform: translateY(-3px); opacity: 0.9; color: #fff; }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.line { background: #00c300; }
.share-btn.ig { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }

/* ==========================================================================
   9. WIDGETS & SIDEBAR
   ========================================================================== */
.widget { background: #fff; padding: 25px; margin-bottom: 30px; border-radius: 8px; border: 1px solid var(--border-color); }
.widget-title { font-size: 1.2rem; color: var(--primary-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; text-transform: uppercase; }
.sidebar-menu-list li { padding: 10px 0; border-bottom: 1px dotted #eee; }
.sidebar-menu-list li a { color: var(--text-color); font-weight: 500; display: block; }
.sidebar-menu-list li a:hover { color: var(--primary-color); padding-left: 5px; }

.widget.author-info-widget { background: #1a1a1a; color: #ddd; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); text-align: center; }
.widget-title-small { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #666; margin-bottom: 10px; border: none; padding: 0; }
.author-highlight { margin: 15px 0 25px; }
.author-highlight a { font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1.2; text-decoration: none; }
.author-highlight a:hover { color: var(--primary-color); }
.author-fonts-list { padding: 0; margin: 0; list-style: none; }
.author-fonts-list li { padding: 15px 0; border-bottom: 1px solid #333; display: flex; flex-direction: column; gap: 10px; }
.author-fonts-list li:last-child { border-bottom: none; }
.other-font-thumb { display: block; overflow: hidden; border-radius: 6px; }
.other-font-thumb img { width: 100%; height: auto; transition: transform 0.3s; opacity: 0.8; }
.other-font-thumb:hover img { transform: scale(1.05); opacity: 1; }
.other-font-title { color: #aaa; font-size: 1rem; font-weight: 500; transition: color 0.2s; }
.other-font-title:hover { color: #fff; }
.view-all-author { display: inline-block; margin-top: 20px; font-size: 0.85rem; color: var(--primary-color); font-weight: bold; padding: 5px 15px; border: 1px solid var(--primary-color); border-radius: 20px; }
.view-all-author:hover { background: var(--primary-color); color: #fff; }
.f0nt-ad-container { max-width: 100%; overflow: hidden; }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer { background: #222; color: #888; padding: 40px 0; margin-top: 60px; text-align: center; }
.footer-menu-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }
.footer-menu-list li a { color: #aaa; font-size: 1rem; text-decoration: none; transition: color 0.2s; }
.footer-menu-list li a:hover { color: #fff; text-decoration: underline; }

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .header-inner { flex-direction: column; text-align: center; 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 { order: 1; max-width: 100%; margin-bottom: 10px; margin-left: 0; }
    .f0nt-search-container { height: 50px; }
    .f0nt-search-input { font-size: 1.1rem; text-align: center; padding: 0; }
    .f0nt-search-input:focus { text-align: left; padding-left: 15px; }
    .menu-toggle { display: block; order: 2; width: 100%; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 12px; border-radius: 4px; cursor: pointer; font-size: 1rem; }
    .main-navigation { order: 3; display: none; width: 100%; margin-bottom: 0; }
    .main-navigation.toggled { display: block; }
    .nav-menu { flex-direction: column; height: auto; margin-top: 10px; }
    .nav-menu li { width: 100%; }
    .nav-menu li a { width: 100%; padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); justify-content: center; }
    
    .site-grid { display: block; }
    .featured-headline { flex-direction: column; gap: 0; padding: 0; }
    .headline-image { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 1/1; max-width: 100%; }
    .headline-content { padding: 30px 20px; }
    .headline-title { font-size: 2rem; }
    .headline-ribbon { top: 15px; right: -35px; padding: 5px 40px; font-size: 0.75rem; }
    
    .post-list { column-count: 1; }
    .widget { margin-top: 40px; }
    #content-creators li { flex-direction: column; text-align: center; }
    #content-creators li::before { margin-right: 0; margin-bottom: 10px; font-size: 3em; min-width: auto; padding-right: 0; }
    #download a { flex-direction: column; gap: 10px; }
    .footer-menu-list { flex-direction: column; gap: 10px; }
    
    .author-header-zone, .search-header-zone { padding: 40px 0; }
    .author-page-title, .search-page-title { font-size: 2.5rem; }
}