/*
 * Rawafed Al-Ma'rifa — homepage & sidebar polish
 * Loaded by OJS as the journal stylesheet (Settings > Website > Appearance > Advanced),
 * after the Noble theme. Removing it restores the stock theme look.
 */

:root {
  --ra-primary: #2a90ff;
  --ra-primary-ink: #0b62c4;
  --ra-gold: #faba2b;
  --ra-ink: rgba(0, 0, 0, 0.87);
  --ra-muted: #5b6472;
  --ra-line: #e5e7eb;
  --ra-tint: #eef6ff;
  --ra-surface: #fff;
}
html.dark {
  --ra-primary-ink: #8cc4ff;
  --ra-ink: #e5e7eb;
  --ra-muted: #a3acb9;
  --ra-line: #374151;
  --ra-tint: rgba(42, 144, 255, 0.14);
  --ra-surface: #1f2937;
}

/* ---------- Sidebar frame ---------- */

/* Taller than the viewport, so sticky only trapped the lower blocks */
.pkp_structure_sidebar.sticky {
  position: static;
}

.pkp_structure_sidebar .pkp_block {
  padding: 18px 18px 16px;
  border-bottom-width: 4px;
  border-radius: 6px 6px 0 0;
}

.pkp_structure_sidebar .pkp_block .title {
  position: relative;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ra-line);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ra-ink);
}
.pkp_structure_sidebar .pkp_block .title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -1px;
  width: 36px;
  height: 2px;
  background: var(--ra-gold);
}

.pkp_structure_sidebar a:focus-visible {
  outline: 2px solid var(--ra-primary);
  outline-offset: 2px;
}

/* ---------- Primary call to action: submit a manuscript ---------- */

.pkp_structure_sidebar .block_make_submission {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.pkp_structure_sidebar .block_make_submission .content {
  padding: 0;
}
.pkp_structure_sidebar .block_make_submission .block_make_submission_link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--ra-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 0 6px 16px -6px rgba(11, 98, 196, 0.55);
  transition: background-color 0.18s ease-out, box-shadow 0.18s ease-out, transform 0.18s ease-out;
}
.pkp_structure_sidebar .block_make_submission .block_make_submission_link::before {
  content: "\f040"; /* fa-pencil */
  font-family: FontAwesome;
  font-weight: normal;
  font-size: 15px;
}
.pkp_structure_sidebar .block_make_submission .block_make_submission_link:hover {
  background: var(--ra-primary-ink);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(11, 98, 196, 0.6);
  transform: translateY(-1px);
}
.pkp_structure_sidebar .block_make_submission .block_make_submission_link:focus-visible {
  outline: 2px solid var(--ra-gold);
  outline-offset: 3px;
}

/* ---------- Link lists: journal menu + information block ---------- */

.ra-menu {
  display: flex;
  flex-direction: column;
}
.ra-menu-group {
  margin: 14px 0 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ra-muted);
}
.ra-menu-group:first-child {
  margin-top: 0;
}

.ra-menu a,
.pkp_structure_sidebar .block_information li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 6px;
  color: var(--ra-ink);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.ra-menu a .fa {
  flex: none;
  width: 1.25em;
  text-align: center;
  color: var(--ra-primary);
}
.ra-menu a[target="_blank"]::after {
  content: "\f08e"; /* fa-external-link */
  font-family: FontAwesome;
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--ra-muted);
}
.ra-menu a:hover,
.pkp_structure_sidebar .block_information li a:hover {
  background: var(--ra-tint);
  color: var(--ra-primary-ink);
}

.pkp_structure_sidebar .block_information ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pkp_structure_sidebar .block_information li a::before {
  content: "\f104"; /* fa-angle-left, points "forward" in RTL */
  font-family: FontAwesome;
  width: 1.25em;
  text-align: center;
  color: var(--ra-primary);
}
html[lang^="en"] .pkp_structure_sidebar .block_information li a::before {
  content: "\f105";
}

/* ---------- Indexing logos ---------- */

.ra-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ra-logos a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--ra-line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
.ra-logos a:hover {
  border-color: var(--ra-primary);
  box-shadow: 0 4px 12px -6px rgba(11, 98, 196, 0.45);
}
.ra-logos img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 64px;
  height: auto;
}

/* Single-image promo blocks (article template, plagiarism check) */
#customblock-articletemplate .content p,
#customblock-68aed389e8cb3 .content p {
  margin: 0;
  text-align: center;
}
.pkp_structure_sidebar .pkp_block#customblock-articletemplate .content img,
.pkp_structure_sidebar .pkp_block#customblock-68aed389e8cb3 .content img {
  display: inline-block;
  width: auto;
  /* !important: headerHead.tpl forces img { max-width: 100% !important } below 768px */
  max-width: min(180px, 100%) !important;
  height: auto;
  border-radius: 6px;
}

/* ---------- Language switch as a segmented control ---------- */

