/* Sahl — دليل الاستخدام (/{locale}/guide). يرث متغيرات sahl.css ويضيف تخطيط ثلاثة أعمدة وبحثاً فورياً. */
.g-hero { background: linear-gradient(180deg, var(--teal-chip) 0%, #fff 100%); padding: 40px 0 28px; }
.g-hero h1 { font-size: 40px; margin-bottom: 10px; }
.g-hero-sub { max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.8; margin-bottom: 22px; }
.g-hero-hint { color: var(--faint); font-size: 14px; margin-top: 10px; }
.g-hero .g-search { max-width: 640px; }

/* بحث */
.g-search { position: relative; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--input); border-radius: 12px; padding: 10px 14px; }
.g-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-mist); }
.g-search svg { color: var(--faint); flex: 0 0 auto; }
.g-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 15px; background: transparent; color: var(--ink); min-width: 0; }
.g-search kbd { font-family: inherit; font-size: 12px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: var(--alt); }
.g-search-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(31,41,51,.14); max-height: 60vh; overflow: auto; padding: 6px; }
.g-search-results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.g-search-results a:hover, .g-search-results a.is-active { background: var(--teal-chip); }
.g-search-results a b { display: block; font-weight: 700; font-size: 15px; }
.g-search-results a small { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.g-search-results a small mark, .g-search-results a b mark { background: #fff3cd; color: inherit; border-radius: 3px; padding: 0 2px; }
.g-search-results .g-sr-sec { display: inline-block; font-size: 12px; color: var(--teal); margin-top: 2px; }
.g-search-results .g-sr-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

/* فهرس الأقسام */
.g-index { padding-top: 32px; }
.g-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.g-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px 22px; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.g-card:hover { border-color: var(--teal-mist); box-shadow: 0 12px 30px rgba(27,122,110,.10); transform: translateY(-2px); }
.g-card-num { position: absolute; top: 18px; inset-inline-end: 20px; font-size: 13px; font-weight: 700; color: var(--faint); }
.g-card-icon { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; background: var(--teal-chip); color: var(--teal); align-items: center; justify-content: center; }
.g-card h2 { font-size: 20px; }
.g-card p { color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.g-card ul { list-style: none; margin: 4px 0 0; padding: 0; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.g-card ul li::before { content: '›'; color: var(--teal); margin-inline-end: 6px; }
.g-card ul li.g-more::before { content: ''; margin: 0; }
.g-card ul li.g-more { color: var(--faint); }
.g-card-count { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--teal); font-weight: 700; }

/* تخطيط الصفحات الداخلية */
.g-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding-block: 36px 72px; align-items: start; }
.g-layout-3 { grid-template-columns: 280px minmax(0, 1fr) 220px; }
.g-aside { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; display: grid; gap: 14px; padding-inline-end: 4px; }
.g-side { display: grid; gap: 2px; font-size: 14.5px; }
.g-side-home { display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.g-side-home.is-active, .g-side-home:hover { background: var(--teal-chip); color: var(--teal-dark); }
.g-side-sec summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--ink); }
.g-side-sec summary::-webkit-details-marker { display: none; }
.g-side-sec summary:hover { background: var(--alt); }
.g-side-sec summary .g-icon { width: 18px; height: 18px; color: var(--teal); flex: 0 0 auto; }
.g-side-sec summary span { flex: 1; }
.g-side-sec summary em { font-style: normal; font-size: 12px; color: var(--faint); }
.g-side-sec[open] summary { color: var(--teal-dark); }
.g-side-sec ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 0; border-inline-start: 2px solid var(--line-soft); margin-inline-start: 18px; }
.g-side-sec li a { display: block; padding: 6px 12px; color: var(--muted); border-radius: 0 8px 8px 0; line-height: 1.5; }
[dir="rtl"] .g-side-sec li a { border-radius: 8px 0 0 8px; }
.g-side-sec li a:hover { color: var(--teal-dark); background: var(--alt); }
.g-side-sec li a[aria-current="page"] { color: var(--teal-dark); font-weight: 700; background: var(--teal-chip); box-shadow: -2px 0 0 var(--teal); }
[dir="rtl"] .g-side-sec li a[aria-current="page"] { box-shadow: 2px 0 0 var(--teal); }

