/* خريطة الفوتر: حركة */
.map-ring { fill:none; stroke:#f59e0b; stroke-width:2.5; transform-box:fill-box; transform-origin:center; animation:mapRing 2.4s ease-out infinite; opacity:0; }
@keyframes mapRing { 0%{transform:scale(.4);opacity:.95} 100%{transform:scale(4.2);opacity:0} }
.map-core { transform-box:fill-box; transform-origin:center; animation:mapCore 1.2s ease-in-out infinite; }
@keyframes mapCore { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.25;transform:scale(1.35)} }
.map-tw { animation:mapTw 3s ease-in-out infinite; }
@keyframes mapTw { 0%,100%{opacity:0} 50%{opacity:1} }
.map-arc-line { stroke:#f59e0b; stroke-width:2; stroke-dasharray:6 7; animation:mapDash 1.2s linear infinite; }
@keyframes mapDash { to { stroke-dashoffset:-26; } }
@media (prefers-reduced-motion:reduce) { .map-ring,.map-core,.map-tw,.map-arc-line { animation:none; } }
.empty-home { display:none !important; }
/* شريط الأخبار المتحرك (العلوي + البث المباشر) */
.mq { overflow:hidden; direction:ltr; position:relative; }
.mq-track { display:flex; width:max-content; animation:mqMove var(--mq-dur,60s) linear infinite; will-change:transform; }
.mq:hover .mq-track { animation-play-state:paused; }
.mq-set { display:flex; align-items:center; flex-shrink:0; direction:rtl; white-space:nowrap; }
.mq-item { padding:0 .35rem; background:none; border:0; color:inherit; font:inherit; }
button.mq-item { cursor:pointer; }
.mq-sep { opacity:.55; padding:0 .9rem; }
@keyframes mqMove { from{transform:translateX(-50%)} to{transform:translateX(0)} }
@media (prefers-reduced-motion:reduce) { .mq { overflow-x:auto; } .mq-track { animation:none; } }
html[data-mk-off] #market-section, html[data-mk-off] [data-cat="market"] { display: none !important; }
html { scroll-behavior: smooth; overflow-anchor: none; scrollbar-gutter: stable; }
/* الصفحة الرئيسية: الأقسام الثلاثة (سلع / عملات رقمية / عملات أجنبية) في مربّع واحد يتقلّب تلقائياً */
.mk-rot { display: grid; }
.mk-rot > [data-mkg] { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.mk-rot > [data-mkg].on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.mk-rot[data-mkrot="off"] { display: block; }
.mk-rot[data-mkrot="off"] > [data-mkg] { opacity: 1; visibility: visible; margin-top: 1.5rem; }
.mk-rot[data-mkrot="off"] > [data-mkg]:first-child { margin-top: 0; }
/* خلفية هادئة لكل قسم من الأسواق: رملي للمعادن والطاقة، أزرق رمادي للرقمية، أخضر مريمي للأجنبية */
.mk-panel { border-radius: .85rem; padding: .85rem 1rem 1rem; border: 1px solid var(--mk-bd); background: var(--mk-bg); --mk-ac: #a8a29e; }
.mk-p-com, .mk-p-crypto, .mk-p-fx, .mk-p-food { --mk-bg: #cfe7d9; --mk-bd: #a9d0b9; --mk-ac: #5fa27f; --mk-card: #e8f5ee; }
.dark .mk-p-com, .dark .mk-p-crypto, .dark .mk-p-fx, .dark .mk-p-food { --mk-bg: #152a21; --mk-bd: #264a39; --mk-ac: #4a8068; --mk-card: #1c3a2d; }
.mk-panel [data-mk] { background: var(--mk-card) !important; border-color: var(--mk-bd) !important; }
.mk-panel [data-mk] { border-top-color: var(--mk-ac) !important; }
.mk-panel .mk-head { border-bottom-color: var(--mk-ac) !important; }
.mk-panel .mk-head > div:first-child > span:first-child { background: var(--mk-ac) !important; }
html:not(.dark) .mk-panel [data-mk] .font-semibold, html:not(.dark) .mk-panel [data-mk] .mk-price { color: #0c0a09; }
.mk-tag { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mk-tag.mk-ok, .mk-tag.mk-warn { font-size: 0 !important; line-height: 1; } .mk-tag.mk-ok::before, .mk-tag.mk-warn::before { content: '●'; font-size: 10px; }
.mk-panel .grid { grid-auto-rows: 1fr; }
.mk-rot > .mk-inner { display: none; }
body[data-view="market"] .mk-rot > .mk-inner { display: block; }
.mk-dots { display: inline-flex; gap: 5px; align-items: center; }
.mk-dots i { width: 7px; height: 7px; border-radius: 999px; background: #d6d3d1; cursor: pointer; transition: background .3s, width .3s; }
.mk-dots i.on { background: #b45309; width: 18px; }
/* صفحة البورصة: الأقسام الثلاثة ظاهرة معاً، وشريط العاجل والأقسام ثابتان فوق، بلا فوتر */
body[data-view="market"] .mk-rot { display: block; }
body[data-view="market"] .mk-rot > [data-mkg] { opacity: 1; visibility: visible; transition: none; margin-top: .55rem; padding: .5rem .75rem .65rem; }
body[data-view="market"] .mk-rot > [data-mkg]:first-child { margin-top: 0; }
body[data-view="market"] .mk-more, body[data-view="market"] .mk-dots { display: none; }
body[data-view="market"] footer { display: none; }
body[data-view="market"] main { padding-top: .75rem; padding-bottom: .75rem; }
/* صفحة البورصة: ثلاثة أعمدة (الأسواق العالمية يميناً، الرقمية بالوسط، الأجنبية يساراً)، كل عنصر بسطر واحد */
body[data-view="market"] .mk-rot { max-width: none; margin-inline: auto; --mk-row: clamp(40px, calc((100vh - 320px) / 10), 56px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
@supports (height: 100svh) { body[data-view="market"] .mk-rot { --mk-row: clamp(40px, calc((100svh - 320px) / 10), 56px); } }
body[data-view="market"] .mk-rot > [data-mkg] { grid-area: auto; margin-top: 0; padding: .55rem .55rem .65rem; display: flex; flex-direction: column; min-width: 0; }
body[data-view="market"] #market-section .mk-head { flex: none; height: 2.4rem; flex-wrap: nowrap; overflow: hidden; }
body[data-view="market"] #market-section .mk-head > div { min-width: 0; flex-wrap: nowrap; }
body[data-view="market"] #market-section .mk-head > div:first-child { flex: 1 1 auto; overflow: hidden; }
body[data-view="market"] #market-section .mk-head > div:last-child { flex: none; }
body[data-view="market"] #market-section .mk-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.95rem, 1.25vw, 1.15rem); }
body[data-view="market"] #market-section .mk-head button { white-space: nowrap; padding: .2rem .45rem; font-size: 11px; }
body[data-view="market"] #market-section .grid { grid-template-columns: 1fr !important; grid-auto-rows: minmax(var(--mk-row), 1fr); gap: .3rem; flex: 1 1 auto; }
body[data-view="market"] #market-section [data-mk] { display: flex; flex-direction: row !important; align-items: center; gap: .45rem; height: 100%; padding: .3rem .65rem; border-top-width: 1px !important; border-right: 3px solid var(--mk-ac) !important; border-radius: .5rem; }
body[data-view="market"] #market-section [data-mk] > div:first-child { flex: 1 1 auto; min-width: 0; }
body[data-view="market"] #market-section [data-mk] > div:first-child .font-semibold { font-size: 14px; gap: .45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-view="market"] #market-section [data-mk] > div:first-child .w-6 { width: 1.75rem; height: 1.75rem; font-size: 13px; flex: none; }
body[data-view="market"] #market-section [data-mk] .mk-price { font-size: 17px; line-height: 1.2; flex: none; min-width: 5.6rem; text-align: left; }
body[data-view="market"] #market-section [data-mk] > div:nth-child(3) { flex: none; min-width: 3.9rem; justify-content: flex-end; }
body[data-view="market"] #market-section [data-mk] .mk-unit, body[data-view="market"] #market-section [data-mk] .mk-time { display: none; }
body[data-view="market"] #market-section [data-mk] .mk-chg { font-size: 12.5px; }
body[data-view="market"] #market-section .mk-head > div:first-child > span.text-xs { display: none; }
body[data-view="market"] #market-section .mk-head h2 { font-size: 1.4rem; }
body[data-view="market"] #market-status { margin-top: .5rem; font-size: 10px; }
/* أربعة أعمدة على الشاشات الكبيرة: كل بطاقة بسطرين (الاسم فوق، والسعر والتغيّر تحت) */
@media (min-width: 1024px) and (max-width: 1179px) { body[data-view="market"] #market-section .mk-head .mk-lt { display: none; } }
@media (min-width: 1024px) {
  body[data-view="market"] #market-section .mk-head h2 { font-size: clamp(.95rem, 1.25vw, 1.15rem); }
  body[data-view="market"] #market-section [data-mk] { display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 0 .4rem; padding: .1rem .6rem; }
  body[data-view="market"] #market-section [data-mk] > div:first-child { grid-column: 1 / -1; }
  body[data-view="market"] #market-section [data-mk] > div:first-child .font-semibold { font-size: 13px; }
  body[data-view="market"] #market-section [data-mk] > div:first-child .w-6 { width: 1.3rem; height: 1.3rem; font-size: 11px; }
  body[data-view="market"] #market-section [data-mk] > div:first-child { line-height: 1.1; }
  body[data-view="market"] #market-section [data-mk] > div:first-child .font-semibold { line-height: 1.1; }
  body[data-view="market"] #market-section [data-mk] .mk-price { grid-column: 1; min-width: 0; font-size: 16px; line-height: 1.15; text-align: right; }
  body[data-view="market"] #market-section [data-mk] > div:nth-child(3) { grid-column: 2; min-width: 0; }
  body[data-view="market"] #market-section [data-mk] .mk-chg { font-size: 12px; }
  body[data-view="market"] .mk-rot { --mk-row: clamp(40px, calc((100vh - 320px) / 10), 54px); }
  @supports (height: 100svh) { body[data-view="market"] .mk-rot { --mk-row: clamp(40px, calc((100svh - 320px) / 10), 54px); } }
}
@media (min-width: 1024px) and (max-width: 1199px) {
}
/* الموبايل والشاشات الضيقة: قسم واحد ظاهر بالمرة مع أزرار تبديل فوق */
.mk-tabs { display: none; }
@media (max-width: 1023px) {
  body[data-view="market"] .mk-rot { display: block; }
  body[data-view="market"] .mk-rot { --mk-row: clamp(38px, calc((100vh - 350px) / 10), 52px); }
  @supports (height: 100svh) { body[data-view="market"] .mk-rot { --mk-row: clamp(38px, calc((100svh - 350px) / 10), 52px); } }
  body[data-view="market"] .mk-rot > [data-mkg]:not(.on) { display: none; }
  body[data-view="market"] .mk-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-bottom: .5rem; }
  .mk-tabs button { font-size: 11px; line-height: 1.25; font-weight: 800; padding: .4rem .15rem; border-radius: .6rem; border: 1px solid #a9d0b9; background: #e8f5ee; color: #14532d; }
  .mk-tabs button.on { background: #5fa27f; color: #fff; border-color: #5fa27f; }
  .dark .mk-tabs button { background: #1c3a2d; border-color: #264a39; color: #bbf7d0; }
  .dark .mk-tabs button.on { background: #4a8068; color: #fff; }
}
@media (max-width: 480px) {
  body[data-view="market"] #market-section [data-mk] > div:first-child .font-semibold { font-size: 13px; gap: .35rem; }
  body[data-view="market"] #market-section [data-mk] > div:first-child .w-6 { width: 1.5rem; height: 1.5rem; font-size: 12px; }
  body[data-view="market"] #market-section [data-mk] .mk-price { min-width: 5.2rem; font-size: 15px; }
  body[data-view="market"] #market-section [data-mk] > div:nth-child(3) { min-width: 3.7rem; }
  body[data-view="market"] #market-section [data-mk] .mk-chg { font-size: 11.5px; }
  body[data-view="market"] #market-section [data-mk] { gap: .4rem; padding: .3rem .55rem; }
}
body[data-view="market"] #market-section .mk-head { margin-bottom: .5rem; padding-bottom: .25rem; }
body[data-view="market"] #breaking-bar { position: sticky; top: var(--hdr-h, 84px); z-index: 39; }
body { overflow-anchor: none; }
body[data-view="contact"] main { padding-top: .75rem; padding-bottom: .75rem; }
footer { contain: layout paint; }
html.is-scrolling .mq-track, html.is-scrolling footer svg * { animation-play-state: paused !important; }
footer svg { overflow: hidden; }
body { font-family: 'Cairo','Tajawal',sans-serif; background-color:#faf8f5; color:#1c1917; -webkit-font-smoothing:antialiased; }
.dark body { background-color:#0c0a09; color:#f5f5f4; }
.brand-logo.brand-ar { font-family:Cairo,Tahoma,sans-serif; font-weight:900; letter-spacing:0; word-spacing:normal; text-transform:none; }
.brand-logo { font-family:'Libre Baskerville','Baskerville','Times New Roman',Times,serif; font-weight:400; letter-spacing:.1em; word-spacing:-.3em; text-transform:uppercase; line-height:1; }
.font-editorial { font-family:'Amiri',serif; }
.card-img { transition: transform .5s ease; }
.card:hover .card-img { transform: scale(1.05); }
.article-body p { margin-bottom: 1rem; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:#f5f5f4; }
::-webkit-scrollbar-thumb { background:#d6d3d1; border-radius:3px; }
#main-nav { scrollbar-width: none; } #main-nav::-webkit-scrollbar { display:none; }
.ib { min-width:2rem; height:2rem; padding:0 .55rem; display:inline-flex; align-items:center; justify-content:center; gap:.25rem; border-radius:.5rem; background:#f5f5f4; font-size:.85rem; font-weight:700; transition:background .2s; }
.ib:hover { background:#e7e5e4; } .dark .ib { background:#292524; } .dark .ib:hover { background:#44403c; }
.reveal { opacity:0; transition:opacity .6s ease; } .reveal.in { opacity:1; transform:none; }
@keyframes liveDot { 0%,100%{opacity:1} 50%{opacity:.35} }
.live-dot { animation: liveDot 1.2s infinite; }
/* حفظ المقال كـ PDF: طباعة المقال المفتوح فقط */
@media print {
  .no-print { display:none !important; }
  body.print-article > *:not(#article-modal) { display:none !important; }
  body.print-article, body.print-article #article-modal, body.print-article #article-modal * { background:#fff !important; color:#000 !important; box-shadow:none !important; }
  body.print-article #article-modal { position:static !important; display:block !important; padding:0 !important; }
  body.print-article .modal-card, body.print-article .modal-scroll { max-height:none !important; overflow:visible !important; border:0 !important; }
  body.print-article #modal-img { max-height:340px; object-fit:cover; }
}
/* عرض الصور المتحرك للخبر الرئيسي: انتقال بطيء وهادئ */
.hero-slide { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; z-index:0; transition:opacity 1.8s ease-in-out; }
.hero-slide.prev { opacity:1; z-index:1; transition:none; }
.hero-slide.on { opacity:1; z-index:2; }
#hero-caption { transition:opacity .7s ease; }
.hero-dot { height:.5rem; width:.5rem; border-radius:9999px; background:rgba(255,255,255,.55); transition:width .5s ease, background-color .5s ease; }
.hero-dot.on { width:1.5rem; background:#fff; }
@media (prefers-reduced-motion: reduce) { .hero-slide, #hero-caption, .hero-dot { transition:none; } }

/* بطاقات الأقسام المتقلبة: كل مربع يتبدّل ببطء بين أخبار القسم (الصورة والخبر معاً) */
.slot { display:grid; }
.slot > .card { grid-area:1/1; opacity:0; visibility:hidden; pointer-events:none; transition:opacity 1.8s ease-in-out, visibility 0s linear 1.8s, transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.slot > .card.on { opacity:1; visibility:visible; pointer-events:auto; transition:opacity 1.8s ease-in-out, visibility 0s, transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
@media (prefers-reduced-motion: reduce) { .slot > .card, .slot > .card.on { transition:none; } }
