/*
Theme Name: Thinker Friend
Theme URI: https://thinkerfriend.com/
Description: ธีมลูกของ Twenty Twenty-Five สำหรับ thinkerfriend.com — community ของคนชอบ Tech และ AI
Author: Thinker Friend
Template: twentytwentyfive
Version: 1.5.0
Requires PHP: 7.4
Text Domain: thinkerfriend
*/

:root {
	--tf-navy: #0E2A47;
	--tf-ink: #1B2733;
	--tf-body: #46525F;
	--tf-muted: #5A6878;
	--tf-line: #E3E8EF;
	--tf-bg: #F6F8FB;
	--tf-blue: #1668B0;
	--tf-sky: #E7F2FC;
	--tf-sky-ink: #0F5A99;
	--tf-yellow: #F6C343;
	--tf-head: 'Prompt', system-ui, sans-serif;
	--tf-text: 'IBM Plex Sans Thai', system-ui, sans-serif;
}

body {
	margin: 0;
	background: var(--tf-bg);
	color: var(--tf-ink);
	font-family: var(--tf-text);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
}
.tf-site a { color: var(--tf-navy); text-decoration: none; }
.tf-site a:hover { color: var(--tf-blue); }
.tf-site a:focus-visible, .tf-site button:focus-visible, .tf-site input:focus-visible, .tf-site summary:focus-visible { outline: 3px solid var(--tf-yellow); outline-offset: 2px; }
.tf-site img { max-width: 100%; height: auto; }
.tf-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.tf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tf-h { font-family: var(--tf-head); color: var(--tf-navy); }

