/* ==========================================================================
   home-services.css — "موسوعات وخدمات إسلامية بلغات العالم": a brand-blue
   band (same visual language as the partner banners of the inner pages) with
   four white cards linking to the partner encyclopedias / services, and an
   «المزيد» link under them.
   ========================================================================== */

.hsvc {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 104px 24px;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 70%),
    var(--color-blue-500);
}

/* Calligraphy ornament (the site's decorative motif) on the left only: white,
   faint, edges faded with the same radial mask as the other ornaments of the site */
.hsvc::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -90px;
  left: -110px;
  width: 480px;
  height: 480px;
  background: url("../../images/pattern-calligraphy.webp") center / contain no-repeat;
  filter: brightness(0) invert(1);
  opacity: .07;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
}

.hsvc__container {
  max-width: var(--cw, 1180px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* --------------------------------------------------------------------------
   Heading (shared section-title size)
   -------------------------------------------------------------------------- */
.hsvc__head {
  display: flex;
  justify-content: center;
}

.hsvc__title {
  margin: 0;
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: var(--fs-section-title);
  line-height: 1.3;
  color: var(--color-white);
  text-align: center;
  text-wrap: balance;
}

.hsvc__title-accent {
  color: var(--color-cream-300);
}

/* --------------------------------------------------------------------------
   Cards — the whole card is the link
   -------------------------------------------------------------------------- */
.hsvc__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.hsvc__card,
.hsvc__card:hover {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 250px;
  box-sizing: border-box;
  padding: 22px;
  border-radius: 28px;
  background: var(--color-white);
  border: 1px solid rgba(255, 255, 255, .6);
  color: var(--color-navy-700);
  text-decoration: none;
  transition: background-color .3s ease, box-shadow .35s ease;
}

/* hover: colour only, no movement (the site's rule). On the blue band the card
   turns cream (the site's hover colour on dark surfaces, like the title
   accent), its logo tile turns white, the "زيارة الموقع" pill fills and a
   shadow appears under the card. */
.hsvc__card:hover {
  background: var(--hover-cream);
  box-shadow: 0 26px 44px -26px rgba(10, 25, 45, .65);
}

.hsvc__card:hover .hsvc__logo {
  background: var(--color-white);
}

.hsvc__card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55);
}

/* Logo tile */
.hsvc__logo {
  height: 76px;
  border-radius: 18px;
  background: var(--color-mist-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .3s ease;
}

.hsvc__logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
}

.hsvc__logo .hsvc__logo-img--tall {
  height: 44px;
}

/* Text wordmark used where there is no logo image */
.hsvc__wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.hsvc__wordmark-ar {
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-gold-600);
}

.hsvc__wordmark-url {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--color-neutral-400);
}

/* name and description: two lines at most, then "…" (as on every card) */
.hsvc__name {
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hsvc__desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-ink-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer: domain + "زيارة الموقع" pill (fills on card hover); pushed to the
   card's bottom, so the cards of a row line up whatever their text */
.hsvc__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-line-soft);
}

.hsvc__domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink-500);
}

.hsvc__visit {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 14px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px solid var(--color-blue-500);
  color: var(--color-blue-500);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease;
}

.hsvc__visit svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hsvc__card:hover .hsvc__visit {
  background: var(--color-blue-500);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   "المزيد" under the cards — the site's "more" button (44px outline pill:
   grid icon · label · arrow, like .mat__more-link), drawn in white on the
   blue band. Hover: cream fill, navy ink (the site's hover on dark surfaces).
   -------------------------------------------------------------------------- */
.hsvc__more {
  display: flex;
  justify-content: center;
}

.hsvc__more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  box-sizing: border-box;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--color-white);
  background: transparent;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.hsvc__more-link svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hsvc__more-link:hover {
  background: var(--hover-cream);
  border-color: var(--hover-cream-border);
  color: var(--hover-cream-ink);
}

.hsvc__more-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55);
}

@media (prefers-reduced-motion: reduce) {
  .hsvc__card,
  .hsvc__logo,
  .hsvc__visit,
  .hsvc__more-link {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .hsvc__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hsvc {
    padding: 72px 16px;
  }

  .hsvc__container {
    gap: 28px;
  }

  .hsvc__grid {
    gap: 12px;
  }

  .hsvc__card,
  .hsvc__card:hover {
    min-height: 0;
    padding: 18px;
    border-radius: 22px;
    gap: 12px;
  }

  .hsvc__logo {
    height: 60px;
  }

  .hsvc::before {
    top: -60px;
    left: -90px;
    width: 320px;
    height: 320px;
  }
}

@media (max-width: 480px) {
  .hsvc__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
