/*
  SiamCafe Blog — skin CSS
  Adapted from Mediumish (MIT, WowThemes.net) + stripped of third-party
  (Disqus / GA / AdSense / Lunr / Gravatar). Light + green #00ab6b, Thai-first
  typography (Sarabun). Phase 1 central skin.
*/

:root {
  --accent: #00ab6b;
  --accent-dark: #038252;
  --ink: rgba(0, 0, 0, .84);
  --ink-soft: rgba(0, 0, 0, .54);
  --line: rgba(0, 0, 0, .09);
  --bg: #fff;
}

* { box-sizing: border-box; }

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); transition: all .2s; }
a:hover { color: var(--accent-dark); text-decoration: none; }

img { max-width: 100%; }

/* ---------- Navbar ---------- */
.mediumnavigation {
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 2px 2px -2px rgba(0, 0, 0, .15);
  padding: .6rem 0;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #fff; font-family: 'Righteous', sans-serif;
  font-size: 1.3rem; margin-right: 8px;
}
.brand-text { font-weight: 700; color: var(--ink); }
.mediumnavigation .nav-link { color: var(--ink-soft); font-weight: 600; padding: .4rem .9rem; }
.mediumnavigation .nav-item.active .nav-link,
.mediumnavigation .nav-link:hover { color: var(--accent); }
.mediumnavigation .form-control {
  font-size: .85rem; border-radius: 30px; border: 1px solid var(--line); min-width: 170px;
}
.mediumnavigation .search-icon {
  margin-left: -42px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.mediumnavigation .search-icon:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.site-content { min-height: 70vh; padding-top: 1.5rem; margin-top: 64px; }
.mainheading { padding: 1rem 0; }
.sitetitle { font-family: 'Righteous', 'Sarabun', sans-serif; font-size: 2rem; }
.lead { color: var(--ink-soft); }

.section-title h2 {
  border-bottom: 1px solid rgba(0, 0, 0, .125);
  margin-bottom: 26px; font-weight: 700; font-size: 1.4rem;
}
.section-title span {
  border-bottom: 2px solid var(--accent);
  display: inline-block; padding-bottom: 18px; margin-bottom: -1px;
}

/* ---------- Category pills ---------- */
.cat-pill {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
  background: rgba(0, 171, 107, .12); color: var(--accent-dark);
}
.cat-forex { background: rgba(0, 171, 107, .12); color: var(--accent-dark); }
.cat-ai    { background: rgba(99, 102, 241, .12); color: #4f46e5; }
.cat-it    { background: rgba(14, 165, 233, .12); color: #0369a1; }
.cat-trade { background: rgba(234, 88, 12, .12); color: #c2410c; }

/* ---------- Featured card ---------- */
.featured-card {
  border: 1px solid var(--line); border-radius: .5rem; overflow: hidden;
  margin-bottom: 40px; box-shadow: 0 1px 8px rgba(0, 0, 0, .05);
}
.featured-card .featured-thumb-link {
  position: relative; display: block; height: 340px; overflow: hidden; background: #f2f2f2;
}
.featured-box-img-cover { object-fit: cover; width: 100%; height: 100%; display: block; }
.featured-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .12));
}
.featured-card .card-title { font-size: 1.6rem; font-weight: 700; line-height: 1.25; }
.featured-card .card-text { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }

/* ---------- Postbox row ---------- */
.postbox-row {
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; padding-bottom: 8px;
}
.postbox-row .postbox-thumb-link {
  display: block; height: 110px; border-radius: .35rem; overflow: hidden; background: #f2f2f2;
}
.postbox-row .card-body { padding: 0 0 0 18px; }
.postbox-row .card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: .4rem; }
.postbox-row .card-text { color: var(--ink-soft); font-size: .92rem; line-height: 1.55; }
.thumb-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-weight: 700; color: var(--ink-soft); background: #ededed; font-size: .8rem;
}
.wrapfooter { font-size: .8rem; display: flex; align-items: center; margin-top: 8px; }
.post-name { font-weight: 600; color: var(--ink); margin-right: 8px; }
.post-date { color: var(--ink-soft); }
.mb-30px { margin-bottom: 26px; }
.empty-feed { color: var(--ink-soft); padding: 2rem 0; }

