/* UAE Free Zone — design tokens
   Gulf ink, cool paper, and one colour per emirate. Emirate colours carry
   meaning (which emirate a zone sits in) and are never used as decoration. */
:root {
  --ink: #0F2A33;
  --ink-soft: #33505A;
  --muted: #5D6E72;
  --paper: #F5F7F6;
  --sheet: #FFFFFF;
  --rule: #CBD5D3;
  --rule-strong: #8FA19F;
  --link: #0B5F73;
  --stamp: #A8261C;

  --e-dubai: #1F6F8B;
  --e-abudhabi: #8C6A12;
  --e-sharjah: #5E4A93;
  --e-rak: #2C7A55;
  --e-ajman: #A4492A;
  --e-fujairah: #2F6E9E;
  --e-uaq: #7B3A63;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --ui: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --measure: 66ch;
  --wrap: 1180px;
  --gap: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Masthead */
.masthead { background: var(--ink); color: #E8EFEE; }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 1.05rem/1 var(--display); font-stretch: 112%; letter-spacing: 0.01em; }
.brand__mark { width: 26px; height: 26px; }
.nav { list-style: none; display: flex; gap: clamp(12px, 2.5vw, 28px); margin: 0; padding: 0; font: 500 0.95rem/1 var(--ui); }
.nav a { color: #DCE6E5; text-decoration: none; padding-block: 6px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
.independent { margin: 0 auto; padding: 7px 0 9px; border-top: 1px solid rgba(255,255,255,0.14); font: 400 0.8rem/1.3 var(--ui); color: #B9C9C7; }

/* Type */
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; font-stretch: 118%; letter-spacing: -0.012em; margin: 0 0 0.4em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 750; font-stretch: 108%; margin: 2.2em 0 0.55em; }
h3 { font-size: 1.2rem; font-weight: 700; font-stretch: 100%; margin: 1.8em 0 0.4em; }
p, ul, ol { margin: 0 0 1.05em; }
.lede { font-size: clamp(1.12rem, 1.8vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); max-width: 58ch; }
.small { font: 400 0.85rem/1.45 var(--ui); color: var(--muted); }

/* Home hero: the ledger is the hero */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(20px, 3vw, 28px); }
.hero h1 { max-width: 15ch; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font: 500 0.9rem/1.3 var(--ui); color: var(--muted); margin-top: 18px; }
.hero__meta strong { color: var(--ink); font-weight: 700; }

/* Emirate key */
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0 0 14px; font: 500 0.85rem/1.2 var(--ui); color: var(--ink-soft); }
.key li { display: inline-flex; align-items: center; gap: 7px; }
.chip { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
[data-emirate="Dubai"] { --e: var(--e-dubai); }
[data-emirate="Abu Dhabi"] { --e: var(--e-abudhabi); }
[data-emirate="Sharjah"] { --e: var(--e-sharjah); }
[data-emirate="Ras Al Khaimah"] { --e: var(--e-rak); }
[data-emirate="Ajman"] { --e: var(--e-ajman); }
[data-emirate="Fujairah"] { --e: var(--e-fujairah); }
[data-emirate="Umm Al Quwain"] { --e: var(--e-uaq); }
.chip { background: var(--e, var(--rule-strong)); }

/* The ledger */
.ledger { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.ledger__filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: #EEF2F1; }
.ledger__filters button { font: 500 0.85rem/1 var(--ui); padding: 8px 12px; border-radius: 3px; border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink); cursor: pointer; }
.ledger__filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ledger table { width: 100%; border-collapse: collapse; font: 400 0.95rem/1.4 var(--ui); }
.ledger th { text-align: left; font-weight: 600; font-size: 0.82rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.ledger td { padding: 13px 14px; border-bottom: 1px solid #E3E9E8; vertical-align: top; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td:first-child { border-left: 5px solid var(--e, var(--rule)); }
.ledger .zone-name { font-weight: 700; font-stretch: 106%; color: var(--ink); text-decoration: none; }
.ledger .zone-name:hover { text-decoration: underline; }
.ledger .zone-sub { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.ledger .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger tbody tr:hover { background: #F4F8F7; }
.ledger__foot { padding: 10px 14px; border-top: 1px solid var(--rule); font: 400 0.82rem/1.4 var(--ui); color: var(--muted); background: #FAFBFB; }

@media (max-width: 760px) {
  .ledger thead { display: none; }
  .ledger table, .ledger tbody, .ledger tr, .ledger td { display: block; }
  .ledger tr { border-left: 5px solid var(--e, var(--rule)); border-bottom: 1px solid var(--rule); padding: 10px 12px; }
  .ledger td { border: 0; padding: 3px 0; }
  .ledger td:first-child { border-left: 0; }
  .ledger td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.82rem; }
}

/* Sections */
.section { padding-block: clamp(36px, 6vw, 64px); }
.section + .section { border-top: 1px solid var(--rule); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section__head h2 { margin: 0; }
.section__head a { font: 500 0.95rem/1 var(--ui); }

.list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 0 var(--gap); }
.list li { border-top: 1px solid var(--rule); padding: 16px 0 18px; }
.list a.t { font: 700 1.1rem/1.3 var(--display); font-stretch: 102%; color: var(--ink); text-decoration: none; }
.list a.t:hover { text-decoration: underline; }
.list p { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; }
.list .d { display: block; font: 400 0.8rem/1.2 var(--ui); color: var(--muted); margin-top: 8px; }

/* Articles */
.article { padding-block: clamp(32px, 5vw, 56px); }
.article__head { max-width: 46rem; }
.article__head h1 { font-size: clamp(1.95rem, 4.4vw, 3rem); font-stretch: 110%; }
.byline { font: 400 0.88rem/1.4 var(--ui); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; }
.prose { max-width: var(--measure); font-size: 1.09rem; line-height: 1.72; }
.prose h2 { margin-top: 1.9em; }
.prose li { margin-bottom: 0.35em; }
.prose blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 1.1em; border-left: 3px solid var(--rule-strong); color: var(--ink-soft); }
.prose table { width: 100%; border-collapse: collapse; font: 400 0.92rem/1.45 var(--ui); margin: 1.4em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 0.84rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.aside { font: 400 0.92rem/1.5 var(--ui); }
.aside__box { border: 1px solid var(--rule); background: var(--sheet); border-radius: 4px; padding: 16px 18px; margin-bottom: 18px; }
.aside__box h2 { font-size: 1rem; margin: 0 0 8px; font-stretch: 100%; }
.aside__box ul { padding-left: 1.1em; margin: 0; }

/* Checked stamp: when a fact was last verified */
.checked { display: inline-flex; align-items: center; gap: 8px; font: 600 0.82rem/1.2 var(--ui); color: var(--stamp); border: 1.5px solid var(--stamp); border-radius: 3px; padding: 5px 9px; transform: rotate(-1.2deg); }
.note { border-left: 4px solid var(--stamp); background: #FBF3F2; padding: 12px 16px; font: 400 0.92rem/1.5 var(--ui); color: var(--ink-soft); margin: 1.4em 0; }

/* Zone profile */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; margin: 22px 0 28px; }
.facts div { background: var(--sheet); padding: 14px 16px; }
.facts dt { font: 500 0.8rem/1.2 var(--ui); color: var(--muted); }
.facts dd { margin: 4px 0 0; font: 600 1.02rem/1.35 var(--ui); }
.zone-band { border-top: 8px solid var(--e, var(--rule)); }

/* Footer */
.foot { background: var(--ink); color: #C9D6D4; margin-top: 64px; padding: 44px 0 26px; font: 400 0.92rem/1.55 var(--ui); }
.foot a { color: #fff; }
.foot__grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.foot__brand { font: 700 1.05rem/1 var(--display); font-stretch: 112%; color: #fff; }
.foot__head { font-weight: 600; color: #fff; margin-bottom: 6px; }
.foot__links { list-style: none; padding: 0; margin: 0; }
.foot__links li { margin-bottom: 6px; }
.foot__small { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.82rem; color: #9FB3B0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page { padding-block: clamp(32px, 5vw, 56px); }
.page .prose { margin-top: 8px; }
.emirate-group { margin-top: 28px; }
.emirate-group h2 { display: flex; align-items: center; gap: 10px; }
.emirate-group h2 .chip { width: 16px; height: 16px; }
@media (min-width: 761px) {
  .ledger table { table-layout: fixed; }
  .ledger th:nth-child(1) { width: 21%; }
  .ledger th:nth-child(2) { width: 33%; }
  .ledger th:nth-child(3) { width: 17%; }
  .ledger th:nth-child(4) { width: 11%; }
  .ledger th:nth-child(5) { width: 18%; }
  .ledger td.num { white-space: normal; }
  .ledger td.num .zone-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