/* Header */
.tf-header { background: #fff; border-bottom: 1px solid var(--tf-line); }
.tf-header__in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 14px; padding-bottom: 14px; }
.tf-brand { display: flex; align-items: center; gap: 12px; }
.tf-brand img { width: 48px; height: 48px; }
.tf-brand__name { display: block; font-family: var(--tf-head); font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--tf-navy); }
.tf-brand__tag { display: block; font-size: 13px; line-height: 1.2; color: var(--tf-muted); }
.tf-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-weight: 500; font-size: 16px; flex: 1 1 420px; }
.tf-nav a[aria-current="page"] { color: var(--tf-blue); }
.tf-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 22px; background: var(--tf-navy); color: #fff !important; font-weight: 600; font-size: 15px; box-sizing: border-box; }
.tf-btn:hover { background: #163a60; }
.tf-mnav { display: none; margin-left: auto; }
.tf-mnav summary { list-style: none; width: 44px; height: 44px; border-radius: 22px; background: var(--tf-navy); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tf-mnav summary::-webkit-details-marker { display: none; }
.tf-mnav nav { position: absolute; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--tf-line); padding: 8px 24px 16px; display: flex; flex-direction: column; z-index: 50; }
.tf-mnav nav a { padding: 12px 0; border-bottom: 1px solid var(--tf-line); font-weight: 500; }
@media (max-width: 899px) {
	.tf-header__in { position: relative; }
	.tf-nav, .tf-header .tf-btn { display: none; }
	.tf-mnav { display: block; }
	.tf-brand__tag { display: none; }
}

/* Welcome strip */
.tf-strip { background: var(--tf-navy); color: #fff; }
.tf-strip__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-top: 18px; padding-bottom: 18px; }
.tf-strip h1 { margin: 0; font-family: var(--tf-head); font-weight: 600; font-size: 22px; line-height: 1.4; color: #fff; }
.tf-strip h1 em { font-style: normal; color: var(--tf-yellow); }
.tf-strip p { margin: 0; font-size: 15px; color: #C9D4E0; }

/* Layout */
.tf-page { padding-top: 40px; }
.tf-cols { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.tf-main { flex: 2 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 48px; }
.tf-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.tf-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tf-sec-head h2 { margin: 0; font-family: var(--tf-head); font-size: 24px; color: var(--tf-navy); }
.tf-more { color: var(--tf-blue) !important; font-weight: 600; font-size: 15px; }

/* Chips */
.tf-chip { display: inline-block; align-self: flex-start; background: var(--tf-sky); color: var(--tf-sky-ink) !important; font-size: 13px; font-weight: 600; line-height: 1.4; padding: 4px 12px; border-radius: 999px; }
.tf-chip--parliament-tpchannel { background: #FDF3D6; color: #6B4E00 !important; }
.tf-chip--law { background: #EAF2EC; color: #24623A !important; }
.tf-chip--creator-business { background: #F3EAF7; color: #5E2E78 !important; }

/* Featured */
.tf-feat { background: #fff; border: 1px solid var(--tf-line); border-radius: 20px; overflow: hidden; }
.tf-feat__img { display: block; aspect-ratio: 16 / 9; background: var(--tf-sky); }
.tf-feat__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-feat__body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 10px; }
.tf-feat__title { margin: 0; font-family: var(--tf-head); font-weight: 700; font-size: 30px; line-height: 1.35; }
.tf-feat__ex { margin: 0; color: var(--tf-body); }
.tf-meta { margin: 0; font-size: 14px; color: var(--tf-muted); }

/* Rows (latest) */
.tf-rows h2 { margin: 0 0 4px; font-family: var(--tf-head); font-size: 22px; color: var(--tf-navy); }
.tf-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--tf-line); }
.tf-row:last-child { border-bottom: 0; }
.tf-row__img { width: 112px; height: 63px; flex: none; border-radius: 10px; overflow: hidden; background: var(--tf-sky); }
.tf-row__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-row__t { display: block; font-weight: 600; font-size: 16px; line-height: 1.45; color: var(--tf-ink); }
.tf-row__d { display: block; font-size: 13px; color: var(--tf-muted); margin-top: 4px; }

/* Card grid */
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.tf-card { background: #fff; border: 1px solid var(--tf-line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tf-card__img { display: block; aspect-ratio: 16 / 9; background: var(--tf-sky); }
.tf-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.tf-card__t { margin: 0; font-family: var(--tf-head); font-weight: 600; font-size: 19px; line-height: 1.45; }
.tf-card__d { font-size: 13px; color: var(--tf-muted); }

/* Sidebar boxes */
.tf-box { background: #fff; border: 1px solid var(--tf-line); border-radius: 20px; padding: 24px; }
.tf-box h2 { margin: 0 0 6px; font-family: var(--tf-head); font-size: 20px; color: var(--tf-navy); }
.tf-robot__hi { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tf-robot__hi img { width: 88px; height: 88px; flex: none; }
.tf-bubble { background: var(--tf-sky); color: var(--tf-navy); padding: 12px 16px; border-radius: 18px 18px 18px 4px; font-weight: 600; }
.tf-search { display: flex; flex-wrap: wrap; gap: 10px; }
.tf-search input[type="search"] { flex: 1 1 200px; min-height: 50px; border-radius: 999px; border: 2px solid #D5E3F0; padding: 0 20px; font-size: 16px; font-family: inherit; background: #fff; box-sizing: border-box; }
.tf-search button { min-height: 50px; padding: 0 24px; border-radius: 999px; border: 0; background: var(--tf-navy); color: #fff; font-weight: 600; font-size: 16px; font-family: inherit; cursor: pointer; }
.tf-rank { margin: 0; padding: 0; list-style: none; }
.tf-rank li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--tf-line); }
.tf-rank li:last-child { border-bottom: 0; }
.tf-rank__n { font-family: var(--tf-head); font-weight: 700; font-size: 30px; line-height: 1; color: var(--tf-blue); min-width: 26px; }
.tf-rank a { font-weight: 600; line-height: 1.45; color: var(--tf-ink); }
.tf-rank small { display: block; font-size: 13px; color: var(--tf-muted); }
.tf-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-cats a { padding: 8px 14px; border-radius: 999px; font-size: 15px; background: var(--tf-sky); }
.tf-cats a.tf-chip--parliament-tpchannel { background: #FDF3D6; }
.tf-cats a.tf-chip--law { background: #EAF2EC; }
.tf-cats a.tf-chip--creator-business { background: #F3EAF7; }

/* Newsletter */
.tf-nl { background: var(--tf-navy); color: #fff; border-radius: 24px; padding: 36px; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; margin-top: 56px; }
.tf-nl > img { width: 104px; height: 104px; }
.tf-nl__txt { flex: 1 1 320px; }
.tf-nl h2 { margin: 0 0 6px; font-family: var(--tf-head); font-weight: 700; font-size: 26px; line-height: 1.35; color: #fff; }
.tf-nl h2 em { font-style: normal; color: var(--tf-yellow); }
.tf-nl p { margin: 0; color: #C9D4E0; }
.tf-nl form { flex: 1 1 360px; display: flex; flex-wrap: wrap; gap: 10px; }
.tf-nl label { width: 100%; font-size: 14px; color: #C9D4E0; }
.tf-nl input[type="email"] { flex: 1 1 200px; min-height: 48px; border-radius: 12px; border: 0; padding: 0 16px; font-size: 16px; font-family: inherit; box-sizing: border-box; }
.tf-nl button { min-height: 48px; padding: 0 24px; border-radius: 12px; border: 0; background: var(--tf-yellow); color: var(--tf-navy); font-weight: 700; font-size: 16px; font-family: inherit; cursor: pointer; }
.tf-nl--small { margin-top: 36px; padding: 28px; }
.tf-nl--small h2 { font-size: 22px; }

/* Footer */
.tf-footer { margin-top: 64px; background: #fff; border-top: 1px solid var(--tf-line); }
.tf-footer__in { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 28px; font-size: 15px; color: var(--tf-muted); }
.tf-footer__brand { display: flex; align-items: center; gap: 10px; }
.tf-footer__brand img { width: 32px; height: 32px; }
.tf-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.tf-footer nav a { color: var(--tf-body); }

/* Article */
.tf-article { max-width: 760px; margin: 0 auto; padding: 36px 24px 0; box-sizing: border-box; }
.tf-crumb { font-size: 14px; color: var(--tf-muted); }
.tf-crumb a { color: var(--tf-body) !important; }
.tf-article__title { margin: 16px 0 0; font-family: var(--tf-head); font-weight: 700; font-size: 40px; line-height: 1.35; color: var(--tf-navy); }
.tf-byline { margin-top: 18px; display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--tf-muted); line-height: 1.4; }
.tf-byline img { width: 40px; height: 40px; }
.tf-byline strong { color: var(--tf-ink); font-weight: 600; }
.tf-hero { max-width: 1000px; margin: 32px auto 0; padding: 0 24px; box-sizing: border-box; }
.tf-hero img { width: 100%; height: auto; border-radius: 18px; display: block; }
.tf-prose { max-width: 680px; margin: 0 auto; padding: 36px 24px 0; box-sizing: border-box; font-size: 18px; line-height: 1.85; }
.tf-prose > * { max-width: 100%; }
.tf-prose p { margin: 0 0 1.1em; }
.tf-prose a { color: var(--tf-blue) !important; text-decoration: underline; text-underline-offset: 3px; }
.tf-prose blockquote { margin: 0 0 1.4em; padding: 22px 26px; background: #fff; border-radius: 16px; border: 1px solid var(--tf-line); font-family: var(--tf-head); font-size: 21px; line-height: 1.6; color: var(--tf-navy); }
.tf-prose img { border-radius: 12px; height: auto; }
.tf-prose figure { margin: 0 0 1.4em; }
.tf-prose figcaption { font-size: 14px; color: var(--tf-muted); }
.tf-prose iframe { max-width: 100%; }
.tf-share { margin: 32px auto 0; max-width: 680px; padding: 20px 24px 0; box-sizing: border-box; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 15px; }
.tf-share > span { color: var(--tf-muted); }
.tf-share a { border: 1px solid var(--tf-line); background: #fff; padding: 10px 16px; border-radius: 999px; }
.tf-after { max-width: 680px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.tf-related { margin-top: 56px; }
.tf-comments { max-width: 680px; margin: 40px auto 0; padding: 0 24px; box-sizing: border-box; }

/* Archive */
.tf-arch-head { padding: 40px 0 24px; }
.tf-arch-head h1 { margin: 0; font-family: var(--tf-head); font-size: 34px; color: var(--tf-navy); }
.tf-arch-head p { margin: 6px 0 0; color: var(--tf-muted); }
.tf-pager { margin-top: 40px; }
.tf-pager .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tf-pager .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 12px; background: #fff; border: 1px solid var(--tf-line); box-sizing: border-box; }
.tf-pager .page-numbers.current { background: var(--tf-navy); color: #fff; border-color: var(--tf-navy); }
.tf-empty { background: #fff; border: 1px solid var(--tf-line); border-radius: 16px; padding: 32px; }

@media (max-width: 640px) {
	body { font-size: 16px; }
	.tf-feat__title { font-size: 24px; }
	.tf-feat__body { padding: 18px 18px 22px; }
	.tf-article__title { font-size: 28px; }
	.tf-prose { font-size: 17px; }
	.tf-nl { padding: 26px 22px; }
	.tf-nl > img { width: 72px; height: 72px; }
	.tf-strip h1 { font-size: 19px; }
	.tf-page { padding-top: 24px; }
}

/* ---------- Read stats ---------- */
.tf-views { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--tf-muted); font-size: 13px; }
.tf-views svg { flex: none; }
.tf-rank small .tf-views { margin-left: 8px; }
.tf-byline .tf-dot { margin: 0 8px; color: #B6C0CB; }
.tf-meta-i { display: inline-flex; align-items: center; gap: 5px; }
.tf-stats { margin-top: 40px; background: #fff; border: 1px solid var(--tf-line); border-radius: 20px; padding: 24px 24px 22px; }
.tf-stats__h { margin: 0 0 16px; font-family: var(--tf-head); font-weight: 600; font-size: 20px; color: var(--tf-navy); }
.tf-stats__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 12px; }
.tf-stat { background: var(--tf-bg); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.tf-stat__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--tf-sky); color: var(--tf-sky-ink); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tf-stat__n { font-family: var(--tf-head); font-weight: 700; font-size: 26px; line-height: 1.2; color: var(--tf-navy); }
.tf-stat__l { font-size: 14px; color: var(--tf-muted); line-height: 1.4; }
.tf-stat--rank { background: #FFF6DC; }
.tf-stat--rank .tf-stat__ic { background: var(--tf-yellow); color: var(--tf-navy); }
.tf-spark { margin: 18px 0 0; }
.tf-spark__bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.tf-spark__bar { flex: 1; background: var(--tf-blue); border-radius: 4px 4px 2px 2px; opacity: .85; }
.tf-spark__bar:last-child { background: var(--tf-yellow); opacity: 1; }
.tf-spark figcaption { margin-top: 8px; font-size: 13px; color: var(--tf-muted); }

/* ---------- Top bar: Facebook page ---------- */
.tf-topbar { background: #EEF2F7; border-bottom: 1px solid var(--tf-line); }
.tf-topbar__in { display: flex; justify-content: flex-end; align-items: center; min-height: 40px; }
.tf-fb { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; color: var(--tf-navy) !important; padding: 6px 0; }
.tf-fb:hover .tf-fb__txt strong { text-decoration: underline; }
.tf-fb__logo { flex: none; }
.tf-fb__txt strong { font-weight: 600; }
.tf-fb__count { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #1877F2; color: #fff; font-weight: 600; font-size: 13px; }
@media (max-width: 640px) {
	.tf-topbar__in { justify-content: center; }
	.tf-fb { font-size: 13px; }
	.tf-fb__lead { display: none; }
}
.tf-stats__src { margin: 14px 0 0; font-size: 12px; color: var(--tf-muted); }
/* ---------- Article body: one standard for every post (1.5.0) ----------
 * Older posts carry editor sizes (has-x-large-font-size …) and headings at
 * every level; these rules give them all the same type scale and spacing. */
.tf-prose { font-weight: 400; color: var(--tf-ink); }
.tf-prose strong, .tf-prose b { font-weight: 600; }
.tf-prose h1, .tf-prose h2, .tf-prose h3, .tf-prose h4, .tf-prose h5, .tf-prose h6 { font-family: var(--tf-head); font-weight: 600; color: var(--tf-navy); line-height: 1.45; margin: 1.7em 0 0.55em; letter-spacing: 0; }
.tf-prose h1, .tf-prose h2 { font-size: 26px !important; }
.tf-prose h3 { font-size: 22px !important; }
.tf-prose h4 { font-size: 19px !important; }
.tf-prose h5, .tf-prose h6 { font-size: 18px !important; }
.tf-prose h1 strong, .tf-prose h2 strong, .tf-prose h3 strong, .tf-prose h4 strong, .tf-prose h5 strong { font-weight: inherit; }
.tf-prose > :first-child { margin-top: 0; }
/* Paragraphs the editor made "large": keep them a little bigger as a lead line, not poster-size. */
.tf-prose p.has-large-font-size, .tf-prose p.has-x-large-font-size, .tf-prose p.has-xx-large-font-size,
.tf-prose li.has-large-font-size { font-size: 20px !important; line-height: 1.75 !important; font-weight: 500; color: var(--tf-navy); margin-bottom: 1.1em; }
.tf-prose p:empty { display: none; }
.tf-prose ul, .tf-prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.tf-prose li { margin: 0 0 0.4em; }
.tf-prose li > ul, .tf-prose li > ol { margin: 0.4em 0 0; }
.tf-prose hr, .tf-prose .wp-block-separator { border: 0; border-top: 1px solid var(--tf-line); width: 100%; max-width: 100%; margin: 2.2em 0; opacity: 1; }
.tf-prose .wp-block-table { margin: 0 0 1.6em; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tf-prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.6; background: #fff; }
.tf-prose th, .tf-prose td { border: 1px solid var(--tf-line); padding: 10px 14px; vertical-align: top; }
.tf-prose thead th, .tf-prose thead td { background: var(--tf-sky); color: var(--tf-navy); font-weight: 600; border-bottom: 2px solid #C9DDF0; }
.tf-prose .wp-block-table figcaption { margin-top: 8px; }
.tf-prose .wp-block-embed { margin: 0 0 1.6em; }
.tf-prose .wp-block-embed__wrapper { position: relative; }
.tf-prose .wp-block-embed.is-type-video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; }
.tf-prose pre { background: #fff; border: 1px solid var(--tf-line); border-radius: 12px; padding: 16px 18px; font-family: var(--tf-text); font-size: 16px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.tf-prose .wp-block-gallery { margin: 0 0 1.6em; }
@media (max-width: 640px) {
	.tf-prose h1, .tf-prose h2 { font-size: 22px !important; }
	.tf-prose h3 { font-size: 20px !important; }
	.tf-prose h4 { font-size: 18px !important; }
	.tf-prose h5, .tf-prose h6 { font-size: 17px !important; }
	.tf-prose p.has-large-font-size, .tf-prose p.has-x-large-font-size, .tf-prose p.has-xx-large-font-size, .tf-prose li.has-large-font-size { font-size: 18px !important; }
	.tf-prose table { font-size: 15px; }
	.tf-prose th, .tf-prose td { padding: 8px 10px; }
}