/* ---------- Single post ---------- */
.post-breadcrumb { font-size: .85rem; color: var(--ink-soft); margin: 1rem 0; }
.post-breadcrumb a { color: var(--ink-soft); }
.post-breadcrumb a:hover { color: var(--accent); }
.post-breadcrumb .sep { margin: 0 6px; }
.posttitle { font-weight: 700; margin-bottom: 1rem; font-size: 2.1rem; line-height: 1.2; }
.post-top-meta { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.5rem; }
.post-top-meta .dot:after { content: "·"; margin: 0 6px; }
.featured-image { display: block; margin-bottom: 1.5rem; border-radius: .5rem; }

.article-post { font-size: 1.12rem; line-height: 1.86; color: var(--ink); }
.article-post p { margin: 0 0 1.5rem; }
.article-post h2, .article-post h3, .article-post h4 { font-weight: 700; margin: 2rem 0 1rem; }
.article-post img { border-radius: .4rem; }
.article-post figure.incontent { margin: 1.5rem 0; }
.article-post figure.incontent figcaption { font-size: .85rem; color: var(--ink-soft); text-align: center; margin-top: .5rem; }
.article-post blockquote {
  border-left: 4px solid var(--accent); padding: 0 20px; font-style: italic; color: var(--ink-soft);
}

ul.tags { list-style: none; padding: 0; margin: 2rem 0; }
ul.tags li { display: inline-block; font-size: .9rem; margin: 0 6px 6px 0; }
ul.tags li a { background: rgba(0, 0, 0, .05); color: var(--ink-soft); border-radius: 3px; padding: 5px 10px; }
ul.tags li a:hover { background: rgba(0, 171, 107, .1); color: var(--accent-dark); }

