/* ==========================================================================
   SOAR Media theme — v0.1.0
   Direction: «وضوح هندسي» — clean grid, one accent, strong type.
   Tokens use the same --soar-* names as SOAR Media Core, so the dashboard
   colors apply here too. The values below are only fallbacks.
   Theme classes are prefixed .st- so nothing here touches the current pages.
   ========================================================================== */

:root {
    --soar-orange: #ff6a00;
    --soar-orange-dark: #d95600;
    --soar-orange-soft: #fff1e6;
    --soar-black: #111111;
    --soar-text: #252525;
    --soar-muted: #666666;
    --soar-bg-soft: #fafafa;
    --soar-white: #ffffff;
    --soar-border: rgba(0, 0, 0, 0.09);
    --soar-radius-sm: 12px;
    --soar-radius-md: 16px;
    --soar-radius-lg: 22px;
    --soar-container: 1180px;
    --soar-font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', Tahoma, Arial, sans-serif;

    --st-line: rgba(17, 17, 17, 0.08);
    --st-grid: rgba(17, 17, 17, 0.045);
    --st-header-offset: 96px;
}

/* ---------- Minimal base (what Astra used to give the pages) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--soar-font-family);
    color: var(--soar-text);
    background: var(--soar-white);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
img { border-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--soar-orange); outline-offset: 2px; }
.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute !important; width: 1px; word-wrap: normal !important;
}

.st-skip {
    position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100000;
    background: var(--soar-black); color: #fff; padding: 10px 16px; border-radius: 10px;
    text-decoration: none; font-weight: 600;
}
.st-skip:focus { top: 12px; }

/* ---------- Layout ---------- */
.st-wrap { width: min(var(--soar-container), calc(100% - 40px)); margin-inline: auto; }
.st-wrap-article { width: min(1120px, calc(100% - 40px)); }
.st-main { display: block; }

/* ---------- Type ---------- */
.st-h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.2vw, 48px);
    line-height: 1.3;
    font-weight: 700;
    color: var(--soar-black);
    letter-spacing: 0;
    text-wrap: balance;
}
.st-h2 { margin: 0 0 22px; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.4; font-weight: 700; color: var(--soar-black); }
.st-lead { margin: 0; max-width: 760px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.85; color: var(--soar-muted); }
.st-kicker {
    display: inline-block; margin: 0 0 12px;
    font-size: 13px; font-weight: 600; line-height: 1;
    color: var(--soar-orange-dark); text-decoration: none;
    padding: 7px 12px; border-radius: 999px; background: var(--soar-orange-soft);
}
.st-kicker:hover { background: var(--soar-orange); color: var(--soar-black); }

/* ---------- Buttons (dark text on orange: 6.3:1 contrast) ---------- */
.st-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 22px; border-radius: 999px;
    font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none;
    border: 1px solid transparent; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.st-btn:hover { transform: translateY(-1px); }
.st-btn-primary { background: var(--soar-orange); color: var(--soar-black); }
.st-btn-primary:hover { background: var(--soar-orange-dark); color: var(--soar-black); }
.st-btn-outline { background: transparent; border-color: var(--soar-black); color: var(--soar-black); }
.st-btn-outline:hover { background: var(--soar-black); color: #fff; }
.st-btn-ghost-light { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.st-btn-ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- Hero band (shared) ---------- */
.st-hero {
    position: relative;
    padding: 46px 0 50px;
    background-color: var(--soar-bg-soft);
    background-image:
        linear-gradient(var(--st-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--st-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    border-bottom: 1px solid var(--st-line);
}
.st-hero::after {
    content: ""; position: absolute; inset-inline-end: 0; bottom: -1px;
    width: min(240px, 30%); height: 3px; background: var(--soar-orange);
}

/* ---------- Breadcrumbs ---------- */
.st-crumbs { margin: 0 0 18px; font-size: 13px; color: var(--soar-muted); }
.st-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.st-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.st-crumbs li + li::before { content: "‹"; color: rgba(0, 0, 0, .3); }
.st-crumbs a { color: inherit; text-decoration: none; }
.st-crumbs a:hover { color: var(--soar-orange-dark); text-decoration: underline; }
.st-crumbs [aria-current] { color: var(--soar-text); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Meta row ---------- */
.st-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--soar-muted); }
.st-meta li { display: inline-flex; align-items: center; gap: 8px; }
.st-meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--soar-orange); }

/* ---------- Article ---------- */
.st-cover { margin-top: 32px; margin-bottom: 0; }
.st-cover img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--soar-radius-lg); border: 1px solid var(--st-line); }
.st-cover figcaption { margin-top: 10px; font-size: 13px; color: var(--soar-muted); text-align: center; }