.pkp_structure_sidebar .block_language ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pkp_structure_sidebar .block_language li {
  flex: 1;
  margin: 0;
}
.pkp_structure_sidebar .block_language li a {
  display: block;
  padding: 7px 10px;
  border: 1px solid var(--ra-line);
  border-radius: 6px;
  color: var(--ra-ink);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease-out, color 0.15s ease-out;
}
.pkp_structure_sidebar .block_language li a:hover {
  border-color: var(--ra-primary);
  color: var(--ra-primary-ink);
}
.pkp_structure_sidebar .block_language li.current a {
  border-color: var(--ra-primary);
  background: var(--ra-primary);
  color: #fff;
  font-weight: 700;
}

/* ---------- Editor's pick: readable scroll row instead of overlapping deck ---------- */

.pkp_structure_main .noble-editorial-pick {
  gap: 16px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 30px;
  scrollbar-width: thin;
  scrollbar-color: #c3c9d2 transparent;
}
html.dark .pkp_structure_main .noble-editorial-pick {
  scrollbar-color: #4b5563 transparent;
}
.pkp_structure_main .noble-editorial-pick .mini-card,
body[dir="rtl"] .pkp_structure_main .noble-editorial-pick .mini-card {
  flex: 0 0 290px;
  min-width: 0;
  max-width: 290px;
  margin-inline-start: 0;
  scroll-snap-align: start;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.pkp_structure_main .noble-editorial-pick .mini-card:hover,
body[dir="rtl"] .pkp_structure_main .noble-editorial-pick .mini-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
}
.pkp_structure_main .noble-editorial-pick .mini-card:hover ~ .mini-card,
body[dir="rtl"] .pkp_structure_main .noble-editorial-pick .mini-card:hover ~ .mini-card {
  transform: none;
}
/* English titles inside the RTL page: keep punctuation on the right side */
.pkp_structure_main .noble-editorial-pick .title,
.pkp_structure_main .noble-editorial-pick .ep-authors {
  unicode-bidi: plaintext;
  text-align: start;
}
.pkp_structure_main .noble-editorial-pick .title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}

/* ---------- Announcements: never let a long URL break the layout ---------- */

.obj_announcement_summary .summary,
.obj_announcement_summary h3 {
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .pkp_structure_sidebar *,
  .pkp_structure_main .noble-editorial-pick .mini-card {
    transition: none !important;
    transform: none !important;
  }
}

/* =====================================================================
 * Header: language switch, hamburger, mobile drawer
 * (markup: noble/templates/frontend/components/header.tpl + ra-languageSwitch.tpl)
 * ===================================================================== */

/* ---------- Language pill (desktop top bar) ---------- */

.ra-lang-slot {
  padding-inline: 4px 10px;
}
.ra-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ra-line);
  border-radius: 999px;
  background: var(--ra-surface);
  color: var(--ra-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out, color 0.15s ease-out;
}
.ra-lang-pill .fa {
  font-size: 16px;
  color: var(--ra-primary);
}
.ra-lang-pill:hover {
  border-color: var(--ra-primary);
  background: var(--ra-tint);
  color: var(--ra-primary-ink);
}
.ra-lang-pill:focus-visible,
.ra-burger:focus-visible,
.ra-drawer-close:focus-visible,
.ra-lang-seg a:focus-visible,
#menu-mobile a:focus-visible {
  outline: 2px solid var(--ra-primary);
  outline-offset: 2px;
}

/* 3+ languages: dropdown */
.ra-lang-menu {
  position: relative;
}
.ra-lang-menu summary {
  list-style: none;
}
.ra-lang-menu summary::-webkit-details-marker {
  display: none;
}
.ra-lang-menu-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--ra-line);
  border-radius: 10px;
  background: var(--ra-surface);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.3);
}
.ra-lang-menu-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ra-ink);
  font-size: 14px;
  text-decoration: none;
}
.ra-lang-menu-list a:hover,
.ra-lang-menu-list a[aria-current] {
  background: var(--ra-tint);
  color: var(--ra-primary-ink);
}

/* Desktop primary nav: icons now render, give them room */
#navigationPrimary > li > a .fa {
  margin-inline-start: 6px;
  color: var(--ra-primary);
}

/* ---------- Phone top bar + hamburger ---------- */

/* The theme sets overflow-x:hidden + overflow-y:auto on html/body, which turns body into a
   non-scrolling scroll container and silently disables every position:sticky on the page.
   clip hides sideways overflow without creating a scroll container. body.overflow-hidden
   (drawer scroll lock) still wins on specificity. */
html,
body {
  overflow-x: clip;
  overflow-y: visible;
}

