/* ============================================================
   خبرنا — الترويسة، الدرج، شريط العاجل، والفوتر
   ============================================================ */

:root {
  --masthead-h: 64px;
}

@media (min-width: 1025px) {
  :root {
    --masthead-h: 100px;
  }
}

/* ---------- الشعار ---------- */
.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
}

.brand__logo {
  width: auto;
  height: 42px;
}

.brand__logo--own {
  height: auto;
  max-height: 46px;
  max-width: 230px;
  object-fit: contain;
}

.brand__logo--plate {
  padding: 4px 8px;
  background: #FFFFFF;
}

.brand__logo--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__logo--light {
    display: none;
  }

  :root:not([data-theme="light"]) .brand__logo--dark {
    display: block;
  }
}

:root[data-theme="dark"] .brand__logo--light {
  display: none;
}

:root[data-theme="dark"] .brand__logo--dark {
  display: block;
}

/* ---------- الترويسة ----------
   تلتصق بإزاحة سالبة بمقدار الماستهيد على الشاشة الواسعة، فحين يخرج هو
   يبقى شريط الأقسام وحده. على الهاتف لا شريط أقسام: الماستهيد هو ما يثبت. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-paper);
}

@media (min-width: 1025px) {
  .site-header {
    top: calc(var(--masthead-h) * -1);
  }
}

.masthead {
  height: var(--masthead-h);
}

.masthead__in {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: 100%;
}

.masthead__stamp {
  display: none;
}

.masthead__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-inline-start: auto;
}

@media (min-width: 1025px) {
  .brand__logo {
    height: 58px;
  }

  .brand__logo--own {
    max-height: 62px;
    max-width: 300px;
  }

  .masthead__in {
    gap: var(--sp-6);
  }

  /* الوقت كبيراً بخط اللوحة، والتاريخ تحته — ختم يوم الصحيفة. */
  .masthead__stamp {
    display: grid;
    align-content: center;
    gap: 4px;
    padding-inline-start: var(--sp-6);
    border-inline-start: 2px solid var(--c-line);
  }

  .masthead__tools {
    gap: var(--sp-2);
  }
}

.masthead__clock {
  font-size: 34px;
  font-weight: 700;
}

.masthead__date {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink-3);
}

/* حقل البحث في الترويسة: سطر حبر تحته، لا صندوق. */
.nav-search {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  width: 250px;
  min-height: 44px;
  border-block-end: 3px solid var(--c-ink);
}

.nav-search svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--c-ink-2);
}

.nav-search__input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  outline: none;
}

.nav-search__input::placeholder {
  color: var(--c-ink-3);
}

@media (min-width: 1025px) {
  .nav-search {
    display: flex;
  }

  .search-btn,
  .burger {
    display: none;
  }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-decoration: none !important;
}

.lang-switch:hover {
  background: var(--c-ink);
  color: var(--c-paper);
}

.lang-switch__short {
  display: none;
}

@media (max-width: 1024px) {
  .masthead .lang-switch__long {
    display: none;
  }

  .masthead .lang-switch__short {
    display: inline;
  }
}

/* الشمس في الوضع الداكن، والقمر في الفاتح. */
.theme-icon--sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon--sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-icon--moon {
    display: none;
  }
}

:root[data-theme="dark"] .theme-icon--sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon--moon {
  display: none;
}

/* ---------- شريط الأقسام ---------- */
.navbar {
  display: none;
}

@media (min-width: 1025px) {
  .navbar {
    display: block;
  }
}

.navbar__in {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 54px;
}

.navbar__home,
.navbar__search {
  display: none;
}

.navbar__home .brand__logo {
  height: 34px;
}

.site-header[data-stuck="true"] .navbar__home {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.site-header[data-stuck="true"] .navbar__search {
  display: inline-grid;
}

.menu {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--sp-5);
  min-width: 0;
}

.menu__item {
  position: relative;
}

.menu__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  font-size: 17px;
  font-weight: 800;
  color: var(--c-ink-2);
}

.menu__link:hover {
  color: var(--c-ink);
  text-decoration: none;
}

/* الرابط الحالي يقف على سطر مدوّر — والمرور يرسمه. */
.menu__link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 7px;
  height: 5px;
  border-radius: 5px;
  background: var(--c-bar);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.menu__link:hover::after,
.menu__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.menu__link[aria-current="page"] {
  color: var(--c-ink);
}

.menu__caret {
  width: 14px;
  height: 14px;
}

.submenu {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  z-index: 60;
  display: none;
  min-width: 230px;
  padding: var(--sp-2) 0;
  border: 2px solid var(--c-ink);
  background: var(--c-panel);
}

.menu__item:hover .submenu,
.menu__item:focus-within .submenu {
  display: block;
}

.submenu__link {
  display: block;
  padding: 9px var(--sp-4);
  font-weight: 700;
}

.header-rule {
  height: var(--bar-rule);
  border-radius: var(--bar-rule);
  background: var(--c-bar);
}

@media (max-width: 1024px) {
  .header-rule {
    height: var(--bar);
  }
}

