/* ABC Translation Palestine — site styles
   Palette: stamp-ink navy, olive, seal-wax red on a cool paper ground.
   All spacing uses logical properties so the same sheet serves RTL (ar) and LTR (en). */

/* Self-hosted variable fonts (SIL Open Font License), subset to Arabic + Latin */
@font-face { font-family: "Readex Pro"; src: url("../fonts/readex-pro.woff") format("woff"); font-weight: 300 600; font-display: swap; }
@font-face { font-family: "Reem Kufi"; src: url("../fonts/reem-kufi.woff") format("woff"); font-weight: 500 700; font-display: swap; }

:root {
  --ink: #1b2a47;
  --ink-2: #2c3d61;
  --olive: #56622f;
  --olive-soft: #e7eadb;
  --wax: #9e2b25;
  --paper: #f3f5f2;
  --sheet: #ffffff;
  --line: #d3d9d0;
  --text: #1c2230;
  --muted: #586273;
  --focus: #c98a12;
  --radius-s: 4px;
  --radius-m: 10px;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --f-display: "Reem Kufi", "Readex Pro", system-ui, sans-serif; /* large headings only */
  --f-ui: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --f-body: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.44rem;
  --step-3: 1.8rem;
  --step-4: clamp(2rem, 4.2vw, 2.9rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-weight: 350;
}
html[dir="rtl"] body { line-height: 1.85; }

img, svg { max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--wax); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--f-display); color: var(--ink); line-height: 1.3; font-weight: 600; margin: 0 0 0.6em; }
h3 { font-family: var(--f-ui); }
html[dir="rtl"] h1, html[dir="rtl"] h2 { line-height: 1.55; font-weight: 600; }
h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); margin-top: 1.6em; }
h3 { font-size: var(--step-1); margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin-block-end: 0.35em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.prose { max-width: 42rem; }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 50; }
.skip:focus { inset-inline-start: 0.5rem; top: 0.5rem; }

/* ---------- top bar & header ---------- */
.topbar { background: var(--ink); color: #dfe5f1; font-size: var(--step--1); }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; justify-content: space-between; padding-block: 0.45rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar .contact-line { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.topbar bdi { unicode-bidi: isolate; direction: ltr; }

.site-header { background: var(--sheet); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--f-ui); font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
.brand-sub { display: block; font-family: var(--f-body); font-size: 0.78rem; font-weight: 400; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a { text-decoration: none; padding: 0.5rem 0.7rem; border-radius: var(--radius-s); color: var(--text); font-weight: 450; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--olive-soft); }
.nav .lang { border: 1px solid var(--line); margin-inline-start: 0.4rem; font-weight: 500; }
.nav .cta-mini { background: var(--ink); color: #fff; margin-inline-start: 0.3rem; }
.nav .cta-mini:hover { background: var(--ink-2); color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.45rem 0.7rem; font: inherit; color: var(--ink); cursor: pointer; }

@media (max-width: 960px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--sheet); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 0.5rem var(--gutter) 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; }
  .nav .lang, .nav .cta-mini { margin-inline-start: 0; text-align: center; margin-top: 0.4rem; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: var(--step--1); color: var(--muted); padding-block: 1.1rem 0; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-inline-end: 0.3rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* ---------- hero: the legalization chain ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 0.45em; }
.hero .lead { font-size: var(--step-1); color: var(--muted); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.btn { display: inline-block; font: inherit; font-weight: 500; text-decoration: none; padding: 0.8rem 1.35rem; border-radius: var(--radius-s); border: 1px solid var(--ink); cursor: pointer; line-height: 1.3; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--olive-soft); color: var(--ink); }

.chain { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; }
.chain::before { content: ""; position: absolute; inset: 50% 12% auto; border-top: 2px dashed var(--line); }
.stamp {
  position: relative; aspect-ratio: 1; width: min(100%, 11.5rem); margin-inline: auto;
  border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 1.2rem;
  color: var(--ink); background: var(--sheet);
  box-shadow: inset 0 0 0 3px currentColor, inset 0 0 0 7px var(--sheet), inset 0 0 0 8px currentColor;
  transform: rotate(var(--tilt, -4deg));
  margin-block: 0;
}
.stamp:nth-child(2) { --tilt: 5deg; color: var(--olive); }
.stamp:nth-child(3) { --tilt: -2deg; color: var(--olive); }
.stamp:nth-child(4) { --tilt: 3deg; color: var(--wax); }
.stamp .n { display: block; font-family: var(--f-display); font-size: 1.9rem; line-height: 1; font-weight: 700; }
.stamp .t { display: block; font-family: var(--f-ui); font-size: 1rem; font-weight: 600; line-height: 1.3; margin-top: 0.3rem; }
.stamp .d { display: block; font-size: 0.74rem; color: var(--muted); line-height: 1.35; margin-top: 0.25rem; }
.chain-caption { grid-column: 1 / -1; text-align: center; font-size: var(--step--1); color: var(--muted); margin: 0.3rem 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: press 0.5s cubic-bezier(.2,.9,.3,1.3) both; }
  .stamp:nth-child(2) { animation-delay: 0.15s; }
  .stamp:nth-child(3) { animation-delay: 0.3s; }
  .stamp:nth-child(4) { animation-delay: 0.45s; }
  @keyframes press { from { opacity: 0; transform: scale(1.25) rotate(var(--tilt, -4deg)); } to { opacity: 1; transform: scale(1) rotate(var(--tilt, -4deg)); } }
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .stamp { width: min(100%, 9.5rem); } }

