/* =========================================================================
   YEHEMAK — إعادة التصميم
   متغيّرات الثيم + هيكل الصفحة (topbar / header / nav / breaking / footer / drawer)
   مستخرجة من التصميم: YEHEMAK Redesign.dc.html
   ========================================================================= */

/* ---- الثيم النهاري (الافتراضي) ---- */
.yh-root,
.yh-root[data-theme="light"] {
  --bg: #eef1f6;
  --page: #ffffff;
  --surface-2: #f3f5f8;
  --text: #14223b;
  --text-light: #ffff;
  --muted: #5b6b82;
  --muted-2: #8a97ab;
  --border: #eef1f5;
  --topbar: #0f2342;
  --topbar-text: #9fb3d1;
  --nav: #13294b;
  --nav-text: #d7e0ee;
  --accent: #ef7d00;
  --headline: #0f2342;
  --card: #ffffff;
  --card-border: #eef1f5;
  --tag-bg: #e7952c;
  --logo-bg: #13294b;
}

/* ---- الثيم الليلي ---- */
.yh-root[data-theme="dark"] {
  --bg: #060c16;
  --page: #0b1422;
  --surface-2: #1b2c46;
  --text: #e7eef8;
  --muted: #9fb1c9;
  --muted-2: #7e91ad;
  --border: rgba(255, 255, 255, .08);
  --topbar: #070d18;
  --topbar-text: #8295b0;
  --nav: #0d1726;
  --nav-text: #c2d0e4;
  --accent: #ff8a1f;
  --headline: #ffffff;
  --card: #101d31;
  --card-border: rgba(255, 255, 255, .07);
  --tag-bg: #1b2c46;
  --logo-bg: #13294b;
}

/* ---- أساسيات ---- */
html, body { margin: 0; padding: 0; }

body {
  direction: rtl;
  font-family: 'Tajawal', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
img { display: block; max-width: 100%; }
a { text-decoration: none; cursor: pointer; color: inherit; }

.yh-root {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', sans-serif;
  transition: background .25s ease, color .25s ease;
  display: flex;
  flex-direction: column;
}

.yh-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.yh-icon { display: inline-block; vertical-align: middle; }

/* =========================== TOP BAR =========================== */
.yh-topbar { background: var(--topbar); }

.yh-topbar__inner {
  padding: 9px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--topbar-text);
}

.yh-topbar__date { display: inline-flex; align-items: center; gap: 8px; }
.yh-topbar__actions { display: flex; gap: 14px; align-items: center; }
.yh-topbar__sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .2); }
.yh-topbar__social { color: var(--topbar-text); display: inline-flex; }

.yh-theme-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .2);
  color: var(--topbar-text);
  padding: 5px 13px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

