/* ============================================================
   JunoMarkets Ghost Theme — screen.css
   Brand: #F97316 orange, #111111 black, Inter font
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --orange: #F97316;
  --orange-light: #FEF3E8;
  --orange-mid: #FDBA74;
  --black: #111111;
  --gray: #6B7280;
  --gray-light: #F3F2F0;
  --white: #FFFFFF;
  --offwhite: #FAF9F7;
  --green: #16A34A;
  --red: #DC2626;
  --border: #E5E7EB;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.13);
  --radius: 12px;
  --max-w: 1160px;
  --content-w: 720px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--black);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin-bottom: 1.4em; }
h1,h2,h3,h4,h5,h6 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }

/* ── Layout Helpers ───────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.content-container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-logo img {
  height: 32px;
  width: auto;
}

.site-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.03em;
}

.site-logo-text span {
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.current {
  color: var(--black);
}

.nav-cta {
  padding: 9px 20px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.nav-cta:hover {
  background: #EA6C0B;
  transform: translateY(-1px);
}

/* Mobile nav */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  background: var(--white);
  padding: 16px 24px 24px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* ── Hero (Homepage) ──────────────────────────────────────── */
.home-hero {
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 56px;
  text-align: center;
}

.home-hero .pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #FFF0E6;
  color: var(--orange);
  margin-bottom: 20px;
}

.home-hero h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--black);
}

.home-hero h1 .accent { color: var(--orange); }

.home-hero p {
  font-size: 17px;
  color: var(--gray);
  max-width: 520px;
  margin: 0 auto 0;
  line-height: 1.7;
}

/* ── Post Grid ────────────────────────────────────────────── */
.post-feed {
  padding: 56px 0 80px;
}

.post-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.post-feed-header h2 {
  font-size: 22px;
  font-weight: 800;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── Post Card ────────────────────────────────────────────── */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-light);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}

.post-card:hover .post-card-image img {
  transform: scale(1.04);
}

.post-card-no-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--orange-light) 0%, var(--offwhite) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-no-image .card-icon {
  width: 48px;
  height: 48px;
  background: var(--orange);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.post-card-content {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.post-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--orange-light);
  color: var(--orange);
}

.post-tag.secondary {
  background: var(--gray-light);
  color: var(--gray);
}

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--black);
  transition: color .2s;
}

.post-card:hover .post-card-title {
  color: var(--orange);
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--gray);
  font-weight: 500;
  margin-top: auto;
}

.post-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}

.post-card-author-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* Featured post card (first post) */
.post-card.featured {
  grid-column: span 3;
  flex-direction: row;
  border-radius: var(--radius);
}

.post-card.featured .post-card-image,
.post-card.featured .post-card-no-image {
  width: 48%;
  flex-shrink: 0;
  aspect-ratio: unset;
  min-height: 300px;
}

.post-card.featured .post-card-content {
  padding: 32px 36px;
  justify-content: center;
}

.post-card.featured .post-card-title {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.post-card.featured .post-card-excerpt {
  font-size: 15px;
  -webkit-line-clamp: 4;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0 0;
}

.pagination a,
.pagination .page-number {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--black);
  transition: all .2s;
}

.pagination a:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.pagination .page-number {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* ── Single Post ──────────────────────────────────────────── */
.post-header {
  padding: 56px 24px 40px;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.post-tags-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.post-title {
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--black);
}

.post-meta-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.post-separator { color: var(--border); }

.post-feature-image {
  margin: 0 0 0;
}

.post-feature-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

/* Post body content */
.post-content-wrapper {
  padding: 56px 0 80px;
}

.post-body {
  font-size: 18px;
  line-height: 1.8;
  color: var(--black);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 2em 0 0.75em;
  letter-spacing: -0.02em;
}

.post-body h2 { font-size: 28px; }
.post-body h3 { font-size: 22px; }
.post-body h4 { font-size: 18px; }

.post-body a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover { color: #EA6C0B; }

.post-body ul, .post-body ol {
  padding-left: 1.8em;
  margin-bottom: 1.5em;
}

.post-body li { margin-bottom: 0.5em; }

.post-body blockquote {
  border-left: 4px solid var(--orange);
  padding: 16px 24px;
  margin: 2em 0;
  background: var(--orange-light);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--black);
}

.post-body code {
  background: var(--gray-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
  font-family: 'Fira Code', 'Courier New', monospace;
}

.post-body pre {
  background: #1a1a1a;
  color: #f8f8f2;
  padding: 24px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 2em 0;
  font-size: 14px;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.post-body img {
  border-radius: 10px;
  margin: 2em auto;
  box-shadow: var(--shadow);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 15px;
}

.post-body th {
  background: var(--gray-light);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.post-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.post-body tr:hover td { background: var(--offwhite); }

/* Ghost card styles */
.kg-width-wide {
  margin-left: -10%;
  margin-right: -10%;
}

.kg-width-full {
  margin-left: -24px;
  margin-right: -24px;
}

.kg-image { border-radius: 10px; }

.kg-embed-card {
  display: flex;
  justify-content: center;
  margin: 2em 0;
}

.kg-callout-card {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 10px;
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  margin: 2em 0;
}

.kg-callout-emoji { font-size: 24px; flex-shrink: 0; }
.kg-callout-text { font-size: 16px; line-height: 1.6; }

.kg-toggle-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 1.5em 0;
}

.kg-toggle-heading { font-weight: 700; cursor: pointer; }

/* ── Post Footer / Related ────────────────────────────────── */
.post-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 80px;
  margin-top: 0;
}

.post-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 48px;
}

.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.share-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.related-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
}