/* ---------- شريط البحث ---------- */
.searchbar {
  display: none;
  padding-block: var(--sp-4);
  background: var(--c-paper);
}

.searchbar[data-open="true"] {
  display: block;
}

.searchbar__form {
  display: flex;
  gap: var(--sp-2);
}

.searchbar__input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 var(--sp-3);
  border: 2px solid var(--c-ink);
  border-radius: 0;
  background: var(--c-panel);
  font-size: var(--fs-md);
  font-weight: 600;
}

.searchbar__input:focus {
  outline: none;
  box-shadow: inset 0 -4px 0 var(--c-ink);
}

/* ---------- عاجل ---------- */
.breaking__in {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-3) 0;
}

.breaking__tag {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 var(--sp-3);
  background: var(--c-red);
  color: var(--c-on-red);
  font-weight: 800;
}

.breaking__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: kb-pulse 1.4s ease-in-out infinite;
}

@keyframes kb-pulse {
  50% {
    opacity: 0.25;
  }
}

.breaking__track {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-weight: 700;
  scrollbar-width: none;
}

.breaking__track::-webkit-scrollbar {
  display: none;
}

.breaking__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 34px;
}

.breaking__item + .breaking__item::before {
  content: "";
  flex: none;
  width: 14px;
  height: 4px;
  border-radius: 4px;
  background: var(--c-bar);
}

/* ---------- الدرج ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  visibility: hidden;
  pointer-events: none;
}

.drawer[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
}

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: var(--c-scrim);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer[data-open="true"] .drawer__scrim {
  opacity: 1;
}

.drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: min(380px, 88vw);
  padding: var(--sp-3) var(--sp-5) var(--sp-6);
  overflow-y: auto;
  background: var(--c-paper);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

html[dir="ltr"] .drawer__panel {
  transform: translateX(-100%);
}

.drawer[data-open="true"] .drawer__panel {
  transform: none;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 60px;
}

.drawer__head::after {
  content: none;
}

.drawer__date {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px var(--sp-3);
  padding-block-end: var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink-3);
  background: linear-gradient(var(--c-bar), var(--c-bar)) bottom / 100% var(--bar) no-repeat;
}

.drawer__date .clock {
  font-size: 26px;
  color: var(--c-ink);
}

.drawer__nav {
  display: grid;
}

.drawer__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 20px;
  font-weight: 800;
  text-align: start;
  color: var(--c-ink);
  cursor: pointer;
}

.drawer__link svg {
  width: 18px;
  height: 18px;
  margin-inline-start: auto;
}

.drawer__link[aria-current="page"]::before {
  content: "";
  flex: none;
  width: 20px;
  height: 5px;
  border-radius: 5px;
  background: var(--c-bar);
}

.drawer__sub {
  padding-inline-start: var(--sp-4);
}

.drawer__sub .drawer__link {
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
}

.drawer__foot {
  display: grid;
  justify-items: start;
  gap: var(--sp-4);
  margin-block-start: auto;
  padding-block-start: var(--sp-4);
}

/* ---------- روابط التواصل ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--c-ink);
  color: var(--c-ink);
  text-decoration: none !important;
}

.social svg {
  width: 18px;
  height: 18px;
}

.social:hover {
  background: var(--c-ink);
  color: var(--c-paper);
}

.social__abbr {
  font-size: 13px;
  font-weight: 800;
}

/* ---------- الفوتر ---------- */
.site-footer {
  margin-block-start: var(--sp-7);
  padding-block: var(--sp-5) var(--sp-5);
}

.footer__lines {
  display: grid;
  gap: 6px;
  margin-block-end: var(--sp-6);
}

.footer__lines::before,
.footer__lines::after {
  content: "";
  display: block;
  height: var(--bar-rule);
  border-radius: var(--bar-rule);
  background: var(--c-bar);
}

.footer__lines::after {
  width: var(--bar-short);
  height: var(--bar);
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: var(--sp-7);
  align-items: start;
}

@media (max-width: 900px) {
  .footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
  }
}

.footer__brand {
  display: grid;
  justify-items: start;
  gap: var(--sp-4);
}

.footer__brand .brand__logo {
  height: 54px;
}

.footer__about {
  max-width: 42ch;
  font-family: var(--f-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--c-ink-2);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-5);
}

.footer__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: var(--sp-2);
  font-size: var(--fs-md);
  font-weight: 800;
}

.footer__title::before {
  content: "";
  flex: none;
  width: 16px;
  height: 5px;
  border-radius: 5px;
  background: var(--c-bar);
}

.footer__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 700;
  color: var(--c-ink-2);
}

.footer__news {
  display: grid;
  gap: var(--sp-2);
  width: 100%;
}

.footer__note {
  color: var(--c-ink-3);
}

.newsletter__form {
  display: flex;
  gap: var(--sp-2);
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-block-start: var(--sp-6);
  padding-block-start: var(--sp-4);
  border-block-start: 2px solid var(--c-line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink-3);
}

.footer__bar-end {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.footer__bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--c-ink-2);
}