.st-article-grid { display: block; padding: 44px 0 64px; }
.st-article-body { max-width: 760px; margin-inline: auto; min-width: 0; }
@media (min-width: 981px) {
    .st-article-grid.has-toc { display: grid; grid-template-columns: minmax(0, 760px) 260px; justify-content: space-between; gap: 56px; }
    .st-article-grid.has-toc .st-article-body { margin: 0; order: 1; }
    .st-article-grid.has-toc .st-toc { order: 2; }
}

.st-toc { margin: 0 0 28px; }
@media (min-width: 981px) {
    .st-toc { position: sticky; top: var(--st-header-offset); align-self: start; max-height: calc(100vh - var(--st-header-offset) - 24px); overflow: auto; margin: 0; }
}
.st-toc details { border: 1px solid var(--st-line); border-radius: var(--soar-radius-md); background: #fff; }
.st-toc summary { cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 15px; color: var(--soar-black); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.st-toc summary::-webkit-details-marker { display: none; }
.st-toc summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--soar-orange-dark); }
.st-toc details[open] summary::after { content: "–"; }
.st-toc ol { margin: 0; padding: 0 18px 16px; list-style: none; counter-reset: st-toc; }
.st-toc li { margin: 0; }
.st-toc a { display: block; padding: 7px 12px 7px 0; border-inline-start: 2px solid var(--st-line); padding-inline-start: 12px; font-size: 14px; line-height: 1.6; color: var(--soar-muted); text-decoration: none; }
.st-toc .st-toc-l3 a { padding-inline-start: 26px; font-size: 13px; }
.st-toc a:hover { color: var(--soar-black); }
.st-toc a.is-active { color: var(--soar-black); border-inline-start-color: var(--soar-orange); font-weight: 600; }

