/* Alshariea public UI refresh — RTL, responsive, dependency-free */
:root {
  --ui-brand: var(--brand, #a91f2b);
  --ui-accent: var(--accent, #d28a24);
  --ui-ink: #172033;
  --ui-muted: #687386;
  --ui-line: #e7eaf0;
  --ui-paper: #ffffff;
  --ui-soft: #f5f7fa;
  --ui-radius: 18px;
  --ui-shadow: 0 12px 34px rgba(22, 34, 55, .08);
  --ui-container: 1240px;
}

html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body.site-body {
  margin: 0;
  color: var(--ui-ink);
  background: #f4f6f9;
  font-family: "IBM Plex Sans Arabic", "Cairo", Tahoma, Arial, sans-serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.site-body a { color: inherit; text-decoration: none; }
body.site-body img { max-width: 100%; height: auto; }
body.site-body button,
body.site-body input { font: inherit; }
body.site-body button { cursor: pointer; }
body.site-body .container {
  width: min(var(--ui-container), calc(100% - 40px));
  margin-inline: auto;
}
body.site-body :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ui-accent) 70%, white);
  outline-offset: 3px;
}

/* Accessibility */
.skip-link {
  position: fixed;
  z-index: 10000;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff !important;
  background: var(--ui-brand);
}
.skip-link:focus { transform: translateY(0); }
#scroll-progress {
  position: fixed;
  z-index: 999;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 0;
  height: 3px;
  background: var(--ui-accent);
}

/* Top information bar */
.topbar-custom {
  color: #f7f8fb;
  background: #182235;
  font-size: 12px;
}
.topbar-custom-inner,
.topbar-custom-left,
.topbar-custom-right,
.topbar-date,
.topbar-pages,
.socials {
  display: flex;
  align-items: center;
}
.topbar-custom-inner {
  min-height: 38px;
  justify-content: space-between;
  gap: 18px;
}
.topbar-custom-left, .topbar-custom-right { gap: 18px; min-width: 0; }
.topbar-date { gap: 7px; white-space: nowrap; color: #e9edf4; }
.topbar-date .icon { width: 14px; height: 14px; }
.topbar-pages { gap: 15px; min-width: 0; overflow: hidden; }
.topbar-pages a { color: #d8deea !important; white-space: nowrap; transition: color .2s ease; }
.topbar-pages a:hover { color: #fff !important; }
.dash-link { color: #fff !important; font-weight: 700; white-space: nowrap; }
.socials { gap: 8px; }
.socials a {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: inherit;
  transition: background .2s ease, transform .2s ease;
}
.socials a:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.socials .icon { width: 16px; height: 16px; }
.socials.sm { gap: 4px; }
.socials.sm a { width: 25px; height: 25px; }

/* Main header */
.header-custom {
  position: relative;
  z-index: 20;
  background: var(--ui-paper);
  border-bottom: 1px solid var(--ui-line);
}
.header-custom-inner {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-block: 16px;
}
.header-brand-custom { min-width: 0; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ui-ink) !important;
}
.logo-img, .logo-mark {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 15px;
}
.logo-img { object-fit: contain; background: #fff; }
.logo-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--ui-brand), #6f1420);
  font: 900 30px/1 "Cairo", Tahoma, sans-serif;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--ui-brand) 22%, transparent);
}
.logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.logo-text strong {
  color: var(--ui-ink);
  font: 900 clamp(19px, 2vw, 27px)/1.35 "Cairo", Tahoma, sans-serif;
  letter-spacing: -.4px;
}
.logo-text small { margin-top: 3px; color: var(--ui-muted); font-size: 12px; }
.logo.light .logo-text strong, .logo.light .logo-text small { color: #fff; }
.header-tools-custom { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  color: var(--ui-ink);
  background: var(--ui-paper);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { border-color: var(--ui-brand); background: var(--ui-soft); }
.theme-icon { font-size: 18px; line-height: 1; }
.header-search-custom, .mobile-search {
  display: flex;
  align-items: center;
  min-width: 220px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: var(--ui-soft);
}
.header-search-custom input, .mobile-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--ui-ink);
  background: transparent;
  font-size: 13px;
}
.header-search-custom button, .mobile-search button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  align-self: stretch;
  border: 0;
  color: #fff;
  background: var(--ui-brand);
  transition: filter .2s ease;
}
.header-search-custom button:hover, .mobile-search button:hover { filter: brightness(1.1); }
.header-search-custom .icon, .mobile-search .icon { width: 19px; height: 19px; }
.header-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-paper);
}
.header-burger span { width: 19px; height: 2px; border-radius: 2px; background: var(--ui-ink); }

