/* ============================================================
   profile.leap.sa: the LEAP RD&O profile library
   Look: leap.sa's blog list (main-site/css/news-index.css and
   blog-index.css): white, light grey panels, LEAP black #1d1d1d
   as the one accent, Cairo.
   Motion: the Smart Points site's Style B reveal system
   (smartpoints/astro-site/src/styles/style-b.css) and its page
   transitions (lab-vt.css). Hidden start states live only under
   html.rv-js, which the head script sets when motion is allowed.
   ============================================================ */

:root {
    --ink: #1d1d1d;
    --ink-hover: #3a3a3a;
    --ink-2: #4B5563;
    --ink-3: #5F6875;
    --bg: #FFFFFF;
    --panel: #F4F6F8;
    --line: #E2E6EA;
    --line-strong: #CBD2D9;
    --select: #E4E6E9;
    --radius: 10px;
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 48px);
    --group-col: 180px;
    --col-gap: clamp(24px, 4vw, 56px);
    --entry-pad: clamp(24px, 3vw, 36px);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
html[lang="en"] { --group-col: 200px; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { font-family: 'Cairo', system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.85; overflow-x: clip; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { line-height: 1.7; }
::selection { background: var(--select); color: var(--ink); }
a { color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
bdi { unicode-bidi: isolate; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- skip link ---------- */
.skip { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 50; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- header (floating white bar, as on leap.sa) ---------- */
.site-header { position: sticky; top: 0; z-index: 20; padding: 12px var(--gutter) 0; view-transition-name: site-header; }
.site-header .bar { max-width: calc(var(--wrap) - 2 * 24px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 12px 8px 20px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(16, 24, 40, .07); }
html[dir="rtl"] .site-header .bar { padding: 8px 20px 8px 12px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.logo img { height: 32px; width: auto; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch, .cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px 2px; border-radius: 999px; font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.lang-switch { color: var(--ink); border: 1.5px solid var(--line-strong); transition: border-color .3s ease; }
.lang-switch:hover { border-color: var(--ink); }
.cta { background: var(--ink); color: #fff; transition: background-color .3s ease; }
.cta:hover { background: var(--ink-hover); }
.cta-short { display: none; }

/* ---------- page head ---------- */
.page-head { padding-block: clamp(28px, 5vw, 56px) 28px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-3); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
h1 { margin-top: 14px; font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
html[lang="en"] h1 { line-height: 1.12; letter-spacing: -.02em; }
html[lang="ar"] h1 { font-size: clamp(1.75rem, 4.6vw, 3.4rem); }
.ln { display: block; overflow: hidden; padding-block: .12em .2em; margin-block: -.12em -.2em; }
.ln > span { display: block; }
.lede { margin-top: 18px; max-width: 60ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); }
.updated { margin-top: 8px; font-size: .9rem; color: var(--ink-3); }

/* ---------- filter (the blog's segmented control) ---------- */
.filter-bar { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.filter a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 2px; border-radius: 8px; color: var(--ink-2); font-weight: 700; font-size: .95rem; text-decoration: none; transition: background-color .3s ease, color .3s ease; }
.filter a:hover { color: var(--ink); background: #fff; }
.filter a[aria-current="true"] { background: var(--ink); color: #fff; }
.filter .count { font-weight: 500; font-variant-numeric: tabular-nums; }
.filter-status { font-size: .9rem; color: var(--ink-3); }

/* ---------- groups: a rail like the blog's months ---------- */
.groups { border-top: 1px solid var(--line); }
.group { display: grid; grid-template-columns: var(--group-col) minmax(0, 1fr); gap: var(--col-gap); padding-block: 8px; border-bottom: 1px solid var(--line); }
.group[hidden] { display: none; }
.group-head { position: sticky; top: 100px; align-self: start; padding-top: calc(var(--entry-pad) - 4px); }
.group-head h2 { font-size: clamp(1.4rem, 2vw, 1.7rem); font-weight: 800; line-height: 1.3; }
.group-count { display: block; margin-top: 4px; font-size: .9rem; color: var(--ink-3); }
.group-cards { position: relative; border-inline-start: 1px solid var(--line); }

.card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 400px); gap: clamp(20px, 3vw, 40px); padding-block: var(--entry-pad); padding-inline-start: var(--col-gap); }
.card + .card { border-top: 1px solid var(--line); }
.card[hidden] { display: none; }
.card::before { content: ""; position: absolute; inset-inline-start: -4.5px; top: calc(var(--entry-pad) + 12px); width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 1; }
.tag, .chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px 2px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.tag { background: var(--ink); color: #fff; }
.chips { display: inline-flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-weight: 600; }
.facts { color: var(--ink-3); font-weight: 600; white-space: nowrap; }

.card-title { margin-top: 14px; font-size: clamp(1.3rem, 2.1vw, 1.65rem); font-weight: 800; line-height: 1.5; max-width: 32ch; overflow-wrap: anywhere; }
html[lang="en"] .card-title { line-height: 1.3; }
.card-title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 2px; transition: background-size .5s var(--ease); }
html[dir="ltr"] .card-title a { background-position: 0 100%; }
.card-title a:hover, .card-title a:focus-visible { background-size: 100% 2px; }
.brief { margin-top: 8px; max-width: 62ch; font-size: 1.05rem; color: var(--ink-2); }
.note { margin-top: 12px; display: inline-block; padding: 6px 12px 8px; border-radius: 8px; background: var(--panel); font-size: .92rem; color: var(--ink-2); }
.note strong { color: var(--ink); }

.actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px 2px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: 700 .95rem/1.2 'Cairo', system-ui, sans-serif; text-decoration: none; transition: background-color .3s ease, border-color .3s ease; }
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn + .btn { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn + .btn:hover { border-color: var(--ink); background: #fff; }

.more { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: .95rem; color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1.5px; transition: background-size .5s var(--ease); }
html[dir="ltr"] .more { background-position: 0 100%; }
.more:hover, .more:focus-visible { background-size: 100% 1.5px; }
.more .arrow { width: 16px; height: 16px; transition: translate .4s var(--ease); }
html[dir="rtl"] .more .arrow { transform: scaleX(-1); }
.more:hover .arrow { translate: 3px 0; }
html[dir="rtl"] .more:hover .arrow { translate: -3px 0; }

.cover { display: block; align-self: start; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color .3s ease; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: scale .6s var(--ease); }
.card:hover .cover { border-color: var(--line-strong); }
.card:hover .cover img { scale: 1.03; }

/* ---------- FAQ ---------- */
.faq { padding-block: clamp(40px, 6vw, 72px); max-width: 860px; }
.faq h2 { margin-bottom: 12px; font-size: clamp(1.4rem, 2vw, 1.7rem); font-weight: 800; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding-block: 12px; font-weight: 700; font-size: 1.05rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 600; line-height: 1; transition: transform .4s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; max-width: 70ch; color: var(--ink-2); }
.faq details a { font-weight: 700; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); }
.foot { display: grid; gap: 22px; padding-block: 40px; }
.contact { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.contact dt { font-size: .85rem; color: var(--ink-3); }
.contact dd { font-weight: 700; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.contact a:hover { text-decoration: underline; }
.legal { font-size: .85rem; color: var(--ink-3); }
.legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-3); }

/* ---------- 404 ---------- */
.nf-main { display: grid; gap: 36px; padding-block: 64px; }
.nf-main section { display: grid; gap: 12px; justify-items: start; }
.nf-main h1, .nf-main h2 { margin: 0; font-size: 1.8rem; font-weight: 800; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
    .group { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 0; }
    .group-head { position: static; display: flex; align-items: baseline; justify-content: space-between; margin-inline: calc(-1 * var(--gutter)); padding: 12px var(--gutter); background: var(--panel); border-bottom: 1px solid var(--line); }
    .group-head h2 { font-size: 1.2rem; }
    .group-count { margin: 0; }
    .card { grid-template-columns: minmax(0, 1fr); padding-inline-start: 22px; }
    .card-title { font-size: 1.3rem; }
    .brief { font-size: 1rem; }
}
@media (max-width: 480px) {
    .cta-long { display: none; }
    .cta-short { display: inline; }
    .logo img { height: 28px; }
    .lang-switch, .cta { padding-inline: 12px; font-size: .9rem; }
    .site-header .bar, html[dir="rtl"] .site-header .bar { padding-inline: 14px 8px; min-height: 60px; }
    html[dir="rtl"] .site-header .bar { padding-inline: 14px 8px; }
    .filter { width: 100%; }
    .filter a { flex: 1 1 auto; justify-content: center; padding-inline: 12px; }
    .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 359px) {
    .cta { display: none; }
}

/* ============================================================
   Motion: Smart Points Style B
   [data-rv]          fade (0.9s) and rise from 26px (1.1s)
   [data-rv="lines"]  each .ln slides up out of its own mask
   [data-rv="wipe"]   the frame uncovers from the bottom while the
                      image settles from scale(1.14)
   ============================================================ */
html.rv-js [data-rv=""] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
html.rv-js [data-rv=""].is-in { opacity: 1; transform: none; }
html.rv-js [data-rv="lines"] .ln > span { transform: translateY(130%); transition: transform 1.25s var(--ease); transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 120ms); }
html.rv-js [data-rv="lines"].is-in .ln > span { transform: none; }
html.rv-js [data-rv="wipe"] { clip-path: inset(100% 0 0 0 round var(--radius)); transition: clip-path 1.3s var(--ease), border-color .3s ease; transition-delay: var(--d, 0ms), 0ms; }
html.rv-js [data-rv="wipe"] .b-zoom { transform: scale(1.14); transition: transform 1.8s var(--ease), scale .6s var(--ease); transition-delay: var(--d, 0ms), 0ms; }
html.rv-js [data-rv="wipe"].is-in { clip-path: inset(0 0 0 0 round var(--radius)); }
html.rv-js [data-rv="wipe"].is-in .b-zoom { transform: none; }

/* Page transitions between / and /en/ (Smart Points lab-vt.css) */
@view-transition { navigation: auto; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-rise-in { from { opacity: 0; transform: translateY(16px); } }
::view-transition-old(root) { animation: 220ms ease both vt-fade-out; }
::view-transition-new(root) { animation: 460ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both vt-rise-in; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
