/* Tech Station — Salla Themes
   Shared stylesheet. Direction-agnostic (uses CSS logical properties). */

:root {
  --brand-900: #3d0b80;
  --brand-800: #4c0f9e;
  --brand-700: #5f16c7;
  --brand-600: #7523e0;
  --brand-500: #8b2bef;
  --brand-400: #9c4dfe;
  --brand-100: #efe6ff;
  --brand-50:  #f8f4ff;

  --ink-900: #14101f;
  --ink-800: #241d38;
  --ink-600: #4c4560;
  --ink-500: #6b647f;
  --ink-300: #b6b0c4;
  --line:    #e7e3ef;
  --paper:   #ffffff;
  --paper-2: #faf9fd;

  --ok: #0f8f6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 16, 31, .06), 0 4px 14px rgba(20, 16, 31, .05);
  --shadow-md: 0 8px 30px rgba(61, 11, 128, .10);
  --maxw: 1140px;

  --font-ar: "Tajawal", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-en: "Inter", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[data-lang="en"] body { font-family: var(--font-en); line-height: 1.68; }

/* ---------- language visibility ---------- */
html[data-lang="ar"] [data-l="en"] { display: none !important; }
html[data-lang="en"] [data-l="ar"] { display: none !important; }

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

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-500); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.3; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
h4 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-inline-start: 1.35em; }
li { margin-bottom: .4em; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: var(--brand-50); color: var(--brand-800);
  padding: .12em .45em; border-radius: 6px; border: 1px solid var(--brand-100);
  direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 6vw, 84px); }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); }
.lead { font-size: 1.1rem; color: var(--ink-600); }
.center { text-align: center; }
.muted { color: var(--ink-500); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { height: 34px; width: auto; }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a {
  color: var(--ink-600); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand-800); background: var(--brand-50); font-weight: 700; }

.lang-btn {
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer;
  background: var(--ink-900); color: #fff; border: 0;
  padding: 8px 16px; border-radius: 999px; letter-spacing: .02em;
}
.lang-btn:hover { background: var(--brand-700); }

.nav-toggle {
  display: none; font: inherit; cursor: pointer; background: transparent;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; color: var(--ink-800);
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-block; margin-inline-start: auto; }
  .nav {
    display: none; position: absolute; inset-inline: 12px; top: 66px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px; box-shadow: var(--shadow-md); margin-inline-start: 0;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 11px 14px; border-radius: var(--radius-sm); }
  .lang-btn { margin-block-start: 6px; }
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1100px 520px at 85% -15%, rgba(156, 77, 254, .55), transparent 60%),
    linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 55%, var(--brand-500) 100%);
  color: #fff; padding-block: clamp(56px, 7vw, 104px);
  position: relative; overflow: hidden;
}
.hero h1, .hero h2 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .88); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; gap: 32px; } }

.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; margin-bottom: 18px;
}
.section .eyebrow { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

.hero__shot {
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(20, 5, 50, .42);
  border: 1px solid rgba(255, 255, 255, .16);
}

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: .97rem; padding: 12px 24px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: #fff; color: var(--brand-800); }
.btn--primary:hover { background: var(--brand-50); color: var(--brand-800); }
.btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn--solid { background: var(--brand-700); color: #fff; }
.btn--solid:hover { background: var(--brand-600); color: #fff; }
.btn--line { border-color: var(--line); color: var(--ink-800); background: #fff; }
.btn--line:hover { border-color: var(--brand-400); color: var(--brand-700); }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  display: grid; place-items: center; color: var(--brand-700);
}
.card__icon svg { width: 21px; height: 21px; }

.theme-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.theme-card__media { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.theme-card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.theme-card__body h3 { margin-bottom: .3em; }
.theme-card__body .btns { margin-top: auto; padding-top: 16px; }
.theme-card__body .badge { align-self: flex-start; }

.badge {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
}
.badge--ok { background: #e8f7f2; color: var(--ok); border-color: #c6ebe0; }

/* ---------- shots ---------- */
figure.shot { margin: 0 0 26px; }
figure.shot img {
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); width: 100%;
}
figure.shot figcaption {
  font-size: .9rem; color: var(--ink-500); margin-top: 10px; text-align: start;
}

pre.code-block {
  background: var(--ink-900); color: #e8e4f2; border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; direction: ltr; text-align: left;
  font-size: .88rem; line-height: 1.6; margin: 0 0 22px;
}
pre.code-block code {
  background: none; border: 0; padding: 0; color: inherit; font-size: inherit;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 460px; background: #fff; }
th, td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); font-size: .95rem; }
thead th { background: var(--brand-50); color: var(--brand-800); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- docs layout ---------- */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 42px; align-items: start; }
.docs > * { min-width: 0; }
.doc-body { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 980px) { .docs { grid-template-columns: 1fr; gap: 24px; } }

.toc {
  position: sticky; top: 88px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; background: var(--paper-2);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
@media (max-width: 980px) { .toc { position: static; max-height: none; } }
.toc h4 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--ink-600); font-size: .92rem; font-weight: 500;
}
.toc a:hover { background: #fff; color: var(--brand-700); text-decoration: none; }

.doc-body > section { scroll-margin-top: 92px; padding-block: 8px 26px; }
.doc-body > section + section { border-top: 1px solid var(--line); padding-top: 30px; }
.doc-body h2 { margin-top: 0; }

.note {
  border-inline-start: 4px solid var(--brand-400);
  background: var(--brand-50); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 0 0 22px;
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--brand-800); }

.kv { list-style: none; padding: 0; margin: 0 0 20px; }
.kv li {
  display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.kv li:last-child { border-bottom: 0; }
.kv b { color: var(--ink-900); min-width: 190px; }

.faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); background: #fff; }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--ink-900);
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-600); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq .faq__a { padding: 0 20px 18px; color: var(--ink-600); }
.faq .faq__a p:last-child { margin-bottom: 0; }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: .88rem; color: var(--ink-500); padding-block: 18px 0; }
.crumbs a { color: var(--ink-500); }
.crumbs a:hover { color: var(--brand-700); }
.crumbs span { margin-inline: 8px; color: var(--ink-300); }

/* ---------- CTA strip ---------- */
.cta {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  color: #fff; border-radius: 20px; padding: clamp(28px, 4vw, 44px);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.cta h2, .cta h3 { color: #fff; margin-bottom: .25em; }
.cta p { color: rgba(255, 255, 255, .88); margin: 0; }
.cta .btns { margin-top: 0; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ink-900); color: rgba(255, 255, 255, .7); padding-block: 52px 30px; margin-top: 0; }
.site-footer a { color: rgba(255, 255, 255, .8); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.site-footer img.flogo { height: 34px; width: auto; margin-bottom: 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; font-size: .94rem; }
.footer-bottom {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .87rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
}

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; background: #fff; color: var(--brand-800);
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100; font-weight: 700;
}
.skip:focus { inset-inline-start: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