@media (max-width: 1023.98px) {
  .ra-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding-block: 8px;
    box-shadow: 0 1px 0 var(--ra-line), 0 6px 16px -12px rgba(0, 0, 0, 0.35);
  }
  .ra-topbar .pkp_site_name_wrapper {
    padding-inline: 14px;
  }
  .ra-topbar .header-logo img {
    max-height: 46px;
    width: auto;
  }
  .ra-topbar #navigationUserWrapper {
    display: none;
  }

  .ra-burger {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 12px;
    background: var(--ra-tint);
    color: var(--ra-primary-ink);
    transition: background-color 0.15s ease-out;
  }
  .ra-burger:active {
    background: #dcecff;
  }
  html.dark .ra-burger:active {
    background: rgba(42, 144, 255, 0.25);
  }
}

.ra-burger-lines {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}
.ra-burger-lines span {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: top 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease-out;
}
.ra-burger-lines span:nth-child(1) { top: 0; }
.ra-burger-lines span:nth-child(2) { top: 6px; }
.ra-burger-lines span:nth-child(3) { top: 12px; }
.ra-burger.is-open .ra-burger-lines span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.ra-burger.is-open .ra-burger-lines span:nth-child(2) { opacity: 0; }
.ra-burger.is-open .ra-burger-lines span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---------- Mobile drawer ---------- */

/* The library positions drawer + mask absolutely at the page top, so opening the
   menu after scrolling showed nothing. Pin both to the viewport. */
#menu-mobile,
.tmla-mask {
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
}
#menu-mobile {
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ra-surface);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.22);
}

.ra-drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ra-line);
  background: var(--ra-surface);
}
.ra-drawer-logo img {
  display: block;
  width: auto;
  max-height: 40px;
}
.ra-drawer-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: var(--ra-tint);
  color: var(--ra-primary-ink);
  font-size: 18px;
}

.ra-drawer-search {
  padding: 14px 14px 6px;
}
.ra-drawer-search-form > div {
  align-items: center;
  height: 44px;
  border: 1px solid var(--ra-line);
  border-radius: 10px;
  background: var(--ra-tint);
  overflow: hidden;
}
.ra-drawer-search-form > div:focus-within {
  border-color: var(--ra-primary);
}
.ra-drawer-search-form input[type="search"] {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 42px;
  padding-inline: 12px;
  font-size: 16px; /* 16px stops iOS zooming on focus */
}
.ra-drawer-search-form button[type="submit"] {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  margin: 0;
  color: var(--ra-primary-ink);
}

.mobile-primary-menu {
  flex: 1 0 auto;
  padding: 6px 10px;
}
#menu-mobile .mobile-primary-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#menu-mobile .mobile-primary-menu li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  border-bottom: 1px solid var(--ra-line);
}
#menu-mobile .mobile-primary-menu li:last-child {
  border-bottom: 0;
}
#menu-mobile .mobile-primary-menu li > a {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ra-ink);
  font-size: 15.5px;
  line-height: 1.4;
  text-decoration: none;
}
#menu-mobile .mobile-primary-menu li > a .fa {
  order: -1; /* menu titles put the icon after the label; show it first */
  width: 1.25em;
  text-align: center;
  color: var(--ra-primary);
}
#menu-mobile .mobile-primary-menu li > a:active,
#menu-mobile .mobile-primary-menu li > a:hover {
  background: var(--ra-tint);
}
#menu-mobile .mobile-primary-menu a[aria-current="page"] {
  background: var(--ra-tint);
  color: var(--ra-primary-ink);
  font-weight: 700;
}
#menu-mobile .dropdown-menu-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  color: var(--ra-muted);
  cursor: pointer;
}
#menu-mobile .mobile-primary-menu li > ul {
  flex-basis: 100%;
  padding: 0 0 8px;
  padding-inline-start: 32px;
}
#menu-mobile .mobile-primary-menu li > ul li {
  border-bottom: 0;
}
#menu-mobile .mobile-primary-menu li > ul a {
  min-height: 40px;
  font-size: 14.5px;
  color: var(--ra-muted);
}

/* Register / Login as two buttons */
#menu-mobile .ra-drawer-user {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ra-line);
}
#menu-mobile .ra-drawer-user > li {
  flex: 1 1 120px;
  border-bottom: 0;
}
#menu-mobile .ra-drawer-user > li > a {
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ra-line);
  border-radius: 10px;
  font-weight: 600;
}
#menu-mobile .ra-drawer-user > li:last-child > a {
  border-color: var(--ra-primary);
  background: var(--ra-primary);
  color: #fff;
}
#menu-mobile .ra-drawer-user > li:last-child > a .fa {
  color: #fff;
}

.ra-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 20px;
  border-top: 1px solid var(--ra-line);
}
.ra-lang-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--ra-tint);
}
.ra-lang-seg a {
  flex: 1;
  padding: 9px 8px;
  border-radius: 7px;
  color: var(--ra-ink);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}
.ra-lang-seg a.is-current {
  background: var(--ra-surface);
  color: var(--ra-primary-ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}
.ra-drawer-issn {
  color: var(--ra-muted);
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .ra-burger-lines span,
  .ra-lang-pill {
    transition: none;
  }
}