.g-main { min-width: 0; }
.g-main h1 { font-size: 34px; line-height: 1.25; margin-bottom: 10px; }
.g-sec-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.g-sec-head p { color: var(--muted); font-size: 16px; line-height: 1.8; }
.g-meta { display: flex; gap: 8px; color: var(--faint); font-size: 13.5px; margin-bottom: 14px; }
.g-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: g; }
.g-list li a { display: block; position: relative; padding: 18px 20px 18px 56px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); counter-increment: g; transition: border-color .15s, background .15s; }
[dir="rtl"] .g-list li a { padding: 18px 56px 18px 20px; }
.g-list li a::before { content: counter(g); position: absolute; top: 18px; inset-inline-start: 18px; width: 26px; height: 26px; border-radius: 8px; background: var(--teal-chip); color: var(--teal-dark); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.g-list li a:hover { border-color: var(--teal-mist); background: #fbfdfc; }
.g-list h2 { font-size: 18px; margin-bottom: 4px; }
.g-list p { color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.g-list .g-meta { margin: 8px 0 0; }

/* نص المقال */
.g-body { font-size: 16.5px; }
.g-body h2 { font-size: 24px; padding-top: 8px; scroll-margin-top: 90px; }
.g-body h3 { scroll-margin-top: 90px; }
.g-body ol { padding-inline-start: 24px; }
.g-body ol li, .g-body ul li { margin-bottom: 8px; line-height: 1.8; }
.g-body ol li::marker { color: var(--teal); font-weight: 700; }
.g-body code, .g-body kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--alt); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.g-body table { font-size: 15px; }
.g-body thead th { background: var(--alt); }
.g-body img { border-radius: 12px; border: 1px solid var(--line); margin: 1em 0; }
.g-body figure { margin: 1.4em 0; }
.g-body figcaption { color: var(--faint); font-size: 13.5px; text-align: center; margin-top: 6px; }
.callout { border-radius: 12px; padding: 16px 18px; margin: 1.4em 0; border: 1px solid; }
.callout p { margin: 0; }
.callout p + p, .callout p + ul, .callout ul { margin-top: 8px; }
.callout .callout-title { font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.callout .callout-title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.callout-tip { background: var(--toast); border-color: #CFEBDD; color: #17432F; }
.callout-tip .callout-title { color: var(--green-ink); }
.callout-warn { background: #FFF6E8; border-color: #F3DDB6; color: #5D3F0A; }
.callout-warn .callout-title { color: #9A6410; }
.callout-accounting { background: #EEF4FA; border-color: #CFE0F0; color: #1B3A5B; }
.callout-accounting .callout-title { color: #1B4F8C; }
.g-toc-inline { display: none; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.g-toc-inline summary { cursor: pointer; font-weight: 700; color: var(--teal-dark); }
.g-toc-inline ol, .g-toc ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.g-toc-inline li.lvl3, .g-toc li.lvl3 { padding-inline-start: 14px; }
.g-toc-inline a, .g-toc a { display: block; padding: 4px 0; color: var(--muted); line-height: 1.5; }
.g-toc { position: sticky; top: 84px; font-size: 14px; }
.g-toc > p { font-weight: 800; color: var(--faint); font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; margin-bottom: 6px; }
.g-toc a { border-inline-start: 2px solid var(--line-soft); padding-inline-start: 12px; }
.g-toc a:hover { color: var(--teal-dark); }
.g-toc a.is-active { color: var(--teal-dark); border-color: var(--teal); font-weight: 700; }

.g-feedback { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 36px 0 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--alt); font-size: 15px; }
.g-feedback button { font: inherit; font-weight: 700; padding: 6px 18px; border-radius: 8px; border: 1px solid var(--input); background: #fff; color: var(--ink); cursor: pointer; }
.g-feedback button:hover { border-color: var(--teal); color: var(--teal-dark); }
.g-feedback .g-thanks { color: var(--green-ink); font-weight: 700; }
.g-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 28px; }
.g-pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.g-pager a:hover { border-color: var(--teal-mist); background: #fbfdfc; }
.g-pager a small { color: var(--faint); font-size: 12.5px; }
.g-pager a span { font-weight: 700; }
.g-pager-next { text-align: end; }
.g-related { margin-top: 10px; }

/* كتلة الدليل في الرئيسية والصفحات الداخلية */
.g-strip .g-grid { grid-template-columns: repeat(3, 1fr); }
.g-strip .section-actions { margin-top: 28px; text-align: center; }
.g-readmore { margin: 28px 0 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--alt); }
.g-readmore h2 { font-size: 18px; margin-bottom: 8px; }
.g-readmore ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.g-readmore ul li::before { content: '›'; color: var(--teal); margin-inline-end: 6px; }

@media (max-width: 1180px) {
    .g-layout-3 { grid-template-columns: 260px minmax(0, 1fr); }
    .g-toc { display: none; }
    .g-toc-inline { display: block; }
    .g-grid, .g-strip .g-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .container { padding-inline: 20px; }
    .g-hero h1, .g-main h1 { font-size: 28px; }
    .g-layout, .g-layout-3 { grid-template-columns: 1fr; gap: 20px; padding-block: 20px 56px; }
    .g-aside { position: static; max-height: none; overflow: visible; }
    .g-side { display: none; }
    .g-side.is-open { display: grid; }
    .g-aside::after { content: ''; }
    .g-grid, .g-strip .g-grid { grid-template-columns: 1fr; }
    .g-pager { grid-template-columns: 1fr; }
    .g-pager-next { text-align: start; }
    .g-search kbd { display: none; }
}
