/* Standalone stylesheet for the backend-rendered article + index pages (linked as /article.css).
   These pages are static HTML written to S3 by Ta.Business/Articles, not React — so this is their
   only styling. Keep it self-contained and brand-aligned (no build-hashed assets). */

:root {
  --ta-ink: #1a2233;
  --ta-muted: #5b6577;
  --ta-accent: #2f6df6;
  --ta-border: #e6e9f0;
  --ta-bg: #ffffff;
  --ta-max: 720px;
  --ta-wide: 1152px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ta-ink);
  background: var(--ta-bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  line-height: 1.65;
  font-size: 18px;
}

a { color: var(--ta-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header (matches the public marketing site) ---- */
.site-header { border-bottom: 1px solid var(--ta-border); background: var(--ta-bg); }
.header-inner {
  max-width: var(--ta-wide);
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.header-inner .brand { display: inline-flex; align-items: center; }
.header-inner .brand img { height: 28px; width: auto; display: block; }
.header-inner .nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-link {
  color: var(--ta-ink);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-link:hover { text-decoration: none; background: rgba(15, 23, 42, 0.05); }
.btn-primary {
  background: var(--ta-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.btn-primary:hover { text-decoration: none; filter: brightness(0.95); }

/* Language switcher: no-JS <details> dropdown */
.lang { position: relative; }
.lang > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--ta-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ta-ink);
  white-space: nowrap;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover { border-color: var(--ta-ink); background: rgba(15, 23, 42, 0.04); }
.lang .globe {
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  opacity: 0.65;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.6px 100% no-repeat;
}
.lang .caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; opacity: 0.55; margin-top: 2px; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 200px;
  max-height: 360px;
  overflow: auto;
  background: var(--ta-bg);
  border: 1px solid var(--ta-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.28);
  z-index: 30;
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ta-ink);
  font-size: 14px;
}
.lang-menu a:hover { text-decoration: none; background: rgba(15, 23, 42, 0.05); }
.lang-menu a[aria-current="true"] { background: rgba(47, 109, 246, 0.1); font-weight: 600; }
.lang-menu .code { margin-inline-start: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ta-muted); }

main { max-width: var(--ta-max); margin: 0 auto; padding: 28px 20px; }

/* ---- Back to articles ---- */
.crumbs { margin: 0 0 14px; }
.crumbs .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ta-muted);
}
.crumbs .back:hover { text-decoration: none; color: var(--ta-accent); }
.crumbs .back-arrow { flex-shrink: 0; }
[dir="rtl"] .crumbs .back-arrow { transform: scaleX(-1); }

/* ---- Footer (matches the public marketing site) ---- */
.site-footer {
  border-top: 1px solid var(--ta-border);
  margin-top: 64px;
  background: var(--ta-bg);
}
.footer-inner { max-width: var(--ta-wide); margin: 0 auto; padding: 40px 24px; }
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}
@media (min-width: 720px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-col h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ta-ink);
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col li.indent { padding-inline-start: 12px; }
.footer-col a { color: var(--ta-muted); font-size: 14px; }
.footer-col a:hover { color: var(--ta-accent); text-decoration: none; }
.footer-bar {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ta-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ta-muted);
  font-size: 13px;
}
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.footer-legal a { color: var(--ta-muted); }
.footer-legal a:hover { color: var(--ta-accent); text-decoration: none; }
.footer-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-meta a { color: var(--ta-muted); }
.footer-meta a:hover { color: var(--ta-accent); }
.social { display: inline-flex; gap: 8px; }
.social a {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ta-border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ta-muted);
}
.social a:hover { border-color: var(--ta-accent); color: var(--ta-accent); text-decoration: none; }
.article h1, .index h1 { font-size: 2rem; line-height: 1.2; margin: 0.2em 0 0.4em; }
.article .meta { color: var(--ta-muted); font-size: 15px; margin-top: 0; }
.article .hero { margin: 18px 0; }
.article .hero img,
.prose img { width: 100%; height: auto; border-radius: 10px; }

.prose { font-size: 1.05rem; }
.prose h2 { font-size: 1.5rem; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 1.25rem; margin: 1.4em 0 0.4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em 1.25em; }
.prose blockquote {
  margin: 1em 0;
  padding: 0.4em 1em;
  border-left: 3px solid var(--ta-accent);
  color: var(--ta-muted);
}
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
  font-size: 0.9rem;
}
.prose code { font-family: ui-monospace, "Fira Code", Consolas, monospace; font-size: 0.92em; }
.prose :not(pre) > code { background: #f1f4f9; padding: 0.1em 0.35em; border-radius: 5px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--ta-border); padding: 8px 10px; text-align: left; }

/* Index / listing */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card a { display: block; color: inherit; border: 1px solid var(--ta-border); border-radius: 12px; overflow: hidden; }
.card a:hover { text-decoration: none; border-color: var(--ta-accent); }
.card img { width: 100%; height: 170px; object-fit: cover; display: block; }
.card h2 { font-size: 1.15rem; margin: 12px 14px 6px; }
.card p { margin: 0 14px 14px; color: var(--ta-muted); font-size: 15px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 36px 0 0; }
.pagination span { color: var(--ta-muted); }

[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--ta-accent); }
