/* ============================================================
   assets/css/style.css — Global design tokens and shared styles
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --bg:            #F0F2F8;
  --surface:       #FFFFFF;
  --border:        #E4E6EE;
  --border-hover:  #C7CAD8;
  --text-primary:  #0F1117;
  --text-body:     #4B5563;
  --text-muted:    #9CA3AF;
  --indigo:        #4F46E5;
  --indigo-hover:  #4338CA;
  --indigo-light:  #EEF2FF;
  --indigo-mid:    #C7D2FE;
  --indigo-text:   #6366F1;
  --green:         #22C55E;
  --green-dark:    #16A34A;
  --font:          'Plus Jakarta Sans', sans-serif;
  --r:             16px;
  --shadow:        0 2px 12px rgba(0,0,0,.07);
  --shadow-hover:  0 6px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
main { flex: 1; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.container { max-width: 1240px; margin: 0 auto; padding-inline: 32px; }

/* ── Back bar ── */
.back-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 32px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--indigo); transition: gap .18s; }
.back-link:hover { gap: 10px; }

/* ── Tab nav ── */
.tab-nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 32px; }
.tab-nav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab-nav-inner::-webkit-scrollbar { display: none; }
.tab-link { display: inline-flex; align-items: center; padding: 14px 20px; font-size: .9rem; font-weight: 600; color: var(--text-body); white-space: nowrap; transition: color .18s; }
.tab-link:hover { color: var(--indigo); }
.tab-link.active { background: var(--indigo); color: #fff; border-radius: 8px; margin: 8px 0; }

/* ── Code card (shared) ── */
.code-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px 24px; }
.code-card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); text-align: center; margin-bottom: 18px; line-height: 1.3; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 2px dashed var(--indigo-mid); border-radius: 12px; padding: 14px 16px; background: #FAFBFF; margin-bottom: 14px; }
.code-text { font-family: 'Courier New', monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .1em; color: var(--text-primary); user-select: all; word-break: break-all; }
.copy-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px; background: var(--indigo-light); border: 1.5px solid var(--indigo-mid); border-radius: 8px; cursor: pointer; font-family: var(--font); transition: background .18s; flex-shrink: 0; }
.copy-btn:hover { background: #DDE4FF; border-color: var(--indigo); }
.copy-btn.copied { background: #DCFCE7; border: 2px solid var(--green-dark); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.copy-btn svg { color: var(--indigo); }
.copy-btn.copied svg { color: var(--green-dark); }
.copy-btn .icon-copy  { display: block; }
.copy-btn .icon-check { display: none; }
.copy-btn.copied .icon-copy  { display: none; }
.copy-btn.copied .icon-check { display: block; }
.copy-label { font-size: .7rem; font-weight: 700; color: var(--indigo); letter-spacing: .04em; }
.copy-btn.copied .copy-label { color: var(--green-dark); }
.reveal-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 20px; background: var(--indigo); color: #fff; font-family: var(--font); font-size: .95rem; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .18s, transform .15s; margin-bottom: 12px; }
.reveal-btn:hover { background: var(--indigo-hover); transform: translateY(-1px); }
.verified-line { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .82rem; color: var(--text-muted); }
.verified-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; flex-shrink: 0; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: auto; }
.footer-bar { max-width: 1400px; margin: 0 auto; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-copy { font-size: .85rem; color: var(--text-muted); }
.footer-toggle { display: flex; align-items: center; gap: 7px; padding: 7px 16px; background: transparent; border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--font); font-size: .82rem; font-weight: 600; color: var(--text-body); cursor: pointer; transition: border-color .18s, color .18s, background .18s; }
.footer-toggle:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-light); }
.footer-toggle-icon { transition: transform .25s ease; }
.footer-toggle.open .footer-toggle-icon { transform: rotate(180deg); }
.footer-panel { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s ease, opacity .3s ease; }
.footer-panel.open { max-height: 400px; opacity: 1; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 36px 32px 40px; display: flex; justify-content: space-between; gap: 40px; }
.footer-col h4 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-primary); margin-bottom: 20px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: .95rem; color: var(--text-body); transition: color .18s; }
.footer-col a:hover { color: var(--indigo); }
.footer-col--right { text-align: right; }
.footer-col--right ul { align-items: flex-end; }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item details { width: 100%; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; font-size: .95rem; font-weight: 700; color: var(--text-primary); cursor: pointer; list-style: none; gap: 16px; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chevron { flex-shrink: 0; color: var(--indigo); transition: transform .22s ease; }
.faq-item details[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 16px 22px 20px; font-size: .92rem; line-height: 1.75; color: var(--text-body); border-top: 1px solid var(--border); }

/* ── Breadcrumbs ── */
.breadcrumbs ol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; font-size: .85rem; color: var(--text-muted); padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li:not(:last-child)::after { content: '›'; color: var(--text-muted); }
.breadcrumbs a { color: var(--indigo); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ── Header compact search (brand + article pages) ── */
.back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-search-wrap { position: relative; }
.header-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  transition: border-color .18s;
}
.header-search-form:focus-within {
  border-color: var(--indigo);
  background: var(--surface);
}
.header-search-icon { color: var(--text-muted); flex-shrink: 0; }
.header-search-form input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text-primary);
  width: 180px;
  padding: 0 8px;
}
.header-search-form input::placeholder { color: var(--text-muted); }