/* ---------- Internal-link block (network) ---------- */
.internal-links {
  margin: 2.5rem 0; padding: 1.5rem; border: 1px solid var(--line);
  border-radius: .6rem; background: #fafafa;
}
.il-heading { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.il-card {
  display: flex; flex-direction: column; padding: 1rem; height: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: .5rem; transition: all .2s;
}
.il-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.il-name { font-weight: 700; color: var(--accent-dark); margin-bottom: 4px; }
.il-desc { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Author box ---------- */
.author-box {
  display: flex; align-items: center; gap: 16px; margin: 2.5rem 0;
  padding: 1.5rem; border-radius: .6rem; background: rgba(0, 171, 107, .05);
}
.author-avatar {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 1.8rem; font-weight: 700; font-family: 'Righteous', sans-serif;
}
.author-name { font-weight: 700; font-size: 1.1rem; }
.author-bio { font-size: .9rem; color: var(--ink-soft); margin: 4px 0 0; }

/* ---------- Post nav ---------- */
.post-nav { margin: 2rem 0 3rem; font-weight: 600; }
.pn-prev, .pn-next { color: var(--ink); font-size: .95rem; }
.pn-prev:hover, .pn-next:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(0, 0, 0, .07); padding: 2.5rem 0 2rem;
  font-size: .88rem; color: var(--ink-soft); margin-top: 50px; background: #fff;
}
.footer-brand { font-weight: 700; color: var(--ink); font-size: 1.1rem; margin-bottom: .5rem; }
.footer-heading { font-weight: 700; color: var(--ink); font-size: .95rem; margin-bottom: .8rem; }
.footer-network, .footer-cats { list-style: none; padding: 0; }
.footer-network li, .footer-cats li { margin-bottom: 6px; }
.net-desc { color: var(--ink-soft); font-size: .82rem; }
.risk-warning {
  margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: .5rem;
  background: #fff8e6; border: 1px solid #ffe39e; color: #8a6d1a; font-size: .82rem; line-height: 1.6;
}
.footer-copy { margin-top: 1.2rem; text-align: center; color: var(--ink-soft); font-size: .82rem; }

/* ---------- Buttons ---------- */
.btn.subscribe {
  background: var(--accent); border-color: var(--accent); color: #fff;
  border-radius: 30px; font-weight: 600; padding: 8px 22px;
}
.btn.subscribe:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.xm-aff-cta {
  margin: 1.5rem 0; padding: 1rem 1.2rem; border-radius: .5rem;
  background: rgba(0, 171, 107, .06); border: 1px dashed var(--accent);
  font-size: .95rem;
}
.xm-aff-cta a { font-weight: 700; color: var(--accent-dark); }

/* ---------- AEO TL;DR box ---------- */
.aeo-tldr {
  margin: 0 0 2rem; padding: 1.2rem 1.4rem; border-radius: .6rem;
  background: linear-gradient(180deg, rgba(0,171,107,.10), rgba(0,171,107,.04));
  border: 1px solid rgba(0,171,107,.30); border-left: 5px solid var(--accent);
}
.aeo-tldr .aeo-kicker {
  font-family: 'Righteous','Sarabun',sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: .8rem;
  color: var(--accent-dark); margin: 0 0 .4rem;
}
.aeo-tldr .aeo-text { font-size: 1.05rem; line-height: 1.7; color: var(--ink); margin: 0; }

/* ---------- Inline contextual refs (internal + money) ---------- */
.article-post .inline-ref {
  margin: 1rem 0 1.5rem; padding: .6rem .9rem; border-radius: .4rem;
  background: rgba(0,0,0,.025); border-left: 3px solid var(--line);
  font-size: .98rem; color: var(--ink-soft);
}
.article-post .inline-ref a { font-weight: 600; }
.article-post .money-ref { border-left-color: var(--accent); background: rgba(0,171,107,.05); }

/* ---------- Related posts ---------- */
.related-posts { margin: 2.5rem 0; }
.rel-heading { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 4px; }
.rel-card { display: flex; gap: 12px; align-items: center; padding: .6rem;
  border: 1px solid var(--line); border-radius: .5rem; height: 100%; transition: all .2s; }
.rel-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.rel-thumb { flex: 0 0 auto; width: 84px; height: 60px; border-radius: .35rem;
  overflow: hidden; background: #f2f2f2; }
.rel-thumb img { object-fit: cover; width: 100%; height: 100%; }
.rel-title { display: block; font-weight: 600; color: var(--ink); font-size: .95rem;
  line-height: 1.35; margin-top: 4px; }

/* ---------- Author title (E-E-A-T) ---------- */
.author-title { font-size: .85rem; font-weight: 600; color: var(--accent-dark); margin: 2px 0; }
.author-name a { color: var(--ink); }
.author-name a:hover { color: var(--accent); }
.bc-current { color: var(--ink-soft); }

/* ---------- Pagination ---------- */
.pagination-nav { display: flex; align-items: center; justify-content: center;
  gap: 18px; margin: 2.5rem 0 1rem; font-weight: 600; }
.pagination-nav a { padding: 8px 18px; border-radius: 30px; border: 1px solid var(--line);
  color: var(--ink); }
.pagination-nav a:hover { border-color: var(--accent); color: var(--accent); }
.pagination-nav .page-status { color: var(--ink-soft); font-size: .9rem; }

@media (max-width: 767px) {
  .featured-card .featured-thumb-link { height: 220px; }
  .featured-card .card-title { font-size: 1.3rem; }
  .posttitle { font-size: 1.6rem; }
  .postbox-row .postbox-thumb-link { height: 88px; }
  .postbox-row .card-body { padding-left: 12px; }
  .author-box { flex-direction: column; text-align: center; }
  .article-post { font-size: 1.05rem; }
}