/* ---------- Prose ---------- */
.st-prose { font-size: 18px; line-height: 1.95; color: var(--soar-text); overflow-wrap: anywhere; }
.st-prose > :first-child { margin-top: 0; }
.st-prose p { margin: 0 0 1.25em; }
.st-prose h2, .st-prose h3, .st-prose h4 { color: var(--soar-black); font-weight: 700; scroll-margin-top: calc(var(--st-header-offset) + 8px); }
.st-prose h2 { position: relative; margin: 2.2em 0 .7em; padding-top: 18px; font-size: clamp(23px, 2.4vw, 28px); line-height: 1.45; }
.st-prose h2::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 36px; height: 3px; background: var(--soar-orange); border-radius: 3px; }
.st-prose h3 { margin: 1.8em 0 .6em; font-size: clamp(19px, 2vw, 22px); line-height: 1.5; }
.st-prose h4 { margin: 1.6em 0 .5em; font-size: 18px; }
.st-prose a { color: var(--soar-orange-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.st-prose a:hover { color: var(--soar-black); }
.st-prose strong { color: var(--soar-black); font-weight: 700; }
.st-prose ul, .st-prose ol { margin: 0 0 1.4em; padding-inline-start: 1.3em; }
.st-prose li { margin: .4em 0; padding-inline-start: .2em; }
.st-prose ul li::marker { color: var(--soar-orange); }
.st-prose ol li::marker { color: var(--soar-orange-dark); font-weight: 700; }
.st-prose blockquote { margin: 1.8em 0; padding: 20px 24px; border-inline-start: 4px solid var(--soar-orange); background: var(--soar-orange-soft); border-start-end-radius: var(--soar-radius-sm); border-end-end-radius: var(--soar-radius-sm); font-size: 19px; color: var(--soar-black); }
.st-prose blockquote p:last-child { margin: 0; }
.st-prose img { border-radius: var(--soar-radius-md); }
.st-prose figure { margin: 1.8em 0; }
.st-prose figcaption, .st-prose .wp-element-caption { margin-top: 8px; font-size: 14px; color: var(--soar-muted); text-align: center; }
.st-prose hr { border: 0; height: 1px; background: var(--st-line); margin: 2.4em 0; }
.st-prose code { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--soar-bg-soft); border: 1px solid var(--st-line); padding: 2px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.st-prose pre { direction: ltr; text-align: left; overflow: auto; background: #151515; color: #f2f2f2; padding: 18px 20px; border-radius: var(--soar-radius-md); font-size: 14px; line-height: 1.7; }
.st-prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.st-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 16px; display: block; overflow-x: auto; }
.st-prose th, .st-prose td { padding: 12px 14px; border-bottom: 1px solid var(--st-line); text-align: start; vertical-align: top; }
.st-prose th { background: var(--soar-bg-soft); color: var(--soar-black); font-weight: 700; white-space: nowrap; }
.st-prose iframe, .st-prose video { max-width: 100%; border-radius: var(--soar-radius-md); }
.st-prose .alignleft { float: left; margin: .3em 0 1em 1.4em; }
.st-prose .alignright { float: right; margin: .3em 1.4em 1em 0; }
.st-prose .aligncenter { margin-inline: auto; display: block; }

/* ---------- Tags / share ---------- */
.st-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; padding: 0; list-style: none; }
.st-tags a { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--st-line); font-size: 13px; color: var(--soar-muted); text-decoration: none; }
.st-tags a:hover { border-color: var(--soar-orange); color: var(--soar-black); }
.st-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 0; padding: 18px 0; border-top: 1px solid var(--st-line); border-bottom: 1px solid var(--st-line); font-size: 14px; }
.st-share span { color: var(--soar-muted); margin-inline-end: 4px; }
.st-share a, .st-share button { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--st-line); background: #fff; color: var(--soar-black); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.st-share a:hover, .st-share button:hover { border-color: var(--soar-black); }

/* ---------- CTA ---------- */
.st-cta {
    position: relative; overflow: hidden;
    display: grid; gap: 22px; margin: 40px 0 0; padding: 30px;
    border-radius: var(--soar-radius-lg); background: var(--soar-black); color: rgba(255, 255, 255, .78);
}
.st-cta::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to left, #000, transparent 70%);
    -webkit-mask-image: linear-gradient(to left, #000, transparent 70%);
}
.st-cta > * { position: relative; }
.st-cta-kicker { margin: 0 0 8px; color: var(--soar-orange); font-size: 13px; font-weight: 700; }
.st-cta-title { margin: 0 0 10px; color: #fff; font-size: clamp(21px, 2.4vw, 26px); line-height: 1.45; }
.st-cta p { margin: 0; line-height: 1.8; }
.st-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 760px) { .st-cta { grid-template-columns: 1fr auto; align-items: center; padding: 36px 40px; } .st-cta-actions { flex-direction: column; } }