/* Header search dropdown */
.header-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 300;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.header-search-dropdown.open { display: block; }

@media (max-width: 600px) {
  .header-search-form input { width: 130px; }
  .header-search-dropdown { right: -32px; width: 260px; }
}

/* ── Brand header bar (replaces back-bar) ── */
.brand-header-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Left: back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--indigo);
  white-space: nowrap;
  transition: gap .18s;
  flex-shrink: 0;
}
.back-link:hover { gap: 10px; }

/* Centre: site brand logo */
.brand-header-logo {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.02em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.brand-header-logo span { color: var(--indigo); }

/* Right: search form */
.header-search-wrap { position: relative; flex-shrink: 0; }
.header-search-form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  height: 36px;
  overflow: hidden;
  transition: border-color .18s;
}
.header-search-form:focus-within {
  border-color: var(--indigo);
  background: var(--surface);
}
.header-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 10px;
}
.header-search-form input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text-primary);
  width: 160px;
  padding: 0 8px;
}
.header-search-form input::placeholder { color: var(--text-muted); }
.header-search-go {
  height: 100%;
  padding: 0 14px;
  background: var(--indigo);
  color: #fff;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .18s;
  flex-shrink: 0;
}
.header-search-go:hover { background: var(--indigo-hover); }

/* Header search dropdown */
.header-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 300;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.header-search-dropdown.open { display: block; }

/* ── Static pages (About, Privacy Policy etc.) ── */
.static-page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.static-page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 48px 52px;
}
.static-page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.static-page-content { color: var(--text-body); line-height: 1.8; font-size: .97rem; }
.static-page-content h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 32px 0 12px; }
.static-page-content h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 22px 0 8px; }
.static-page-content p { margin-bottom: 14px; }
.static-page-content p:last-child { margin-bottom: 0; }
.static-page-content ul, .static-page-content ol { padding-left: 22px; margin-bottom: 16px; }
.static-page-content li { margin-bottom: 6px; }
.static-page-content a { color: var(--indigo); text-decoration: underline; }
.static-page-content a:hover { color: var(--indigo-hover); }
.static-page-content strong { font-weight: 700; color: var(--text-primary); }
.static-page-content em { font-style: italic; color: var(--text-muted); }
@media (max-width: 600px) {
  .static-page-card { padding: 28px 20px; }
}

/* ── Back bar (search + static pages) ── */
.back-bar-search {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
}

/* ── Search page ── */
.search-page-header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.search-page-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.search-page-title span { color: var(--indigo); }
.search-page-count { font-size: .9rem; color: var(--text-muted); margin-bottom: 20px; }
.search-page-form {
  display: flex;
  max-width: 480px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.search-page-form:focus-within { border-color: var(--indigo); }
.search-page-form input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  font-family: var(--font);
  font-size: .92rem;
  border: none;
  outline: none;
  color: var(--text-primary);
  background: var(--surface);
}
.search-page-form button {
  height: 46px;
  padding: 0 22px;
  background: var(--indigo);
  color: #fff;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .18s;
}
.search-page-form button:hover { background: var(--indigo-hover); }
.search-no-results {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.search-no-results-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.search-no-results p { color: var(--text-muted); margin-bottom: 24px; }
.search-browse-all {
  display: inline-block;
  padding: 12px 24px;
  background: var(--indigo);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  transition: background .18s;
}
.search-browse-all:hover { background: var(--indigo-hover); }

/* ── Tag archive page ── */
.tag-archive-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}
.tag-hero {
  text-align: center;
  padding: 48px 24px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.tag-hero-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--indigo);
  background: var(--indigo-light);
  border: 1px solid var(--indigo-mid);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.tag-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 20px;
  line-height: 1.2;
}
.tag-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--indigo);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background .18s, transform .15s;
}
.tag-hero-cta:hover { background: var(--indigo-hover); transform: translateY(-1px); }
.tag-archive-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.tag-directory-link {
  text-align: center;
  margin-top: 40px;
}
.tag-back-btn {
  display: inline-block;
  padding: 11px 24px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-body);
  text-decoration: none;
  transition: all .18s;
}
.tag-back-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-light);
}
@media (max-width: 600px) {
  .tag-archive-wrap { padding-inline: 16px; }
  .back-bar-search { padding-inline: 16px; }
}

/* ── Tag page additions ── */
.tag-hero-desc {
  font-size: 1rem;
  color: var(--text-body);
  max-width: 540px;
  margin: 0 auto 24px;
  line-height: 1.65;
}
.tag-code-section {
  margin-bottom: 40px;
}
.tag-section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.tag-code-card-wrap {
  max-width: 520px;
}
