/* Shared design tokens and global foundations. */

:root {
  --elbi-blue: #0b4eaa;
  --elbi-blue-dark: #083b80;
  --elbi-red: #a13c44;
  --elbi-red-dark: #813036;
  --elbi-red-soft: #f8eff0;
  --elbi-red-border: #e7cace;
  --elbi-charcoal: #15171a;
  --elbi-text: #15171a;
  --elbi-text-secondary: #475467;
  --elbi-muted: #667085;
  --elbi-border: #e4e7ec;
  --elbi-border-hover: #cdd4df;
  --elbi-soft: #f5f6f8;
  --elbi-white: #ffffff;
  --elbi-radius: 6px;
  --elbi-radius-sm: 6px;
  --elbi-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  --elbi-shadow-card: 0 2px 7px rgba(16, 24, 40, 0.07);
  --elbi-container: 1320px;
  --elbi-page-gutter: 24px;
  --elbi-section-gap: 32px;
  --elbi-section-gap-mobile: 22px;
  --elbi-section-padding: 20px;
  --elbi-heading-gap: 16px;
  --elbi-card-gap: 20px;
  --elbi-row-gap: 12px;
  --elbi-title-section: 26px;
  --elbi-title-card: 19px;
  --elbi-title-compact: 15px;
  --elbi-meta-size: 12.5px;
  --elbi-label-size: 12px;
  --elbi-ratio-card: 16 / 9;
  --elbi-ratio-compact: 3 / 2;
  --elbi-font-arabic: "Noto Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

@media screen and (max-width: 1279px) { :root { --elbi-page-gutter: 22px; } }
@media screen and (max-width: 1024px) { :root { --elbi-page-gutter: 18px; } }
@media screen and (max-width: 768px) {
  :root {
    --elbi-page-gutter: 16px;
    --elbi-title-section: 22px;
    --elbi-title-card: 18px;
  }
}

/* Global foundations */
body {
  background: var(--elbi-soft);
  color: var(--elbi-text);
  font-family: var(--elbi-font-arabic);
  font-size: 15px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
.font-family-1,
.font-family-2 {
  font-family: var(--elbi-font-arabic);
}

a,
a:visited {
  color: inherit;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--elbi-red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.main-navigation a:focus-visible {
  outline: 2px solid var(--elbi-red);
  outline-offset: 3px;
}

/* Shared editorial roles */
:is(
  body.home.rtl .af-main-banner-latest-posts,
  body.single.rtl .af-reated-posts,
  body.single.rtl .above-footer-widget-section
) .widget-title .heading-line {
  color: var(--elbi-charcoal);
  font-size: var(--elbi-title-section);
  line-height: 1.4;
  font-weight: 700;
}

:is(
  body.home.rtl .aft-main-banner-wrapper .aft-trending-part,
  body.single.rtl #secondary,
  body.archive.rtl #secondary
) :is(.widget-title .heading-line, .wp-block-heading) {
  color: var(--elbi-charcoal);
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
}

:is(
  body.home.rtl .af-main-banner-latest-posts .grid-design-default.read-single,
  body.single :is(.af-reated-posts, .above-footer-widget-section) .read-single,
  body.archive .elbilad-archive-card
) {
  overflow: hidden;
  border: 1px solid var(--elbi-border);
  border-radius: var(--elbi-radius);
  background: var(--elbi-white);
  box-shadow: var(--elbi-shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:is(
  body.home.rtl .af-main-banner-latest-posts .grid-design-default.read-single,
  body.single :is(.af-reated-posts, .above-footer-widget-section) .read-single,
  body.archive .elbilad-archive-card
):hover {
  border-color: var(--elbi-border-hover);
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.09);
}

:is(
  body.home.rtl .af-main-banner-latest-posts,
  body.single :is(.af-reated-posts, .above-footer-widget-section)
) .read-img.read-bg-img,
body.archive .elbilad-archive-card__media {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: var(--elbi-ratio-card);
  overflow: hidden;
}

:is(
  body.home.rtl .af-main-banner-latest-posts,
  body.single :is(.af-reated-posts, .above-footer-widget-section)
) .read-img img,
body.archive .elbilad-archive-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(
  body.home.rtl .af-main-banner-latest-posts,
  body.single :is(.af-reated-posts, .above-footer-widget-section)
) .read-title h3,
body.archive .elbilad-archive-card__title {
  color: var(--elbi-charcoal);
  font-size: var(--elbi-title-card);
  line-height: 1.55;
  font-weight: 700;
}

:is(
  body.home.rtl .af-main-banner-latest-posts,
  body.single :is(.af-reated-posts, .above-footer-widget-section)
) :is(.entry-meta, .post-item-metadata),
body.archive .elbilad-archive-card__date {
  color: var(--elbi-muted);
  font-size: var(--elbi-meta-size);
  line-height: 1.5;
}

:is(.cat-links li a, .categories-inside-image a.reviewnews-categories),
body.archive .elbilad-archive-card__category {
  border-radius: var(--elbi-radius-sm);
  font-size: var(--elbi-label-size);
  line-height: 1.4;
  font-weight: 700;
}

body.home.rtl .af-main-banner-latest-posts
  .categories-inside-image a.reviewnews-categories,
body.archive .elbilad-archive-card__category {
  padding: 3px 8px;
  border: 1px solid var(--elbi-red-border);
  background: var(--elbi-red-soft);
  color: var(--elbi-red-dark);
}

:is(
  body.home.rtl .aft-banner-layout-9 .banner-vertical-slider,
  body.single-post #secondary .reviewnews_trending_news_widget
) .read-img,
body.home .elbilad-home-editorial .elbilad-compact-post__thumbnail {
  aspect-ratio: var(--elbi-ratio-compact);
}

:is(
  body.home.rtl .aft-banner-layout-9 .banner-vertical-slider,
  body.single-post #secondary .reviewnews_trending_news_widget
) .read-title h3 a {
  font-size: var(--elbi-title-compact);
  line-height: 1.5;
  font-weight: 600;
}

@media screen and (max-width: 768px) {
  :is(
    body.home.rtl .aft-main-banner-wrapper .aft-trending-part,
    body.single.rtl #secondary,
    body.archive.rtl #secondary
  ) :is(.widget-title .heading-line, .wp-block-heading) {
    font-size: 20px;
  }
}

/* Keep standard ReviewNews pages aligned without changing Elementor layouts. */
body:not(.elementor-page):not(.elementor-default) .container-wrapper {
  box-sizing: border-box;
  width: min(calc(100% - 40px), var(--elbi-container));
  max-width: var(--elbi-container);
  margin-right: auto;
  margin-left: auto;
}

@media screen and (max-width: 768px) {
  body:not(.elementor-page):not(.elementor-default) .container-wrapper {
    width: min(calc(100% - 28px), var(--elbi-container));
  }
}

@media screen and (max-width: 480px) {
  body:not(.elementor-page):not(.elementor-default) .container-wrapper {
    width: min(calc(100% - 24px), var(--elbi-container));
  }
}