/* =========================== HEADER =========================== */
.yh-header {
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.yh-header__inner {
  padding: 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yh-header__start { display: flex; align-items: center; gap: 12px; }
.yh-header__end { display: flex; align-items: center; gap: 14px; }

.yh-burger {
  display: none;               /* يظهر في الموبايل */
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.yh-logo {
  background: var(--logo-bg);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.yh-logo img { height: 28px; width: auto; }

.yh-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 18px;
  width: 320px;
  color: var(--muted-2);
  font-size: 14px;
}

/* زرّ البحث في الموبايل (أيقونة بدل صندوق البحث) */
.yh-search-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.yh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--nav);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =========================== NAV (المنيو) =========================== */
.yh-nav { background: var(--nav); }

.yh-nav__inner {
  padding: 0 9px;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  position: relative;         /* مرجع لتموضع لوحة الميجا */
}

.yh-nav__link {
  color: var(--nav-text);
  font-size: 15px;
  font-weight: 500;
  padding: 15px 16px;
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;        /* العنوان لا ينكسر لسطرين */
  flex-shrink: 0;
}

/* زرّ «كل الأقسام» */
.yh-nav__all {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 15px 18px;
  background: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.yh-nav__chevron { transition: transform .2s ease; }
.yh-nav__all.is-open .yh-nav__chevron { transform: rotate(180deg); }

/* ===== لوحة الـ Mega Menu ===== */
.yh-mega {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 80;
  margin: 0 12px;
  background: var(--page);
  border-top: 3px solid var(--accent);
  box-shadow: 0 24px 46px rgba(8, 18, 38, .24);
  border-radius: 0 0 14px 14px;
  padding: 26px 30px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.yh-mega.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.yh-mega__grid { display: grid; grid-template-columns: repeat(5, 1fr) 272px; gap: 26px; }
.yh-mega__col { min-width: 0; }
.yh-mega__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.yh-mega__head-title { font-family: 'Markazi Text', serif; font-size: 19px; font-weight: 700; color: var(--headline); }
.yh-mega__link {
  display: block;
  padding: 7px 8px;
  font-size: 14px;
  color: var(--text);
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.yh-mega__link:hover { background: var(--surface-2); color: var(--accent); }

.yh-mega__featured { position: relative; display: block; border-radius: 12px; overflow: hidden; min-height: 178px; background: #0f2342; }
.yh-mega__featured-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .92; }
.yh-mega__featured-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,18,38,.95), rgba(8,18,38,.15) 75%); }
.yh-mega__featured-body { position: absolute; bottom: 0; right: 0; left: 0; padding: 16px; }
.yh-mega__featured-title { margin: 9px 0 0; font-family: 'Markazi Text', serif; font-size: 18px; font-weight: 600; line-height: 1.45; color: #fff; }
.yh-nav__link:hover { color: #fff; }

.yh-nav__link.is-active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* =========================== BREAKING =========================== */
.yh-breaking {
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.yh-breaking__inner { display: flex; align-items: stretch; }

.yh-breaking__badge {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.yh-breaking__text {
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
}

/* شريط الأخبار العمودي (ticker — كل خبر يطلع من تحت) */
.yh-breaking__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;          /* يُظهر سطرًا واحدًا فقط؛ الارتفاع يضبطه الـ JS */
}
.yh-breaking__ticker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.yh-breaking__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.yh-breaking__item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.yh-breaking__item a {
  flex: 1;
  min-width: 0;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s ease;
}
.yh-breaking__item a:hover { color: var(--accent); }

/* =========================== MAIN =========================== */
.yh-main {
  flex: 1;
  padding: 10px 10px 10px;
}

/* =========================== FOOTER =========================== */
.yh-footer { background: var(--logo-bg); color: var(--topbar-text);     /*background-image: linear-gradient(to right, #e6912b 0%, #e6912b 37.5%, #1a446c 37.5%, #1a446c 100%);*/}

.yh-footer__inner { padding: 15px 15px 0; }

.yh-footer__cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 25px;
  padding-bottom: 10px;
}

.yh-footer__logo {
  background: var(--logo-bg);
  border-radius: 9px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06);
}
.yh-footer__logo img { height: 26px; width: auto; }

.yh-footer__about {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--topbar-text);
  max-width: 280px;
}

.yh-footer__title {
  font-family: 'Markazi Text', serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.yh-footer__link {
  display: block;
  font-size: 14px;
  color: var(--topbar-text);
  padding: 6px 0;
  transition: color .15s ease;
}
.yh-footer__link:hover { color: #fff; }

.yh-footer__social { display: flex; gap: 10px; }
.yh-footer__social a {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.yh-footer__social a:hover { background: var(--accent); }

.yh-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.yh-footer__bottom-links { display: flex; gap: 18px; }
.yh-footer__bottom-links a { color: var(--topbar-text); }
.yh-footer__bottom-links a:hover { color: #fff; }

/* =========================== MOBILE DRAWER =========================== */
.yh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
}

.yh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 285px;
  max-width: 82%;
  background: var(--page);
  color: var(--text);
  z-index: 100;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -10px 0 34px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* الحالة المفتوحة */
.yh-root.is-menu-open .yh-overlay { opacity: 1; visibility: visible; }
.yh-root.is-menu-open .yh-drawer { transform: translateX(0); }

.yh-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  border-bottom: 1px solid var(--border);
}

.yh-drawer__logo {
  background: var(--logo-bg);
  border-radius: 9px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
}
.yh-drawer__logo img { height: 24px; width: auto; }

.yh-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.yh-drawer__nav { display: flex; flex-direction: column; padding: 10px 0; }

.yh-drawer__link {
  padding: 6px 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-right: 3px solid transparent;border-bottom: 1px solid var(--border);
    transition: color .15s ease, border-color .15s ease;
}
.yh-drawer__link.is-active {
  color: var(--accent);
  font-weight: 700;
  border-right-color: var(--accent);
}

.yh-drawer__foot {
  margin-top: auto;
  padding: 18px;
  border-top: 1px solid var(--border);
}

.yh-drawer__theme {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--nav);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* =========================== RESPONSIVE =========================== */
@media (max-width: 820px) {
  .yh-burger { display: flex; }
  .yh-search { display: none; }
  .yh-search-mobile { display: flex; }
  .yh-nav { display: none; }
  .yh-footer__cols { grid-template-columns: 1fr 1fr; }
}