/* Header ads — independent from search and bounded on small screens */
.header-ad, .adsense-row { padding-block: 10px; }
.header-ad .ad, .adsense-row .adsense-unit { max-width: 970px; margin-inline: auto; }
.header-ad .ad-box img { display: block; width: 100%; max-height: 90px; object-fit: contain; border-radius: 12px; }
.ad-placeholder {
  display: grid;
  place-items: center;
  gap: 1px;
  min-height: 62px;
  border: 1px dashed #c9ced8;
  border-radius: 12px;
  color: #778196;
  background: #f8f9fb;
}
.ad-placeholder strong { color: var(--ui-brand); font-size: 14px; }
.ad-label, .adsense-label { display: block; margin-bottom: 4px; color: #98a0ae; text-align: center; font-size: 10px; }
.adsense-unit { min-height: 0; text-align: center; }

/* Desktop navigation */
.nav-custom {
  position: relative;
  z-index: 15;
  color: #fff;
  background: linear-gradient(100deg, #8f1824, var(--ui-brand) 55%, #751521);
  box-shadow: 0 5px 16px rgba(55, 20, 25, .12);
}
.nav-custom-inner { display: flex; align-items: stretch; justify-content: space-between; gap: 12px; min-height: 53px; }
.nav-list-custom {
  display: flex;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.nav-list-custom::-webkit-scrollbar { display: none; }
.nav-list-custom li { display: flex; flex: 0 0 auto; }
.nav-list-custom a {
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .2s ease, border-color .2s ease;
}
.nav-list-custom a:hover, .nav-list-custom a.active { background: rgba(255,255,255,.11); border-bottom-color: #f1c36b; }
.nav-search-custom { display: grid; place-items: center; flex: 0 0 46px; color: #fff !important; }
.nav-search-custom:hover { background: rgba(255,255,255,.12); }
.nav-search-custom .icon { width: 19px; height: 19px; }

/* Mobile menu */
.mobile-menu-custom:not([hidden]) {
  position: fixed;
  z-index: 1002;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  width: min(88vw, 370px);
  max-height: 100dvh;
  overflow-y: auto;
  padding: 20px;
  color: var(--ui-ink);
  background: var(--ui-paper);
  box-shadow: 0 0 50px rgba(13, 23, 40, .24);
  animation: menu-in .2s ease-out;
}
@keyframes menu-in { from { transform: translateX(18px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--ui-line); }
.mobile-menu-head .logo-img, .mobile-menu-head .logo-mark { width: 42px; height: 42px; flex-basis: 42px; }
.mobile-menu-head .logo-text strong { font-size: 18px; }
.mobile-close { width: 40px; height: 40px; border: 0; border-radius: 12px; color: var(--ui-ink); background: var(--ui-soft); font-size: 26px; }
.mobile-menu-custom nav { padding-block: 14px; }
.mobile-menu-custom nav ul { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 0; padding: 0; list-style: none; }
.mobile-menu-custom nav a {
  display: block;
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--ui-ink) !important;
  font-weight: 700;
  background: transparent;
}
.mobile-menu-custom nav a:hover, .mobile-menu-custom nav a[aria-current="page"] { color: var(--ui-brand) !important; background: color-mix(in srgb, var(--ui-brand) 8%, white); }
.mobile-search { min-width: 0; width: 100%; margin-top: auto; }
.mobile-backdrop:not([hidden]) {
  position: fixed;
  z-index: 1001;
  inset: 0;
  display: block;
  background: rgba(10, 18, 30, .52);
  backdrop-filter: blur(2px);
}

/* Breaking news ticker */
.ticker-custom { color: var(--ui-ink); background: #fff; border-bottom: 1px solid var(--ui-line); }
.ticker-inner { display: flex; align-items: center; gap: 14px; min-height: 45px; overflow: hidden; }
.ticker-label { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--ui-brand); font-size: 12px; font-weight: 900; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #df3948; box-shadow: 0 0 0 4px rgba(223,57,72,.12); }
.ticker-window { min-width: 0; overflow: hidden; }
.ticker-track { display: flex; align-items: center; gap: 34px; width: max-content; animation: ticker-move var(--duration, 45s) linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-track a { color: #364257 !important; font-size: 12px; white-space: nowrap; }
.ticker-track a:hover { color: var(--ui-brand) !important; }
@keyframes ticker-move { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* Main content and reusable components */
.site-main { min-height: 50vh; padding-block: 26px 48px; }
.site-main > .container { max-width: var(--ui-container); }
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
}
.section-title .bar { flex: 0 0 5px; align-self: stretch; min-height: 28px; border-radius: 8px; background: var(--ui-brand); }
.section-title h2 { margin: 0; color: var(--ui-ink); font: 900 21px/1.4 "Cairo", Tahoma, sans-serif; white-space: nowrap; }
.section-title .line { height: 1px; flex: 1; background: var(--ui-line); }
.section-title .more { color: var(--ui-brand) !important; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 7px;
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--ui-muted); font-size: 11px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 14px; height: 14px; }
.card-v, .card-h, .card-c, .widget {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-paper);
  box-shadow: 0 4px 16px rgba(20, 31, 50, .035);
}
.card-v, .card-h { transition: transform .22s ease, box-shadow .22s ease; }
.card-v:hover, .card-h:hover { transform: translateY(-3px); box-shadow: var(--ui-shadow); }
.card-v .thumb, .card-h .thumb, .mini-thumb { position: relative; overflow: hidden; background: #e8ebf0; }
.card-v .thumb { aspect-ratio: 16 / 10; }
.card-v .thumb img, .card-h .thumb img, .mini-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-v .thumb .badge { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; }
.card-v .body, .card-h .body { padding: 15px 16px 17px; }
.card-v h3, .card-h h3 { margin: 0 0 9px; color: var(--ui-ink); font: 800 17px/1.65 "Cairo", Tahoma, sans-serif; }
.card-v p, .card-h p { margin: 0 0 12px; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.card-v .meta, .card-h .meta { padding-top: 10px; border-top: 1px solid var(--ui-line); }
.card-h { display: grid; grid-template-columns: minmax(125px, 36%) minmax(0, 1fr); }
.card-h .thumb { min-height: 150px; }
.card-h .body { align-self: center; }
.card-c { display: flex; align-items: center; gap: 12px; padding: 11px 12px; box-shadow: none; }
.card-c h4 { margin: 0; color: var(--ui-ink); font-size: 13px; line-height: 1.7; }
.card-c small { display: block; margin-top: 4px; color: var(--ui-muted); font-size: 10px; }
.card-c .rank { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; color: var(--ui-brand); background: color-mix(in srgb, var(--ui-brand) 9%, white); font-weight: 900; }
.mini-thumb { flex: 0 0 64px; width: 64px; height: 54px; border-radius: 9px; }
.card-overlay { position: relative; min-width: 0; min-height: 260px; overflow: hidden; isolation: isolate; border-radius: var(--ui-radius); background: #273247; }
.card-overlay .bg { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-overlay .shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, rgba(8,14,25,.88), rgba(8,14,25,.04) 78%); }
.card-overlay .overlay-body { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 22px; color: #fff; }
.card-overlay h2, .card-overlay h3 { margin: 9px 0; color: #fff; font: 900 clamp(18px, 2.2vw, 27px)/1.55 "Cairo", Tahoma, sans-serif; }
.card-overlay p { margin: 0 0 10px; color: rgba(255,255,255,.86); font-size: 13px; }
.card-overlay .meta { color: rgba(255,255,255,.85); }
.no-cover { display: grid; place-items: center; min-height: 120px; color: rgba(255,255,255,.85); background: linear-gradient(135deg, #9c1e2b, #283449); }
.no-cover span { font: 900 42px "Cairo", Tahoma, sans-serif; }
.widget { margin-bottom: 18px; padding: 16px; }
.widget-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--ui-ink); font: 800 16px "Cairo", Tahoma, sans-serif; }
.widget-title .icon { width: 18px; height: 18px; color: var(--ui-brand); }
.widget .card-c + .card-c { margin-top: 8px; }
.sidebar { min-width: 0; }
.stretched { position: relative; z-index: 1; }

/* Footer */
.footer-custom { color: #e9edf5; background: #172235; }
.footer-cta { padding-block: 26px; color: #fff; background: linear-gradient(110deg, #8d1c29, var(--ui-brand)); }
.footer-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-cta-text h3 { margin: 0 0 4px; color: #fff; font: 900 20px "Cairo", Tahoma, sans-serif; }
.footer-cta-text p { margin: 0; color: rgba(255,255,255,.83); font-size: 12px; }
.newsletter { display: flex; width: min(100%, 410px); min-height: 46px; overflow: hidden; border-radius: 12px; background: #fff; }
.newsletter input { flex: 1; width: 100%; min-width: 0; padding: 0 14px; border: 0; outline: 0; color: #263145; background: #fff; font-size: 13px; }
.newsletter button { flex: 0 0 auto; padding: 0 20px; border: 0; color: #fff; background: #182235; font-weight: 800; }
.footer-main { padding-block: 44px; }
.footer-grid-custom { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 34px; }
.footer-about { max-width: 340px; margin: 15px 0; color: #b8c1d0; font-size: 13px; line-height: 1.9; }
.footer-col-custom h4 { margin: 0 0 15px; color: #fff; font: 800 15px "Cairo", Tahoma, sans-serif; }
.footer-links-custom, .footer-contact-custom { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-links-custom a, .footer-contact-custom a, .footer-contact-custom span { color: #bac4d3 !important; font-size: 12px; transition: color .2s ease; }
.footer-links-custom a:hover, .footer-contact-custom a:hover { color: #fff !important; }
.footer-links-custom.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-contact-custom li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.footer-contact-custom .icon { flex: 0 0 16px; width: 16px; height: 16px; color: #e9bd74; }
.footer-bottom-custom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; }
.footer-bottom-inner p, .footer-legal { margin: 0; color: #aeb8c8; font-size: 11px; }
.footer-legal { display: flex; align-items: center; gap: 10px; }
.footer-legal a:hover { color: #fff; }
#back-top {
  position: fixed;
  z-index: 900;
  inset-inline-end: 18px;
  inset-block-end: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--ui-brand);
  box-shadow: 0 7px 22px rgba(0,0,0,.2);
}

/* Article pages: protect the reading column from overflow */
.is-article .site-main { padding-block-start: 20px; }
.is-article .article-layout,
.is-article .article-grid,
.is-article .single-layout,
.is-article .content-layout { min-width: 0; }
.is-article .article-content,
.is-article .article-body,
.is-article .single-content,
.is-article .post-content { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.is-article .article-content img,
.is-article .article-body img,
.is-article .single-content img,
.is-article .post-content img { max-width: 100%; height: auto; }
.is-article table { display: block; max-width: 100%; overflow-x: auto; }
.is-article pre, .is-article code { max-width: 100%; overflow-x: auto; }

/* Tablet */
@media (max-width: 1024px) {
  body.site-body .container { width: min(100% - 32px, var(--ui-container)); }
  .header-custom-inner { min-height: 90px; gap: 16px; }
  .header-search-custom { min-width: 190px; }
  .nav-list-custom a { padding-inline: 11px; font-size: 12px; }
  .footer-grid-custom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}

/* Phone */
@media (max-width: 700px) {
  body.site-body { font-size: 14px; }
  body.site-body .container { width: calc(100% - 28px); }
  .topbar-custom-inner { min-height: 34px; }
  .topbar-pages, .topbar-custom-right .socials { display: none; }
  .topbar-date { font-size: 11px; }
  .header-custom-inner { min-height: 74px; gap: 8px; padding-block: 10px; }
  .logo { gap: 8px; }
  .logo-img, .logo-mark { flex-basis: 42px; width: 42px; height: 42px; border-radius: 12px; }
  .logo-mark { font-size: 24px; }
  .logo-text strong { font-size: 17px; }
  .logo-text small { max-width: 160px; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
  .header-tools-custom { gap: 7px; }
  .theme-toggle { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 11px; }
  .theme-toggle .theme-label { display: none; }
  .theme-icon { font-size: 17px; }
  .header-search-custom { min-width: 0; width: clamp(104px, 31vw, 170px); height: 40px; border-radius: 11px; }
  .header-search-custom input { padding-inline: 9px; font-size: 11px; }
  .header-search-custom button { flex-basis: 36px; }
  .header-burger { display: flex; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; }
  .header-ad, .adsense-row { padding-block: 5px; }
  .header-ad .ad-label, .adsense-header-row .adsense-label { margin-bottom: 2px; }
  .header-ad .ad-box img { max-height: 58px; }
  .header-ad .ad-placeholder { min-height: 44px; }
  .nav-custom { display: none; }
  .ticker-inner { min-height: 39px; gap: 9px; }
  .ticker-label { font-size: 10px; }
  .ticker-track { gap: 22px; }
  .ticker-track a { font-size: 11px; }
  .site-main { padding-block: 16px 32px; }
  .section-title { gap: 9px; margin: 20px 0 13px; }
  .section-title h2 { font-size: 18px; }
  .card-overlay { min-height: 230px; border-radius: 15px; }
  .card-overlay .overlay-body { padding: 16px; }
  .card-overlay h2, .card-overlay h3 { font-size: 19px; }
  .card-v, .card-h, .card-c, .widget { border-radius: 14px; }
  .card-v .body, .card-h .body { padding: 12px; }
  .card-v h3, .card-h h3 { font-size: 15px; }
  .card-v p, .card-h p { font-size: 12px; }
  .card-h { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); }
  .card-h .thumb { min-height: 120px; }
  .widget { padding: 13px; }
  .footer-cta-inner { align-items: stretch; flex-direction: column; gap: 14px; }
  .footer-cta-text h3 { font-size: 18px; }
  .newsletter { width: 100%; }
  .footer-main { padding-block: 30px; }
  .footer-grid-custom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .footer-brand-custom { grid-column: 1 / -1; }
  .footer-about { max-width: none; }
  .footer-col-custom h4 { font-size: 14px; }
  .footer-links-custom a, .footer-contact-custom a, .footer-contact-custom span { font-size: 11px; }
  .footer-bottom-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding-block: 13px; }
  #back-top { inset-inline-end: 12px; inset-block-end: 12px; width: 40px; height: 40px; border-radius: 12px; }
}

@media (max-width: 380px) {
  .header-custom-inner { gap: 5px; }
  .logo-text small { display: none; }
  .header-tools-custom { gap: 5px; }
  .header-search-custom { width: 94px; }
  .header-search-custom input { padding-inline: 7px; }
  .theme-toggle, .header-burger { width: 36px; min-width: 36px; height: 36px; min-height: 36px; flex-basis: 36px; }
  .footer-grid-custom { grid-template-columns: 1fr 1fr; }
}

/* Dark mode hook: html[data-theme] is set by the existing app.js */
html[data-theme="dark"] body.site-body {
  --ui-ink: #edf1f7;
  --ui-muted: #aeb8c8;
  --ui-line: #303b4d;
  --ui-paper: #1d293a;
  --ui-soft: #253246;
  color: var(--ui-ink);
  background: #111a28;
}
html[data-theme="dark"] .header-custom,
html[data-theme="dark"] .card-v,
html[data-theme="dark"] .card-h,
html[data-theme="dark"] .card-c,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .mobile-menu-custom { background: var(--ui-paper); }
html[data-theme="dark"] .ticker-custom { background: #1d293a; border-color: var(--ui-line); }
html[data-theme="dark"] .ticker-track a { color: #e2e8f0 !important; }
html[data-theme="dark"] .ad-placeholder { color: #b6c0cf; background: #202d40; border-color: #465267; }
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .header-search-custom,
html[data-theme="dark"] .header-burger { color: var(--ui-ink); background: var(--ui-soft); border-color: var(--ui-line); }
html[data-theme="dark"] .header-search-custom input { color: var(--ui-ink); }
html[data-theme="dark"] .mobile-menu-custom nav a { color: var(--ui-ink) !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* -------------------------------------------------------------------------
   Article card headlines — 1.5.1
   Clear Arabic hierarchy, controlled wrapping and consistent card rhythm.
   ------------------------------------------------------------------------- */
.card-v .card-title,
.card-h .card-title,
.card-c .card-title,
.card-overlay .card-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  direction: rtl;
  text-align: right;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: pretty;
}

body.site-body .card-title-link {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  color: inherit;
  font-family: "Cairo", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.58;
  text-decoration: none;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
  word-break: normal;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.card-v .card-title { margin-block: 0 10px; }
.card-v .card-title-link {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.58;
}
.card-v .body { display: flex; flex-direction: column; min-width: 0; }
.card-v .meta { margin-top: auto; }
.card-v .card-title::after {
  display: block;
  width: 32px;
  height: 2px;
  margin-block-start: 8px;
  border-radius: 99px;
  background: var(--ui-brand);
  content: "";
  opacity: .45;
  transition: width .2s ease, opacity .2s ease;
}
.card-v:hover .card-title::after { width: 50px; opacity: .85; }

.card-h .card-title { margin-block: 2px 8px; }
.card-h .card-title-link {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: clamp(15px, 1.12vw, 17px);
  line-height: 1.58;
}

.card-c { align-items: flex-start; }
.card-c-content { flex: 1 1 auto; min-width: 0; }
.card-c .card-title-link {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.62;
}
.card-c small { line-height: 1.5; }

.card-overlay .card-title { margin-block: 9px 10px; }
.card-overlay .card-title-link {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: #fff !important;
  font-size: clamp(19px, 2.05vw, 27px);
  font-weight: 900;
  line-height: 1.43;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .32);
}
.card-overlay .card-title-overlay-hero .card-title-link {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: clamp(22px, 2.7vw, 35px);
  line-height: 1.42;
}
.card-overlay .card-title-link:hover {
  color: #fff !important;
  text-decoration: underline;
  text-decoration-color: var(--ui-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

body.site-body .card-v .card-title-link:hover,
body.site-body .card-h .card-title-link:hover,
body.site-body .card-c .card-title-link:hover {
  color: var(--ui-brand) !important;
}

/* Keep title focus obvious without changing the whole card surface. */
body.site-body .card-title-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid color-mix(in srgb, var(--ui-accent) 78%, white);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .card-v .card-title-link { font-size: 16px; line-height: 1.58; }
  .card-h .card-title-link { font-size: 15px; line-height: 1.58; }
  .card-c .card-title-link { font-size: 13px; }
  .card-overlay .card-title-link { font-size: 19px; line-height: 1.48; }
  .card-overlay .card-title-overlay-hero .card-title-link { font-size: 23px; }
}

@media (max-width: 420px) {
  .card-v .card-title-link { font-size: 15px; line-height: 1.62; }
  .card-h .card-title-link { font-size: 14px; line-height: 1.58; }
  .card-c .card-title-link { font-size: 12.5px; line-height: 1.6; }
  .card-overlay .card-title { margin-block: 7px 8px; }
  .card-overlay .card-title-link { font-size: 18px; line-height: 1.5; }
  .card-overlay .card-title-overlay-hero .card-title-link { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-v .card-title::after,
  body.site-body .card-title-link { transition: none; }
}

