/*
 * Dawri Pro illustrated guide (/guide/pro). Builds on site.css tokens; logical properties for RTL/LTR.
 * The @media print part lays the same page out as the A4 PDF (cover page, one chapter per page start).
 */
main.page.guide-pro-main { padding-top: 0; max-width: none; padding-inline: 0; }
.gp { --gp-max: 1200px; color: var(--ink); }
html[lang="ar"] .gp, .gp[lang="ar"] { font-family: var(--font-arabic); line-height: 1.8; }
.gp[lang="fr"] { font-family: var(--font-latin); }

/* ---------- Cover ---------- */
.gp-cover {
    position: relative; overflow: hidden; color: #e6f2f0;
    background:
        radial-gradient(800px 420px at 90% -10%, rgba(45, 212, 191, .28), transparent 70%),
        radial-gradient(700px 380px at -10% 110%, rgba(251, 191, 36, .16), transparent 70%),
        linear-gradient(160deg, var(--brand-950) 0%, var(--brand-900) 55%, var(--brand-800) 100%);
    padding: clamp(24px, 4vw, 40px) max(var(--gutter), calc((100% - var(--gp-max)) / 2)) clamp(28px, 4vw, 44px);
}
.gp-cover-top, .gp-cover-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gp-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.35rem; color: #fff; }
.gp-brand img { width: 44px; height: 44px; border-radius: 12px; }
.gp-brand b { color: var(--accent); }
.gp-edition { font-size: .9rem; color: #a9c2be; border: 1px solid rgba(255, 255, 255, .18); padding: 4px 12px; border-radius: 999px; }
.gp-cover-body { display: grid; gap: clamp(24px, 4vw, 48px); align-items: center; padding-block: clamp(28px, 5vw, 56px); grid-template-columns: 1fr; }
.gp-cover .eyebrow { color: var(--brand-200); }
.gp-cover h1 { color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); margin-bottom: 16px; }
.gp-lead { font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: #d5e9e6; max-width: 620px; }
.gp-audience { font-size: .92rem; color: #9fc3bd; max-width: 620px; }
.gp-pdf { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.gp-size { font-weight: 500; opacity: .75; }
.gp-cover-shot { margin: 0; }
.gp-cover-shot img { width: 100%; border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .15); }
.gp-cover-foot { border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 18px; justify-content: flex-start; font-size: .95rem; color: #c6d6d3; }
.gp-nextbit { height: 48px; width: auto; }
@media (min-width: 980px) {
    .gp-cover-body { grid-template-columns: 1.05fr 1fr; }
    .gp-cover-shot img { transform: perspective(1600px) rotateY(-8deg); }
    [dir="rtl"] .gp-cover-shot img { transform: perspective(1600px) rotateY(8deg); }
}

/* ---------- Layout ---------- */
.gp-layout { max-width: var(--gp-max); margin-inline: auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 40px; display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .gp-layout { grid-template-columns: 250px minmax(0, 1fr); } }
.gp-aside { display: none; }
@media (min-width: 1100px) { .gp-aside { display: block; } }
.gp-aside nav { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: .92rem; }
.gp-aside-title { font-weight: 700; color: var(--muted); margin: 4px 10px 8px; font-size: .85rem; }
.gp-aside ol { list-style: none; margin: 0; padding: 0; }
.gp-aside a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 550; line-height: 1.35; }
.gp-aside a:hover { background: var(--brand-50); color: var(--brand-800); }
.gp-aside a span { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--brand-50); color: var(--brand); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.gp-article { min-width: 0; }

/* ---------- TOC ---------- */
.page:not(.home) .gp-toc h2 { margin-top: 0; }
.gp-toc-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.gp-toc-grid a { display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 650; line-height: 1.35; transition: border-color .15s, box-shadow .15s; }
.gp-toc-grid a:hover { border-color: #b7d9d5; box-shadow: var(--shadow); }
.gp-toc-n { font-weight: 800; color: var(--brand-600); font-variant-numeric: tabular-nums; }
.gp-toc-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.gp-toc-ic .icon { width: 20px; height: 20px; }

/* ---------- Chapters ---------- */
.gp-chapter { margin-top: clamp(48px, 7vw, 80px); scroll-margin-top: calc(var(--header-h) + 16px); }
.gp-ch-head { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 18px; margin-bottom: 8px; border-bottom: 2px solid var(--brand-100); }
.gp-ch-n { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); box-shadow: 0 10px 24px -10px rgba(15, 118, 110, .7); font-family: var(--font-latin); }
.gp-ch-head .eyebrow { margin-bottom: 4px; }
.page:not(.home) .gp-ch-head h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem); }
.gp-ch-lead { margin: 0; color: var(--ink-2); font-size: 1.08rem; max-width: 760px; }
.gp h3 { margin: 30px 0 10px; font-size: 1.2rem; color: var(--brand-900); }
.gp p { max-width: 820px; }

