/* ═══════════ مدونة راية — الواجهة العامة ═══════════ */
@font-face { font-family: 'Qatar2022'; src: url('fonts/Qatar2022-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Qatar2022'; src: url('fonts/Qatar2022-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --teal: #149193;
  --teal-dark: #07444A;
  --teal-ink: #0b3438;
  --gold: #C8A24E;
  --gold-soft: #f6eedb;
  --bg: #f7f9f9;
  --card: #ffffff;
  --text: #1d2b2d;
  --muted: #5d7073;
  --line: #e2eaea;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(7,68,74,.05), 0 8px 24px rgba(7,68,74,.07);
  --font: 'Qatar2022', 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--teal-dark); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; color: #fff; }

/* ── الرأس ── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--teal-dark); }
.brand img { height: 44px; width: auto; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--teal); color: #fff; font: 800 22px/1 var(--font); position: relative; }
.brand-mark::after { content: ''; position: absolute; width: 16px; height: 3px; background: var(--gold); border-radius: 3px; bottom: 8px; inset-inline-start: -6px; transform: rotate(-20deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 20px; font-weight: 800; }
.brand-text small { font-size: 11px; color: var(--teal); }
.brand-blog { font-size: 13px; font-weight: 700; color: var(--gold); border-inline-start: 2px solid var(--line); padding-inline-start: 10px; margin-inline-start: 2px; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 10px; color: var(--teal-dark); font-weight: 500; font-size: 15px; }
.main-nav a:hover, .main-nav a[aria-current] { background: #eef6f6; }
.btn-gold { display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: #fff !important; font-weight: 700; padding: 9px 18px; border-radius: 12px; transition: transform .15s, box-shadow .15s; }
.btn-gold:hover { background: #b8913d !important; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(200,162,78,.35); }
.btn-lg { padding: 14px 26px; font-size: 17px; white-space: nowrap; }
@media (max-width: 640px) {
  .main-nav a:not(.btn-gold):not([aria-current]) { display: none; }
  .main-nav a[aria-current] { display: none; }
  .brand-blog { display: none; }
}

/* ── الواجهة الرئيسية (Hero) ── */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 100% 0%, var(--teal) 0%, var(--teal-dark) 55%, #052f33 100%); color: #fff; padding: 64px 0 72px; }
.hero-sm { padding: 40px 0 44px; }
.hero-trail { position: absolute; inset-inline-start: -40px; bottom: 0; width: min(720px, 90%); opacity: .55; pointer-events: none; }
.hero-trail path { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 8 10; stroke-linecap: round; }
.hero-inner { position: relative; }
.eyebrow { display: inline-block; margin: 0 0 10px; color: var(--gold); font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 46px); line-height: 1.3; font-weight: 800; max-width: 760px; }
.hero .lead { margin: 0 0 26px; font-size: clamp(16px, 2.2vw, 19px); color: #d3ecec; max-width: 640px; }
.hero .crumbs a, .hero .crumbs { color: #bfe3e3; }
.search { display: flex; gap: 8px; max-width: 560px; background: #fff; padding: 6px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.search input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: 16px; padding: 10px 12px; background: transparent; color: var(--text); }
.search input:focus { outline: none; }
.search button { border: 0; font: inherit; font-weight: 700; background: var(--teal); color: #fff; padding: 10px 20px; border-radius: 12px; cursor: pointer; }
.search button:hover { background: var(--teal-dark); }

/* ── الأقسام ── */
.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-top: 22px; padding-bottom: 4px; scrollbar-width: none; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pills a { flex: none; padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--teal-dark); font-weight: 500; font-size: 15px; }
.cat-pills a small { color: var(--muted); font-size: 12px; }
.cat-pills a.active, .cat-pills a:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.cat-pills a.active small, .cat-pills a:hover small { color: #a9d6d6; }

/* ── البطاقات ── */
.listing { padding-top: 26px; padding-bottom: 20px; }
.section-title { font-size: 22px; margin: 34px 0 16px; color: var(--teal-dark); display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 6px; height: 22px; background: var(--gold); border-radius: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(7,68,74,.06), 0 16px 36px rgba(7,68,74,.12); }
.card-media { display: block; aspect-ratio: 16/9; background: linear-gradient(135deg, #dff0f0, #f4ecd9); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-ph { display: grid; place-items: center; height: 100%; font-size: 42px; color: var(--teal); opacity: .45; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.chip { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--teal-dark); background: var(--gold-soft); padding: 3px 12px; border-radius: 999px; }
.card-title { margin: 0; font-size: 19px; line-height: 1.5; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--teal); }
.card-excerpt { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: auto; display: flex; gap: 6px; color: var(--muted); font-size: 13px; padding-top: 6px; }
.card-featured { display: grid; grid-template-columns: 1.25fr 1fr; }
.card-featured .card-media { aspect-ratio: auto; min-height: 340px; }
.card-featured .card-body { padding: 32px; justify-content: center; }
.card-featured .card-title { font-size: clamp(22px, 3vw, 30px); }
.card-featured .card-excerpt { -webkit-line-clamp: 4; font-size: 16px; }
@media (max-width: 820px) {
  .card-featured { grid-template-columns: 1fr; }
  .card-featured .card-media { min-height: 0; aspect-ratio: 16/9; }
  .card-featured .card-body { padding: 20px; }
}
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); background: #fff; border-radius: var(--radius); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 34px 0 10px; color: var(--muted); }
.pager a { background: #fff; border: 1px solid var(--line); padding: 9px 18px; border-radius: 12px; font-weight: 700; }
.pager a:hover { border-color: var(--teal); }

/* ── دعوة للتواصل ── */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 36px 0; padding: 28px; border-radius: var(--radius); background: linear-gradient(120deg, var(--teal-dark), var(--teal)); color: #fff; position: relative; overflow: hidden; }
.cta::after { content: '✈'; position: absolute; inset-inline-end: 22%; top: -14px; font-size: 90px; opacity: .08; transform: rotate(-15deg); }
.cta h2 { margin: 0 0 4px; font-size: 22px; }
.cta p { margin: 0; color: #d3ecec; }

/* ── صفحة المقال ── */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .1s linear; }
.preview-bar { background: #fff4d6; color: #7a5a12; text-align: center; padding: 8px; font-weight: 700; font-size: 14px; }
.post-head { padding: 38px 0 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--teal); font-weight: 500; }
.post-head h1 { margin: 0 0 14px; font-size: clamp(27px, 4.6vw, 42px); line-height: 1.35; color: var(--teal-ink); font-weight: 800; }
.post-lead { margin: 0 0 18px; font-size: 19px; color: var(--muted); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.post-meta b { color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; }
.dot { opacity: .5; }
.post-cover { margin: 6px auto 0; }
.post-cover img { width: 100%; border-radius: 22px; aspect-ratio: 16/9; object-fit: cover; box-shadow: var(--shadow); }
.post-body { padding-top: 30px; padding-bottom: 10px; }

.keypoints { background: var(--gold-soft); border-inline-start: 5px solid var(--gold); border-radius: 14px; padding: 18px 22px; margin-bottom: 26px; }
.keypoints h2 { margin: 0 0 8px; font-size: 18px; color: var(--teal-dark); }
.keypoints ul { margin: 0; padding-inline-start: 20px; }
.keypoints li { margin: 4px 0; }
.toc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 20px; margin-bottom: 28px; }
.toc summary { cursor: pointer; font-weight: 800; color: var(--teal-dark); }
.toc ol { margin: 10px 0 4px; padding-inline-start: 22px; }
.toc li { margin: 5px 0; }
.toc li.lvl-3 { margin-inline-start: 18px; list-style: circle; font-size: 15px; }

.content { font-size: 18px; line-height: 1.95; overflow-wrap: anywhere; }
.content > *:first-child { margin-top: 0; }
.content h2 { font-size: 26px; color: var(--teal-dark); margin: 42px 0 12px; line-height: 1.45; }
.content h3 { font-size: 21px; color: var(--teal-ink); margin: 32px 0 10px; }
.content h4 { font-size: 18px; margin: 26px 0 8px; }
.content p { margin: 0 0 18px; }
.content a { text-decoration: underline; text-decoration-color: rgba(20,145,147,.35); text-underline-offset: 4px; }
.content img { border-radius: 14px; margin: 22px auto; }
.content ul, .content ol { padding-inline-start: 26px; margin: 0 0 18px; }
.content li { margin: 6px 0; }
.content li::marker { color: var(--teal); font-weight: 700; }
.content blockquote { margin: 24px 0; padding: 16px 22px; background: #eef6f6; border-inline-start: 4px solid var(--teal); border-radius: 12px; color: var(--teal-ink); }
.content hr { border: 0; height: 1px; background: var(--line); margin: 32px 0; }
.content pre { background: #0b3438; color: #e8f4f4; padding: 16px; border-radius: 12px; overflow-x: auto; direction: ltr; text-align: left; font-size: 14px; }
.content code { background: #eef6f6; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.content pre code { background: none; padding: 0; }
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: 12px; }
.content table { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; }
.content th, .content td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; }
.content th { background: #eef6f6; color: var(--teal-dark); }
.content .ql-align-center { text-align: center; }
.content .ql-align-left { text-align: left; }
.content .ql-align-justify { text-align: justify; }
.content .ql-direction-rtl { direction: rtl; }

.faq { margin-top: 40px; }
.faq h2 { font-size: 24px; color: var(--teal-dark); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; }
.tags a { background: #eef6f6; color: var(--teal-dark); padding: 5px 12px; border-radius: 999px; font-size: 14px; }
.tags a:hover { background: var(--teal); color: #fff; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; }
.share span { color: var(--muted); font-weight: 700; }
.share a, .share button { border: 1px solid var(--line); background: #fff; color: var(--teal-dark); padding: 6px 14px; border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--teal); }
.cta-post { margin-top: 34px; }
.related { padding-bottom: 30px; }

/* ── 404 ── */
.notfound { text-align: center; padding: 70px 16px 30px; }
.nf-code { font-size: 96px; font-weight: 800; color: var(--teal); line-height: 1; }
.notfound h1 { color: var(--teal-dark); }
.notfound .search { margin: 24px auto 30px; }

/* ── التذييل ── */
.site-footer { background: var(--teal-dark); color: #cfe6e6; margin-top: 50px; padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.f-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 19px; margin-bottom: 8px; }
.f-title { color: var(--gold); font-size: 16px; margin: 4px 0 10px; }
.f-links { list-style: none; margin: 0; padding: 0; }
.f-links li { margin: 6px 0; }
.f-links a, .f-bottom a { color: #cfe6e6; }
.f-links a:hover, .f-bottom a:hover { color: #fff; }
.site-footer .muted { color: #9cc4c4; }
.f-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 16px; padding-bottom: 22px; font-size: 14px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .share, .cta, .related, .progress, .toc { display: none !important; } body { background: #fff; } }
