/* ============================================================
   TechNext Asia — Blog Shared Stylesheet
   Applies to all article pages in /AI Article/
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&family=Montserrat:wght@600;700;800&display=swap');

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --bg: #f0ece3;
  --white: #ffffff;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --blue-pale: #eff6ff;
  --plum: #6d2d7a;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --handwriting: 'Caveat', cursive;
  --sans: 'DM Sans', sans-serif;
  --logo: 'Montserrat', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   Navigation
   ============================================================ */
#mainNav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 88px;
  width: auto;
  mix-blend-mode: multiply;
}

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

.nav-links a {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-apply {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  background: var(--plum);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.nav-apply:hover {
  background: #5a2465;
  transform: translateY(-1px);
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.lang-btn.active { background: var(--blue); color: #fff; box-shadow: 0 1px 4px rgba(37,99,235,0.3); }
.lang-btn:hover:not(.active) { color: var(--text); background: rgba(0,0,0,0.05); }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile Nav */
@media (max-width: 768px) {
  #mainNav { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid transparent; }
  .nav-links { display: none; }
  .hamburger { display: flex; background: rgba(0,0,0,0.07); border-radius: 10px; padding: 8px; transition: background 0.2s; }
  .hamburger.open { background: rgba(37,99,235,0.12); }
  .hamburger.open span { background: var(--blue); }
  .nav-apply { display: none; }
  @keyframes navMenuIn {
    from { opacity: 0; transform: scale(0.82) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: 72px; right: 16px; left: auto; min-width: 180px; background: #fff; border-radius: 18px; padding: 6px; gap: 2px; box-shadow: 0 10px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.06); z-index: 200; transform-origin: top right; animation: navMenuIn 0.22s cubic-bezier(0.34,1.56,0.64,1) both; }
  .nav-links.open li { border-bottom: none; }
  .nav-links.open a { display: block; padding: 0.75rem 1.1rem; font-size: 0.92rem; border-radius: 12px; color: var(--text); font-weight: 500; transition: background 0.15s; }
  .nav-links.open a:hover { background: rgba(0,0,0,0.05); }
  .nav-links.open a.active { color: var(--blue); font-weight: 600; }
  #mainNav { padding: 0 5%; }
  .logo-img { height: 44px; }
  .lang-switcher { position: relative; background: none; padding: 0; gap: 0; border-radius: 0; }
  .lang-btn { display: none; }
  .lang-btn.active { display: inline-flex; align-items: center; gap: 3px; background: var(--blue); color: #fff; padding: 5px 10px; border-radius: 7px; font-size: 0.7rem; box-shadow: 0 1px 4px rgba(37,99,235,0.3); }
  .lang-btn.active::after { content: ' ▾'; font-size: 0.55rem; opacity: 0.85; }
  .lang-switcher.open { flex-direction: column; align-items: stretch; background: #fff; border-radius: 10px; padding: 4px; gap: 2px; box-shadow: 0 4px 20px rgba(0,0,0,0.14); min-width: 60px; }
  .lang-switcher.open .lang-btn { display: block; text-align: center; padding: 6px 10px; border-radius: 6px; color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.05em; }
  .lang-switcher.open .lang-btn.active { background: var(--blue); color: #fff; box-shadow: none; gap: 0; }
  .lang-switcher.open .lang-btn.active::after { display: none; }
  .lang-switcher.open .lang-btn:hover:not(.active) { background: rgba(0,0,0,0.05); color: var(--text); }
}

/* ============================================================
   Article Hero
   ============================================================ */
.article-hero {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 26, 46, 0.15) 0%,
    rgba(26, 26, 46, 0.55) 100%
  );
}

/* ============================================================
   Article Wrap
   ============================================================ */
.article-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 6% 100px;
}

/* ============================================================
   Back Link
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--blue);
}

/* ============================================================
   Category Badge
   ============================================================ */
.cat-badge {
  display: inline-block;
  background: var(--blue-pale);
  color: var(--blue-dark);
  padding: 5px 16px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   Article Meta
   ============================================================ */
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-meta .meta-sep {
  opacity: 0.4;
}

/* ============================================================
   Article Title
   ============================================================ */
.article-title {
  font-family: var(--handwriting);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* ============================================================
   Article Body
   ============================================================ */
.article-body {
  font-size: 1rem;
  line-height: 1.85;
  color: #374151;
}

.article-body h2 {
  font-family: var(--handwriting);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--blue);
  line-height: 1.3;
}

.article-body h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.8rem 0 0.6rem;
}

.article-body p {
  margin-bottom: 1.2rem;
}

.article-body ul,
.article-body ol {
  margin: 1rem 0 1.2rem;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  padding-left: 0.25rem;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.article-body a:hover {
  color: var(--blue-dark);
}

/* ============================================================
   Highlight Box
   ============================================================ */
.highlight-box {
  background: var(--blue-pale);
  border-left: 4px solid var(--blue);
  padding: 1.2rem 1.5rem;
  border-radius: 0 12px 12px 0;
  margin: 2rem 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

.highlight-box strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Share Bar
   ============================================================ */
.share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2rem 0;
  border-top: 1.5px solid var(--border);
  margin-top: 3rem;
}

.share-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--sans);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.share-btn.linkedin {
  background: #0a66c2;
  color: #ffffff;
}

.share-btn.twitter {
  background: #000000;
  color: #ffffff;
}

.share-btn.facebook {
  background: #1877f2;
  color: #ffffff;
}

.share-btn.copy {
  background: var(--border);
  color: var(--text);
}

.share-btn.copy.copied {
  background: #d1fae5;
  color: #065f46;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.65);
  padding: 1rem 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-copy {
  font-size: 0.82rem;
  font-family: var(--sans);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.95);
}

/* ============================================================
   Reveal Animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .article-hero {
    height: 260px;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-wrap {
    padding: 32px 5% 80px;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding: 1rem 5%;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .share-bar {
    gap: 8px;
  }

  .share-btn {
    padding: 8px 16px;
  }
}

/* ============================================================
   2-Column Article Layout (content | sidebar) + Recommended Below
   ============================================================ */
.article-page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2.5rem;
  align-items: start;
}

/* Override article-wrap when inside layout */
.article-page-layout .article-wrap {
  max-width: 100%;
  margin: 0;
  padding: 48px 0 60px;
}

/* ── Right: Sticky Sidebar ── */
.article-sidebar {
  padding-top: 52px;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Sidebar Cards ── */
.toc-card,
.share-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
}

.sidebar-card-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px solid var(--border);
}

/* ── TOC Navigation ── */
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1.4;
  text-decoration: none;
}

.toc-link:hover {
  color: var(--blue);
  background: var(--blue-pale);
}

.toc-link.active {
  color: var(--blue);
  background: var(--blue-pale);
  border-left-color: var(--blue);
  font-weight: 600;
}

/* ── Share Card ── */
.share-card-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.73rem;
  font-weight: 600;
  font-family: var(--sans);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

.share-card-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.share-card-btn.s-linkedin { background: #0a66c2; color: #fff; }
.share-card-btn.s-twitter  { background: #000;    color: #fff; }
.share-card-btn.s-copy     { background: var(--border); color: var(--text); }
.share-card-btn.s-copy.copied { background: #d1fae5; color: #065f46; }

/* ============================================================
   Recommended Articles Section (below article)
   ============================================================ */
.rec-section {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 3%;
}

.rec-section-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.rec-article-card {
  display: block;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s, box-shadow 0.22s;
}

.rec-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.09);
}

.rec-article-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--border);
}

.rec-article-body {
  padding: 1rem 1.1rem 1.25rem;
}

.rec-article-cat {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.4rem;
}

.rec-article-title {
  font-family: var(--handwriting);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.rec-article-card:hover .rec-article-title { color: var(--blue); }

.rec-article-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .article-page-layout {
    grid-template-columns: minmax(0, 1fr) 256px;
    gap: 2rem;
  }
}

@media (max-width: 860px) {
  .article-page-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0;
  }
  .toc-card { display: none; }
  .share-card { flex: 1; min-width: 240px; }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .article-page-layout { padding: 0; }
  .article-page-layout .article-wrap { padding: 32px 5% 48px; }
  .rec-section { padding: 0 5%; }
  .rec-grid { grid-template-columns: 1fr; }
  .share-card { min-width: 0; }
}

/* skip-to-content */
.skip-link{position:absolute;top:-100px;left:16px;z-index:9999;padding:10px 18px;background:#6d2d7a;color:#fff;font-size:0.9rem;font-weight:700;border-radius:0 0 8px 8px;text-decoration:none;transition:top 0.2s;}
.skip-link:focus{top:0;}