.gp-steps { list-style: none; counter-reset: s; margin: 12px 0 18px; padding: 0; display: grid; gap: 10px; max-width: 860px; }
.gp-steps li { counter-increment: s; position: relative; padding-inline-start: 46px; min-height: 32px; padding-top: 3px; }
.gp-steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: .95rem; display: grid; place-items: center; font-family: var(--font-latin); }
.gp-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 36px; bottom: -8px; width: 2px; background: var(--brand-100); }
.gp-list { margin: 10px 0 18px; padding-inline-start: 22px; max-width: 860px; }
.gp-list li { margin: 6px 0; }
.gp-list li::marker { color: var(--brand); }

.gp-defs { margin: 14px 0 22px; display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.gp-defs > div { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 16px; padding: 12px 16px; }
.gp-defs > div + div { border-top: 1px solid var(--line); }
.gp-defs > div:nth-child(odd) { background: #fbfdfc; }
.gp-defs dt { font-weight: 700; color: var(--brand-900); }
.gp-defs dd { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { .gp-defs > div { grid-template-columns: 1fr; gap: 2px; } }

/* Figures: a light window frame around each screenshot */
.gp-fig { margin: 22px 0 26px; }
.gp-frame { position: relative; border-radius: 12px; border: 1px solid #d5dee6; background: #fff; box-shadow: var(--shadow); overflow: hidden; padding-top: 22px; }
.gp-frame::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 22px; background: #eef2f4; border-bottom: 1px solid #dfe5ea; }
.gp-frame::after { content: ""; position: absolute; top: 7px; inset-inline-start: 12px; width: 8px; height: 8px; border-radius: 50%; background: #f87171; box-shadow: 14px 0 0 #fbbf24, 28px 0 0 #34d399; }
[dir="rtl"] .gp-frame::after { box-shadow: -14px 0 0 #fbbf24, -28px 0 0 #34d399; }
.gp-frame img { display: block; width: 100%; }
.gp-fig figcaption { margin-top: 10px; font-size: .92rem; color: var(--muted); }
.gp-fig figcaption b { color: var(--brand-800); margin-inline-end: 6px; }
.gp-fig-md { max-width: 620px; }
.gp-fig-sm { max-width: 440px; }
.gp-figs { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .gp-figs { grid-template-columns: 1.4fr 1fr; } }
.gp-figs .gp-fig { margin: 12px 0; }

/* Callouts */
.gp-callout { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0; padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid; max-width: 860px; }
.gp-callout-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.gp-callout-ic .icon { width: 20px; height: 20px; }
.gp-callout b { margin-inline-end: 4px; }
.gp-tip { background: #fffbeb; border-color: #fde68a; }
.gp-tip .gp-callout-ic { background: var(--accent); color: #422006; }
.gp-tip b { color: #92400e; }
.gp-note { background: var(--brand-50); border-color: #b7e4dd; }
.gp-note .gp-callout-ic { background: var(--brand); color: #fff; }
.gp-note b { color: var(--brand-800); }
.gp-warn { background: #fef2f2; border-color: #fecaca; }
.gp-warn .gp-callout-ic { background: #dc2626; color: #fff; }
.gp-warn b { color: #991b1b; }

/* FAQ */
.gp-faq { display: grid; gap: 12px; margin: 14px 0 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.gp-faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.gp-faq-item h4 { margin: 0 0 6px; font-size: 1.02rem; color: var(--brand-900); }
.gp-faq-item p { margin: 0; color: var(--ink-2); }

/* Apps (download cards) */
.gp-apps { display: grid; gap: 16px; margin: 18px 0 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gp-app { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.gp-app-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 10px; }
.gp-app h4 { margin: 0 0 2px; font-size: 1.05rem; }
.gp-app p { margin: 0 auto 10px; color: var(--muted); font-size: .9rem; }
.gp-qr { display: block; width: 132px; height: 132px; margin: 0 auto 8px; }
.gp-qr svg { width: 100%; height: 100%; }
.gp-app-link { font-size: .85rem; font-weight: 650; word-break: break-all; }

/* Benefits (last chapter) */
.gp-benefits .gp-ch-n { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 10px 24px -10px rgba(180, 83, 9, .6); }
.gp-cards { display: grid; gap: 16px; margin: 20px 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border-top: 4px solid var(--brand-600); }
.gp-card:nth-child(4n+2) { border-top-color: var(--accent); }
.gp-card:nth-child(4n+3) { border-top-color: #2563eb; }
.gp-card:nth-child(4n+4) { border-top-color: var(--brand-800); }
.gp-card-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.gp-card h4 { margin: 0 0 6px; font-size: 1.08rem; }
.gp-card p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.gp-top { margin-top: 18px; font-size: .9rem; }
.gp-top a { text-decoration: none; }

/* Closing */
.gp-outro { margin-top: 64px; display: grid; gap: 24px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow-sm); }
@media (min-width: 860px) { .gp-outro { grid-template-columns: 1.6fr 1fr; } }
.page:not(.home) .gp-outro h2 { margin-top: 0; font-size: 1.5rem; }
.gp-nb-line { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.gp-outro-brand { display: grid; justify-items: center; gap: 8px; color: var(--muted); font-weight: 600; text-align: center; }
.gp-outro-brand img { width: 220px; height: auto; }

/* =================================================================
   Print / PDF (A4)
   ================================================================= */
@page { size: A4; margin: 14mm 13mm 16mm; }
@page :first { margin: 0; }
@media print {
    html, body { background: #fff !important; }
    body { font-size: 10.5pt; }
    html[lang="ar"] body { line-height: 1.7; }
    .site-header, .site-footer, .skip-link, .no-print { display: none !important; }
    main.page.guide-pro-main { padding: 0; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; text-decoration: none; }

    .gp-cover { height: 297mm; padding: 16mm 15mm 14mm; display: flex; flex-direction: column; break-after: page; }
    .gp-cover-body { flex: 1; grid-template-columns: 1fr; align-content: center; gap: 12mm; padding-block: 8mm; }
    .gp-cover h1 { font-size: 34pt; }
    .gp-lead { font-size: 13pt; max-width: none; }
    .gp-audience { font-size: 10pt; max-width: none; }
    .gp-cover-shot img { transform: none !important; max-height: 105mm; width: auto; max-width: 100%; margin-inline: auto; display: block; }
    .gp-nextbit { height: 46px; }

    .gp-layout { display: block; padding: 0; max-width: none; }
    .gp-toc { break-after: page; }
    .gp-toc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .gp-toc-grid a { padding: 9px 12px; box-shadow: none; }

    .gp-chapter { margin-top: 0; break-before: page; }
    .gp-ch-head { break-after: avoid; }
    .gp-ch-n { width: 48px; height: 48px; font-size: 1.25rem; border-radius: 14px; box-shadow: none; }
    .page:not(.home) .gp-ch-head h2 { font-size: 20pt; }
    .gp h3 { break-after: avoid; margin-top: 16px; }
    .gp-steps li, .gp-defs > div, .gp-callout, .gp-faq-item, .gp-card, .gp-app { break-inside: avoid; }
    .gp-steps li::after { display: none; }
    .gp-fig { break-inside: avoid; margin: 12px 0 14px; }
    .gp-frame { box-shadow: none; }
    .gp-frame img { max-height: 150mm; width: auto; max-width: 100%; margin-inline: auto; }
    .gp-fig-full .gp-frame { width: fit-content; max-width: 100%; margin-inline: auto; }
    .gp-figs { grid-template-columns: 1.4fr 1fr; }
    .gp-faq, .gp-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
    .gp-apps { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .gp-card, .gp-app, .gp-faq-item { box-shadow: none; padding: 12px; }
    .gp-outro { break-inside: avoid; box-shadow: none; margin-top: 18mm; }
}
