@import url("./assets/fonts/typography.css?v=4");

:root {
  color-scheme: light;
  --petrol: #123D46;
  --petrol-deep: #0D3038;
  --sand: #C5A47E;
  --ivory: #F7F5F0;
  --paper: #fff;
  --ink: #202B30;
  --muted: #65757A;
  --line: #E6E2DA;
  --bn-font-family: "Tajawal", "Noto Sans Arabic", sans-serif;
  font-family: var(--bn-font-family);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--ivory);
  background-image:
    radial-gradient(ellipse at 14% 0%, rgba(197,164,126,.12), transparent 34rem),
    linear-gradient(rgba(18,61,70,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,61,70,.025) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
  font-size: 16px;
  line-height: 1.75;
}

a { color: var(--petrol); text-underline-offset: .2em; }
a:hover { color: var(--petrol-deep); }
a:focus-visible, summary:focus-visible { outline: 3px solid rgba(197,164,126,.8); outline-offset: 3px; border-radius: 5px; }
.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; padding: 5px; border: 1px solid rgba(18,61,70,.1); border-radius: 15px; background: #fff; }
.brand-copy { display: grid; line-height: 1.3; }
.brand-copy strong { color: var(--petrol); font-size: 18px; font-weight: 700; }
.brand-copy small { color: var(--muted); font-size: 12px; }
.header-nav { display: flex; align-items: center; gap: 9px; }
.header-nav a { display: inline-flex; min-height: 40px; align-items: center; padding: 7px 13px; border: 1px solid transparent; border-radius: 10px; color: #526469; text-decoration: none; font-weight: 500; }
.header-nav a:hover, .header-nav a[aria-current="page"] { border-color: rgba(18,61,70,.12); background: #fff; color: var(--petrol); }
.header-nav .back-link { border-color: rgba(18,61,70,.14); background: var(--petrol); color: #fff; }
.header-nav .back-link:hover { background: var(--petrol-deep); color: #fff; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  align-items: center;
  border-radius: 24px;
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
  background:
    radial-gradient(ellipse at 82% 120%, rgba(197,164,126,.23), transparent 35%),
    linear-gradient(120deg, var(--petrol-deep), var(--petrol));
  box-shadow: 0 18px 44px rgba(13,48,56,.14);
}
.hero::before, .hero::after { position: absolute; pointer-events: none; content: ""; }
.hero::before {
  inset: 0;
  opacity: .28;
  background-image: linear-gradient(rgba(255,255,255,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.11) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, transparent 15%, #000 100%);
}
.hero::after {
  width: 310px; height: 310px; inset-inline-end: -94px; bottom: -212px;
  border: 1px solid rgba(197,164,126,.46); border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255,255,255,.035), 0 0 0 54px rgba(255,255,255,.025);
}
.hero-copy { position: relative; z-index: 1; max-width: 720px; }
.hero-eyebrow { display: flex; align-items: center; gap: 9px; color: #E0C7A9; font-size: 14px; font-weight: 500; }
.hero-eyebrow::before { width: 8px; height: 8px; border-radius: 2px; background: var(--sand); transform: rotate(45deg); content: ""; }
.hero h1 { margin: 8px 0 7px; font-size: clamp(32px, 5vw, 48px); font-weight: 700; line-height: 1.2; }
.hero p { max-width: 650px; margin: 0; color: rgba(255,255,255,.78); font-size: 17px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.88); font-size: 13px; }

.intro-note { display: flex; gap: 14px; align-items: flex-start; margin: 22px 0; padding: 17px 20px; border: 1px solid rgba(197,164,126,.48); border-inline-start: 4px solid var(--sand); border-radius: 14px; background: rgba(255,255,255,.83); color: #56656A; }
.intro-note strong { display: block; color: var(--petrol); font-weight: 700; }
.note-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #F4EFE7; color: var(--petrol); font-weight: 700; }
.legal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; margin: 22px 0 42px; }
.toc, .document, .english-version { border: 1px solid rgba(18,61,70,.10); border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: 0 8px 25px rgba(32,43,48,.045); }
.toc { position: sticky; top: 18px; padding: 18px 15px; }
.toc h2 { margin: 0 9px 10px; color: var(--petrol); font-size: 17px; font-weight: 700; }
.toc ol { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.toc a { display: flex; align-items: baseline; gap: 9px; padding: 7px 9px; border-radius: 9px; color: #5B6B70; line-height: 1.45; text-decoration: none; }
.toc a:hover { background: var(--ivory); color: var(--petrol); }
.toc a span { color: #B38B5D; font-size: 12px; font-weight: 700; }
.document { padding: clamp(20px, 3.6vw, 38px); }
.document section { scroll-margin-top: 24px; padding-block: 0 22px; }
.document section + section { padding-top: 22px; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 9px; }
.section-index { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(197,164,126,.6); border-radius: 11px; background: #FAF6EF; color: var(--petrol); font-size: 14px; font-weight: 700; }
.document h2 { margin: 1px 0 0; color: var(--petrol); font-size: 21px; font-weight: 700; line-height: 1.4; }
.document p { margin: 7px 0; color: #4E5E63; }
.document ul { display: grid; gap: 6px; margin: 8px 0 3px; padding-inline-start: 22px; color: #4E5E63; }
.document li::marker { color: #B68E60; }
.inline-en { direction: ltr; unicode-bidi: isolate; }
.english-version { margin-top: 24px; overflow: hidden; }
.english-version summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 61px; padding: 15px 20px; color: var(--petrol); cursor: pointer; font-weight: 700; list-style: none; }
.english-version summary::-webkit-details-marker { display: none; }
.english-version summary::after { content: "+"; color: #9F7951; font-size: 23px; line-height: 1; }
.english-version[open] summary::after { content: "−"; }
.english-content { padding: 4px clamp(20px, 3.6vw, 38px) 30px; border-top: 1px solid var(--line); }
.english-content .section-head { flex-direction: row; }
.english-content h2 { font-size: 20px; }
.english-content p, .english-content ul { color: #4E5E63; }
.english-content section + section { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.legal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 30px; border-top: 1px solid rgba(18,61,70,.12); color: var(--muted); font-size: 14px; }
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 15px; }
.legal-footer a { color: #4E6368; }

@media (max-width: 800px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 220px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; background-size: auto, 32px 32px, 32px 32px; }
  .wrap { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 70px; gap: 9px; }
  .brand { gap: 8px; }
  .brand img { width: 42px; height: 42px; border-radius: 13px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 10px; }
  .header-nav { gap: 4px; }
  .header-nav a { min-height: 38px; padding: 6px 8px; font-size: 13px; }
  .header-nav .back-link { font-size: 0; }
  .header-nav .back-link::after { content: "الرئيسية"; font-size: 13px; }
  .hero { min-height: 0; border-radius: 18px; padding: 25px 21px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .hero-meta { margin-top: 15px; }
  .intro-note { padding: 13px; }
  .legal-layout { gap: 12px; margin-top: 12px; }
  .toc { padding: 13px 10px; }
  .toc ol { grid-template-columns: 1fr; }
  .toc a { padding-block: 6px; }
  .document { padding: 19px 16px; }
  .document h2 { font-size: 19px; }
  .section-head { gap: 9px; }
  .section-index { flex-basis: 30px; width: 30px; height: 30px; }
  .legal-footer { flex-direction: column; gap: 7px; }
}

@media print {
  body { background: #fff; }
  .site-header, .toc, .legal-footer, .header-nav, .intro-note { display: none; }
  .wrap { width: 100%; }
  .hero { min-height: 0; margin-bottom: 16px; padding: 22px; border-radius: 0; print-color-adjust: exact; }
  .legal-layout { display: block; margin: 0; }
  .document, .english-version { box-shadow: none; break-inside: avoid; }
  .english-version[open] .english-content { display: block; }
}