/* ---------- Cards / grid ---------- */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.st-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--st-line); border-radius: var(--soar-radius-lg); overflow: hidden; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.st-card:hover { border-color: rgba(17, 17, 17, .18); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0, 0, 0, .07); }
.st-card-media { display: block; aspect-ratio: 16 / 9; background: var(--soar-bg-soft); overflow: hidden; }
.st-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-card-ph {
    display: grid; place-items: center; width: 100%; height: 100%;
    background-color: var(--soar-bg-soft);
    background-image: linear-gradient(var(--st-grid) 1px, transparent 1px), linear-gradient(90deg, var(--st-grid) 1px, transparent 1px);
    background-size: 28px 28px;
}
.st-card-ph img { width: 112px; height: auto; opacity: .35; filter: grayscale(1); }
.st-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.st-card-body .st-kicker { align-self: flex-start; margin-bottom: 12px; }
.st-card-title { margin: 0 0 10px; font-size: 19px; line-height: 1.55; font-weight: 700; }
.st-card-title a { color: var(--soar-black); text-decoration: none; background-image: linear-gradient(var(--soar-orange), var(--soar-orange)); background-size: 0 2px; background-repeat: no-repeat; background-position: 100% 100%; transition: background-size .25s ease; }
.st-card-title a:hover { background-size: 100% 2px; }
.st-card-excerpt { margin: 0 0 16px; font-size: 15px; line-height: 1.8; color: var(--soar-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.st-card-meta { margin-top: auto; display: flex; gap: 14px; font-size: 13px; color: var(--soar-muted); }
.st-card-meta span + span::before { content: "·"; margin-inline-end: 14px; color: var(--soar-orange); }

@media (min-width: 900px) {
    .st-card-featured { grid-column: 1 / -1; flex-direction: row; }
    .st-card-featured .st-card-media { flex: 0 0 55%; aspect-ratio: auto; min-height: 340px; }
    .st-card-featured .st-card-body { justify-content: center; padding: 36px 40px; }
    .st-card-featured .st-card-title { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.45; }
    .st-card-featured .st-card-excerpt { font-size: 17px; -webkit-line-clamp: 4; }
}

/* ---------- Archive ---------- */
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.st-chips a { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--st-line); background: #fff; color: var(--soar-text); font-size: 14px; font-weight: 600; text-decoration: none; }
.st-chips a:hover { border-color: var(--soar-black); }
.st-chips a.is-active { background: var(--soar-black); border-color: var(--soar-black); color: #fff; }
.st-archive-body { padding: 44px 0 72px; }
.st-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 44px; }
.st-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--st-line); color: var(--soar-black); text-decoration: none; font-weight: 600; }
.st-pager .page-numbers.current { background: var(--soar-black); border-color: var(--soar-black); color: #fff; }
.st-pager a.page-numbers:hover { border-color: var(--soar-black); }
.st-empty { max-width: 620px; margin: 0 auto; text-align: center; padding: 36px 0; }
.st-empty p { color: var(--soar-muted); }
.st-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

/* ---------- Related ---------- */
.st-related { padding: 56px 0 72px; background: var(--soar-bg-soft); border-top: 1px solid var(--st-line); }

/* ---------- Plain pages ---------- */
.st-page-body { padding: 44px 0 72px; }
.st-page-body .st-prose { max-width: 760px; }
.st-full > .alignfull { margin-inline: 0; }

/* ---------- Fallback header/footer (only without the plugin) ---------- */
.st-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--st-line); backdrop-filter: blur(8px); }
.st-header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.st-logo img { display: block; height: 44px; width: auto; }
.st-nav ul { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.st-nav a { color: var(--soar-black); text-decoration: none; font-weight: 600; font-size: 15px; }
.st-footer { background: var(--soar-black); color: rgba(255, 255, 255, .7); padding: 28px 0; font-size: 14px; }
.st-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
@media (max-width: 860px) { .st-nav { display: none; } }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .st-wrap, .st-wrap-article { width: calc(100% - 28px); }
    .st-hero { padding: 30px 0 34px; background-size: 28px 28px; }
    .st-prose { font-size: 17px; line-height: 1.9; }
    .st-article-grid { padding: 30px 0 48px; }
    .st-cta { padding: 24px 20px; }
    .st-cta-actions .st-btn { width: 100%; }
    .st-card-body { padding: 18px; }
    .st-crumbs [aria-current] { max-width: 24ch; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; }

@media print {
    .soarv2-header, .soarv2-footer, .st-toc, .st-share, .st-cta, .st-related, .soar-floating-contact { display: none !important; }
    .st-hero { background: none; }
    .st-prose { font-size: 12pt; }
}
