/* شهاب — مكتب البيانات (data.html). Figures are drawn by js/data.js.

   على الأبيض: رأس فاتح (آخر تحديث على جانبه، وتحته تبويبات تقفز إلى كل
   مجموعة)، ثم صف لكل مجموعة: عنوانها في عمود البداية وأرقامها بجانبه أعمدةً
   متساوية تفصلها خطوط رفيعة — بلا صناديق. الرقم كبير، التغيّر تحته، ثم الوصف
   والمنحنى والمصدر مع زر نسخ الرابط. في الآخر ثلاث روابط سياق على نفس الشبكة.
   لا أرقام مكررة في الرأس. */
a{transition:color .16s ease,background .16s ease,border-color .16s ease}

/* ================================================================ figures */
.sh-data-body{margin-top:12px}
.sh-fig-group{display:grid;grid-template-columns:240px minmax(0,1fr);gap:40px;padding:36px 0;border-bottom:1px solid var(--color-border-soft);scroll-margin-top:calc(var(--sh-compact-h,100px) + 16px)}
.sh-fig-group__h{margin:0;font-family:var(--sh-font);font-size:clamp(22px,2vw,26px);font-weight:800;line-height:1.35;color:var(--sh-navy);text-wrap:balance}
.sh-fig-grid{display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;min-width:0}
.sh-fig{position:relative;display:flex;flex-direction:column;gap:10px;min-width:0;padding-inline:28px;scroll-margin-top:calc(var(--sh-compact-h,100px) + 40px);transition:background .2s ease}
.sh-fig:first-child{padding-inline-start:0}
.sh-fig:last-child{padding-inline-end:0}
.sh-fig + .sh-fig{border-inline-start:1px solid var(--color-border-soft)}
.sh-fig[data-hit]{background:var(--color-surface-blue);box-shadow:0 0 0 12px var(--color-surface-blue)}
.sh-fig__top{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.sh-fig__value{font-family:var(--sh-font);font-size:clamp(34px,3.2vw,44px);font-weight:800;line-height:1;color:var(--sh-navy);direction:ltr;unicode-bidi:isolate}
.sh-fig__value small{margin-inline-start:3px;font-size:.5em}
.sh-fig__delta{font-family:var(--sh-font);font-size:14px;font-weight:700;line-height:1.4;color:var(--sh-ink-2);white-space:nowrap}
.sh-fig__delta em{font-style:normal;font-weight:400;color:var(--sh-mute)}
.sh-fig__delta[data-dir="up"]{color:var(--color-red-soft)}
.sh-fig__delta[data-dir="down"]{color:var(--color-desk-land)}
.sh-fig__label{margin:0;font-family:var(--sh-font);font-size:17px;font-weight:700;line-height:1.55;color:var(--sh-ink);text-wrap:pretty}
.sh-fig__spark{display:block;width:100%;max-width:220px;height:40px}
.sh-fig__foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:10px;border-top:1px solid var(--color-border-soft)}
.sh-fig__src{font-family:var(--sh-font);font-size:14px;line-height:1.6;color:var(--sh-mute)}
.sh-fig__copy{flex:none;display:grid;place-items:center;width:40px;height:40px;margin-inline-end:-10px;border:0;background:transparent;color:var(--sh-mute);font-size:14px;cursor:pointer}
@media (hover:hover){.sh-fig__copy:hover{color:var(--sh-blue);background:var(--color-surface-soft)}}
.sh-fig__copy:focus-visible{outline:2px solid var(--sh-blue);outline-offset:2px}
.sh-fig__err{padding:26px;border:1px solid var(--color-border);text-align:center;font-family:var(--sh-font);font-size:17px;font-weight:700;color:var(--sh-mute)}
.sh-data-note{margin:18px 0 0;font-family:var(--sh-font);font-size:14px;line-height:1.8;color:var(--sh-mute)}
.sh-data-note[hidden]{display:none}

/* ================================================================ context */
.sh-data-ctx{display:grid;grid-template-columns:240px minmax(0,1fr);gap:40px;align-items:start;margin:48px 0 72px}
.sh-data-ctx__h{margin:0;font-family:var(--sh-font);font-size:clamp(22px,2vw,26px);font-weight:800;line-height:1.35;color:var(--sh-navy)}
.sh-data-ctx__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.sh-data-ctx__card{display:flex;flex-direction:column;gap:10px;min-width:0;padding:22px;background:var(--color-surface-soft);color:var(--sh-ink)}
@media (hover:hover){.sh-data-ctx__card:hover{background:var(--color-surface-blue);color:var(--sh-ink)}}
.sh-data-ctx__card:focus-visible{outline:2px solid var(--sh-blue);outline-offset:2px}
.sh-data-ctx__k{display:inline-flex;align-items:center;gap:8px;font-family:var(--sh-font);font-size:14px;font-weight:700;color:var(--sh-blue)}
.sh-data-ctx__t{font-family:var(--sh-font);font-size:19px;font-weight:800;line-height:1.5;color:var(--sh-navy);text-wrap:pretty}
@media (hover:hover){.sh-data-ctx__card:hover .sh-data-ctx__t{color:var(--sh-blue)}}

/* ============================================================ breakpoints */
@media (max-width:1100px){
  .sh-fig-group,.sh-data-ctx{grid-template-columns:minmax(0,1fr);gap:20px}
}
@media (max-width:900px){
  .sh-fig-grid{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 0}
  .sh-fig,.sh-fig:first-child,.sh-fig:last-child{padding-inline:0 20px}
  .sh-fig:nth-child(even){padding-inline:20px 0;border-inline-start:1px solid var(--color-border-soft)}
  .sh-fig:nth-child(odd){border-inline-start:0}
  .sh-data-ctx__grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:640px){
  .sh-fig-group{padding:28px 0}
  .sh-fig,.sh-fig:first-child,.sh-fig:last-child{padding-inline:0 12px}
  .sh-fig:nth-child(even){padding-inline:12px 0}
  .sh-fig__value{font-size:28px}
  .sh-fig__label{font-size:15px;line-height:1.5}
  .sh-fig__delta{font-size:13px;white-space:normal}
  .sh-fig__spark{height:30px}
  .sh-fig__src{font-size:13px}
  .sh-fig__copy{width:44px;height:44px;margin-inline-end:-12px}
  .sh-data-ctx{margin:36px 0 56px}
  .sh-data-ctx__card{padding:18px}
}

/* A press has to answer on a touch screen, where :hover never fires: the ground
   steps to navy for as long as the control is held. No transform and no radius —
   the timing is the colour transition the control already carries. */
body[data-sh-page="data"] :where(.sh-more,.sh-pager__btn,.sh-chip,.sh-tag,.sh-btn):active{
  background:var(--sh-navy);color:#fff;border-color:var(--sh-navy);
}
body[data-sh-page="data"] :where(.sh-data-ctx__card):active{
  background:var(--color-surface-blue);
}

/* the burger and its chevron live in the shared css/responsive.css, which feeds
   the four locked pages, so their guard is written here, per page */
@media (prefers-reduced-motion:reduce){
  body[data-sh-page="data"] .sh-nav-toggle span,
  body[data-sh-page="data"] header nav .sh-menu > a > span:last-child{transition:none}
  body[data-sh-page="data"] a,.sh-fig{transition:none}
}