/* ---------- sections ---------- */
.band { padding-block: clamp(2.5rem, 6vw, 4rem); }
.band-sheet { background: var(--sheet); border-block: 1px solid var(--line); }
.band-ink { background: var(--ink); color: #e4e9f3; }
.band-ink h2, .band-ink h3, .band-ink a { color: #fff; }
.section-head { max-width: 40rem; margin-bottom: 1.8rem; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--muted); }
.band-ink .section-head p { color: #c6cfdf; }

/* service index: a register, not a card grid */
.register { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.register li { margin: 0; border-bottom: 1px solid var(--line); }
.register a { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 0.3rem 2rem; padding: 1.1rem 0.25rem; text-decoration: none; color: var(--text); }
.register a:hover { background: var(--paper); }
.register .name { font-family: var(--f-ui); font-size: var(--step-1); font-weight: 600; color: var(--ink); }
.register .desc { color: var(--muted); }
@media (max-width: 700px) { .register a { grid-template-columns: 1fr; } }

/* directory lists (cities, languages, countries) */
.directory { list-style: none; padding: 0; margin: 0; columns: 4 11rem; column-gap: 2rem; }
.directory li { break-inside: avoid; margin: 0 0 0.15rem; }
.directory a { display: block; padding: 0.3rem 0; text-decoration: none; }
.directory a:hover { text-decoration: underline; }
.directory small { color: var(--muted); }
.dir-group h3 { font-size: var(--step-0); font-weight: 500; color: var(--olive); margin: 1.4rem 0 0.6rem; }

/* page layout: content + aside */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: clamp(1.5rem, 4vw, 3.5rem); padding-block: 1.5rem 3.5rem; align-items: start; }
.page-head { padding-block: 1.2rem 0.2rem; }
.page-head .lead { font-size: var(--step-1); color: var(--muted); max-width: 44rem; }
@media (max-width: 960px) { .page { grid-template-columns: 1fr; } }
.aside { position: sticky; top: 5.5rem; display: grid; gap: 1rem; }
@media (max-width: 960px) { .aside { position: static; } }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.3rem; }
.panel h2, .panel h3 { margin-top: 0; font-size: var(--step-1); font-family: var(--f-ui); line-height: 1.4; }
.panel ul { margin-bottom: 0; }
.panel-ink { background: var(--ink); color: #e4e9f3; border-color: var(--ink); }
.panel-ink h2, .panel-ink a { color: #fff; }

.steps { list-style: none; padding: 0; counter-reset: s; margin: 0 0 1.4rem; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 3rem; margin-bottom: 1rem; min-height: 2.2rem; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid var(--olive); color: var(--olive); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; }
.steps strong { display: block; color: var(--ink); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-inline-start: 1.6rem; }
.checklist li::before { content: ""; position: absolute; inset-inline-start: 0.1rem; top: 0.62em; width: 0.7rem; height: 0.38rem; border-inline-start: 2px solid var(--olive); border-bottom: 2px solid var(--olive); transform: rotate(-45deg); }
html[dir="rtl"] .checklist li::before { transform: rotate(45deg) scaleX(-1); }

.note { border-inline-start: 4px solid var(--olive); background: var(--olive-soft); padding: 0.9rem 1.1rem; border-radius: var(--radius-s); margin: 1.2rem 0; }
.note-wax { border-color: var(--wax); background: #f6e9e7; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.8rem; margin: 1.2rem 0 1.6rem; }
.fact { border: 1px solid var(--line); background: var(--sheet); padding: 0.9rem 1rem; border-radius: var(--radius-s); }
.fact b { display: block; font-family: var(--f-ui); color: var(--ink); }
.fact span { color: var(--muted); font-size: var(--step--1); }

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; padding: 0; }
.tags li { margin: 0; }
.tags a { display: inline-block; border: 1px solid var(--line); background: var(--sheet); border-radius: 99px; padding: 0.25rem 0.8rem; font-size: var(--step--1); text-decoration: none; }
.tags a:hover { border-color: var(--ink); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 0.2rem 0; }
.faq summary { cursor: pointer; padding: 0.85rem 0; font-weight: 500; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-display); font-size: 1.3rem; line-height: 1; color: var(--olive); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); }

/* ---------- forms ---------- */
.form { display: grid; gap: 0.9rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: var(--step--1); font-weight: 500; margin-bottom: 0.3rem; color: var(--ink); }
.field .opt { color: var(--muted); font-weight: 350; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--sheet);
  border: 1px solid #b9c1b6; border-radius: var(--radius-s); padding: 0.65rem 0.75rem;
}
.field textarea { min-height: 7.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 0; }
.field input[type="file"] { padding: 0.5rem; background: var(--paper); }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.panel-ink .field label { color: #fff; }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--step--1); }
.consent input { margin-top: 0.35rem; width: 1.05rem; height: 1.05rem; flex: none; }
.hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 0.8rem 1rem; border-radius: var(--radius-s); display: none; }
.form-status.ok { display: block; background: var(--olive-soft); color: #2f3a12; border: 1px solid var(--olive); }
.form-status.err { display: block; background: #f6e9e7; color: #6f1c18; border: 1px solid var(--wax); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* contact page */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); padding-block: 1.5rem 4rem; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.channel { display: block; text-decoration: none; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.channel b { display: block; font-family: var(--f-ui); font-size: var(--step-1); color: var(--ink); }
.channel span { color: var(--muted); font-size: var(--step--1); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* CTA strip */
.cta-strip .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; }
.cta-strip h2 { margin: 0 0 0.3rem; }
.cta-strip p { margin: 0; color: #c6cfdf; }
.cta-strip .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.cta-strip .btn-ghost { color: #fff; border-color: #8e9bb8; }
.cta-strip .btn-ghost:hover { background: var(--ink-2); color: #fff; }

/* footer */
.site-footer { background: #121d33; color: #b8c2d6; font-size: var(--step--1); padding-block: 3rem 1.5rem; }
.site-footer a { color: #e2e8f3; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-family: var(--f-ui); color: #fff; font-size: var(--step-0); margin: 0 0 0.8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.foot-bottom { border-top: 1px solid #2a3654; margin-top: 2.5rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; }

/* 404 / thanks */
.center-page { text-align: center; padding-block: 5rem; }
.center-page .stamp { margin-bottom: 2rem; color: var(--olive); }
