/* صفحة عرض محتوى البحث — تفاصيل + مكتبة */

.sc-type-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.sc-type-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.sc-type-nav a.is-active,
.sc-type-nav a:hover {
  background: linear-gradient(135deg, #ff2d2d, #b10011);
  border-color: transparent;
  color: #fff;
}

/* بوابات تفاعلية — أخف من فلاتر التصنيف */
.sc-portals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fafafa;
  border: 1px solid #ececf1;
}

.sc-portals-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  white-space: nowrap;
}

.sc-portals-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.sc-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sc-portal i {
  color: #9ca3af;
  font-size: 12px;
}

.sc-portal:hover,
.sc-portal.is-active {
  border-color: rgba(185, 28, 28, 0.45);
  color: #991b1b;
  background: #fff7f7;
}

.sc-portal:hover i,
.sc-portal.is-active i {
  color: #b91c1c;
}

body.homepage .sc-portals-label {
  color: #6b7280 !important;
}

body.homepage .sc-portal {
  color: #1f2937 !important;
}

body.homepage .sc-portal:hover,
body.homepage .sc-portal.is-active {
  color: #991b1b !important;
}

.sc-page {
  padding-bottom: 48px;
  color: #111827;
}

.sc-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(215, 0, 0, 0.38), transparent 55%),
    linear-gradient(128deg, #0c0003 0%, #230009 42%, #500014 100%);
  color: #ffffff;
  border-radius: 26px;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px);
  margin-bottom: 18px;
  box-shadow: 0 28px 70px rgba(60, 0, 14, 0.38);
}

/* يتغلب على body.homepage h1/p الغامقة */
body.homepage .sc-hero,
body.homepage .sc-hero h1,
body.homepage .sc-hero h2,
body.homepage .sc-hero h3,
body.homepage .sc-hero p,
body.homepage .sc-hero .sc-lead,
body.homepage .sc-hero .sc-kicker,
body.homepage .sc-hero .sc-chips span,
body.homepage .sc-hero a {
  color: #ffffff !important;
}

.sc-kicker {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.sc-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: #ffffff !important;
  line-height: 1.25;
}

.sc-lead {
  margin: 0;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.96) !important;
  font-weight: 600;
  line-height: 1.8;
}

.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.sc-chips span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  color: #ffffff !important;
}

.sc-media {
  margin-bottom: 18px;
  border-radius: 22px;
  overflow: hidden;
  background: #0b0b0b;
  border: 1px solid #ececf1;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.sc-media-image img {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  background: #111;
}

.sc-media-video video,
.sc-media-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.sc-media-file {
  padding: 20px;
  background: #fff;
  display: grid;
  gap: 14px;
}

.sc-pdf {
  width: 100%;
  min-height: 480px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.sc-media-empty {
  padding: 48px 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #1a0008, #3f0014);
}

.sc-media-empty i {
  font-size: 42px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.sc-media-link {
  padding: 24px;
  background: #fff;
}

.sc-body {
  background: #fff;
  border: 1px solid #ececf1;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  color: #111827;
}

.sc-body h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: #111827 !important;
}

.sc-body > p {
  margin: 0 0 14px;
  color: #111827 !important;
  font-weight: 650;
  line-height: 1.8;
}

body.homepage .sc-body,
body.homepage .sc-body h2,
body.homepage .sc-body p,
body.homepage .sc-body li,
body.homepage .sc-empty,
body.homepage .sc-card-body,
body.homepage .sc-card-body strong,
body.homepage .sc-card-body small,
body.homepage .sc-type-nav a:not(.is-active) {
  color: #111827 !important;
}

body.homepage .sc-card-body em {
  color: #b91c1c !important;
}

body.homepage .sc-type-nav a.is-active {
  color: #ffffff !important;
}

.sc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sc-card {
  display: grid;
  grid-template-rows: 160px auto;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ececf1;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(120, 0, 20, 0.12);
}

.sc-card-media {
  background: #140004;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-card-ico {
  color: #fecdd3;
  font-size: 34px;
}

.sc-card-body {
  padding: 12px 14px 14px;
  display: grid;
  gap: 4px;
}

.sc-card-body em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}

.sc-card-body strong {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
}

.sc-card-body small {
  color: #6b7280;
  font-weight: 700;
  line-height: 1.5;
}

.sc-empty {
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #ececf1;
  font-weight: 700;
  color: #111827 !important;
}

.sc-empty a {
  color: #b91c1c !important;
  font-weight: 800;
}

/* بحث + تبديل العرض */
.sc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.sc-search {
  position: relative;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  min-width: min(100%, 240px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.sc-search > i {
  color: #9ca3af;
  font-size: 14px;
}

.sc-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 12px 10px;
  font: inherit;
  font-weight: 700;
  color: #111827;
  min-width: 0;
}

.sc-search input::placeholder {
  color: #9ca3af;
  font-weight: 650;
}

.sc-search-clear {
  border: 0;
  background: #f3f4f6;
  color: #4b5563;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sc-search-clear:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.sc-toolbar-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.sc-count {
  font-size: 13px;
  font-weight: 800;
  color: #6b7280;
}

.sc-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.sc-view-btn {
  border: 0;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-view-btn.is-active,
.sc-view-btn[aria-pressed='true'] {
  background: linear-gradient(135deg, #ff2d2d, #b10011);
  color: #fff;
}

body.homepage .sc-view-btn:not(.is-active) {
  color: #4b5563 !important;
}

body.homepage .sc-view-btn.is-active {
  color: #fff !important;
}

body.homepage .sc-search input,
body.homepage .sc-count,
body.homepage .sc-list-main strong,
body.homepage .sc-list-main small {
  color: #111827 !important;
}

body.homepage .sc-list-meta em {
  color: #b91c1c !important;
}

/* وضع القائمة */
.sc-list {
  display: grid;
  gap: 8px;
}

.sc-list-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #ececf1;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sc-list-row:hover {
  border-color: rgba(185, 28, 28, 0.35);
  box-shadow: 0 12px 28px rgba(120, 0, 20, 0.1);
  transform: translateY(-1px);
}

.sc-list-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a0008, #500014);
  color: #fecdd3;
  font-size: 16px;
  flex-shrink: 0;
}

.sc-list-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sc-list-main strong {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-list-main small {
  color: #6b7280;
  font-weight: 700;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-list-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: end;
}

.sc-list-meta em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}

.sc-list-meta span {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
}

.sc-list-open {
  color: #9ca3af;
  font-size: 13px;
}

@media (max-width: 700px) {
  .sc-list-row {
    grid-template-columns: auto 1fr auto;
  }

  .sc-list-meta {
    display: none;
  }

  .sc-toolbar-side {
    width: 100%;
    justify-content: space-between;
    margin-inline-start: 0;
  }
}