/* ── Author Box ───────────────────────────────────────────── */
.author-box {
  background: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.author-box-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box-img-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  flex-shrink: 0;
}

.author-box-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.author-box-bio {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
  margin: 0;
}

/* ── Tag/Author Archive Pages ─────────────────────────────── */
.archive-header {
  padding: 56px 24px 48px;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.archive-label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--orange-light);
  color: var(--orange);
  margin-bottom: 14px;
}

.archive-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.archive-description {
  font-size: 16px;
  color: var(--gray);
  max-width: 480px;
  margin: 0 auto;
}

/* ── CTA Banner ───────────────────────────────────────────── */
.cta-banner {
  background: var(--black);
  padding: 64px 24px;
  text-align: center;
  color: #fff;
}

.cta-banner h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.cta-banner h2 span { color: var(--orange); }

.cta-banner p {
  font-size: 16px;
  color: rgba(255,255,255,.65);
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn-orange {
  display: inline-block;
  padding: 14px 32px;
  background: var(--orange);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
}

.cta-banner .btn-orange:hover {
  background: #EA6C0B;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,.4);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--black);
  color: rgba(255,255,255,.5);
  padding: 40px 24px;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.footer-logo span { color: var(--orange); }

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,.5);
  transition: color .2s;
  font-weight: 500;
}

.footer-links a:hover { color: #fff; }

.footer-copy { color: rgba(255,255,255,.35); }

/* ── Error Page ───────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 80px 24px;
}

.error-code {
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 16px;
}

.error-message {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.error-description {
  font-size: 16px;
  color: var(--gray);
  margin-bottom: 32px;
}

.btn-home {
  display: inline-block;
  padding: 12px 28px;
  background: var(--orange);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
}

.btn-home:hover {
  background: #EA6C0B;
  transform: translateY(-1px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-card.featured { flex-direction: column; grid-column: span 2; }
  .post-card.featured .post-card-image,
  .post-card.featured .post-card-no-image { width: 100%; min-height: 240px; }
}

@media (max-width: 640px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card.featured { grid-column: span 1; }
  .author-box { flex-direction: column; }
  .post-footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .post-body { font-size: 16px; }
  .kg-width-wide { margin-left: 0; margin-right: 0; }
  .kg-width-full { margin-left: -16px; margin-right: -16px; }
}

/* ── Language Switcher ─────────────────────────────────────── */
.lang-hero {
  padding: 56px 24px 48px;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.lang-hero-inner h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.lang-hero-inner p {
  font-size: 16px;
  color: var(--gray);
  max-width: 520px;
  margin: 0 auto 28px;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--black);
  text-decoration: none;
  transition: all .2s;
}
.lang-pill:hover { border-color: var(--orange); color: var(--orange); }
.lang-pill-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff !important;
}

/* Nav language switcher */
.lang-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-nav-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  text-decoration: none;
  transition: color .2s;
}
.lang-nav-btn:hover { color: var(--orange); }
.lang-nav-sep { color: var(--border); font-size: 12px; }

/* ── Tag page — EN / TH / Other content visibility ─────────── */

/* Default: show other-tag elements, hide lang-specific */
.en-tag-title, .en-tag-desc,
.th-tag-title, .th-tag-desc { display: none; }

/* EN tag page: show EN content, hide TH + other */
.tag-en .en-tag-title, .tag-en .en-tag-desc { display: block; }
.tag-en .other-tag-label, .tag-en .other-tag-title, .tag-en .other-tag-desc { display: none; }

/* TH tag page: show TH content, hide EN + other */
.tag-th .th-tag-title, .tag-th .th-tag-desc { display: block; }
.tag-th .other-tag-label, .tag-th .other-tag-title, .tag-th .other-tag-desc { display: none; }
